-
Notifications
You must be signed in to change notification settings - Fork 22
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
feat: [DHIS2-13343] hidden program stage rule effect #3406
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.
Seems like you've made a good job figuring out edge cases! 👍
I noticed that the design doc mentions here and there to add a tooltip message “You can’t add any more $ProgramStageName events", doesn't look like this has been implemented yet. I also added a comment on the cypress test. 😇
// clean up | ||
cy.visit( | ||
'/#/enrollment?enrollmentId=fmhIsWXVDmS&orgUnitId=s7SLtx8wmRA&programId=WSGAb5XwJ3Y&teiId=uW8Y7AIcRKA', | ||
); | ||
|
||
cy.get('[data-test="enrollment-page-content"]').contains('Enrollment Dashboard'); | ||
|
||
cy.get('[data-test="stages-and-events-widget"]') | ||
.find('[data-test="stage-content"]') | ||
.eq(3) | ||
.click(); | ||
|
||
cy.contains('WHOMCH Pregnancy outcome').should('exist'); | ||
cy.contains('[data-test="dhis2-uicore-button"]', 'Edit event').click(); | ||
cy.contains('[data-test="dhis2-uicore-button"]', 'Delete').click(); | ||
cy.contains('[data-test="dhis2-uicore-button"]', 'Yes, delete event').click(); |
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.
Relying on the test to do cleanup at the end might cause problems if the test fails mid-way. If cleanup is required then I've understood that best practice is to do it at the beginning of a test.
Hey @superskip, |
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.
Tooltip implementation looks good 👍
Just one more concern with the test:
cy.get('[data-test="stages-and-events-widget"]') | ||
.find('[data-test="stage-content"]') | ||
.eq(3) | ||
.click(); |
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 think we run into trouble if there are no events in the program stage (which is initially the case?). Is it possible to do an early return if the program stage is empty?
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.
Great suggestion! I updated to code to handle the case of no events in the program stage. 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.
All good! ⭐
🚀 Deployed on https://deploy-preview-3406--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.2,2.39.3,2.38.5 versions
# [100.39.0](v100.38.0...v100.39.0) (2023-09-07) ### Features * [DHIS2-13343] hidden program stage rule effect ([#3406](#3406)) ([4ef2973](4ef2973))
🎉 This PR is included in version 100.39.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
# [100.39.0](v100.38.0...v100.39.0) (2023-09-07) ### Features * [DHIS2-13343] hidden program stage rule effect ([#3406](#3406)) ([4ef2973](4ef2973))
DHIS2-13343
Tech summary
/enrollment
page/enrollmentEventNew
page