Issue 2191 - added option to select facilities to import at the account level#2237
Merged
Issue 2191 - added option to select facilities to import at the account level#2237
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds selective facility import support when importing an account backup, enabling users to choose specific facilities to import/replace and surfacing differences to guide decisions.
Changes:
- Adds a “Select Facilities to Import” option and corresponding selection/differences UI in the import-backup modal.
- Updates import workflow to delete chosen replacement facilities and import only selected facilities.
- Extends supporting services (facility import return value, facility delete loading suppression, loading UI tracking).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| src/app/shared/helper-services/backup-data.service.ts | Changes facility import API to return facility + progress index for multi-facility imports. |
| src/app/indexedDB/db-changes.service.ts | Adds optional showLoading flag to facility deletion for batch operations. |
| src/app/core-components/loading/loading.component.html | Adjusts @for tracking for loading messages. |
| src/app/core-components/import-backup-modal/import-backup-modal.component.ts | Implements selective facility import logic, state, duplicate checks, and “differences” calculation. |
| src/app/core-components/import-backup-modal/import-backup-modal.component.html | Adds facility selection table UI and disables import when no facilities are selected. |
| src/app/core-components/import-backup-modal/import-backup-modal.component.css | Adds styling for the selection table/checkboxes and adjusts modal sizing/scroll behavior. |
Comments suppressed due to low confidence (1)
src/app/core-components/import-backup-modal/import-backup-modal.component.ts:218
overwriteDatais aboolean | 'selective_import', but the facility-import path treats it as a boolean truthy check (if (this.overwriteData)). If the user previously selected selective import and then loads a facility backup without resettingoverwriteData, the code will incorrectly take the overwrite path and delete/overwrite a facility. ResetoverwriteDatawhen a new file is loaded and/or use explicit checks (overwriteData === true) in the facility import branch.
} else {
if (this.overwriteData) {
await this.importExistingFacility(tmpBackupFile);
} else {
await this.importNewFacility(tmpBackupFile)
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/app/core-components/import-backup-modal/import-backup-modal.component.ts
Show resolved
Hide resolved
src/app/core-components/import-backup-modal/import-backup-modal.component.html
Outdated
Show resolved
Hide resolved
src/app/core-components/import-backup-modal/import-backup-modal.component.ts
Outdated
Show resolved
Hide resolved
src/app/core-components/import-backup-modal/import-backup-modal.component.html
Outdated
Show resolved
Hide resolved
src/app/core-components/import-backup-modal/import-backup-modal.component.ts
Show resolved
Hide resolved
src/app/core-components/import-backup-modal/import-backup-modal.component.ts
Show resolved
Hide resolved
src/app/core-components/import-backup-modal/import-backup-modal.component.ts
Outdated
Show resolved
Hide resolved
src/app/core-components/import-backup-modal/import-backup-modal.component.ts
Show resolved
Hide resolved
rmroot
requested changes
Feb 25, 2026
src/app/core-components/import-backup-modal/import-backup-modal.component.ts
Outdated
Show resolved
Hide resolved
src/app/core-components/import-backup-modal/import-backup-modal.component.ts
Outdated
Show resolved
Hide resolved
rmroot
approved these changes
Feb 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
connects #2191
This pull request introduces a major enhancement to the facility import process in the backup modal, enabling selective facility import from backup files. The changes include new UI elements for selecting facilities, logic updates for handling selective imports, and additional checks for data differences and duplicate selections. The update improves user control and feedback during the import process.
Selective Facility Import Feature:
Logic and State Management Updates:
Import Workflow Enhancements:
UI and Styling Improvements:
Dependency and Service Integration:
These changes collectively make the facility import process more flexible, user-friendly, and robust.