-
Notifications
You must be signed in to change notification settings - Fork 480
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
Allow only admins to delete a location or a bed #7671
Allow only admins to delete a location or a bed #7671
Conversation
@AnkurPrabhu is attempting to deploy a commit to the Open Healthcare Network Team on Vercel. A member of the Team first needs to authorize it. |
✅ Deploy Preview for care-egov-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
the tooltip is clipping-in in the mobile view |
7fe6d26
to
b359b4d
Compare
Hi, This pr has been automatically marked as stale because it has not had any recent activity. It will be automatically closed if no further activity occurs for 7 more days. Thank you for your contributions. |
const handleDelete = (name: string, _id: string) => { | ||
setBedData({ | ||
show: true, | ||
name, | ||
}); | ||
}; | ||
|
||
const allowedUser = | ||
["DistrictAdmin", "StateAdmin"].includes(authUser.user_type) || | ||
authUser.is_superuser; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need not do super user checks explicitly as all super users are state admins.
disabled={isOccupied} | ||
tooltip={isOccupied ? "Bed is occupied" : undefined} | ||
tooltipClassName="w-full lg:w-auto" | ||
disabled={!allowedUser || isOccupied} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of doing that, we could make use of the authorizeFor
prop present in the button component
Hi, This pr has been automatically marked as stale because it has not had any recent activity. It will be automatically closed if no further activity occurs for 7 more days. Thank you for your contributions. |
@rithviknishad ptal |
LGTM |
@AnkurPrabhu Your efforts have helped advance digital healthcare and TeleICU systems. 🚀 Thank you for taking the time out to make CARE better. We hope you continue to innovate and contribute; your impact is immense! 🙌 |
Proposed Changes
button
LocationManagement.tsx
BedManagement.tsx
@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers
Merge Checklist
Screenshots:
BedManagement.tsx
LocationManagement.tsx