Skip to content

Diya fix(userStatus): Fixed User Lifecycle Issues#5264

Open
DiyaWadhwani wants to merge 2 commits into
developmentfrom
Diya_UserLifecycleFlow
Open

Diya fix(userStatus): Fixed User Lifecycle Issues#5264
DiyaWadhwani wants to merge 2 commits into
developmentfrom
Diya_UserLifecycleFlow

Conversation

@DiyaWadhwani
Copy link
Copy Markdown
Contributor

@DiyaWadhwani DiyaWadhwani commented May 13, 2026

Description

Fixes the user lifecycle status management flow on the frontend — specifically the active cell color rendering and incorrect API routing for reactivation and final day cancellation.
Fixes # (High) — User deactivation/reactivation/pause lifecycle flow

Related PRS (if any):

This frontend PR is related to the backend PR #2122

Main changes explained:

  • Update ActiveCell.jsx to fix deriveUserStatus so it trusts isActive as the source of truth, removing a stale endDate branch that was incorrectly marking active users as grey/inactive.
  • Update UserManagement.jsx to replace updateUserPauseStatus with activateUserAction inside reactivateUser, so both "Reactivate Paused User" and "Cancel Final Day" correctly route through changeUserStatus with action: ACTIVATE instead of the /pause endpoint which was not clearing endDate, reactivationDate, or inactiveReason.
  • Update userLifecycleActions.js to remove a dead no-op endDate mutation in deactivateImmediatelyAction that ran after buildUpdatedUserLifecycleDetails had already resolved the end date, making the mutation have no effect.

How to test:

  1. Check out this branch alongside the backend PR branch
  2. Run npm install and start the app locally
  3. Clear site data and cache
  4. Log in as an Owner or Administrator
  5. Go to User Management
  6. Find an active user — verify their active cell is green
  7. Click their active cell → select Deactivate Immediately → verify cell turns grey
  8. Click their active cell → select Reactivate User → verify cell turns green directly (no red or orange flash)
  9. Click their active cell → select Set Final Day → set a future date → verify cell turns orange
  10. Click their active cell → select Cancel Final Day → verify cell turns green directly (no red flash)
  11. Click their active cell → select Pause User → set a reactivation date → verify cell turns red
  12. Click their active cell → select Reactivate User → verify cell turns green directly (no red flash)

Note:

The root cause of the incorrect color flashes was that reactivateUser in UserManagement.jsx was calling updateUserPauseStatus which hits the /pause endpoint. That endpoint only updates isActive and reactivationDate on the DB and cache — it does not clear endDate or inactiveReason. This meant the Redux store and cache retained stale values after reactivation, causing deriveUserStatus to briefly return the wrong status. Routing through activateUserAction fixes this as it hits changeUserStatus which clears all lifecycle fields atomically.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 13, 2026

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit 67eb5be
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/6a03e7e11d05280008585fa6
😎 Deploy Preview https://deploy-preview-5264--highestgoodnetwork-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@sonarqubecloud
Copy link
Copy Markdown

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.

1 participant