-
Notifications
You must be signed in to change notification settings - Fork 6
check for Pulse report permission in UI #2482
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
Conversation
| CAN_DELETE_REVIEW_PERIOD("Delete review period", "Review Period"), | ||
| CAN_ADMINISTER_SETTINGS("Add or edit settings", "Settings"), | ||
| CAN_VIEW_SETTINGS("View settings", "Settings"), | ||
| CAN_VIEW_ALL_PULSE_RESPONSES("View all pulse responses", "Pulse"); |
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.
I moved this permission to the Reporting category since it is a kind of report and we don't have anything else in the Pulse category.
| @@ -1,8 +1,7 @@ | |||
| import { useMediaQuery } from '@mui/material'; | |||
| import React, { useState } from 'react'; | |||
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.
useState is not used here.
| import React from 'react'; | ||
| import DesktopTable from './DesktopTable'; | ||
| import MobileTable from './MobileTable'; | ||
| import { allPermissions, roles } from './sample-data'; |
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.
allPermissions and roles are not used here.
|
|
||
| // TODO: Uncomment this check after PR #2429 is merged. | ||
| //if (selectHasViewPulseReportPermission(state)) { | ||
| if (selectHasViewPulseReportPermission(state)) { |
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.
This is working now.
| export const selectReviewPeriods = state => state.reviewPeriods; | ||
| export const selectPermissions = state => state.permissions; | ||
|
|
||
| const hasPermission = permissionName => createSelector( |
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.
Prettier made lots of formatting changes in this file.
|
|
||
| useEffect(() => { | ||
| const getRolePermissions = async () => { | ||
| let res = await getRolePermissionsList(csrf); |
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.
let -> const
|
|
||
| // Mock the date if under test so the snapshot stays consistent | ||
| const today = process?.env?.VITEST_WORKER_ID ? new Date(2024, 5, 4) : new Date(); | ||
| const today = import.meta.env.VITEST_WORKER_ID |
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.
This is a good change that Josh made in a separate PR.
No description provided.