WEB-623 refactor: remove hard-coded back-routing for component reload - #3044
Conversation
|
Note
|
| Cohort / File(s) | Change Summary |
|---|---|
Core Data Reload Service src/app/core/services/data-reload.service.ts |
New service with per-context reload management. Exposes getReloadObservable(context: string) and triggerReload(context: string) using ReplaySubject for late subscriber support; includes cleanup(context: string) for resource management. |
Centers View Component Refactoring src/app/centers/centers-view/centers-view.component.ts |
Implements OnDestroy lifecycle hook and introduces destroy$ Subject for RxJS subscription cleanup using takeUntil pattern. Integrates DataReloadService for per-center reload context (center-{id}), adds refreshData() to fetch updated center data on reload events. Converts public injected fields (dialog, centersService) to private, expands doAction() with new cases, updates navigation with queryParams for Edit Meeting, and renames centersUnassignStaff() to unassignStaff(). |
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~30 minutes
Suggested reviewers
- alberto-art3ch
- IOhacker
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | The title clearly describes the main refactoring objective: removing hard-coded back-routing for component reload, which aligns with the introduction of DataReloadService and lifecycle cleanup in CentersViewComponent. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing touches
- 📝 Generate docstrings
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 @coderabbitai help to get the list of available commands and usage tips.
IOhacker
left a comment
There was a problem hiding this comment.
LGTM, it is a very good improvement
|
@IOhacker Thanks |
This PR cleans up the way components reload their data. Earlier, reloading was done by navigating to another route and then coming back using hard-coded paths. This made the code harder to maintain and caused unnecessary routing just to refresh data.
With this change, components reload their data through a shared reload service instead of using route navigation. This keeps routing and data refresh separate, makes the code easier to understand, and provides a consistent approach that can be reused across components.
WEB-623
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
If you have multiple commits please combine them into one commit by squashing them.
Read and understood the contribution guidelines at
web-app/.github/CONTRIBUTING.md.