avo
avo copied to clipboard
Non-standalone actions should not be able to run with no records if on `index_controls`
Feature
Non-standalone actions should not be able to run with no records if on index_controls
From Discord:
When actions are listed on the dropdown, they are disabled/greyed if the action isn't standalone AND if we have not selected records from the checkboxes. Awesome, all good, prevent us from running the action with no records selected.
Is it possible to replicate this feature somehow when we copy the actions directly into the
index_controls? It is a bad UX to the action needed to load and run, to then, display them aNo records selectederror. Without mentioning they will need to write/select/whatever from the action-fields again.
Current workarounds
N/a
Screenshots or screen recordings
N/a
Additional context
N/a
This issue has been marked as stale because there was no activity for the past 15 days.
The bug consists in not having the action disabled if it's not standalone and is added to the index_controls
self.index_controls do
action SOME_ACTION # this will be enabled even when no records are selected and it should be disabled
end
def actions
action SOME_ACTION # this would be disabled in the begining in the actions_list dropdown because it's not standalone and no records would be selected
end
Hi there. Do we have any new content on this bug?
I wanted to understand how actions in the action_list know there are records selected so we could use the same logic for actions that are not standalone and are added to the index_controls. And here's what I found so far:
I know this function called is_disabled? in actions_component.rb controls whether the button in the action list is disabled or not. But past that point, I can't find the logic that looks if there's any selected record.
We were hoping to maybe get some help on this. If that doesn't happen, I guess we'll have some time to work on it next cycle.
@adrianthedev upvote :)!
@adrianthedev and @Paul-Bob : not having this results in a annoying user experience where you give users the impression they can do something while we need to have some some records in scope
Moreover we only know in the handle part that nothing was selected, so the first fields form will be filled in for nothing...