-
Notifications
You must be signed in to change notification settings - Fork 396
upcoming: [UIE-9742] - Implement disabling of required functionalities when a linode is locked. #13377
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
base: develop
Are you sure you want to change the base?
Conversation
…s when a linode is locked.
2385136 to
2cdb4f0
Compare
…hen a Linode has active locks
…and Remove Lock modal titles.
|
|
||
| // Lock-related constants | ||
| export const LINODE_LOCKED_DELETE_TOOLTIP = | ||
| "You don't have permission to delete this linode."; |
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.
| "You don't have permission to delete this linode."; | |
| "You don't have permission to delete this Linode."; |
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.
Addressed in commit 9e4d51b
| <Tooltip | ||
| placement="bottom-start" | ||
| title={LINODE_LOCKED_DELETE_TOOLTIP} | ||
| > | ||
| <span>{deleteButton}</span> | ||
| </Tooltip> |
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 is okay but our Button component has a tooltipText prop on it. Would it make sense to leverage that feature here?
https://design.linode.com/?path=/story/foundations-button--disabled-tooltip
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.
Addressed in commit 9e4d51b
| const isLinodeSubResourcesLocked = | ||
| !!linode?.locks?.length && | ||
| linode.locks.includes('cannot_delete_with_subresources'); |
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.
Is the !!linode?.locks?.length part necessary?
We may be able to simplify it a bit:
| const isLinodeSubResourcesLocked = | |
| !!linode?.locks?.length && | |
| linode.locks.includes('cannot_delete_with_subresources'); | |
| const isLinodeSubResourcesLocked = linode?.locks?.includes('cannot_delete_with_subresources') ?? false; |
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.
Addressed in commit 9e4d51b
bnussman-akamai
|
|
||
| // Lock-related constants | ||
| export const LINODE_LOCKED_DELETE_TOOLTIP = | ||
| "You don't have permission to delete this Linode."; |
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 message conveys IAM permission issue rather than just for resource lock. To me, message added for rebuild looks correct and shouldn't it be conveyed in rest of the messages too?
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 had conveyed the same to Karthik. Since this isn’t a high priority right now and the feature won’t be toggled on, he’ll revisit it later. For now we will go with what we have in figma.
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.
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.
Good catch! Addressed in a320ced
| {isLocked && ( | ||
| <Notice | ||
| spacingBottom={16} | ||
| text={LINODE_LOCKED_DELETE_CONFIG_TOOLTIP} |
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 message is for linode config profiles right? We need to have a separate message here
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.
Addressed in a320ced
Cloud Manager UI test results🔺 1 failing test on test run #7 ↗︎
Details
TroubleshootingUse this command to re-run the failing tests: pnpm cy:run -s "cypress/e2e/core/account/quotas-storage.spec.ts" |
|||||||||||||||||
grevanak-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.
Changes looks good. Thanks @tanushree-akamai

Description 📝
This PR implements disabling of delete and rebuild actions when a Linode has active locks, with appropriate tooltips and warning messages. When a cannot_delete_with_subresources lock is present, delete operations for Linode subresources (Disks, Configurations, and IP Addresses) are also disabled with appropriate tooltip.
Changes 🔄
Scope 🚢
Upon production release, changes in this PR will be visible to:
Preview 📷
Delete option greyed out with tooltip in action menu in Linodes list

Rebuild option greyed out with tooltip in action menu in Linodes list

Delete option greyed out in action menu in Linode detail screen

Rebuild option greyed out in action menu Linode detail screen

Delete option greyed out on Linode settings page

Rebuild modal through a bookmarked url

Delete IP Address option greyed out with tooltip in Linode Network tab.

Delete Disk option greyed out with tooltip in Linode Storage tab.

Delete Config option greyed out with tooltip in Linode Configurations tab.

How to test 🧪
Reproduction steps
[ "create_lock", "delete_lock" ]
Verification steps
Since IAM permissions for Resource Locks are not fully implemented yet, you can temporarily bypass the permission checks to validate the Lock/Unlock behavior with real API data.
Comment the permission checks on line 247 in LinodeActionMenu.tsx:
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 ✅