Skip to content
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

Merged
merged 20 commits into from
Feb 27, 2024
Merged

Conversation

superskip
Copy link
Contributor

@superskip superskip commented Feb 2, 2024

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 and orgUnitId. Their effect can briefly be described as follows.

  • A change in enrollmentId triggers an update of the teiId and programId. The new id's are those associated with the specified enrollment. Any existing values of teiId and programId in the url will be overwritten.
  • A change in teiId triggers downloading of tracked entity type and tei display name.
  • A change in teiId or programId 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.
  • Changes in 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 and programId is being fetched from the server due to updated enrollmentId, we will in the meantime avoid initiating any async request depending on teiId and programId.

Further complexity comes from error handling and dealing with blanking of ids.

@superskip superskip requested a review from a team as a code owner February 2, 2024 16:35
Copy link
Contributor

@simonadomnisoru simonadomnisoru left a 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?

@superskip
Copy link
Contributor Author

superskip commented Feb 14, 2024

Thanks for the review @simonadomnisoru!

  • Changed the enrollment id error message
  • Improved the handling of invalid orgUnitId. I didn't do the error screen exactly like how the other three url parameters do it: in the case of an invalid orgUnitId the scope selector is displayed. But this is probably better than not showing it from a user perspective?
  • Added a small test for checking automatic switching of orgunits, I think it should be sufficient 😄

@superskip superskip added testing and removed testing labels Feb 20, 2024
Copy link

Copy link

@geethaalwan geethaalwan left a 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

@superskip superskip merged commit 0abec43 into master Feb 27, 2024
37 of 38 checks passed
@superskip superskip deleted the DHIS2-16318 branch February 27, 2024 09:58
dhis2-bot added a commit that referenced this pull request Feb 27, 2024
## [100.57.3](v100.57.2...v100.57.3) (2024-02-27)

### Bug Fixes

* [DHIS2-16318] enrollment page url management ([#3522](#3522)) ([0abec43](0abec43))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 100.57.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants