avo-hq/avo

Add a `hidden_when`/`disabled_when` option to the index/show/edit controls

Open

#2,153 opened on Dec 18, 2023

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Ruby (308 forks)user submission
Help wantedJavascriptTask

Repository metrics

Stars
 (1,778 stars)
PR merge metrics
 (Avg merge 1d 6h) (67 merged PRs in 30d)

Description

Example api

self.show_controls = -> {
  action SomeAction, hidden_when: :any_record_selected
  action SomeAction, hidden_when: :no_record_selected
  action SomeAction, disabled_when: :any_record_selected
  action SomeAction, disabled_when: :no_record_selected
}

This would act as a hidden/disabled state when a specific condition applies.

Contributor guide