Hiding actions based on model instance + recent action changes #6583
Replies: 2 comments 5 replies
-
Hi @crynobone, I understand this might be more suited for a discussion but I was hoping to at least get a response from the team, even if is just a simple "no, we'll not do anything about this", or is that what moving an issue to a discussion means? |
Beta Was this translation helpful? Give feedback.
-
Hi @crynobone, We're having the same issue as @ganyicz here. Users asking for a new behavior is totally understandable, but it feels like a breaking change. Wouldn't it have been softer to introduce a new Hiding an action on a resource-basis (and not only autorisations) seems like a must-have from our point of view. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
First off I want to express how amazing our experience with Nova was, we've been using it for almost three years now without any issues, actively upgrading to latest versions and enjoying all the great features that have been added. Its simplicity and ease of use helped us expand and build new features very rapidly without stressing over the admin interface too much.
However we've been stuck with version 4.31.0 due to some "breaking changes" in how actions work. This has been fine although after upgrading to Laravel 11 we've been forced to update Nova as well. The biggest issue we're facing is the inability to hide actions based on a model instance:
We have 20+ actions on our main resource, with most of them available for single model only, usually ran from the inline or detail dropdown. These actions are mostly dependent on the model state and at any point only around 5-10 actions are runnable, with some of them being dependent on other properties like "type" which doesn't change over time, meaning these actions will never run on some models at all.
With the recent change to the canRun callback, which doesn't hide the actions anymore, we're stuck with a big dropdown of disabled and irrelevant actions scattered between the active ones. This makes the interface a lot more difficult to navigate and we are unable to use the canSee callback since it doesn't receive the model instance and the use of $this->resource is unreliable.
Is there any other way to hide actions based on model instance or perhaps provide the original behavior under a config? This would allow us to use Nova without overriding Vue files, which we'll have to do for the time being, but this would make updates much more difficult.
Thanks for considering
I also want to point to some other changes that have surprised us:
Beta Was this translation helpful? Give feedback.
All reactions