-
Notifications
You must be signed in to change notification settings - Fork 367
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
upcoming: [M3-7775] - Disable ability to edit or delete a proxy user via User Profile page #10202
upcoming: [M3-7775] - Disable ability to edit or delete a proxy user via User Profile page #10202
Conversation
7f44e74
to
bef3568
Compare
|
||
const [ | ||
deleteConfirmDialogOpen, | ||
setDeleteConfirmDialogOpen, | ||
] = React.useState<boolean>(false); | ||
|
||
const isProxyUserProfile = currentUser?.user_type === 'proxy'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Should this be just isProxyUser
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used isProxyUserProfile
to try to avoid any confusion that the active user is a proxy user -- they don't have to be, just the current user whose profile is being viewed. If it feels more confusing as it currently is, I can change it, but it made more sense in my mind.
isProxyUserProfile | ||
? RESTRICTED_FIELD_TOOLTIP | ||
: profile?.username !== originalUsername | ||
? 'You can\u{2019}t change another user\u{2019}s email address.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I'm not too sure I care for escaped characters but that's a preferential choice. Double quotes would work fine here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. Our IDE may show a squiggly line or something but there is no issue with using plain quotes here and escaping makes finding strings in code harder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually not just for escaping the quote - it's a curly quote, which is a stylistic choice in Cloud Manager. We can revisit with UX whether or not we want to continue to use the curly quote in CM in a cafe, but this change is intended to stay in line with our current standard for the single quote for the new messages and fix any that weren't consistent before.
This is not a very distinction easy to see in this screenshot, but the difference is visible with can't
compared to user's
:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Implementation looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.should('be.visible'); | ||
}); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
isProxyUserProfile | ||
? RESTRICTED_FIELD_TOOLTIP | ||
: profile?.username !== originalUsername | ||
? 'You can\u{2019}t change another user\u{2019}s email address.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. Our IDE may show a squiggly line or something but there is no issue with using plain quotes here and escaping makes finding strings in code harder
@abailly-akamai - Thank you for catching this! Changed it to |
Coverage Report: ✅ |
Description 📝
In Cloud Manager, a proxy user cannot be deleted, nor can its email address or username be edited once it is provisioned.
This PR is a follow up from #10103 which restricted proxy users from updating their username or email on the Display Settings page (http://localhost:3000/profile/display). There is one additional place that a proxy user could be edited, which is by visiting the User Profile page for the proxy user via URL. (The User Profile button is not visible for a proxy user on the Users & Grants page, http://localhost:3000/account/users.)
Changes 🔄
List any change relevant to the reviewer.
change-username.spec.ts
into two different files: one for the Display Settings section (display-settings.spec.ts
) and another for the User Profile page (user-profile.spec.ts
). This was suggested a while ago and included in the AC of another ticket in the backlog, but it was cleaner to make the switch now rather than shoehorn additional test coverage into where it didn't really belong.Preview 📷
ChildAbleToEditProxyUser.mov
ChildUserTryingToEditProxyAccount.mov
ProxyAbleToEditProxyUser.mov
ProxyTryingToEditItsOwnAccount.mov
How to test 🧪
Prerequisites
(How to setup test environment)
yarn dev
.Reproduction steps
(How to reproduce the issue, if applicable)
Verification steps
(How to verify changes)
*/profile
endpoint to mock the proxy user as the current active user.*/profile
endpoint to mock a child userAs an Author I have considered 🤔
Check all that apply