-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: [DHIS2-16318] enrollment page url management #3522
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to add a Cypress test that checks that the automatic switching of the owner orgUnit is working correctly?
src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPage.epics.js
Outdated
Show resolved
Hide resolved
Thanks for the review @simonadomnisoru!
|
🚀 Deployed on https://deploy-preview-3522--dhis2-capture.netlify.app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested successfully on 2.41,2.40.4,2.39.5,2.38.7 versions
## [100.57.3](v100.57.2...v100.57.3) (2024-02-27) ### Bug Fixes * [DHIS2-16318] enrollment page url management ([#3522](#3522)) ([0abec43](0abec43))
🎉 This PR is included in version 100.57.3 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
DHIS2-16318
This is a complete rewrite of the enrollment page epics. Their primary function is (still) to handle changes in the url.
The url of the enrollment page can be navigated by tweaking four parameters:
enrollmentId
,programId
,teiId
andorgUnitId
. Their effect can briefly be described as follows.enrollmentId
triggers an update of theteiId
andprogramId
. The new id's are those associated with the specified enrollment. Any existing values ofteiId
andprogramId
in the url will be overwritten.teiId
triggers downloading of tracked entity type and tei display name.teiId
orprogramId
triggers enrollment data to be downloaded and causes automatic switching of selected orgUnit to the associated program owner, provided the user has capture scope access to this orgUnit.orgUnitId
triggers no new actions (hence no epics for this).There is some additional complexity related to management of the status of the few asynchronous calls that is going on in the epics. For instance, if a new
teiId
andprogramId
is being fetched from the server due to updatedenrollmentId
, we will in the meantime avoid initiating any async request depending onteiId
andprogramId
.Further complexity comes from error handling and dealing with blanking of ids.