podman-desktop
podman-desktop copied to clipboard
Disable actions when deleting
What does this PR do?
To avoid user to perform any action on an object that is being deleted, this PR disables some actions buttons when user click on delete.
Screenshot / video of UI
https://github.com/containers/podman-desktop/assets/16507629/327419fb-e1c4-4e52-9526-fd586a5e61d2
What issues does this PR fix or reference?
Fixes #5739
How to test this PR?
Option 1) Unit Tests Option 2) Play around with creating and deleting. Expect buttons to be disabled.
When I delete images and open the contextual menu on the image actions, I can see that some entries are still enabled (most probably entries added by extensions). Do you think it could be posisble to disable them, or disable the three dots instead?
When I delete images and open the contextual menu on the image actions, I can see that some entries are still enabled (most probably entries added by extensions). Do you think it could be posisble to disable them, or disable the three dots instead?
Hi @feloy. I have noticed it too! Tomorrow I will try to check how to disable the entries added by extensions.
I'm a little uneasy about this - for our own actions we're changing their enablement based on state, but for extensions we're just saying 'no you can't do that here'. I suppose it is ok for deletion b/c the object is going away anyway, but I worry it's removing the onus on extension developers to correctly enable their actions based on state (status in this case).
I'm a little uneasy about this - for our own actions we're changing their enablement based on state, but for extensions we're just saying 'no you can't do that here'. I suppose it is ok for deletion b/c the object is going away anyway, but I worry it's removing the onus on extension developers to correctly enable their actions based on state (status in this case).
I agree with @deboer-tim .
What I have in mind for trying tomorrow is to have all other actions disabled for the deletion only.
Hi @deboer-tim. Thanks for the hints. I wonder if I'm missing something.
Hi @deboer-tim. Thanks for the hints. I wonder if I'm missing something.
@deboer-tim, @feloy: I'm leaving the 'disable menu' functionality for further discussions and, to another Issue/PR. What are your comments about?
The PR is open for another review :D.
I hope we are able to merge it soon.
@feloy @deboer-tim looks like you didn't reply to @trmendes comments
switching to draft
not updated, closing