feat(stoptb): Nikshay sync screens and results CSV upload - #460
Conversation
Adds the upload half of the Nikshay ID Generator round trip: a new tab lets camp staff pick the visit date and the app's results CSV, posts it to MMU-API's importResultsCsv endpoint, and shows how many Nikshay IDs were written back versus how many rows need manual review or failed, with beneficiary names so staff know who to check. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
Hides the Nikshay Sync header tab outside Stop TB deployments by reusing environment.isMMUOfflineQRCode, the same flag that gates the Camp Hub QR code button on the login page. The Camp Hub results upload tab needed no change: that dialog is only reachable through openQrDialog(), already behind the same flag. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
* fix: block data sync if user does not belong to same VAN Added providerServiceMapID validation in data sync login flow. After successful authentication, the data sync user's PSM is compared against the main session's PSM. If they differ (e.g., Mysuru nurse trying to sync a Vizag van), an alert is shown and sync is blocked. - Alert: 'Data sync user does not belong to the same VAN' - Clears serverKey so the sync screen remains locked - Applies to both normal and concurrent-login (doLogout) flows Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Revert "fix: block data sync if user does not belong to same VAN" This reverts commit 3ea1285. * fix: validate data sync userID matches main session userID Block data sync login if the authenticated data sync user is different from the logged-in MMU session user. Compares userID from the userAuthenticate API response against the session's stored userID. Shows alert 'Sync user is not valid' and clears serverKey if mismatch. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(stoptb): Nikshay sync screens and results CSV upload (#460) * feat(stoptb): add Nikshay results CSV upload tab to camp hub dialog Adds the upload half of the Nikshay ID Generator round trip: a new tab lets camp staff pick the visit date and the app's results CSV, posts it to MMU-API's importResultsCsv endpoint, and shows how many Nikshay IDs were written back versus how many rows need manual review or failed, with beneficiary names so staff know who to check. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * feat: nikshaya id syn screens * feat(stoptb): gate Nikshay Sync nav item behind Stop TB env flag Hides the Nikshay Sync header tab outside Stop TB deployments by reusing environment.isMMUOfflineQRCode, the same flag that gates the Camp Hub QR code button on the login page. The Camp Hub results upload tab needed no change: that dialog is only reachable through openQrDialog(), already behind the same flag. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Sneha <sneha@ADMINs-MacBook-Pro.local> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> * Sn/merge 3.6.3 to 3.8.4 (#468) * fix: replace native alert() with confirmationService in AppHeaderComponent * fix: address CodeRabbit review comments in AppHeaderComponent * fix(auth-guard): remove unmanaged currentLangugae$ subscription * chore(auth-guard): add required GPL-3.0 header * fix(auth-guard): return UrlTree/boolean from canActivate * docs: add CONTRIBUTING.md guide for MMU-UI contributors * docs: fix README setup instructions and Common-UI submodule initialization * refactor: implement standard Reactive Forms validation in DataSyncLoginComponent * feat(core): add aria labels to mobile navbar toggler * fix(rxjs): replace internal rxjs imports with public API paths * fix(core): replace native alert() with ConfirmationService in AppHeaderComponent * chore(deps-dev): bump karma-jasmine-html-reporter from 2.1.0 to 2.2.0 Bumps [karma-jasmine-html-reporter](https://github.com/dfederm/karma-jasmine-html-reporter) from 2.1.0 to 2.2.0. - [Release notes](https://github.com/dfederm/karma-jasmine-html-reporter/releases) - [Commits](dfederm/karma-jasmine-html-reporter@v2.1.0...v2.2.0) --- updated-dependencies: - dependency-name: karma-jasmine-html-reporter dependency-version: 2.2.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump websocket-driver from 0.7.4 to 0.7.5 Bumps [websocket-driver](https://github.com/faye/websocket-driver-node) from 0.7.4 to 0.7.5. - [Changelog](https://github.com/faye/websocket-driver-node/blob/main/CHANGELOG.md) - [Commits](faye/websocket-driver-node@0.7.4...0.7.5) --- updated-dependencies: - dependency-name: websocket-driver dependency-version: 0.7.5 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump axios from 1.16.0 to 1.18.1 Bumps [axios](https://github.com/axios/axios) from 1.16.0 to 1.18.1. - [Release notes](https://github.com/axios/axios/releases) - [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) - [Commits](axios/axios@v1.16.0...v1.18.1) --- updated-dependencies: - dependency-name: axios dependency-version: 1.18.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps): bump engine.io from 6.6.4 to 6.6.9 Bumps [engine.io](https://github.com/socketio/socket.io) from 6.6.4 to 6.6.9. - [Release notes](https://github.com/socketio/socket.io/releases) - [Changelog](https://github.com/socketio/socket.io/blob/main/CHANGELOG.md) - [Commits](https://github.com/socketio/socket.io/compare/engine.io@6.6.4...engine.io@6.6.9) --- updated-dependencies: - dependency-name: engine.io dependency-version: 6.6.9 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump immutable from 4.3.8 to 4.3.9 Bumps [immutable](https://github.com/immutable-js/immutable-js) from 4.3.8 to 4.3.9. - [Release notes](https://github.com/immutable-js/immutable-js/releases) - [Changelog](https://github.com/immutable-js/immutable-js/blob/main/CHANGELOG.md) - [Commits](immutable-js/immutable-js@v4.3.8...v4.3.9) --- updated-dependencies: - dependency-name: immutable dependency-version: 4.3.9 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * feat(stoptb): add a Down Sync tab to the data sync screen Adds the UI for the central-to-local down-sync, which until now could only be triggered by calling the API directly - MMU-UI had no hook for /dataSyncActivity/startDownSync at all. A fifth tab in the data sync workarea, alongside Data Upload, Data Download, Generate BeneficiaryID and Inventory Data Download, so it needs no new route, menu entry or permission. It shows a progress bar, the current table, tables completed, records inserted / updated / skipped, conflicts, and a list of any failed tables. Van ID and providerServiceMapID come from session storage exactly as the Data Download tab takes them. Its progress state is deliberately separate from showProgressBar / progressValue: those belong to the up-sync and the master download, and sharing them would let one sync clear the other's progress bar. The button is still disabled while either is running, since both drive the same API. Polling stops on inProgress = false rather than on percentage >= 100. The master download stops at 100%, which never arrives when a run fails part way; the down-sync reports inProgress explicitly, so a failed run ends the poll and shows the failed tables instead of spinning. canDeactivate blocks navigation while a down-sync is running, and ngOnDestroy clears the interval. Note src/environments/environment.ts is gitignored, so the two URLs are added to the tracked environment files only; a local environment.ts has to be refreshed from environment.local.ts to pick them up. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix: add the screen for downsync * fix: update pom version --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Lakshy S. <suntiwari3495@gmail.com> Co-authored-by: VarshiniGunti <guntiv@iitbhilai.ac.in> Co-authored-by: Aarti Panchal <aartipanchal539@gmail.com> Co-authored-by: Rahul Tripathi <rahul@Rahuls-Mac-mini.local> Co-authored-by: Arpit Tripathi <arpittripathiayo@gmail.com> Co-authored-by: pratyksh gupta <pratykshgupta@pratykshs-MacBook-Pro.local> Co-authored-by: Kaushik Kumar <kaushikrjpm10@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: vanitha1822 <vanitha@navadhiti.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Sneha <sneha@ADMINs-MacBook-Pro.local> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Sneha <sneha@ADMINs-MacBook-Pro.local> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Lakshy S. <suntiwari3495@gmail.com> Co-authored-by: VarshiniGunti <guntiv@iitbhilai.ac.in> Co-authored-by: Aarti Panchal <aartipanchal539@gmail.com> Co-authored-by: Rahul Tripathi <rahul@Rahuls-Mac-mini.local> Co-authored-by: Arpit Tripathi <arpittripathiayo@gmail.com> Co-authored-by: pratyksh gupta <pratykshgupta@pratykshs-MacBook-Pro.local> Co-authored-by: Kaushik Kumar <kaushikrjpm10@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: vanitha1822 <vanitha@navadhiti.com>
* fix: block data sync if user does not belong to same VAN Added providerServiceMapID validation in data sync login flow. After successful authentication, the data sync user's PSM is compared against the main session's PSM. If they differ (e.g., Mysuru nurse trying to sync a Vizag van), an alert is shown and sync is blocked. - Alert: 'Data sync user does not belong to the same VAN' - Clears serverKey so the sync screen remains locked - Applies to both normal and concurrent-login (doLogout) flows Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Revert "fix: block data sync if user does not belong to same VAN" This reverts commit 3ea1285. * fix: validate data sync userID matches main session userID Block data sync login if the authenticated data sync user is different from the logged-in MMU session user. Compares userID from the userAuthenticate API response against the session's stored userID. Shows alert 'Sync user is not valid' and clears serverKey if mismatch. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(stoptb): Nikshay sync screens and results CSV upload (#460) * feat(stoptb): add Nikshay results CSV upload tab to camp hub dialog Adds the upload half of the Nikshay ID Generator round trip: a new tab lets camp staff pick the visit date and the app's results CSV, posts it to MMU-API's importResultsCsv endpoint, and shows how many Nikshay IDs were written back versus how many rows need manual review or failed, with beneficiary names so staff know who to check. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * feat: nikshaya id syn screens * feat(stoptb): gate Nikshay Sync nav item behind Stop TB env flag Hides the Nikshay Sync header tab outside Stop TB deployments by reusing environment.isMMUOfflineQRCode, the same flag that gates the Camp Hub QR code button on the login page. The Camp Hub results upload tab needed no change: that dialog is only reachable through openQrDialog(), already behind the same flag. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Sneha <sneha@ADMINs-MacBook-Pro.local> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> * Sn/merge 3.6.3 to 3.8.4 (#468) * fix: replace native alert() with confirmationService in AppHeaderComponent * fix: address CodeRabbit review comments in AppHeaderComponent * fix(auth-guard): remove unmanaged currentLangugae$ subscription * chore(auth-guard): add required GPL-3.0 header * fix(auth-guard): return UrlTree/boolean from canActivate * docs: add CONTRIBUTING.md guide for MMU-UI contributors * docs: fix README setup instructions and Common-UI submodule initialization * refactor: implement standard Reactive Forms validation in DataSyncLoginComponent * feat(core): add aria labels to mobile navbar toggler * fix(rxjs): replace internal rxjs imports with public API paths * fix(core): replace native alert() with ConfirmationService in AppHeaderComponent * chore(deps-dev): bump karma-jasmine-html-reporter from 2.1.0 to 2.2.0 Bumps [karma-jasmine-html-reporter](https://github.com/dfederm/karma-jasmine-html-reporter) from 2.1.0 to 2.2.0. - [Release notes](https://github.com/dfederm/karma-jasmine-html-reporter/releases) - [Commits](dfederm/karma-jasmine-html-reporter@v2.1.0...v2.2.0) --- updated-dependencies: - dependency-name: karma-jasmine-html-reporter dependency-version: 2.2.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump websocket-driver from 0.7.4 to 0.7.5 Bumps [websocket-driver](https://github.com/faye/websocket-driver-node) from 0.7.4 to 0.7.5. - [Changelog](https://github.com/faye/websocket-driver-node/blob/main/CHANGELOG.md) - [Commits](faye/websocket-driver-node@0.7.4...0.7.5) --- updated-dependencies: - dependency-name: websocket-driver dependency-version: 0.7.5 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump axios from 1.16.0 to 1.18.1 Bumps [axios](https://github.com/axios/axios) from 1.16.0 to 1.18.1. - [Release notes](https://github.com/axios/axios/releases) - [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) - [Commits](axios/axios@v1.16.0...v1.18.1) --- updated-dependencies: - dependency-name: axios dependency-version: 1.18.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps): bump engine.io from 6.6.4 to 6.6.9 Bumps [engine.io](https://github.com/socketio/socket.io) from 6.6.4 to 6.6.9. - [Release notes](https://github.com/socketio/socket.io/releases) - [Changelog](https://github.com/socketio/socket.io/blob/main/CHANGELOG.md) - [Commits](https://github.com/socketio/socket.io/compare/engine.io@6.6.4...engine.io@6.6.9) --- updated-dependencies: - dependency-name: engine.io dependency-version: 6.6.9 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump immutable from 4.3.8 to 4.3.9 Bumps [immutable](https://github.com/immutable-js/immutable-js) from 4.3.8 to 4.3.9. - [Release notes](https://github.com/immutable-js/immutable-js/releases) - [Changelog](https://github.com/immutable-js/immutable-js/blob/main/CHANGELOG.md) - [Commits](immutable-js/immutable-js@v4.3.8...v4.3.9) --- updated-dependencies: - dependency-name: immutable dependency-version: 4.3.9 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * feat(stoptb): add a Down Sync tab to the data sync screen Adds the UI for the central-to-local down-sync, which until now could only be triggered by calling the API directly - MMU-UI had no hook for /dataSyncActivity/startDownSync at all. A fifth tab in the data sync workarea, alongside Data Upload, Data Download, Generate BeneficiaryID and Inventory Data Download, so it needs no new route, menu entry or permission. It shows a progress bar, the current table, tables completed, records inserted / updated / skipped, conflicts, and a list of any failed tables. Van ID and providerServiceMapID come from session storage exactly as the Data Download tab takes them. Its progress state is deliberately separate from showProgressBar / progressValue: those belong to the up-sync and the master download, and sharing them would let one sync clear the other's progress bar. The button is still disabled while either is running, since both drive the same API. Polling stops on inProgress = false rather than on percentage >= 100. The master download stops at 100%, which never arrives when a run fails part way; the down-sync reports inProgress explicitly, so a failed run ends the poll and shows the failed tables instead of spinning. canDeactivate blocks navigation while a down-sync is running, and ngOnDestroy clears the interval. Note src/environments/environment.ts is gitignored, so the two URLs are added to the tracked environment files only; a local environment.ts has to be refreshed from environment.local.ts to pick them up. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix: add the screen for downsync * fix: update pom version --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Lakshy S. <suntiwari3495@gmail.com> Co-authored-by: VarshiniGunti <guntiv@iitbhilai.ac.in> Co-authored-by: Aarti Panchal <aartipanchal539@gmail.com> Co-authored-by: Rahul Tripathi <rahul@Rahuls-Mac-mini.local> Co-authored-by: Arpit Tripathi <arpittripathiayo@gmail.com> Co-authored-by: pratyksh gupta <pratykshgupta@pratykshs-MacBook-Pro.local> Co-authored-by: Kaushik Kumar <kaushikrjpm10@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: vanitha1822 <vanitha@navadhiti.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Sneha <sneha@ADMINs-MacBook-Pro.local> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Sneha <sneha@ADMINs-MacBook-Pro.local> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Lakshy S. <suntiwari3495@gmail.com> Co-authored-by: VarshiniGunti <guntiv@iitbhilai.ac.in> Co-authored-by: Aarti Panchal <aartipanchal539@gmail.com> Co-authored-by: Rahul Tripathi <rahul@Rahuls-Mac-mini.local> Co-authored-by: Arpit Tripathi <arpittripathiayo@gmail.com> Co-authored-by: pratyksh gupta <pratykshgupta@pratykshs-MacBook-Pro.local> Co-authored-by: Kaushik Kumar <kaushikrjpm10@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: vanitha1822 <vanitha@navadhiti.com>




Summary
Front end for the Nikshay ID Generator CSV round trip, in two halves:
nikshay-syncmodule (component, routing, styles) reachable from the app header, for exporting pending Stop TB camp beneficiaries as a CSV for the Nikshay ID Generator desktop app.importResultsCsv, and see how many Nikshay IDs were written back versus how many rows need manual review or failed — with beneficiary names, so staff know exactly who to check.Changes
nikshay-sync/(5 files)camp-hub-qr-code.component.html/.cssapp-header.component.htmlapp-routing.module.tsenvironment.*.ts(5 files)nikshayBeneficiaryCsvUrl,nikshayImportResultsCsvUrl2 commits, 14 files, +699 / −60.
Notes
GET /stopTb/nikshay/exportBeneficiariesCsv,POST /stopTb/nikshay/importResultsCsv). Merge order: API first.Testing
Not yet exercised end-to-end against the Nikshay ID Generator app — please confirm the CSV column contract lines up on that side before merge.
🤖 Generated with Claude Code