-
Notifications
You must be signed in to change notification settings - Fork 57
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
feat(coral): Allow users to delete clusters #2354
Conversation
Signed-off-by: Mathieu Anderson <mathieu.anderson@aiven.io>
Signed-off-by: Mathieu Anderson <mathieu.anderson@aiven.io>
Signed-off-by: Mathieu Anderson <mathieu.anderson@aiven.io>
Signed-off-by: Mathieu Anderson <mathieu.anderson@aiven.io>
coral/src/app/features/configuration/clusters/components/ClustersTable.tsx
Show resolved
Hide resolved
@mathieu-anderson and @programmiri For the copy, let's change Delete to Remove. "Remove" is better here as we are clearing or removing the cluster association in Klaw. For ref: https://aquarium.aiven.io/43ae72f19/p/925433-word-list/t/678211 Also, I suggest updating the label next to the delete icon to "Remove" instead of "Delete." We have something similar in the Aiven Console, for example. Scenario 1: When users cannot remove cluster as it is associated with an env Remove cluster Scenario 2: When users can remove clusters Remove cluster Buttons: Cancel, Remove |
Signed-off-by: Mathieu Anderson <mathieu.anderson@aiven.io>
@harshini-rangaswamy implemented the changes here: 35d9e5e |
Looks good, thanks! |
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.
Left a few small comments.
One bigger question -> I think for superadmin
, the "connect" action should also be in the Dropdown? 🤔 It does not make sense to have one directly accessible button and one other button hidden behind a menu. Also, the contrast for which dropdown menu is active is already very bad accessibility wise, but if there's only one, that is in focus from the beginning, but it's not a focus style, so it's not really to see, which makes keyboard navigation hard.
![Screenshot 2024-03-18 at 09 50 05](https://private-user-images.githubusercontent.com/943800/313535256-1b4896b5-c12f-490e-ab9c-866c0c4d658d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA1NTI3NjYsIm5iZiI6MTcyMDU1MjQ2NiwicGF0aCI6Ii85NDM4MDAvMzEzNTM1MjU2LTFiNDg5NmI1LWMxMmYtNDkwZS1hYjljLTg2NmMwYzRkNjU4ZC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzA5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwOVQxOTE0MjZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1lZWE1YzRiNjllNjcwNWUyOWFhMjk5ZWJhYzU3MTZkMDJiNTA4ZmJlMGRiODUyMzIzNDY3MDYyMGQyZmIxZjk0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.8SLSnnh9zn8x8XkvbDQF-DfYImdAPBg02roT_tzv7WY)
coral/src/app/features/configuration/clusters/components/ClustersTable.tsx
Show resolved
Hide resolved
@@ -87,15 +103,15 @@ const ClustersTable = (props: ClustersTableProps) => { | |||
}, | |||
]; | |||
|
|||
if (handleShowModal !== undefined) { | |||
if (isAdminUser) { |
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 would add a test case for that, too, so we make sure the "Remove" functionality is only available for admins.
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 think this is covered by this test? https://github.com/Aiven-Open/klaw/pull/2354/files#diff-e6826bf48eff7da7a98e47263d677fdeaefe63c1e1bb14a9828e59edd911541bR440-R467
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.
Sorry for not being more precise -> I meant explicitly confirming that there is no delete action available for the user without the permission (e.g. in the block shows all clusters as a table (user without permissions.addDeleteEditClusters)
). It's can get a bit trick to decide how much of "testing that something is NOT there" makes sense 😅 but in a case of this kind of functionality I would do it.
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.
Aaah of course!
Added here ^^ 62dd1c7
@programmiri regarding putting the connect button in the dropdown, I considered it, but I decided against because:
Regarding accessibility, yeah, this is for sure an issue :/ But I think it should probably be acted on at the DS level? At any rate, I think we can modify this later, as it's not central to the functionality. Well, except for the accessibility issues, which are a little tricky to address... |
Yes, your thinking with the button makes sense 🤔 I still would verify with Kate (but for a later PR), as I remember a discussion about this (with Mustafa maybe?) and the "rule" was: if there more than one action, it should be a menu. But that may not be applicable for this case.
It's a colour and focus visibility issue, that's nothing that is planned in the near future to be looked into. We could maybe check if we can apply a simple css fix for this, but that's out of scope for this PR as you said! |
Kate has seen the UI, as I asked here if a modal worked in the context of deleting the cluster, so I think she doesn't have any opposition to what is currently implemented. But I can ask another confirmation ^^ |
No if she has seen it that's perfect! :D |
…olumns Signed-off-by: Mathieu Anderson <mathieu.anderson@aiven.io>
…o 2282-delete-clusters
Linked issue
Resolves: #2282
What kind of change does this PR introduce?
What is the current behavior?
There is not way to delete clusters from Klaw currently
What is the new behavior?
addDeleteEditClusters
Screen.Recording.2024-03-15.at.11.49.24.mov
Other information
React.ReactElement
aschildren
toDialog
The copy is still being worked on by @harshini-rangaswamyRequirements (all must be checked before review)
main
branch have been pulledpnpm lint
has been run successfully