-
Notifications
You must be signed in to change notification settings - Fork 392
feat: [UIE-10051] - IAM Delegation: allow sending an empty array #13300
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
Conversation
…legation with empty array, update the delegations after reopening a drawer
| watch, | ||
| } = form; | ||
|
|
||
| watch('users'); |
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.
wasn't used
| } = form; | ||
|
|
||
| watch('users'); | ||
| // Reinitialize form values when the drawer opens or delegated users change |
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.
add the similar logic as for UpdateEntitiesDrawer
Cloud Manager UI test results🔺 1 failing test on test run #2 ↗︎
Details
TroubleshootingUse this command to re-run the failing tests: pnpm cy:run -s "cypress/e2e/core/linodes/clone-linode.spec.ts" |
|||||||||||||||||
| React.useEffect(() => { | ||
| if (!open) return; | ||
| reset({ users: formattedCurrentUsers }, { keepDirtyValues: true }); | ||
| }, [open, formattedCurrentUsers, reset]); |
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 don't like adding a useEffect to update a form state. It is an anti-pattern. I am surprised you need this as reset() is called in handleClose()?
useForm should have all the method available or I think you could add a key to the FormProvider for instance:
<FormProvider {...form} key={`${delegation?.euuid}-${open}`}>
mpolotsk-akamai
left a comment
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.
Works as expected. Able to unassign all delegations.
| onClose: () => void; | ||
| userOptions: UserOption[]; | ||
| } | ||
| export const UpdateDelegationForm = ({ |
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.
Looks much cleaner now 👍
Description 📝
This PR removes restriction to update user delegation with empty array and fixes an issue where the delegations weren’t updated after reopening a drawer
Changes 🔄
List any change(s) relevant to the reviewer.
Scope 🚢
Upon production release, changes in this PR will be visible to:
Preview 📷
Screen.Recording.2026-01-21.at.12.57.39.PM.mov
Screen.Recording.2026-01-21.at.12.55.20.PM.mov
How to test 🧪
Prerequisites
(How to setup test environment)
Reproduction steps
(How to reproduce the issue, if applicable)
go to /iam/delegations
update delegations by removing all users
go to /iam/delegations
update delegations for an account
open a drawer for the same account
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 ✅