Skip to content

WEB-623 refactor: remove hard-coded back-routing for component reload - #3044

Merged
IOhacker merged 1 commit into
openMF:devfrom
shubhamkumar9199:refactor/component-reload-mechanism
Jan 24, 2026
Merged

WEB-623 refactor: remove hard-coded back-routing for component reload#3044
IOhacker merged 1 commit into
openMF:devfrom
shubhamkumar9199:refactor/component-reload-mechanism

Conversation

@shubhamkumar9199

@shubhamkumar9199 shubhamkumar9199 commented Jan 24, 2026

Copy link
Copy Markdown
Contributor

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.

@coderabbitai

coderabbitai Bot commented Jan 24, 2026

Copy link
Copy Markdown

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'pre_merge_checks'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • 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

Walkthrough

A new DataReloadService is introduced to manage per-context data reloads across components, and CentersViewComponent is refactored to implement proper RxJS subscription cleanup using destroy$ Subject with takeUntil pattern, integrating with the reload service to refresh center data on demand.

Changes

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.

❤️ Share

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

@IOhacker IOhacker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, it is a very good improvement

@IOhacker
IOhacker merged commit 47951f2 into openMF:dev Jan 24, 2026
5 checks passed
@shubhamkumar9199

shubhamkumar9199 commented Jan 24, 2026

Copy link
Copy Markdown
Contributor Author

@IOhacker Thanks

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.

2 participants