-
Notifications
You must be signed in to change notification settings - Fork 585
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
Conversation
…tionship for tasks with filterable parent
WalkthroughThis 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
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
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
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
packages/ui-core/shared/src/lib/tasks/add-task-dialog/add-task-dialog.component.html
Outdated
Show resolved
Hide resolved
packages/ui-core/shared/src/lib/tasks/add-task-dialog/add-task-dialog.component.ts
Show resolved
Hide resolved
There was a problem hiding this 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
📒 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 featureThe 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 theAddTaskDialogComponent
. 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.
View your CI Pipeline Execution ↗ for commit 233e503.
☁️ Nx Cloud last updated this comment at |
…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
Localization