Skip to content

Vinay: Let a user know through a popup that Permissions have been changed for them#3294

Merged
one-community merged 12 commits into
developmentfrom
vinay/notify-user-new-permission
Apr 10, 2025
Merged

Vinay: Let a user know through a popup that Permissions have been changed for them#3294
one-community merged 12 commits into
developmentfrom
vinay/notify-user-new-permission

Conversation

@vinayv-456
Copy link
Copy Markdown
Contributor

@vinayv-456 vinayv-456 commented Mar 20, 2025

Description

If an account changes permissions for another account, then when the account which has permissions edited, logs in, there should be a popup letting them know that permissions have been edited in this account. Only should happen for the first time the user logs into account after permissions were edited.

Related PRS (if any):

This frontend PR is related to the #1278 backend PR.

Main changes explained:

  • src/components/Header/Header.jsx: added popup to show update in permission. refactor popup component. handle on close of permission change popup
  • src/components/PopUpBar/PopUpBar.jsx: updated the PopupBar component to accept the message and reused the component to notify the change in permission
  • src/components/PopUpBar/tests/PopUpBar.test.jsx: updated the test to support the above changes

How to test:

  1. check into "vinay/notify-user-new-permission" branch
  2. This frontend PR is related to the #1278 backend PR.
  3. Login using owner account->Other links -> Permission Management -> Manage User Permission -> Make some permission changes for another account and then submit to save changes.
  4. Log into the account that has permissions edited and now there should be a popup like ‘Heads Up, there were permission changes made to this account ’ only for the first time.

Screenshots or videos of changes:

video1858768607.mp4

Note:

Include the information the reviewers need to know.

@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 20, 2025

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit a88dd20
🔍 Latest deploy log https://app.netlify.com/sites/highestgoodnetwork-dev/deploys/67f7db5abb506a00088fc305
😎 Deploy Preview https://deploy-preview-3294--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 site configuration.

Copy link
Copy Markdown
Contributor

@angad363 angad363 left a comment

Choose a reason for hiding this comment

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

I reviewed the code changes and followed the testing steps as outlined in the PR description. I checked out the "vinay/notify-user-new-permission" branch and logged in using an Owner account. I navigated to "Other Links" → "Permission Management" → "Manage User Permission," made changes to the permissions for two accounts (Angad Dev and Angad Test), and saved the updates. However, after logging into both of these accounts, the yellow popup notification about permission changes did not appear as demonstrated in the video. Additionally, I encountered an error message in the console (screenshot attached). Please review and address these issues before proceeding with the approval.

PR.3294.mp4

pr # 3294 - 2

@angad363
Copy link
Copy Markdown
Contributor

Additionally, I am not being able to edit user permissions using an administrator account. Only, reset to default button works in an admin account.

@vinayv-456
Copy link
Copy Markdown
Contributor Author

Hi @angad363
Did you check in to the backend branch?
There is a backend releated PR too.
And about editing permissions, you may need owner permissions to edit permissions.

Amalesh-A
Amalesh-A previously approved these changes Mar 24, 2025
Copy link
Copy Markdown
Contributor

@Amalesh-A Amalesh-A left a comment

Choose a reason for hiding this comment

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

I am trying to review this PR and I can't change the permissions for the testing account even though I am using an admin account. Am I missing something?

Screenshot 2025-03-20 153417

But, when I click submit on the changes, I can see the header on the account that has received the "changed" permissions.

So, it turns out that it works for Owner accounts and not Admin accounts.

As an owner, I was able to change permissions and a pop-up was alerted on the affected account.

1
2
3
4

@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 Mar 27, 2025
@humemah
Copy link
Copy Markdown
Contributor

humemah commented Mar 29, 2025

I couldn't fully test this feature because permissions aren't editable using the admin account, and the owner account isn't available to me.
UI works as expected. Popup appears when logging in after permission changes.
image
However, when logging into my account, the notification correctly appears, indicating that changes were made.

image

@manushajyasta30 manushajyasta30 self-requested a review March 29, 2025 15:48
Copy link
Copy Markdown
Contributor

@manushajyasta30 manushajyasta30 left a comment

Choose a reason for hiding this comment

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

Hi Vinay,

I have cloned both of your working branches and followed the given steps. I have logged in as owner and added a permission to a user. I cleared the cache, and after logging in with the user account, I'm able to see the yellow message successfully. Good work!
image

image

Copy link
Copy Markdown
Contributor

@karnati007 karnati007 left a comment

Choose a reason for hiding this comment

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

Tested the 'notify-user-new-permission' feature by modifying permissions for another user. Upon logging into the edited account, the expected 'Heads Up' notification appeared correctly on the first login post-change. Functionality works as expected.
VinayHP

Copy link
Copy Markdown
Contributor

@vamsikrishna1704 vamsikrishna1704 left a comment

Choose a reason for hiding this comment

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

Hi @vinayv-456 ,
I have reviewed the PR by running the application locally following the instructions mentioned in the description. I have noticed the display of the pop up notification below the navigation bar to show the user's that their permissions changed when they logged in first time after changes. I would approve the PR to be merged into the main. Thank You.
PR 1278

@Dharmik1710
Copy link
Copy Markdown
Contributor

Reviewed the frontend changes for displaying the permission update notification modal. The message appears correctly when logging in after a permission change and disappears after acknowledgment.

Verified that the modal shows only once, doesn’t reappear on refresh, and is scoped to the correct user. Tested across both light and dark modes, and confirmed the modal styling and logic are working as expected.

A solid addition to improve communication of role changes in the UI.

Copy link
Copy Markdown

@sravankumarbodakonda sravankumarbodakonda left a comment

Choose a reason for hiding this comment

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

I followed the steps: logged in as an admin/owner, navigated to Other Links > Permission Management > Manage User Permission, made some changes to another account's permissions, and submitted the changes. However, after logging into the updated account, the expected popup—‘Heads up, there were permission changes made to this account’—did not appear on the first login as expected.
Screenshot 2025-04-10 at 9 39 18 AM
Screenshot 2025-04-10 at 9 39 51 AM

@vinayv-456
Copy link
Copy Markdown
Contributor Author

I followed the steps: logged in as an admin/owner, navigated to Other Links > Permission Management > Manage User Permission, made some changes to another account's permissions, and submitted the changes. However, after logging into the updated account, the expected popup—‘Heads up, there were permission changes made to this account’—did not appear on the first login as expected. Screenshot 2025-04-10 at 9 39 18 AM Screenshot 2025-04-10 at 9 39 51 AM

Hi @sravankumarbodakonda ,
Have you updated the backend as well? I have mentiooned the Backend PR.

@vinayv-456 vinayv-456 requested a review from angad363 April 10, 2025 14:59
@sravankumarbodakonda
Copy link
Copy Markdown

sravankumarbodakonda commented Apr 10, 2025 via email

@one-community
Copy link
Copy Markdown
Member

Thank you all, merging!

@one-community one-community merged commit 233eb7f into development Apr 10, 2025
6 checks passed
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.

10 participants