Skip to content

Conversation

@AnthonyWeathers
Copy link
Contributor

@AnthonyWeathers AnthonyWeathers commented Jun 2, 2025

Description

Permission Change Log Table had a column replaced and more permissions displayed that would include ones provided by a user's role instead of just permissions added/removed that were not originally apart of their role. Added condition checks to display text in Reason column based on how a user's permissions are being changed, whether by the managing their permissions or changing their role. Also, made individual's name be regular text when the user's role is changed/updated, which would be highlight in blue in the reason column. An individual's name would be bold when their permissions was modified, and the text would be bold red if permissions were modified for a Role.

In Manage User Permissions Modal, added a info modal next to Reset To Default that would list the selected user's role, and permissions that would be reset if Reset to Default is used. Added star icon that appears on same line of a permission that was changed from the default provided by the user's role, red for a deleted default permission and green for an added permission. A paragraph element that pops up when hovering over star icon, for quick understanding of what the star means. Fixed category add/delete button so it adds or delete all sub permissions of a category, or add all remaining unadded permissions of a category with a gray add button. For the reminder modal to save changes, on screen size of 395px or less, fixed styling of the buttons and its div element so they're same size and have consistent padding.

In User Profile, reset user's removedDefaultPermissions to empty and defaultPermissions to the permissions of their new role. Then added a call to the endpoint that saves permission changes and creates a user change log to be shown in the Permission Change Log Table. Will display "See default {role} role permissions" if there is no direct changes to a user's permission if they had no permissions to be changed, or their new role matches it (Example: if they had "Edit Header Message" added and "Edit Team" removed as a Manager, then was changed to Volunteer role, then their change log would show "See default Volunteer role permissions" under Permissions Added since Volunteer role does not have "Edit Team" by default, but would display "Edit Header Message" under Permissions Removed, as it's a permission Volunteers would not have by default). The text would prioritize listing the permissions being modified before displaying the generic text.

Related PRS (if any):

This backend PR is related to the PR#1447 backend PR.
To test this frontend PR properly you need to checkout the PR#1447 backend PR.

How to test:

  1. check into current branch
  2. do npm install and ... to run this PR locally
  3. Clear site data/cache

##Permissions Management
4. log as owner user (to view Permission Change Logs Table), or can log as admin to test Manage User Permissions changes
5. go to dashboard→ Other Links → Permissions Management→…
6. verify if features work, screenshots will serve as reference for most fixes/features

##Testing Role Change
7. go to another user's profile to test (preferably a test account of yours, or you can use Anthony Test/Test2 if you need a test account)→Change the user's role then save it→ Return to Permissions Management
8. Verify there is a new change log for the user's role change (The text will depend if it was solely a role change, or display changed permissions if you added or removed permissions the new role has differently)

Screenshots or videos of changes:

Pop up text when hovering over star icon
Increased height of save changes buttons in save changes reminder modal to 70px so spacing is even from all sides
Updated Reset to Default modal including both added and removed permissions
Red Star icon indicating removed permission for user

(Owner Only)
Updated text for change logs

…for permissions added that are not part of a user's role permissions by default, and added info modal for reset to default to summarize what added permissions will be removed if pressed, and applied some prettier styling to files I change(s) to
…e-PermissionsBeyond-UserRole-DefaultPermissions
…r below 395px, display all changed permissions, whether added or deleted that are not apart of the user's role by default, added red color to star icon for visual indicator of removed default permission
…cent spacing from top and bottom of their button shapes, added a hover over text popup for star icon to give text of permission added or removed, enabled star icon to appear for default permissions that were removed and they appear as red stars, and updated reset to default info modal description to account for both added and removed permissions
… button does not work until clicking reset to default to clear the star icon then the button functions, also included check in checkSubperms so permission categories are now always changeable to green all, gray all, or delete based off of how many of their subperms are added or not added
…e-PermissionsBeyond-UserRole-DefaultPermissions
…e-PermissionsBeyond-UserRole-DefaultPermissions
…e-PermissionsBeyond-UserRole-DefaultPermissions
…e-PermissionsBeyond-UserRole-DefaultPermissions
@netlify
Copy link

netlify bot commented Jun 2, 2025

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit b79b9ba
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/69700632c58cf100082429fd
😎 Deploy Preview https://deploy-preview-3600--highestgoodnetwork-dev.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 project configuration.

…e-PermissionsBeyond-UserRole-DefaultPermissions
…e-PermissionsBeyond-UserRole-DefaultPermissions
@one-community one-community added the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label Jun 9, 2025
TaariqMansurie
TaariqMansurie previously approved these changes Jun 12, 2025
Copy link
Contributor

@TaariqMansurie TaariqMansurie left a comment

Choose a reason for hiding this comment

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

Tested everything locally, the permission log table looks clean with proper widths, the new info modal works as expected, star indicators are helpful and show the right tooltips, and the category buttons behave correctly. Also checked on small screen sizes, styling looks good. All set from my side!

I have attached the following screenshots:

category permission added 2
category permission added
deleted a default permission
permissions_added
responsive screen permission
saved_changes

Copy link
Contributor

@nathanah nathanah left a comment

Choose a reason for hiding this comment

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

I think there's room for some small optimizations, but mostly looks good.

Comment on lines 138 to 174
const getAllPermissions = permissions => {
if (!permissions) {
return;
}
const permissionList = [];

// eslint-disable-next-line no-restricted-syntax
for (const permission of permissions) {
if (permission?.subperms) {
permissionList.push(...getAllPermissions(permission.subperms));
} else {
permissionList.push(permission);
}
}
// eslint-disable-next-line consistent-return
return permissionList;
};

const handleModalOpen = () => {
if (userPermissions?.length > 0 || userRemovedDefaultPermissions?.length > 0) {
const getPermissions = permissionsList.map(permission => permission.subperms).flat();
const getAllSubIndividualPermissions = getAllPermissions(getPermissions);
const changedPermission = new Set();
const matchingPermissions = getAllSubIndividualPermissions.filter(permission => {
if (
// Removes duplicate display of See All Users in Dashboard and Leaderboard and Edit Team 4-Digit Codes
changedPermission.has(permission.key) ||
!(
userPermissions.includes(permission.key) ||
userRemovedDefaultPermissions.includes(permission.key)
)
)
return false;
changedPermission.add(permission.key);
return true;
});
const permissionNames = matchingPermissions.map(permission => permission.label);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const getAllPermissions = permissions => {
if (!permissions) {
return;
}
const permissionList = [];
// eslint-disable-next-line no-restricted-syntax
for (const permission of permissions) {
if (permission?.subperms) {
permissionList.push(...getAllPermissions(permission.subperms));
} else {
permissionList.push(permission);
}
}
// eslint-disable-next-line consistent-return
return permissionList;
};
const handleModalOpen = () => {
if (userPermissions?.length > 0 || userRemovedDefaultPermissions?.length > 0) {
const getPermissions = permissionsList.map(permission => permission.subperms).flat();
const getAllSubIndividualPermissions = getAllPermissions(getPermissions);
const changedPermission = new Set();
const matchingPermissions = getAllSubIndividualPermissions.filter(permission => {
if (
// Removes duplicate display of See All Users in Dashboard and Leaderboard and Edit Team 4-Digit Codes
changedPermission.has(permission.key) ||
!(
userPermissions.includes(permission.key) ||
userRemovedDefaultPermissions.includes(permission.key)
)
)
return false;
changedPermission.add(permission.key);
return true;
});
const permissionNames = matchingPermissions.map(permission => permission.label);
import { permissionLabelKeyMappingObj, getAllPermissionKeys} from './PermissionsConst';
const handleModalOpen = () => {
if (userPermissions?.length > 0 || userRemovedDefaultPermissions?.length > 0) {
const matchingPermissions = [...new Set(getAllPermissionKeys().filter(key =>
userPermissions.includes(key) ||
userRemovedDefaultPermissions.includes(key)
))];
const permissionNames = matchingPermissions.map(key => permissionLabelKeyMappingObj[key]);

This does the same thing but more condensed, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tested it a bit and it does seem to accomplish the same task, so I applied it in the new push, thanks for pointing that out, I hadn't thought to take a look at those.

Comment on lines 262 to 276
<button
className={`changed-permission ${
changedPermission(permission)
? checkChangePermission(permission)
? 'green'
: 'red'
: 'white'
}`}
aria-label={changedPermission(permission) ? 'Modified Permission' : ''}
disabled
type="button"
>
{' '}
{' '}
</button>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<button
className={`changed-permission ${
changedPermission(permission)
? checkChangePermission(permission)
? 'green'
: 'red'
: 'white'
}`}
aria-label={changedPermission(permission) ? 'Modified Permission' : ''}
disabled
type="button"
>
{' '}
{' '}
</button>
(changedPermission(permission) && <button
className={`changed-permission ${
checkChangePermission(permission)
? 'green'
: 'red'
}`}
aria-label={changedPermission(permission) ? 'Modified Permission' : ''}
disabled
type="button"
>
{' '}
{' '}
</button>)

Could do a conditional render instead of white. From your screenshots, it looks like white blends in with the background on light mode, but it wouldn't on dark mode. The conditional render might mess up spacing/alignment stuff though, so up to you. Doesn't matter too much.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For this one, I decided to rework the styling some more, so I think the star icons should be fine now in both of the current setup for light and dark mode, though do let me know if it doesn't.

…e-PermissionsBeyond-UserRole-DefaultPermissions
…ssionKeys from ./PermissionsConst, and updated the css class used for the star icon so the star displays should work in both light and dark mode, also added 0 padding and changed the background color of the star icons to undo style changes made from recent developement merging
nathanah
nathanah previously approved these changes Jun 23, 2025
Copy link
Contributor

@nathanah nathanah left a comment

Choose a reason for hiding this comment

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

Looks great. Thank you

Copy link
Contributor

@Venk-rgb Venk-rgb left a comment

Choose a reason for hiding this comment

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

Rendered the UI to test. There is just one observations:

  • The reset to default tooltip is not working consistently even after clicking the info icon.

Other than that, everything else looks good.

Screenshot 2025-06-24 at 6 28 30 PM Screenshot 2025-06-24 at 6 28 49 PM Screenshot 2025-06-24 at 6 29 20 PM Screenshot 2025-06-24 at 6 29 31 PM Screenshot 2025-06-24 at 6 30 38 PM

@AnthonyWeathers
Copy link
Contributor Author

Rendered the UI to test. There is just one observations:

  • The reset to default tooltip is not working consistently even after clicking the info icon.

Other than that, everything else looks good.

Screenshot 2025-06-24 at 6 28 30 PM Screenshot 2025-06-24 at 6 28 49 PM Screenshot 2025-06-24 at 6 29 20 PM Screenshot 2025-06-24 at 6 29 31 PM Screenshot 2025-06-24 at 6 30 38 PM

Apologizes for being late, was working on other stuff and delegating some time to review this. I re-entered my branch, and will likely need to do a git merge due to styling now being out of order since I last checked. But the reset to default tooltip seems to be working fine, if you have the time, can you point out perhaps which permissions you're attempting to change with my Anthony Volunteer account, where the reset to default doesn't work properly with?

Copy link
Contributor

@sircarmart sircarmart left a comment

Choose a reason for hiding this comment

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

Everything looks good when I test using the google chrome browser.

image

Buttons seem to break using firefox browser. This problem does not occur on latest development branch.
image

The navbar timer buttons are also larger in your branch compared to development.
image

…e-PermissionsBeyond-UserRole-DefaultPermissions
…e-PermissionsBeyond-UserRole-DefaultPermissions
@AnthonyWeathers
Copy link
Contributor Author

Everything looks good when I test using the google chrome browser.

image Buttons seem to break using firefox browser. This problem does not occur on latest development branch. image

The navbar timer buttons are also larger in your branch compared to development. image

Hi there, super late, I've been focused on a different task but taking a look at the branch, and after merging with like roughly today's version of development, I've tested on 4 browsers but unsure if I may have missed something but otherwise it looks fine now, here is a full screenshot of the view on the browsers with me listing the browser name. Let me know if it's fine for your side as well.

Google:
Permission Change Logs Table Google look

Firefox:
Permission Change Logs Table Firefox look

Opera GX:
Permission Change Logs Table Opera look

Microsoft Edge:
Permission Change Logs Table Microsoft Edge look

@aseemdeshmukh
Copy link

PR3600_1
Navigated to /permissionsmanagement and logged in with the admin account.

  • The permissions work well, along with the pop up window that displays to save the changes
  • The star color changes to green or red depending on if the permission is added or removed

Copy link

@sohamsharma08 sohamsharma08 left a comment

Choose a reason for hiding this comment

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

I tested the changes locally and confirmed that the permission log table renders correctly, the new info modal functions as intended, star indicators display accurate tooltips, and category buttons work as expected. I also verified the styling on smaller screens and in dark mode and everything looks consistent. Relevant screenshots are attached for reference.

PR 3600 (1) PR 3600 (2) PR 3600 (3) PR 3600 (4) PR 3600 (5) PR 3600 (6)

@hemanthvenkat
Copy link

PR3600.mp4

i have tested given cases, all working as expected.

aseemdeshmukh
aseemdeshmukh previously approved these changes Aug 23, 2025
Copy link

@aseemdeshmukh aseemdeshmukh left a comment

Choose a reason for hiding this comment

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

Navigated to /permissionsmanagement and logged in with the admin account.

  1. The permissions work well, along with the pop up window that displays to save the changes
  2. The star color changes to green or red depending on if the permission is added or removed

Anusha-Gali
Anusha-Gali previously approved these changes Jan 16, 2026
Copy link

@Anusha-Gali Anusha-Gali left a comment

Choose a reason for hiding this comment

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

Hi Anthony,

I have reviewed your PR locally and the permissions added reflect exactly the changes done.
Screenshot 2026-01-16 at 4 39 01 PM
Screenshot 2026-01-16 at 4 39 21 PM

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible

Projects

None yet

Development

Successfully merging this pull request may close these issues.