-
Notifications
You must be signed in to change notification settings - Fork 248
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
(refactor) Refactor Mark patient deceased form and Mark patient alive modal #1872
Conversation
Size Change: -5.05 kB (-0.05%) Total Size: 11.2 MB ℹ️ View Unchanged
|
37cefb0
to
ef236f4
Compare
packages/esm-patient-chart-app/src/actions-buttons/mark-patient-alive.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-chart-app/src/actions-buttons/mark-patient-deceased.component.tsx
Show resolved
Hide resolved
packages/esm-patient-chart-app/src/mark-patient-deceased/deceased-form.scss
Outdated
Show resolved
Hide resolved
packages/esm-patient-chart-app/src/mark-patient-deceased/deceased-form.scss
Outdated
Show resolved
Hide resolved
"modals": [ | ||
{ | ||
"name": "mark-patient-alive-modal", | ||
"component": "markPatientAliveModal" | ||
} | ||
], | ||
"pages": [ | ||
{ | ||
"component": "root", | ||
"routeRegex": "^patient\/.+\/chart", | ||
"online": true, | ||
"offline": true | ||
} | ||
], | ||
"workspaces": [ | ||
{ | ||
"name": "mark-patient-deceased-workspace-form", | ||
"component": "markPatientDeceasedForm", | ||
"title": "Mark patient deceased", | ||
"type": "form" | ||
} |
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.
@brandones the hints you added to the console about porting over modals and workspaces to use their respective corresponding keys in the routes.json
file came in clutch! Thanks!
markPatientDeceased(deathDate, patientUuid, causeOfDeath) | ||
.then(() => { | ||
closeWorkspace(); | ||
window.location.reload(); |
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.
@ibacher, @brandones is there a better revalidation mechanism for the patient object? fetchCurrentPatient doesn't use SWR so I assume calling mutate with that key won't work. Triggering a full page reload here ensures that the patient's deceased status gets reflected in the Patient Header.
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.
Additionally, I've elected to not show a success notification here as it wouldn't stay on the screen long enough before the page reloads. Should I show it anyway and maybe set an artificial delay to communicate to the user explicitly that marking the patient as deceased succeeded?
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.
Currently not, but that's horrible. We should probably update usePatient()
to return something similar to the mutate()
hook (i.e., to force it to reload).
)} | ||
<div className={styles.container}> | ||
<span className={styles.warningContainer}> | ||
<WarningFilled aria-label={t('warning', 'Warning')} className={styles.warningIcon} size={20} /> |
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.
@ibacher should we switch to the new icons in the framework across the board?
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.
As much as possible! I haven't created a component for every SVG yet and there are some gaps (warning--filled is one of the icons not included in CarbonMRS and I'm not entirely certain we can just re-use Carbon icons, but it's something I'll look into).
packages/esm-patient-chart-app/src/mark-patient-deceased/deceased-form.workspace.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-chart-app/src/deceased/confirmation-dialog.component.tsx
Outdated
Show resolved
Hide resolved
e0a3dca
to
6ec2e7a
Compare
In the tooltip? I like the idea. |
6ec2e7a
to
2f3eb6d
Compare
@ibacher something like this? |
Thanks, @ibacher! |
Requirements
Summary
This PR makes the following refactors to the
Mark patient deceased form
andMark patient alive
modal:Mark patient deceased form
Mark patient alive modal
Screenshots
demo.mp4
Related Issue
https://openmrs.atlassian.net/browse/O3-3452
Other