-
-
Notifications
You must be signed in to change notification settings - Fork 68
Humemah Add Set Final Day permission functionality #3991
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
base: development
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for highestgoodnetwork-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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 also needs a backend PR to add this new permission to Owners and to verify that a user has this permission when updating final day.
Still not sure why setFinalDay is different from changeUserStatus...
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.
Updated src/components/PermissionsManagement/PermissionsConst.jsx - Added new "Set Final Day" permission definition
Where? Looks like this still needs to be done.
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.
From PR#3245. The route permissions also need to be updated as in that PR.
{
label: 'Set Final Day',
key: 'setFinalDay',
description: 'Gives the user permission to set the final working day.',
},
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.
the permission Set Final Day for User is already defined in PermissionsConst.jsx
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.
The key for that is 'setUserFinalDay' instead of 'setFinalDay' as you're checking. So the key needs to be updated either in your hasPermission() calls or in PermissionsConst and anywhere that actually uses 'setUserFinalDay'.
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.
Then the permission checks are inverted, which probably looks like it's working because it's checking the wrong value.
| {!isCurrentUser && ( | ||
| <> | ||
| {!canChangeUserStatus ? ( | ||
| {!canSetFinalDay ? ( |
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.
| {!canSetFinalDay ? ( | |
| {canChangeUserStatus || canSetFinalDay ? ( |
or
| {!canSetFinalDay ? ( | |
| {canSetFinalDay ? ( |
- It looks like the logic for this is inverted? (with the '!')
- Should
changeUserStatusalso be controlling this, or should it be fully replaced?
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.
ShradhaMBhadrannavar
left a comment
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.
Thanks for checking! Based on the error message, it looks like a local environment issue rather than a problem with the PR itself. |
|






















Description
Related PRS (if any):
This frontend PR is related to the #3245
Main changes explained:
Updated src/components/Header/Header.jsx - Added setFinalDay permission to user management access check
Updated src/components/UserManagement/UserTableData.jsx - Added SetFinalDayButton component with permission check
Updated src/components/UserProfile/BasicInformationTab/BasicInformationTab.jsx - Added button visibility based on permission
How to test:
Check out this branch: git checkout Humemah-Updated-final-day
Run npm install and npm start to run locally
Clear site data/cache
Log in as admin/owner user
Go to → Other Links → Permission Management → User Roles
Verify that only Owner and Admin users have this permission by default
Go to → Other Links → Permission Management → Manage User Permission
Verify the permission can be added to other users that are not Admin nor Owner
Go to any user's Profile → Basic Information → End Date section
Verify users with permission can see and interact with the "Set Final Day" button
Verify users without permission cannot see the button
Screenshots or videos of changes:
Note:
Include the information the reviewers need to know.