headlamp-k8s / headlamp

A Kubernetes web UI that is fully-featured, user-friendly and extensible
https://headlamp.dev
Apache License 2.0
2.22k stars 156 forks source link

[RFE] Add cancel callback to clusterAction #718

Closed callmevladik closed 1 year ago

callmevladik commented 2 years ago

Current situation

I use clusterAction from headlamp's redux actions and I would like to add some callback function just in case of user cancelling cluster action. For example: I have a form for creating k8s resources and I have react state with loading state, I mean when clusterAction's callback starts executing I set loading state to true and if some errors occur I set it to false, but if user cancels cluster action I cannot know when it happened, so it would be nice to pass some callback for this case.

Impact

As a dev I'm not able to know when cancelling happens

Ideal future situation

I can pass some callback for cancelling case to clusterAction

Implementation options

To let devs to pass callback for cancelling case to clusterAction

Additional information

[ Please Add any information that does not fit into any of the above sections here ]

joaquimrocha commented 2 years ago

This makes sense and maybe we should also make the navigation management in ClusterActions to be done through default cancel + error callbacks rather than URL configurations.

We will schedule this work very soon.

joaquimrocha commented 1 year ago

This has been added today in #1197 .