[NAE-2268] Fix resolving of referenced taskId on frontend#312
[NAE-2268] Fix resolving of referenced taskId on frontend#312tuplle merged 1 commit intorelease/6.4.2from
Conversation
- flatten the array with values of taskrefs
WalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Suggested labels
Pre-merge checks✅ Passed checks (3 passed)
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.
Example instruction:
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. Comment |
There was a problem hiding this comment.
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:returninsideforEachdoesn't exit the function.The
return taskRefId;on line 319 only exits the forEach callback, not thefindTaskRefIdfunction. This means:
- The loop continues after finding a match
- Subsequent iterations without a match can overwrite
taskRefIdwithundefined- A valid match found earlier could be lost
Replace
forEachwith afor...ofloop 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
📒 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)
projects/netgrif-components-core/src/lib/task-content/services/task-content.service.ts
Show resolved
Hide resolved
|



Description
Fixes NAE-2268
Dependencies
none
Third party dependencies
Blocking Pull requests
There are no dependencies on other PR
How Has Been This Tested?
manually
Test Configuration
Checklist:
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.