fix(tables): support invoking hidden actions #112
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR creates a failing test for an issue I've discovered. I'm happy to submit a PR for the fix if you could point me in the direction you'd like me to take.
Issue
If you have a conditionally hidden action and the condition depends on part of the request (ie: in my case I need to hide the action by default and then show the action when a specific refinement is applied), then you will receive a 500 when trying to invoke that action.
For example:
TrashedFilter
to show active vs trashed recordsTrashedFilter
is being appliedHasActions
cannot find the specified action since it is hidden by default:Fixing the issue
My initial thought would be to create a
getAllActions()
method inHasActions
and call that withingetInlineActions
andgetBulkActions
. One issue with that approach is it would essentially remove any sort of authorization enforcement on actions. You may want to consider a new method on actions for authorization (may be a good idea anyways).