-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat(incidents): add ability to resolve incidents #2222
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/hospitalrun/hospitalrun-frontend/7jw83ca31 |
@jackcmeyer @kumikokashii @tehkapa sorry to bug, may i have some guidance/suggestions regarding items [Q1] and [Q2] in my draft PR. |
As for Q1 you are trying to modify in place an object that is not extensible const completedIncident = await IncidentRepository.saveOrUpdate({
...incidentToComplete,
completedOn: new Date(Date.now().valueOf()).toISOString(),
status: 'completed',
}) You cannot modify objects in place: you have to "generate" a new object and copy props from the old one. Q2 seems that it need a fix. You can open an another PR if you want to work on it :) |
Thanks @fox1t i could have sworn that i tried this before and it refused to work 😇 , works this time around though so that one is now fixed, thanks. I have also fixed Q2 as part of this PR so will update the description. Just need to add some tests then i can remove it from draft status |
Hi all, |
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.
few code related comments.
overall, everything looks good.
One thing, I think we should rename everything that says complete
to be resolve
. It seems like resolve
would be the event a user would take when a incident is no longer an incident.
Thanks @jackcmeyer |
Fixes #2078.
Fixes #2218.
Changes proposed in this pull request:
Incident View
-- Show Complete Incident button when incident is not completed
-- Show Complete Incident button when user has the access
-- Do not show the Complete button when incident is already completed
-- Do not show the Complete button if user does not have the access
-- Show the Completed On details if the incident is completed
-- Do not show the Completed On details if the incident is not completed
-- Extract username utility unit test
Incidents View
Incidents Utilities