Skip to content

feat: [UIE-8646] Update "Assign roles" drawer - #12038

Merged
cpathipa merged 12 commits into
linode:developfrom
rodonnel-akamai:UIE-8646-update-assign-roles-drawer
Apr 16, 2025
Merged

cpathipa merged 12 commits into
linode:developfrom
rodonnel-akamai:UIE-8646-update-assign-roles-drawer

Conversation

@rodonnel-akamai

Copy link
Copy Markdown
Contributor

Description 📝

Highlight the Pull Request's context and intentions.

Changes 🔄

List any change(s) relevant to the reviewer.

  • The hide/show details has been added and implemented
  • The close icon has been changed to a trash can (a new Delete icon)
  • Added a notice with a "create" link for entities that don't exist in the account

Target release date 🗓️

4/22/2025

Preview 📷

Before After
Screenshot 2025-04-15 at 4 39 15 PM Screenshot 2025-04-15 at 4 38 17 PM

How to test 🧪

Prerequisites

(How to setup test environment)

  • Ensure the Identity and Access Beta flag is enabled in dev tools
  • Use devenv and login as vagrant user
  • Click on the "Identity and Access [BETA]" link on the left
  • Click on a specific user in the Users tab
  • Click on the "Assigned Roles" tab within the user details
  • Click on the "Assign New Role" button - the drawer should open

Verification steps

(How to verify changes)

  • Confirm that the "Hide details"/"Show details" toggle switches the visibility of the description boxes beneath each role
  • Confirm that the icon to remove a row has changed from the Close icon ("x") to a Delete icon (trash can)
  • Confirm that a notice with a link to create an entity appears when there are no entities of the given type
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 unit tests are passing
  • TypeScript compilation succeeded without errors
  • Code passes all linting rules

@rodonnel-akamai
rodonnel-akamai requested a review from a team as a code owner April 15, 2025 20:52
@rodonnel-akamai
rodonnel-akamai requested review from bnussman-akamai and hkhalil-akamai and removed request for a team April 15, 2025 20:52
@cpathipa
cpathipa requested review from cpathipa and removed request for hkhalil-akamai April 16, 2025 13:31
export const getCreateLinkForEntityType = (
entityType: EntityType | EntityTypePermissions
): string => {
// TODO - find the exceptions to this rule - most use the route of /{entityType}s/create (note the "s")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ticket to track?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I can add one. I don't know if QA will be testing all the various entity types well or not.

direction="row"
spacing={2}
>
<Typography variant={'h3'}>Roles</Typography>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Brackets not necessary variant='h3'

@linode-gh-bot

Copy link
Copy Markdown

Cloud Manager UI test results

🔺 2 failing tests on test run #4 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
2 Failing538 Passing4 Skipped122m 40s

Details

Failing Tests
SpecTest
clone-linode.spec.tsCloud Manager Cypress Tests→clone linode » clone linode
bucket-details-multicluster.spec.tsCloud Manager Cypress Tests→Object Storage Multicluster Bucket Details Tabs→Properties tab without required capabilities » Object Storage Multicluster Bucket Details Tabs→Properties tab without required capabilities

Troubleshooting

Use this command to re-run the failing tests:

pnpm cy:run -s "cypress/e2e/core/linodes/clone-linode.spec.ts,cypress/e2e/core/objectStorageMulticluster/bucket-details-multicluster.spec.ts"

@github-project-automation github-project-automation Bot moved this from Review to Approved in Cloud Manager Apr 16, 2025
Comment thread packages/manager/.changeset/pr-12038-changed-1744750503892.md Outdated
<Notice spacingTop={8} variant="warning">
<Typography fontSize="inherit">
<Link to={getCreateLinkForEntityType(type)}>
Create a {capitalizeAllWords(type)} Entity

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We need an override for "VPC", "NodeBalancer" and "StackScript"

@@ -86,7 +87,7 @@ export const AssignSingleRole = ({
}}
>
<Button disabled={index === 0} onClick={() => onRemove(index)}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Instead of disabling deleting the first role, could we disable the button if it was the only rule? An example use case: if I assigned multiple roles to a user and I wanted to delete the first role in the list.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(1/2) Can we add a unit test for this component (or create a ticket to do this):

  • Tests that the drawer opens and renders
  • Tests that the drawer closes
  • Tests that the drawer displays multiple roles

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(2/2) Can we add a unit test for this component (or create a ticket to do this):

  • Tests adding a role
  • Tests the entity select
  • Tests the "Create an X entity first" message appears
  • Tests deleting a role

@hkhalil-akamai hkhalil-akamai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overall functionality looks good. Above comments are nits; feel free to consider them in follow-up tickets.

@cpathipa

Copy link
Copy Markdown
Contributor

Approved and merging this PR addressing the feedback for test coverage in the followup tickets
Actions items:

AssignSingleRole

  • Tests adding a role
  • Tests the entity select
  • Tests the "Create an X entity first" message appears
  • Tests deleting a role

AssignNewRoleDrawer

  • Tests that the drawer opens and renders
  • Tests that the drawer closes
  • Tests that the drawer displays multiple roles

CC: @rodonnel-akamai

Will merge this once CI passes.

@cpathipa

Copy link
Copy Markdown
Contributor

@rodonnel-akamai There is unit test failing on this PR can you look into this.
image

@cpathipa
cpathipa merged commit eaa2392 into linode:develop Apr 16, 2025
@github-project-automation github-project-automation Bot moved this from Approved to Merged in Cloud Manager Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants