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

Remove redundant facility selection pop-up for single facility users #6535

Merged
merged 2 commits into from
Nov 7, 2023

Conversation

sriharsh05
Copy link
Contributor

@sriharsh05 sriharsh05 commented Nov 2, 2023

WHAT

🤖 Generated by Copilot at 05d165a

Added useQuery to fetch user permissions and facilities in ManagePatients.tsx. Added response type to getPermittedFacilities route in api.tsx.

Proposed Changes

  • Fixes Pop-up for selection of facility, redundant  #6518 ?
  • I have removed the unnecessary facility selection pop-up that appeared for users with access to only one facility when attempting to register a new patient. This change streamlines the patient registration process by automatically assigning the single available facility to the new patient.

@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers

Merge Checklist

  • Add specs that demonstrate bug / test a new feature.
  • Update product documentation.
  • Ensure that UI text is kept in I18n files.
  • Prep screenshot or demo video for changelog entry, and attach it to issue.
  • Request for Peer Reviews
  • Completion of QA

HOW

🤖 Generated by Copilot at 05d165a

  • Add useQuery hook and routes object to fetch and access API endpoints (link)
  • Declare permittedData variable to store the response from getPermittedFacilities endpoint (link)
  • Modify onClick handler for add-patient-details button to check user's facility permission and navigate accordingly (link)
  • Add TRes property to getPermittedFacilities route definition to specify the expected response type (link)

@sriharsh05 sriharsh05 requested a review from a team November 2, 2023 10:05
@sriharsh05 sriharsh05 requested a review from a team as a code owner November 2, 2023 10:05
Copy link

vercel bot commented Nov 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
care-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 3, 2023 4:18am

Copy link

netlify bot commented Nov 2, 2023

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit 85b882f
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/6544746243a48900099cdba1
😎 Deploy Preview https://deploy-preview-6535--care-egov-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -477,6 +479,8 @@ export const PatientManager = () => {
[fetchFacilityBadgeName, fetchLocationBadgeName]
);

const { data: permittedData } = useQuery(routes.getPermittedFacilities, {});
Copy link
Member

Choose a reason for hiding this comment

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

variable name permittedData doesn't make sense right?

Suggested change
const { data: permittedData } = useQuery(routes.getPermittedFacilities, {});
const { data: permittedFacilities } = useQuery(routes.getPermittedFacilities, {});

@nihal467
Copy link
Member

nihal467 commented Nov 6, 2023

LGTM

@khavinshankar khavinshankar merged commit 46c19a7 into ohcnetwork:develop Nov 7, 2023
33 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pop-up for selection of facility, redundant
4 participants