Skip to content

Conversation

@Kovy95
Copy link
Contributor

@Kovy95 Kovy95 commented Nov 20, 2025

Description

  • flatten the array with values of taskrefs

Fixes NAE-2268

Dependencies

none

Third party dependencies

  • No new dependencies were introduced

Blocking Pull requests

There are no dependencies on other PR

How Has Been This Tested?

manually

Test Configuration

Name Tested on
OS linux mint 21
Runtime node 20.18.0
Dependency Manager npm 10.8.2
Framework version angular 13
Run parameters
Other configuration

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes have been checked, personally or remotely, with @...
  • I have commented my code, particularly in hard-to-understand areas
  • I have resolved all conflicts with the target branch of the PR
  • I have updated and synced my code with the target branch
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes:
    • Lint test
    • Unit tests
    • Integration tests
  • I have checked my contribution with code analysis tools:
  • I have made corresponding changes to the documentation:
    • Developer documentation
    • User Guides
    • Migration Guides

Summary by CodeRabbit

  • Bug Fixes
    • Improved task reference resolution to correctly process nested task references, ensuring accurate recursive searches when resolving task relationships.

✏️ Tip: You can customize this high-level summary in your review settings.

- flatten the array with values of taskrefs
@Kovy95 Kovy95 self-assigned this Nov 20, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 20, 2025

Walkthrough

The findTaskRefId method in the task content service was modified to flatten the array of referenced task IDs before recursive iteration. Previously, mapping TaskRefField values produced a nested array structure that prevented the subsequent search logic from operating correctly on the flat list.

Changes

Cohort / File(s) Summary
Task content service bug fix
projects/netgrif-components-core/src/lib/task-content/services/task-content.service.ts
Modified findTaskRefId to flatten referencedTaskIds array, enabling recursive search to correctly process referenced task IDs when no direct TaskRefField match exists

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify the array flattening logic correctly handles the recursive case
  • Confirm the change resolves the nested array issue without introducing edge cases with empty or deeply nested references

Suggested labels

bugfix

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'NAE-2268 Fix resolving of referenced taskId on frontend' clearly and specifically identifies the main change: fixing the resolution of referenced task IDs on the frontend, matching the core functionality modified in the code.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai bot added the bugfix label Nov 20, 2025
Copy link

@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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
projects/netgrif-components-core/src/lib/task-content/services/task-content.service.ts (1)

316-321: Fix pre-existing logic error: return inside forEach doesn't exit the function.

The return taskRefId; on line 319 only exits the forEach callback, not the findTaskRefId function. This means:

  1. The loop continues after finding a match
  2. Subsequent iterations without a match can overwrite taskRefId with undefined
  3. A valid match found earlier could be lost

Replace forEach with a for...of loop or .find() to enable early termination:

-            referencedTaskIds.forEach(id => {
-                taskRefId = this.findTaskRefId(taskId, this.taskFieldsIndex[id].fields);
-                if (!!taskRefId) {
-                    return taskRefId;
-                }
-            });
+            for (const id of referencedTaskIds) {
+                taskRefId = this.findTaskRefId(taskId, this.taskFieldsIndex[id].fields);
+                if (taskRefId) {
+                    return taskRefId;
+                }
+            }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f307847 and 055780f.

📒 Files selected for processing (1)
  • projects/netgrif-components-core/src/lib/task-content/services/task-content.service.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
projects/netgrif-components-core/src/lib/task-content/services/task-content.service.ts (1)
projects/netgrif-components-core/src/lib/data-fields/task-ref-field/model/task-ref-field.ts (1)
  • TaskRefField (8-47)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: Matrix Test (18)
  • GitHub Check: Test with SonarCloud
  • GitHub Check: Matrix Test (16)
  • GitHub Check: Matrix Test (14)

@sonarqubecloud
Copy link

@tuplle tuplle merged commit c56661c into release/6.4.2 Dec 1, 2025
10 of 11 checks passed
@tuplle tuplle deleted the NAE-2268 branch December 1, 2025 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants