Skip to content

Fix pause/resume permission flow in profile and user management#5122

Open
saitejakaasoju wants to merge 3 commits intodevelopmentfrom
sai/pause-user-permission
Open

Fix pause/resume permission flow in profile and user management#5122
saitejakaasoju wants to merge 3 commits intodevelopmentfrom
sai/pause-user-permission

Conversation

@saitejakaasoju
Copy link
Copy Markdown

Description

Implements the frontend side of the dedicated pause/resume permission flow and fixes pause/resume behavior across the profile page and User Management table.

This PR updates the app to use the new interactWithPauseUserButton permission consistently, routes pause/resume actions through the dedicated pause endpoint, and removes stale permission/bypass logic that caused visibility and behavior mismatches.

Fixes priority high bug(s):

  • Pause button visible in some places but backend rejected the action
  • Resume/pause behavior inconsistent between profile page and User Management table
  • Removing pause permission from Owner/Admin did not hide the button on the profile page
  • Old permission key pauseUserActivity still affected frontend behavior

Related PRs (if any):

This frontend PR is related to the backend PR:

  • HGNRest PR: sai/pause-user-permission-backend

To fully test this frontend PR, you need to run the matching backend PR as well.

Main changes explained:

  • Update src/actions/userManagement.js to:
    • send requestor in pause/resume requests
    • use the dedicated pause endpoint
    • keep lifecycle updates using the corrected user profile endpoint
  • Update src/utils/URL.js to include the dedicated USER_PAUSE endpoint
  • Update src/components/UserManagement/PauseAndResumeButton.jsx to use the new pause/resume action path
  • Update src/components/UserManagement/UserManagement.jsx so table resume/reactivate flows use the dedicated pause endpoint instead of the old lifecycle action
  • Update src/components/UserManagement/UserTableData.jsx to keep pause/resume table behavior aligned and clean up syntax issues
  • Update src/components/UserProfile/BasicInformationTab/BasicInformationTab.jsx to remove the hardcoded Owner/Admin visibility bypass and rely on the real permission
  • Update src/components/UserProfile/UserProfile.jsx to pass hasPermission into BasicInformationTab
  • Update src/components/PermissionsManagement/Permissions.json to remove the old pauseUserActivity entry
  • Update src/utils/routePermissions.js and src/components/Header/Header.jsx to recognize interactWithPauseUserButton
  • Update related tests for the new pause/resume action flow

How to test:

  1. Check out this branch in HighestGoodNetworkApp
  2. Run the app locally with the matching backend PR checked out in HGNRest
  3. Start frontend and backend
  4. Clear site data/cache if needed
  5. Log in as an Owner or Administrator who has interactWithPauseUserButton
  6. Open a user profile and verify:
    • the Pause button is visible when the permission is present
    • clicking Pause successfully pauses the user
    • clicking Resume successfully reactivates the user
  7. Go to User Management and verify:
    • pause/resume from the table works
    • resume works for a paused user
  8. Remove interactWithPauseUserButton from an Owner/Admin account and verify:
    • the Pause button no longer appears on the profile page
    • the table flow no longer allows pause/resume for that user
  9. Grant interactWithPauseUserButton to a non-admin user and verify they can use pause/resume appropriately
  10. Verify the old pauseUserActivity permission is no longer shown/used
  11. Verify this behavior in dark mode as well

Screenshots or videos of changes:

Screen.Recording.2026-04-08.at.9.32.54.PM.mov

Note:

This PR should be tested together with the matching backend PR because the dedicated pause route and permission checks are implemented there.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 9, 2026

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit a667192
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/69d71ad802e6fd000841fc70
😎 Deploy Preview https://deploy-preview-5122--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.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 9, 2026

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants