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-17102] edit event navigation #3592

Merged
merged 7 commits into from
May 29, 2024
Merged

Conversation

simonadomnisoru
Copy link
Contributor

@simonadomnisoru simonadomnisoru commented Apr 2, 2024

DHIS2-17102

Tech summary:

  • When saving an event in a Tracker program, navigate to the enrollment dashboard.
  • When saving an event in an Event program, navigate to the main page / working list.
  • Clean up unused code related to reloading the "view event" form mode

@simonadomnisoru simonadomnisoru requested a review from a team as a code owner April 2, 2024 10:23
Copy link
Contributor

@superskip superskip left a comment

Choose a reason for hiding this comment

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

Lots of orgunit args got pruned, hope they weren't my doing 😅
I've only got one minor performance comment.

if (eventContainer.event && eventContainer.event.attributeCategoryOptions) {
eventContainer.event.attributeCategoryOptions =
convertCategoryOptionsToServer(eventContainer.event.attributeCategoryOptions);
}
let actions = [updateEventContainer(eventContainer, orgUnit)];
let actions = [];

if (meta.triggerAction === enrollmentSiteActionTypes.ROLLBACK_ENROLLMENT_EVENT) {
actions = [...actions, rollbackEnrollmentEvent(eventContainer.event.eventId)];
}
if (meta.triggerAction === enrollmentEditEventActionTypes.EVENT_SAVE_ENROLLMENT_COMPLETE_ERROR) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be changed into else if, which in turn let us avoid using spread syntax on actions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the unnecessary spread syntax on actions. Thanks for the feedback!

Copy link
Contributor

Choose a reason for hiding this comment

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

It is more efficient to use else if as well here (because then the second condition will not get evaluated whenever the first one evaluates to true)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point! The code should be updated now. Thanks!

Copy link
Contributor

@superskip superskip left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link

github-actions bot commented Apr 16, 2024

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.42,2.41.1,2.40.4,2.39.6,2.38.7 versions

@simonadomnisoru simonadomnisoru merged commit 85a6f62 into master May 29, 2024
42 checks passed
@simonadomnisoru simonadomnisoru deleted the DHIS2-17102 branch May 29, 2024 16:07
dhis2-bot added a commit that referenced this pull request May 29, 2024
## [100.68.14](v100.68.13...v100.68.14) (2024-05-29)

### Bug Fixes

* [DHIS2-15920] skip duplicates reviews ([#3629](#3629)) ([3a93911](3a93911))
* [DHIS2-17102] edit event navigation ([#3592](#3592)) ([85a6f62](85a6f62))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 100.68.14 🎉

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