-
Couldn't load subscription status.
- Fork 388
feat: [UIE-9357] - IAM Delegation: Default Roles table #12990
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
feat: [UIE-9357] - IAM Delegation: Default Roles table #12990
Conversation
1bb52a9 to
f065ad2
Compare
f065ad2 to
87db233
Compare
packages/manager/src/features/IAM/Shared/AssignedRolesTable/AssignedRolesTable.tsx
Outdated
Show resolved
Hide resolved
packages/manager/src/features/IAM/Shared/AssignedRolesTable/AssignedRolesTable.tsx
Outdated
Show resolved
Hide resolved
packages/manager/src/features/IAM/Shared/AssignedRolesTable/AssignedRolesTable.tsx
Outdated
Show resolved
Hide resolved
packages/manager/src/features/IAM/Shared/AssignedRolesTable/AssignedRolesTable.tsx
Outdated
Show resolved
Hide resolved
packages/manager/src/features/IAM/Shared/AssignedRolesTable/ChangeRoleDrawer.tsx
Show resolved
Hide resolved
packages/manager/src/features/IAM/Shared/AssignedRolesTable/ChangeRoleDrawer.tsx
Outdated
Show resolved
Hide resolved
packages/manager/src/features/IAM/Users/UserRoles/AssignNewRoleDrawer.tsx
Show resolved
Hide resolved
packages/manager/src/features/IAM/Shared/AssignedRolesTable/UpdateEntitiesDrawer.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.
UI looks good! and logic is mostly good and in sync with the entities tab.
Approving pending some cleanup and code quality improvements.
packages/manager/src/features/IAM/Shared/AssignedRolesTable/AssignedRolesTable.tsx
Outdated
Show resolved
Hide resolved
| onClose={() => setIsUpdateEntitiesDrawerOpen(false)} | ||
| open={isUpdateEntitiesDrawerOpen} | ||
| role={selectedRole} | ||
| username={username} |
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.
same comment as above. This can all be cleaned up since the useIsDefaultDelegationRolesForChildAccount is used in all those modals
packages/manager/src/features/IAM/Users/UserRoles/AssignNewRoleDrawer.tsx
Outdated
Show resolved
Hide resolved
packages/manager/src/features/IAM/Shared/AssignedRolesTable/ChangeRoleDrawer.tsx
Outdated
Show resolved
Hide resolved
packages/manager/src/features/IAM/Shared/AssignedRolesTable/UnassignRoleConfirmationDialog.tsx
Outdated
Show resolved
Hide resolved
packages/manager/src/features/IAM/Users/UserRoles/AssignNewRoleDrawer.tsx
Show resolved
Hide resolved
packages/queries/src/iam/iam.ts
Outdated
| iamQueries.user(username)._ctx.roles.queryKey, | ||
| role, | ||
| ); | ||
| if (username && enabled) { |
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.
@abailly-akamai , could you please check if that's what you mean? I haven't found anything similar to this in CM (might've missed something)
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 works but I would simplify: (sorry the enabled suggestion was not appropriate/needed)
conditional queries/mutations are tricky to handle. usually we tend to render different components but I think this should suffice.
Maybe i am overthinking this and username ?? '' is fine but either way the challenge is to surface a proper error if that happens. Usually i try to prevent sending a mutation if we already know the payload isn't right. sending '' is just getting around the types which isn't ideal
export const useUserRolesMutation = (username: string | undefined) => {
const queryClient = useQueryClient();
return useMutation<IamUserRoles, APIError[], IamUserRoles>({
mutationFn: (data) => {
if (!username) {
throw new Error('Username is required');
}
return updateUserRoles(username, data);
},
onSuccess: (role) => {
if (username) {
queryClient.setQueryData<IamUserRoles>(
iamQueries.user(username)._ctx.roles.queryKey,
role,
);
}
},
});
};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.
Updated, thanks!
34e926d to
d599b68
Compare
Cloud Manager UI test results🔺 3 failing tests on test run #12 ↗︎
Details
TroubleshootingUse this command to re-run the failing tests: pnpm cy:run -s "cypress/e2e/core/linodes/clone-linode.spec.ts,cypress/e2e/core/firewalls/create-firewall.spec.ts,cypress/e2e/core/cloudpulse/timerange-verification.spec.ts" |
|||||||||||||||||||||||
Description 📝
This PR adds the Default Roles table for Default Access.
Changes 🔄
List any change(s) relevant to the reviewer.
Scope 🚢
Upon production release, changes in this PR will be visible to:
Target release date 🗓️
11/04
Preview 📷
How to test 🧪
Prerequisites
(How to setup test environment)
Verification steps
(How to verify changes)
Author Checklists
As an Author, to speed up the review process, I considered 🤔
👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support
As an Author, before moving this PR from Draft to Open, I confirmed ✅