Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

fix(2494): Incidents: Add the ability to edit incident details #2689

Open
wants to merge 121 commits into
base: master
Choose a base branch
from

Conversation

riiniii
Copy link
Contributor

@riiniii riiniii commented Jun 2, 2021

fix #2494

Fixes #2494.

Changes proposed in this pull request:

  • merge code from master to current branch
  • change useResolveIncident hook to useUpdateIncident
  • in ViewIncidentDetails page, implement controlled inputs/forms with useState and useEffect, and make relevant fields editable:
    1a. department
    1b. category
    1c. category item
    1d. description
    1e. incident reported to
    1f. patient impacted
  • make ViewIncidentDetails.test.tsx reflect that form should be editable
  • make it so that patient field is always visible, with on view/update, allows user to update the patient field from previously null/empty/undeff to a new patient value
  • add reportedTo

@vercel
Copy link

vercel bot commented Jun 2, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/hospitalrun/hospitalrun-frontend/JDF9CwtuK2XJ28HSvFQGQmRx1fSe
✅ Preview: https://hospitalrun-frontend-git-fork-riiniii-fix-2494-3-hospitalrun.vercel.app

@riiniii
Copy link
Contributor Author

riiniii commented Jun 2, 2021

cla was signed but showing as not signed, waiting on this

@riiniii
Copy link
Contributor Author

riiniii commented Jun 3, 2021

@tehkapa could you add james + cynthia again for the reviewers? I can't seem to add them by myself

@matteovivona matteovivona requested review from cynthiachen7, a team and DrewGregory and removed request for a team June 8, 2021 08:01
@DrewGregory
Copy link
Contributor

@riiniii The issue with the CLA is that every author every commit in this PR has to sign the CLA. I would edit the commits to remove the authorship of Renee Huang, as it seems that they do not have a GitHub account and thus cannot sign the CLA. @tehkapa It seems like a good amount of contributors are running into this -- should the CLA only consider the GitHub author of the PR?

@@ -1,13 +1,12 @@
import subDays from 'date-fns/subDays'

import useResolveIncident from '../../../incidents/hooks/useResolveIncident'
import useUpdateIncident from '../../../incidents/hooks/useUpdateIncident'
Copy link
Contributor

Choose a reason for hiding this comment

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

I like that you made editing and resolving under the same mutation abstraction.

DrewGregory
DrewGregory previously approved these changes Jun 9, 2021
Copy link
Contributor

@DrewGregory DrewGregory left a comment

Choose a reason for hiding this comment

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

Looks good. I would add a return type to getResolvedOn() so that it is clear to a user of this function what an "unresolved" result would look like.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
in progress indicates that issue/pull request is currently being worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incidents: Add the ability to edit incident details
4 participants