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

feat: [DHIS2-13343] hidden program stage rule effect #3406

Merged
merged 6 commits into from
Sep 7, 2023

Conversation

simonadomnisoru
Copy link
Contributor

@simonadomnisoru simonadomnisoru commented Aug 25, 2023

DHIS2-13343

Tech summary

/enrollment page

  • Quick actions → new and schedule event: Rule effect might disable the buttons
  • Stages and events → new [stagename] event: Rule effect might disable the button

/enrollmentEventNew page

@simonadomnisoru simonadomnisoru marked this pull request as ready for review August 25, 2023 08:08
@simonadomnisoru simonadomnisoru requested a review from a team as a code owner August 25, 2023 08:08
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.

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. 😇

Comment on lines 49 to 64
// 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();
Copy link
Contributor

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.

@simonadomnisoru
Copy link
Contributor Author

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. 😇

Hey @superskip,
Good catch! I added the missing tooltips.
Thank you for the feedback!

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.

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();
Copy link
Contributor

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?

Copy link
Contributor Author

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

@superskip superskip changed the title feat: [DHIS213343] hidden program stage rule effect feat: [DHIS2-13343] hidden program stage rule effect Sep 5, 2023
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.

All good! ⭐

@github-actions
Copy link

github-actions bot commented Sep 6, 2023

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.2,2.39.3,2.38.5 versions

@simonadomnisoru simonadomnisoru merged commit 4ef2973 into master Sep 7, 2023
@simonadomnisoru simonadomnisoru deleted the DHIS2-13343 branch September 7, 2023 12:32
dhis2-bot added a commit that referenced this pull request Sep 7, 2023
# [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-bot
Copy link
Contributor

🎉 This PR is included in version 100.39.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

superskip pushed a commit that referenced this pull request Oct 27, 2023
# [100.39.0](v100.38.0...v100.39.0) (2023-09-07)

### Features

* [DHIS2-13343] hidden program stage rule effect ([#3406](#3406)) ([4ef2973](4ef2973))
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