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) O3-4040: Enable deleting program enrollments #2133

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

PiusKariuki
Copy link
Contributor

@PiusKariuki PiusKariuki commented Dec 5, 2024

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

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

CleanShot 2025-01-27 at 9  37 30@2x

Confirmation modal

CleanShot 2025-01-27 at 9  37 43@2x

Success snackbar

CleanShot 2025-01-27 at 9  37 54@2x

Related Issue

https://openmrs.atlassian.net/browse/O3-4040

Other

@PiusKariuki
Copy link
Contributor Author

@vasharma05 @denniskigen can you please review this for me

@brandones brandones changed the title (feat) Add delete ability to program enrollments#4040 (feat) O3-4040: Add delete ability to program enrollments Dec 15, 2024
Copy link
Contributor

@brandones brandones left a 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.

@PiusKariuki
Copy link
Contributor Author

@brandones I have made the necessary updates requested.

Copy link
Contributor

@brandones brandones left a 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!

@brandones
Copy link
Contributor

Oops, looks like the E2E test failure is related to this work. Please fix the E2E test.

Copy link
Collaborator

@NethmiRodrigo NethmiRodrigo left a 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

Copy link
Member

@denniskigen denniskigen left a 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.

@denniskigen
Copy link
Member

The programs e2e test is failing because this button doesn't exist after moving it to the ProgramsActionsMenu component. You'll likely need to mimic this setup.

@PiusKariuki
Copy link
Contributor Author

Thank you @denniskigen and @NethmiRodrigo . I am working on fixing these tests right now

@brandones
Copy link
Contributor

Hi @PiusKariuki , any updates? Is it clear how to move forward with this?

@PiusKariuki
Copy link
Contributor Author

Hi @brandones , yes it is. I will be making commits to resolve this shortly

@PiusKariuki
Copy link
Contributor Author

@brandones @denniskigen . I resolved the failing E2E and suggestions too. Please review and revert incase of any more feedback

Copy link
Collaborator

@NethmiRodrigo NethmiRodrigo left a 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

@denniskigen denniskigen force-pushed the feat/delete-programs-feature branch 2 times, most recently from f8bd646 to e4d4e50 Compare January 27, 2025 18:11
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.
@denniskigen denniskigen force-pushed the feat/delete-programs-feature branch from e4d4e50 to c8f8885 Compare January 27, 2025 18:12
@denniskigen denniskigen dismissed NethmiRodrigo’s stale review January 27, 2025 18:20

Issues addressed in subsequent changes

Copy link
Member

@denniskigen denniskigen left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks, @PiusKariuki!

@PiusKariuki
Copy link
Contributor Author

Thanks @denniskigen !

@denniskigen denniskigen changed the title (feat) O3-4040: Add delete ability to program enrollments (feat) O3-4040: Enable deleting program enrollments Jan 27, 2025
@denniskigen denniskigen merged commit 4313052 into openmrs:main Jan 27, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy