avo icon indicating copy to clipboard operation
avo copied to clipboard

Non-standalone actions should not be able to run with no records if on `index_controls`

Open JeremasPosta opened this issue 1 year ago • 6 comments

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 a No records selected error. 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

JeremasPosta avatar May 01 '24 21:05 JeremasPosta

This issue has been marked as stale because there was no activity for the past 15 days.

github-actions[bot] avatar May 17 '24 01:05 github-actions[bot]

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

adrianthedev avatar May 28 '24 09:05 adrianthedev

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.

icaroryan avatar Jul 15 '24 23:07 icaroryan

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 avatar Jul 22 '24 09:07 adrianthedev

@adrianthedev upvote :)!

pjmuller avatar Oct 10 '24 09:10 pjmuller

@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...

pjmuller avatar Oct 10 '24 12:10 pjmuller