Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] Implement parent-child relationship for tasks #8886

Merged
merged 2 commits into from
Mar 26, 2025

Conversation

mbabhaziSamuel
Copy link
Contributor

@mbabhaziSamuel mbabhaziSamuel commented Mar 24, 2025

…tionship for tasks with filterable parent

PR

Please note: we will close your PR without comment if you do not check the boxes above and provide ALL requested information.


Summary by CodeRabbit

  • New Features

    • Enhanced task management with a new column displaying parent task information, allowing users to filter and view hierarchical relationships.
    • Improved task creation with an added parent task selector to assign and reflect parent tasks.
  • Localization

    • Expanded language support by introducing consistent "Parent Task" translations across multiple languages for a more intuitive global experience.

Copy link
Contributor

coderabbitai bot commented Mar 24, 2025

Walkthrough

This update introduces functionality for handling parent tasks. A new column for parent tasks is added in the task listing, including filtering and display formatting. In parallel, localization files are updated with a new key for parent tasks across multiple languages. The add-task-dialog now supports selecting a parent task with a new form control and leverages a utility method for accessing form control values. Additionally, the related module has been updated to import the new task selection module.

Changes

File(s) Change Summary
apps/.../task.component.ts Added a new "parent" column in the smart table with custom filtering (filterFunction) and display formatting (valuePrepareFunction), and included the "parent" relation in data retrieval.
packages/ui-core/i18n/assets/i18n/*.json Introduced new key "PARENT_TASK" with appropriate translations in multiple languages (ach, ar, bg, de, en, es, fr, he, it, nl, pl, pt, ru, zh).
packages/ui-core/shared/src/lib/tasks/add-task-dialog/*.component.[ht]ml Updated HTML to use getControlValue('projectId') and to add a new ga-task-selector component for parent task selection.
packages/ui-core/shared/src/lib/tasks/add-task-dialog/*.component.ts Added a new form control parentId and a utility method getControlValue to manage form input values.
packages/ui-core/shared/src/lib/tasks/add-task-dialog/add-task-dialog.module.ts Imported TaskSelectModule to support the new task selection functionality.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant TC as TaskComponent
    participant ST as SmartTable
    U->>TC: Select filter on "parent" column
    TC->>ST: Apply filter (using parent.prefix)
    ST-->>TC: Return filtered task list
Loading
sequenceDiagram
    participant U as User
    participant ATD as AddTaskDialogComponent
    participant TS as ga-task-selector
    U->>ATD: Enter form data with projectId and parentId
    ATD->>ATD: Call getControlValue('projectId')
    ATD->>TS: Bind projectId for parent task selection
    TS-->>ATD: Provide selected parent task
Loading

Possibly related PRs

Poem

I'm a rabbit with a joyful beat,
Hopping into code that’s fresh and neat.
Parent tasks now hop in our view,
Localized words, each language new.
With dialogs and forms all spruced up tight,
I dance in the byte-filled moonlight!
🐰🌟


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ccf7bd1 and 233e503.

📒 Files selected for processing (1)
  • packages/ui-core/shared/src/lib/tasks/add-task-dialog/add-task-dialog.component.html (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/ui-core/shared/src/lib/tasks/add-task-dialog/add-task-dialog.component.html
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: test
  • GitHub Check: build

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@mbabhaziSamuel mbabhaziSamuel self-assigned this Mar 24, 2025
@mbabhaziSamuel mbabhaziSamuel linked an issue Mar 24, 2025 that may be closed by this pull request
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

Implemented parent-child relationship functionality for tasks, allowing tasks to be hierarchically organized with parent-child connections through the task management interface.

  • Added parent task selector component in /packages/ui-core/shared/src/lib/tasks/add-task-dialog/add-task-dialog.component.html with project-based filtering
  • Added new parent column with filtering in /apps/gauzy/src/app/pages/tasks/components/task/task.component.ts
  • Added parentId field handling in /packages/ui-core/shared/src/lib/tasks/add-task-dialog/add-task-dialog.component.ts for task creation/editing
  • Added translations for "Parent Task" across 15 language files including en, de, fr, es, etc.
  • Integrated TaskSelectModule in /packages/ui-core/shared/src/lib/tasks/add-task-dialog/add-task-dialog.module.ts for parent task selection

💡 (4/5) You can add custom instructions or style guidelines for the bot here!

18 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
packages/ui-core/shared/src/lib/tasks/add-task-dialog/add-task-dialog.component.html (2)

139-142: Consider refactoring to use the utility method.

For consistency, consider updating this instance of direct form access to use the same getControlValue('projectId') pattern that was applied to other similar instances.

-<ga-task-priority-select
-    [projectId]="form.get('projectId').value"
-    formControlName="taskPriority"
-    [placeholder]="'TASKS_PAGE.TASK_PRIORITY' | translate"
-></ga-task-priority-select>
+<ga-task-priority-select
+    [projectId]="getControlValue('projectId')"
+    formControlName="taskPriority"
+    [placeholder]="'TASKS_PAGE.TASK_PRIORITY' | translate"
+></ga-task-priority-select>

151-154: Consider refactoring to use the utility method.

For consistency, consider updating this instance of direct form access to use the same getControlValue('projectId') pattern that was applied to other similar instances.

-<ga-task-size-select
-    [projectId]="form.get('projectId').value"
-    formControlName="taskSize"
-    [placeholder]="'TASKS_PAGE.TASK_SIZE' | translate"
-></ga-task-size-select>
+<ga-task-size-select
+    [projectId]="getControlValue('projectId')"
+    formControlName="taskSize"
+    [placeholder]="'TASKS_PAGE.TASK_SIZE' | translate"
+></ga-task-size-select>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9b8a443 and ccf7bd1.

📒 Files selected for processing (18)
  • apps/gauzy/src/app/pages/tasks/components/task/task.component.ts (2 hunks)
  • packages/ui-core/i18n/assets/i18n/ach.json (1 hunks)
  • packages/ui-core/i18n/assets/i18n/ar.json (1 hunks)
  • packages/ui-core/i18n/assets/i18n/bg.json (1 hunks)
  • packages/ui-core/i18n/assets/i18n/de.json (1 hunks)
  • packages/ui-core/i18n/assets/i18n/en.json (1 hunks)
  • packages/ui-core/i18n/assets/i18n/es.json (1 hunks)
  • packages/ui-core/i18n/assets/i18n/fr.json (1 hunks)
  • packages/ui-core/i18n/assets/i18n/he.json (1 hunks)
  • packages/ui-core/i18n/assets/i18n/it.json (1 hunks)
  • packages/ui-core/i18n/assets/i18n/nl.json (1 hunks)
  • packages/ui-core/i18n/assets/i18n/pl.json (1 hunks)
  • packages/ui-core/i18n/assets/i18n/pt.json (1 hunks)
  • packages/ui-core/i18n/assets/i18n/ru.json (1 hunks)
  • packages/ui-core/i18n/assets/i18n/zh.json (1 hunks)
  • packages/ui-core/shared/src/lib/tasks/add-task-dialog/add-task-dialog.component.html (3 hunks)
  • packages/ui-core/shared/src/lib/tasks/add-task-dialog/add-task-dialog.component.ts (4 hunks)
  • packages/ui-core/shared/src/lib/tasks/add-task-dialog/add-task-dialog.module.ts (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: test
  • GitHub Check: build
🔇 Additional comments (25)
packages/ui-core/i18n/assets/i18n/it.json (1)

2615-2615: New localization key added correctly.

The key "PARENT_TASK" with the translation "Attività principale" has been correctly added to the Italian localization file. This addition supports the parent-child relationship feature for tasks as described in the PR objectives.

packages/ui-core/i18n/assets/i18n/de.json (1)

2611-2611: Good addition for the parent-task relationship feature

The German translation "Übergeordnete Aufgabe" is correctly added for the "PARENT_TASK" key, which supports the implementation of the parent-child relationship functionality for tasks as described in the PR objectives.

packages/ui-core/i18n/assets/i18n/nl.json (1)

2615-2615: Appropriate translation added for parent task feature.

The Dutch translation "Hoofdtaak" for "PARENT_TASK" is correctly implemented, supporting the new parent-child relationship functionality for tasks.

packages/ui-core/i18n/assets/i18n/he.json (1)

2640-2640: Well done on adding the Hebrew localization for parent tasks!

This change properly adds the Hebrew translation for "PARENT_TASK" as "משימה ראשית" (Main Task), which aligns with the parent-child relationship feature for tasks mentioned in the PR objectives. The translation is accurately placed within the TASKS_PAGE section alongside other task-related properties.

packages/ui-core/i18n/assets/i18n/ar.json (1)

2600-2600: New translation key added correctly for parent task feature.

The Arabic translation for "PARENT_TASK" has been properly added as "المهمة الرئيسية" (which translates to "The main/parent task"). This addition supports the new parent-child relationship feature for tasks being implemented in this PR.

packages/ui-core/i18n/assets/i18n/pl.json (1)

2615-2615: Translation correctly implemented for parent task feature.

The Polish translation for "Parent Task" has been appropriately added as "Zadanie nadrzędne", which properly reflects the meaning in Polish. This aligns with the PR objective to implement parent-child relationships for tasks.

packages/ui-core/i18n/assets/i18n/pt.json (1)

2615-2615: Translation for parent-child task relationship added correctly.

The Portuguese translation "Tarefa principal" has been added for the "PARENT_TASK" key, which correctly supports the new parent-child relationship feature for tasks.

packages/ui-core/i18n/assets/i18n/zh.json (1)

2615-2615: The Chinese translation for "Parent Task" is correctly implemented.

The addition of the "PARENT_TASK" key with the Chinese translation "父任务" is properly implemented to support the parent-child relationship feature for tasks mentioned in the PR objectives.

packages/ui-core/i18n/assets/i18n/ach.json (1)

2381-2381: Translation addition looks good!

The addition of the "PARENT_TASK" localization key with the value "Laponi me tic" is properly implemented. This aligns well with the PR's objective of implementing parent-child relationships for tasks, providing a translation for the "Parent Task" label in the Acholi language.

packages/ui-core/i18n/assets/i18n/es.json (1)

2616-2616: Translation properly added for parent task feature.

The Spanish translation "Tarea principal" is correctly added for the "PARENT_TASK" key, which supports the parent-child relationship functionality for tasks.

packages/ui-core/i18n/assets/i18n/en.json (1)

2738-2738: New Localization Key "PARENT_TASK" Added Successfully
The new key "PARENT_TASK": "Parent Task" has been added to support the parent–child relationship feature for tasks. This addition follows the established naming conventions and is consistent with the other localization keys. Ensure that the same key is updated consistently across all other language files so that translations remain uniform when this feature is used in the UI.

packages/ui-core/i18n/assets/i18n/bg.json (1)

2674-2674: New translation key properly added.

The Bulgarian translation for "Parent Task" has been correctly added to the tasks section, providing localization support for the new parent-child relationship feature.

packages/ui-core/shared/src/lib/tasks/add-task-dialog/add-task-dialog.module.ts (2)

26-26: Clean import addition for parent task support.

The import of TaskSelectModule is correctly added to support the parent-child relationship feature for tasks.


51-52: Properly configured module imports.

The TaskSelectModule is correctly added to the imports array, allowing the parent task selection functionality to be available in the AddTaskDialogComponent. This change aligns perfectly with the PR objective to implement parent-child relationships for tasks.

packages/ui-core/i18n/assets/i18n/ru.json (1)

2646-2646: Clean translation addition for parent task functionality.

The Russian translation for "Parent Task" has been correctly added to the localization file, supporting the new parent-child relationship feature for tasks.

packages/ui-core/i18n/assets/i18n/fr.json (1)

2610-2610: Correct translation for parent task feature.

The French translation "Tâche parente" is an accurate translation for "Parent Task" and will properly support the new parent-child relationship feature for tasks being implemented.

packages/ui-core/shared/src/lib/tasks/add-task-dialog/add-task-dialog.component.html (3)

18-18: Good refactoring to use the utility method.

Using getControlValue('projectId') instead of direct form control access improves code maintainability and encapsulation.


44-45: Good refactoring to use the utility method.

Consistent use of the getControlValue utility method improves code maintainability.


70-82: Excellent implementation of parent task selection.

The parent task selector is well-structured and aligns with the PR objective of implementing parent-child relationships. The component properly uses the same project ID context as other selectors.

packages/ui-core/shared/src/lib/tasks/add-task-dialog/add-task-dialog.component.ts (4)

76-76: Good addition of the parentId form control.

The form control is properly integrated into the existing form structure, aligning with the parent-child relationship feature.


168-168: Good extraction of parent from selectedTask.

Properly extracting the parent property to be used in the form initialization.


194-194: Good implementation of parentId initialization.

The initialization correctly handles the parent task ID when editing an existing task.


321-334: Well-implemented utility method with good documentation.

The getControlValue method is well-documented and implemented with proper null safety, improving code maintainability and reusability.

apps/gauzy/src/app/pages/tasks/components/task/task.component.ts (2)

178-194: Well-structured parent task column configuration.

The parent task column is properly configured with title, filtering capabilities, and value formatting. The filter function correctly sets up filtering by the parent task prefix, and the value prepare function handles the display appropriately.


441-441: Good addition of parent relation.

Adding 'parent' to the relations list ensures that parent task data is properly loaded for display in the table, which is essential for the parent-child relationship feature.

Copy link

nx-cloud bot commented Mar 24, 2025

View your CI Pipeline Execution ↗ for commit 233e503.

Command Status Duration Result
nx build desktop --base-href ./ ✅ Succeeded 1m 33s View ↗
nx build gauzy -c=production --prod --verbose ✅ Succeeded 4m 1s View ↗
nx build desktop-api --output-path=dist/apps/de... ✅ Succeeded 25s View ↗
nx run api:desktop-api ✅ Succeeded 1m 12s View ↗
nx run gauzy:desktop-ui --base-href ./ ✅ Succeeded 2m 43s View ↗
nx build desktop-ui-lib --configuration=develop... ✅ Succeeded 32s View ↗
nx build plugin-integration-wakatime ✅ Succeeded <1s View ↗
nx build desktop-lib ✅ Succeeded <1s View ↗
Additional runs (57) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2025-03-24 17:40:38 UTC

@rahul-rocket rahul-rocket merged commit b739dfd into develop Mar 26, 2025
16 checks passed
@rahul-rocket rahul-rocket deleted the feature/task-parent-child-relation branch March 26, 2025 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feat] Add parent-child relationship between tasks
2 participants