Skip to content

Conversation

@aaleksee-akamai
Copy link
Contributor

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.

  • removes restriction to update user delegation with empty array
  • update test
  • add form value reinitialization

Scope 🚢

Upon production release, changes in this PR will be visible to:

  • All customers
  • Some customers (e.g. in Beta or Limited Availability)
  • No customers / Not applicable

Preview 📷

Before After
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)

  • use parent account + IAM Delegation flag is enabled

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)

  • should allow sending an empty array
  • should update delegations after reopening the same drawer
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


  • I have read and considered all applicable items listed above.

As an Author, before moving this PR from Draft to Open, I confirmed ✅

  • All tests and CI checks are passing
  • TypeScript compilation succeeded without errors
  • Code passes all linting rules

@aaleksee-akamai aaleksee-akamai self-assigned this Jan 21, 2026
@aaleksee-akamai aaleksee-akamai added the IAM Delegation Implementing the new Parent/Child delegation UI label Jan 21, 2026
…legation with empty array, update the delegations after reopening a drawer
watch,
} = form;

watch('users');
Copy link
Contributor Author

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
Copy link
Contributor Author

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

@linode-gh-bot
Copy link
Collaborator

Cloud Manager UI test results

🔺 1 failing test on test run #2 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
1 Failing864 Passing11 Skipped34m 51s

Details

Failing Tests
SpecTest
clone-linode.spec.tsCloud Manager Cypress Tests→clone linode » can clone a Linode from Linode details page

Troubleshooting

Use 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]);
Copy link
Contributor

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}`}>

Copy link
Contributor

@mpolotsk-akamai mpolotsk-akamai left a 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 = ({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks much cleaner now 👍

@github-project-automation github-project-automation bot moved this from Review to Approved in Cloud Manager Jan 22, 2026
@abailly-akamai abailly-akamai merged commit 7ffb24a into linode:develop Jan 22, 2026
34 of 35 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Merged in Cloud Manager Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

IAM Delegation Implementing the new Parent/Child delegation UI IAM (Identity & Access Management)

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

4 participants