-
Notifications
You must be signed in to change notification settings - Fork 250
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) O3-4040: Enable deleting program enrollments #2133
(feat) O3-4040: Enable deleting program enrollments #2133
Conversation
@vasharma05 @denniskigen can you please review this for me |
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.
Nice work, @PiusKariuki ! The main thing is to clean up the user-facing text. We don't want to scare users by making them think they might be deleting a whole program, when they are in fact just deleting the patient's enrollment.
packages/esm-patient-programs-app/src/programs/program-actions-menu.scss
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/delete-program.modal.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/delete-program.modal.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/delete-program.modal.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/delete-program.modal.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/delete-program.modal.tsx
Outdated
Show resolved
Hide resolved
@brandones I have made the necessary updates requested. |
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.
Thanks @PiusKariuki ! Excellent work.
In the future, if you could work on figuring out how to add commits to your work in a way that makes it easy for reviewers to see what changed since last review, that would be really helpful. Right now it looks like you made like 14 new commits, which would be inconvenient to view one-by-one. Maybe check out git rebase --interactive
if you haven't.
Just a suggestion, nice work otherwise!
Oops, looks like the E2E test failure is related to this work. Please fix the E2E test. |
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.
Thank you @PiusKariuki! Left a few nitpicks about the tests
packages/esm-patient-programs-app/src/programs/delete-program-modal.test.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/delete-program-modal.test.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/delete-program-modal.test.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/delete-program-modal.test.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/delete-program-modal.test.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/program-actions-menu.component.test.tsx
Outdated
Show resolved
Hide resolved
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 start, @PiusKariuki. I've left some feedback.
packages/esm-patient-programs-app/src/programs/delete-program-modal.test.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/delete-program-modal.test.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/delete-program-modal.test.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/delete-program-modal.test.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/delete-program-modal.test.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/delete-program.modal.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/program-actions-menu.component.test.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/program-actions-menu.component.test.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/program-actions-menu.component.test.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/programs-detailed-summary.component.tsx
Show resolved
Hide resolved
The programs e2e test is failing because this button doesn't exist after moving it to the |
Thank you @denniskigen and @NethmiRodrigo . I am working on fixing these tests right now |
Hi @PiusKariuki , any updates? Is it clear how to move forward with this? |
Hi @brandones , yes it is. I will be making commits to resolve this shortly |
@brandones @denniskigen . I resolved the failing E2E and suggestions too. Please review and revert incase of any more 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.
Thank you @PiusKariuki! A few minor nitpicks
packages/esm-patient-programs-app/src/programs/delete-program-modal.test.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/delete-program-modal.test.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/delete-program-modal.test.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/program-actions-menu.component.test.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/program-actions-menu.component.test.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/program-actions-menu.component.test.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/programs-detailed-summary.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/programs-detailed-summary.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/programs-detailed-summary.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/programs-detailed-summary.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/program-actions-menu.test.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/programs-actions-menu.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/programs-actions-menu.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/programs-actions-menu.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/programs-actions-menu.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/programs-detailed-summary.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/delete-program.modal.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/delete-program.modal.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/programs.resource.tsx
Outdated
Show resolved
Hide resolved
f8bd646
to
e4d4e50
Compare
This PR makes it possible to delete program enrollments. It adds a delete button to the program overview and detailed summary components' overflow menus. When clicked, a modal is opened to confirm the deletion.
e4d4e50
to
c8f8885
Compare
Issues addressed in subsequent changes
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. Thanks, @PiusKariuki!
Thanks @denniskigen ! |
Requirements
Summary
This PR adds the ability to delete program enrollments to both the Programs data tiles. It does so by replacing the erstwhile "Edit" button with an overflow menu containing two options: "Edit" and "Delete". Clicking the "Delete" button launches a confirmation modal that prompts the user to confirm the delete action. Once a program enrollment gets deleted, a success snackbar notification confirming the action is shown on the screen.
This PR also augments existing unit and e2e tests to cover this new functionality.
Screenshots
Overflow menu
Confirmation modal
Success snackbar
Related Issue
https://openmrs.atlassian.net/browse/O3-4040
Other