Skip to content
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

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

Open
wants to merge 9 commits into
base: development
Choose a base branch
from

Conversation

vinayv-456
Copy link
Contributor

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. Login using admin/owner account->Other links -> Permission Management -> Manage User Permission -> Make some permission changes for another account and then submit to save changes.
  3. 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.

Copy link

netlify bot commented Mar 20, 2025

Deploy Preview for highestgoodnetwork-dev failed.

Name Link
🔨 Latest commit 4de2976
🔍 Latest deploy log https://app.netlify.com/sites/highestgoodnetwork-dev/deploys/67de23e7d71cfc00085e3422

Copy link

@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

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
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.

Copy link

@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

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.

3 participants