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

Display live monitoring button to only State Admin, District Admin and Doctor. #7029

Merged
merged 5 commits into from
Jan 17, 2024

Conversation

AshrafMd-1
Copy link
Contributor

Proposed Changes

@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

@AshrafMd-1 AshrafMd-1 requested a review from a team as a code owner January 12, 2024 19:19
Copy link

netlify bot commented Jan 12, 2024

👷 Deploy Preview for care-egov-staging processing.

Name Link
🔨 Latest commit e6e9946
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/65a190c3e9dd270008084f54

Copy link

vercel bot commented Jan 12, 2024

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 Jan 16, 2024 1:10pm

Copy link

netlify bot commented Jan 12, 2024

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit 90b6c09
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/65a68026fcb48a00087a14b0
😎 Deploy Preview https://deploy-preview-7029--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.

@AshrafMd-1
Copy link
Contributor Author

@rithviknishad can u review once

Copy link
Member

@rithviknishad rithviknishad left a comment

Choose a reason for hiding this comment

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

This just hides the button. Users could still go to the URL directly and open the page right?

I think we could add a reusable component called: AuthorizedRoute which accepts user_type: UserRole[]; children and show Page Not Found / Forbidden if unauthorized, else the children.

This wrapper would be used directly in the raviger router's routes like:

const routes = {
  ...
  "/path/to/page": (props) => (
    <AuthorizedRoute userTypes={["StateAdmin", ...]}>
      <LiveMonitoring {...props} />
    </AuthorizedRoute>
  )
};

@AshrafMd-1
Copy link
Contributor Author

@rithviknishad is this okay ?

src/Utils/AuthorizeFor.tsx Outdated Show resolved Hide resolved
src/Components/Facility/FacilityHome.tsx Outdated Show resolved Hide resolved
src/Utils/AuthorizeFor.tsx Show resolved Hide resolved
@rithviknishad rithviknishad added the reviewed reviewed by a core member label Jan 16, 2024
@nihal467
Copy link
Member

LGTM

@khavinshankar khavinshankar merged commit b9bd889 into ohcnetwork:develop Jan 17, 2024
36 checks passed
Copy link

@AshrafMd-1 We truly appreciate your efforts. Thank you for taking the time to contribute; this is a very valuable contribution to us 🥇. We always welcome your contribution 🙂, so feel free to contribute to anything anytime, and never lose that spirit of innovation 🙌.

@AshrafMd-1 AshrafMd-1 deleted the Fix-#7021 branch January 24, 2024 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reviewed reviewed by a core member tested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Restrict Live monitoring button in facility details page to Certain users
5 participants