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

6272 move status change to footer #6276

Merged
merged 6 commits into from
Jan 27, 2025

Conversation

lache-melvin
Copy link
Contributor

Fixes #6272

👩🏻‍💻 What does this PR do?

Make status change/delete workflows of encounters match those of other features.

Removes status change and delete from toolbar.

Adds delete button to side panel, and status change to footer:
Screenshot 2025-01-24 at 3 28 40 PM

Pre-requisite to hooking into status change logic within vax card.

💌 Any notes for the reviewer?

🧪 Testing

  • Create an encounter
  • On detail view - there is no status dropdown or delete button in the toolbar
  • Footer has new split button, says Mark as Visited by default
  • Clicking the button changes the status
    • Status breadcrumb updates to show visited
    • You get the green success toast that it saved successfully
    • Status button for visited is now disabled
    • You can still change the button, to mark as Pending or Cancelled
  • Click More to open side panel
  • There is now a delete button
  • Clicking delete opens a confirmation modal - confirming deletes the encounter and redirects you to the list view

📃 Documentation

  • Part of an epic: documentation will be completed for the feature as a whole
  • No documentation required: no user facing changes or a bug fix which isn't a change in behaviour
  • These areas should be updated or checked:
    1.
    2.

@github-actions github-actions bot added this to the v2.6.0 milestone Jan 24, 2025
Copy link

Bundle size difference

Comparing this PR to main

Old size New size Diff
5.21 MB 5.21 MB 548 B (0.01%)

@@ -46,7 +46,7 @@ export const SplitButton = <T,>({
<ButtonGroup color={color} variant="outlined" aria-label={ariaLabel}>
<ButtonWithIcon
color={color}
disabled={isDisabled}
disabled={isDisabled || selectedOption.isDisabled}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hopefully we are okay with the change?

Copy link
Contributor

Choose a reason for hiding this comment

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

It does look a little funky!

Does this essentially ensure the currently selected option is greyed out if that's the current status anyway?

Copy link
Contributor Author

@lache-melvin lache-melvin Jan 27, 2025

Choose a reason for hiding this comment

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

Screenshot 2025-01-28 at 11 39 33 AM

Yeah basically - already visited, so shouldn't be able to mark as visited, but we still want that to be the default option of the button. If they want to change to cancelled or back to pending, can do by selected the dropdown

Before, the only option was to disable the entire button

Copy link
Contributor

Choose a reason for hiding this comment

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

I just noticed them radiuses:

image

image

Was it already cursed to be square before this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah - Mariya's got that in some new designs, I don't think there is a specific issue for it yet though... unless easy to include in your button PR @aimee-mcneil-melville?:

Screenshot 2025-01-28 at 12 19 05 PM

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah it sounds straight forward - I'll take a look :)

Copy link
Contributor

Choose a reason for hiding this comment

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

I've updated the split button to have the rounded corners on the right hand side - I'm not set up for encounters so haven't tested in this area with the disabled split yet

@@ -81,11 +81,15 @@ const useSaveWithStatus = (
};
};

const useSaveWithStatusChangeModal = (
const useSaveWithStatusChange = (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

just renaming as I'm now using both in and outside of the modal

@@ -133,7 +142,7 @@ export const Footer: FC<FooterProps> = ({
gap={2}
>
<Typography sx={{ fontSize: 18, fontWeight: 700 }}>
Document Edit History
{t('label.document-edit-history')}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

side quest - missed translation from ages ago!

@Chris-Petty Chris-Petty self-assigned this Jan 27, 2025
Copy link
Contributor

@Chris-Petty Chris-Petty left a comment

Choose a reason for hiding this comment

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

I haven't got a db setup for testing this stuff yet, could you flick me your one please?

Looks mint though!

@@ -46,7 +46,7 @@ export const SplitButton = <T,>({
<ButtonGroup color={color} variant="outlined" aria-label={ariaLabel}>
<ButtonWithIcon
color={color}
disabled={isDisabled}
disabled={isDisabled || selectedOption.isDisabled}
Copy link
Contributor

Choose a reason for hiding this comment

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

It does look a little funky!

Does this essentially ensure the currently selected option is greyed out if that's the current status anyway?

@lache-melvin lache-melvin merged commit 185906a into develop Jan 27, 2025
5 checks passed
@lache-melvin lache-melvin deleted the 6272-move-status-change-to-footer branch January 27, 2025 22:48
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.

Move encounter status from toolbar to footer
3 participants