-
Notifications
You must be signed in to change notification settings - Fork 1
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
MPDX-7772 Preferences - Admin #866
Conversation
I should prob add the functionality to kick the user back to preferences and show an error if they try to navigate to a Settings page which they're not authorized too. |
I think I'll do this in a separate PR, as I'm thinking about adding the user permissions onto the next-auth session |
This pull request is automatically being deployed by Amplify Hosting (learn more). |
- Impersonate user - Reset an account - Phone TS error fix - Adding tests
d197753
to
b37c153
Compare
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 also need to go over the tests and test the functionality, but here are my comments so far.
src/components/Settings/Admin/ImpersonateUser/ImpersonateUserAccordion.tsx
Outdated
Show resolved
Hide resolved
src/components/Settings/Admin/ResetAccount/ResetAccountAccordion.tsx
Outdated
Show resolved
Hide resolved
src/components/Settings/Admin/ResetAccount/ResetAccountAccordion.tsx
Outdated
Show resolved
Hide resolved
src/components/Settings/Admin/ResetAccount/ResetAccountAccordion.tsx
Outdated
Show resolved
Hide resolved
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 didn't try resetting an account because that's such a destructive operation. But I was able to successfully impersonate you. Great work! 🚀
I noticed that when you're impersonating someone and stop impersonating from the profile menu, it says "Stopping Impersonating and redirecting you to the legacy MPDX". Should we change that now to keep them on MPDX React after they stop impersonating?
src/components/Settings/Admin/ImpersonateUser/ImpersonateUserAccordion.test.tsx
Outdated
Show resolved
Hide resolved
src/components/Settings/Admin/ResetAccount/ResetAccountAccordion.test.tsx
Outdated
Show resolved
Hide resolved
src/components/Settings/Admin/ResetAccount/ResetAccountAccordion.test.tsx
Outdated
Show resolved
Hide resolved
src/components/Settings/Admin/ResetAccount/ResetAccountAccordion.tsx
Outdated
Show resolved
Hide resolved
src/components/Settings/Admin/ImpersonateUser/ImpersonateUserAccordion.tsx
Outdated
Show resolved
Hide resolved
…rAccordion use useUser.
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 think the only required change is switching the "The Key / Relay" labels to refer to Okta, so I'm going to go ahead and approve pending that. Thanks for all the extra tests you added!
import Admin, { suggestedArticles } from './admin.page'; | ||
|
||
jest.mock('next-auth/react'); | ||
jest.mock('next/router', () => ({ |
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.
Instead of mocking useRouter
, most of our tests provide a router object to <TestRouter>
.
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.
Since I'm mocking the returned value on lines 59 & 80, I believe I need to keep mocking the next/router
module.
Description
Building the admin functionality onto the new MPDx. We removed the "Add Offline Organization" as this is now done elsewhere.
I've had to add some functionality we have on other Preferences PRs which haven't been merged yet.
Changes
Checklist: