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

Permissions for 'Transfer to Rec. Facility button' #5422

Merged
merged 2 commits into from
May 2, 2023

Conversation

Ashesh3
Copy link
Member

@Ashesh3 Ashesh3 commented May 1, 2023

WHAT

🤖 Generated by Copilot at 7603075

This pull request updates the shifting logic and UI for the patient and shifting components. It uses the global state for the user and facility data, and adds localization support for the transfer button text. It also restricts the transfer button visibility and functionality based on the shift status and the user's role and permissions.

Proposed Changes

Fixes #5399
The updates made to the code include importing 'useSelector' from 'react-redux', adding state variables to capture user details such as userType and userHomeFacilityId, and disabling the transfer button if the user is not authorized or if the transfer is not allowed. Additionally, changes were made to conditional statements to show the transfer button only if the filter is "COMPLETED" and the shift is assigned to a facility.

The purpose of this implementation is to enable the transfer of patients when authorized and allow for restrictions when transferring is not allowed based on user type, facility assignment, or patient settings.

image
image

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

HOW

🤖 Generated by Copilot at 7603075

  • Import useSelector hook to access global state in PatientHome, ListView, and ShiftCard components (link, link, link)
  • Declare and assign variables to get current user's data and home facility id from global state using useSelector hook in PatientHome, ListView, and ShiftCard components (link, link, link)
  • Replace hard-coded text with translation function t to support localization in PatientHome and ListView components (link, link)
  • Change condition for showing transfer button from shift.status === "TRANSFER IN PROGRESS" to shift.status === "COMPLETED" to allow transfers after shift is completed in PatientHome, ListView, and ShiftCard components (link, link, link)
  • Add disabled prop for transfer button with condition that checks if patient is allowed to be transferred and if current user is authorized to transfer in PatientHome, ListView, and ShiftCard components (link, link, link)

@Ashesh3 Ashesh3 requested a review from a team May 1, 2023 12:43
@Ashesh3 Ashesh3 requested a review from a team as a code owner May 1, 2023 12:43
@Ashesh3 Ashesh3 requested a review from gigincg May 1, 2023 12:43
@vercel
Copy link

vercel bot commented May 1, 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 May 2, 2023 9:35am

@netlify
Copy link

netlify bot commented May 1, 2023

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit 5032bf4
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/6450d8edf4008c0008d6fda8
😎 Deploy Preview https://deploy-preview-5422--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 settings.

@sonarcloud
Copy link

sonarcloud bot commented May 2, 2023

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

No Coverage information No Coverage information
1.3% 1.3% Duplication

@nihal467
Copy link
Member

nihal467 commented May 2, 2023

LGTM

@khavinshankar khavinshankar merged commit beeeec0 into coronasafe:develop May 2, 2023
35 of 37 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.

"Transfer patient records"- shifting module
3 participants