upcoming: [UIE-9742] - Implement disabling of required functionalities when a linode is locked.#13377
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.
| "You don't have permission to delete this linode."; | |
| "You don't have permission to delete this Linode."; |
| <Tooltip | ||
| placement="bottom-start" | ||
| title={LINODE_LOCKED_DELETE_TOOLTIP} | ||
| > | ||
| <span>{deleteButton}</span> | ||
| </Tooltip> |
There was a problem hiding this comment.
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
| const isLinodeSubResourcesLocked = | ||
| !!linode?.locks?.length && | ||
| linode.locks.includes('cannot_delete_with_subresources'); |
There was a problem hiding this comment.
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; |
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.
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.
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.
| {isLocked && ( | ||
| <Notice | ||
| spacingBottom={16} | ||
| text={LINODE_LOCKED_DELETE_CONFIG_TOOLTIP} |
There was a problem hiding this comment.
This message is for linode config profiles right? We need to have a separate message here
grevanak-akamai
left a comment
There was a problem hiding this comment.
Changes looks good. Thanks @tanushree-akamai
Cloud Manager UI test results🔺 1 failing test on test run #8 ↗︎
Details
TroubleshootingUse this command to re-run the failing tests: pnpm cy:run -s "cypress/e2e/core/oneClickApps/one-click-apps.spec.ts" |
|||||||||||||||||

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 ✅