Skip to content

Conversation

@mvolkmann
Copy link
Collaborator

No description provided.

selectHasAnniversaryReportPermission,
selectHasBirthdayReportPermission,
selectHasCheckinsReportPermission,
selectHasPulseReportPermission,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was renamed to selectHasViewPulseReportPermission for consistency with other permissions.

import PropTypes from 'prop-types';
import queryString from 'query-string';
import React, {
useEffect,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Alphabetized imported items.

Copy link
Collaborator

Choose a reason for hiding this comment

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

My OCD thanks you for this!

label={reviewer.name}
variant="outlined"
onDelete={() => deleteReviewer(member, reviewer)}
onDelete={canUpdate ? () => deleteReviewer(member, reviewer) : null}
Copy link
Collaborator Author

@mvolkmann mvolkmann May 24, 2024

Choose a reason for hiding this comment

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

Lots of UI elements are not either removed or disabled based on the values of canUpdate and canLaunch.

export const selectReviewPeriods = state => state.reviewPeriods;
export const selectPermissions = state => state.permissions;

const hasPermission = permissionName => createSelector(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I removed a lot of code duplication by defining this function.

Copy link
Collaborator

Choose a reason for hiding this comment

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

So much better to read!

p?.permission?.includes('CAN_UPDATE_REVIEW_ASSIGNMENTS')
)
);
export const selectHasCreateReviewAssignmentsPermission =
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added selectors for all the new permissions related to review assignments and review periods.
Maybe Tim is removing some of these.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think all these are staying 👍

const hasPermission = selectHasPermissionAssignmentPermission(state);
const [selectedRole, setSelectedRole] = useState(roles[0]);
const [categoriesList, setCategoriesList] = useState([]);
//TODO: This is not yet getting the "Pulse" category of permissions,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hopefully PR #2429 addresses this.

selectCsrfToken,
selectCurrentUser,
selectHasPulseReportPermission,
selectHasViewPulseReportPermission,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just renamed this selector.

Copy link
Collaborator

@jackkeller jackkeller left a comment

Choose a reason for hiding this comment

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

🪄 of approval!

//TODO: Skipping the permission check during testing
// because this permission has not been implemented yet.
// if (selectHasPulseReportPermission(state)) loadPulses();
// TODO: Uncomment this check after PR #2429 is merged.
Copy link
Contributor

Choose a reason for hiding this comment

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

I just merged #2429

Copy link
Contributor

Choose a reason for hiding this comment

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

As far as I can tell, it's working 🎉

Do we need a PulseReportPage.test.jsx though 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@timyates I added this test.

Copy link
Contributor

Choose a reason for hiding this comment

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

Pushed a fix for the test here #2479 the date was changing in the snapshot when under test

@mvolkmann mvolkmann merged commit 611ba8e into develop Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants