-
Notifications
You must be signed in to change notification settings - Fork 23
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
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.
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) { |
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.
This can be changed into else if
, which in turn let us avoid using spread syntax on actions
.
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.
I removed the unnecessary spread syntax on actions
. Thanks for the feedback!
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.
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
)
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.
Good point! The code should be updated now. Thanks!
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.
LGTM 👍
🚀 Deployed on https://deploy-preview-3592--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.42,2.41.1,2.40.4,2.39.6,2.38.7 versions
🎉 This PR is included in version 100.68.14 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
DHIS2-17102
Tech summary: