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

Add unarchive patient support admin page #6299

Merged
merged 15 commits into from
Aug 21, 2023
Merged

Conversation

emyl3
Copy link
Collaborator

@emyl3 emyl3 commented Aug 9, 2023

FRONTEND PULL REQUEST

Related Issue

Changes Proposed

  • adds a page to unarchive patients for site admins
    • supports filtering by organization and testing facility
    • support pagination of archived patients results
    • patients who are part of all facilities for that org will show up in a testing facility result because of the way we retrieve facilities on the backend

Additional Information

Testing

🌈 Now available on dev1 🌈
https://dev.simplereport.gov/app/admin/unarchive-patient

  • org with archived patients - Test org el B

Screenshots / Demos

@jayna-SkylightDigital - Here are some screenshots of the copy we didn't discuss explicitly that I wanted to make sure was OK with you 😸

Instructions copy

Screenshot 2023-08-16 at 16 42 47

No facility in selected org

Screenshot 2023-08-16 at 16 43 01

@emyl3 emyl3 force-pushed the elisa/6063-archived-patients-table branch 5 times, most recently from 55d36bb to 46d5a55 Compare August 10, 2023 15:15
@@ -1,5 +1,6 @@
query GetOrganizations($identityVerified: Boolean) {
organizations(identityVerified: $identityVerified) {
internalId
Copy link
Collaborator Author

@emyl3 emyl3 Aug 10, 2023

Choose a reason for hiding this comment

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

⚠️ the GetOrganizationsWithFacilities query requries the org's internalId as a param

const [selectedFacilityId, setSelectedFacilityId] = useState<string>("");
const [archivedPatientsCount, setArchivedPatientsCount] = useState<
number | undefined
>(undefined);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

⚠️ setting the patients count and patients default to be undefined to differentiate from when we get 0 results or no patients back (for UI purposes)

await fetchAndSetArchivedPatients(orgId, facilityId, organizations);
await fetchAndSetArchivedPatientsCount(orgId, facilityId, organizations);
// clear pagination on search submit
navigate(`${unarchivePatientPageUrl}${searchParams}`);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

⚠️ not sure if this is too hacky...
But our pagination component adds /{number} to the end of the path so if someone was on the 3rd page of results their path would be updated to /admin/unarchive-patient/3

At that point if they select a new facility and new org and click "Search" and that result does not have 3 pages of results it will display "No result" which I found confusing.

The only downside is the get patients query runs 2x in the above scenario (one with the page number of 2 and one with page number of 0)

Let me know if I need to elaborate more 😅

@emyl3 emyl3 temporarily deployed to Dev2 August 10, 2023 17:24 — with GitHub Actions Inactive
@emyl3 emyl3 marked this pull request as ready for review August 10, 2023 18:50
BobanL
BobanL previously approved these changes Aug 11, 2023
Copy link
Contributor

@BobanL BobanL left a comment

Choose a reason for hiding this comment

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

Ran axe tool on all the page combos in dev2 and looked good!

@@ -39,6 +40,10 @@ const SupportAdminRoutes: React.FC<Props> = ({ isAdmin }) => {
path="tenant-data-access"
element={<TenantDataAccessFormContainer />}
/>
<Route path={"unarchive-patient"}>
<Route path=":pageNumber" element={<UnarchivePatientContainer />} />
<Route path="" element={<UnarchivePatientContainer />} />
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way to set the route just once and fallback to a default value if no page number is passed?. Also how can the user pass a page number but the facility selected is not needed?.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ahh yes! It looks like there is a way to set the route once!

I think the only way a user can pass a page number without having selected a facility is by manipulating the url and appending a page number but nothing would display since they have not selected an org or facility

@emyl3
Copy link
Collaborator Author

emyl3 commented Aug 11, 2023

Discussed async with @jayna-SkylightDigital and @johanna-skylight to make this page and the manage facilities page (#5847) more aligned with one another.

  • going to add a clear filters button
  • and header before the table is displayed
Screenshot 2023-08-11 at 11 09 36 manage facility for reference :)

@emyl3 emyl3 force-pushed the elisa/6063-archived-patients-table branch 3 times, most recently from ae66150 to c06255a Compare August 16, 2023 20:30
@emyl3 emyl3 force-pushed the elisa/6063-archived-patients-table branch 2 times, most recently from fcae57f to dfd380b Compare August 17, 2023 15:37
@emyl3 emyl3 temporarily deployed to Dev August 17, 2023 16:08 — with GitHub Actions Inactive
@emyl3 emyl3 force-pushed the elisa/6063-archived-patients-table branch from 2419e3d to e54c1ec Compare August 18, 2023 19:14
@emyl3 emyl3 temporarily deployed to Dev August 18, 2023 19:49 — with GitHub Actions Inactive
@emyl3 emyl3 temporarily deployed to Dev August 18, 2023 20:16 — with GitHub Actions Inactive
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

90.6% 90.6% Coverage
0.0% 0.0% Duplication

@emyl3
Copy link
Collaborator Author

emyl3 commented Aug 18, 2023

@BobanL @fzhao99 @johanna-skylight @mehansen Ready for re-review!!!

@johanna-skylight I left the loading mask when first loading the page since we have 10k+ orgs in prod (id verified and not deleted -- which, I wonder, if we should switch to a combobox later on if support mentions if it is tough to find the org...)

@emyl3 emyl3 temporarily deployed to Dev August 18, 2023 21:12 — with GitHub Actions Inactive
@fzhao99
Copy link
Contributor

fzhao99 commented Aug 21, 2023

@BobanL @fzhao99 @johanna-skylight @mehansen Ready for re-review!!!

@johanna-skylight I left the loading mask when first loading the page since we have 10k+ orgs in prod (id verified and not deleted -- which, I wonder, if we should switch to a combobox later on if support mentions if it is tough to find the org...)

yeah I think we want to switch to a combo box now. they had this request on the ghosting screen way back when I first joined and I think a similar issue applies here.

@johanna-skylight
Copy link
Contributor

@BobanL @fzhao99 @johanna-skylight @mehansen Ready for re-review!!!
@johanna-skylight I left the loading mask when first loading the page since we have 10k+ orgs in prod (id verified and not deleted -- which, I wonder, if we should switch to a combobox later on if support mentions if it is tough to find the org...)

yeah I think we want to switch to a combo box now. they had this request on the ghosting screen way back when I first joined and I think a similar issue applies here.

Oh but that would mean that we also need to change it for the manage facility page. I think we should create a ticket to migrate the dropdown from this page and manage facility as a follow up.

Tagging : @mehansen @jayna-SkylightDigital

@emyl3 emyl3 added this pull request to the merge queue Aug 21, 2023
@emyl3
Copy link
Collaborator Author

emyl3 commented Aug 21, 2023

@BobanL @fzhao99 @johanna-skylight @mehansen Ready for re-review!!!
@johanna-skylight I left the loading mask when first loading the page since we have 10k+ orgs in prod (id verified and not deleted -- which, I wonder, if we should switch to a combobox later on if support mentions if it is tough to find the org...)

yeah I think we want to switch to a combo box now. they had this request on the ghosting screen way back when I first joined and I think a similar issue applies here.

Oh but that would mean that we also need to change it for the manage facility page. I think we should create a ticket to migrate the dropdown from this page and manage facility as a follow up.

Tagging : @mehansen @jayna-SkylightDigital

Thanks everyone! I'll create a ticket -- feel free to edit and update as you see fit @jayna-SkylightDigital and @mehansen

@emyl3
Copy link
Collaborator Author

emyl3 commented Aug 21, 2023

@johanna-skylight @fzhao99 @jayna-SkylightDigital @mehansen
#6393
ticket created to track this effort

Merged via the queue into main with commit 794f0a6 Aug 21, 2023
@emyl3 emyl3 deleted the elisa/6063-archived-patients-table branch August 21, 2023 15:32
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.

[Unarchive patient] Archived patients table
6 participants