avo
avo copied to clipboard
Add the default_controls helper for customizable controls.
Feature
Add a helper that set the default controls on customizable controls. For example if I want to keep all the index controls and add a random link I should be able to do something like this.
self.index_controls = -> {
default_controls
# or with exclude which would exclude one of the default buttons
default_controls(exclude: :delete_button)
# or with only which would only keep those buttons
default_controls(only: [:delete_button, :edit_button])
link_to "Fish.com", "https://fish.com", icon: "heroicons/outline/academic-cap", target: :_blank
}
The exclude
and only
options are optional and nice to have's.
They would help the user to better order the default controls.
Current workarounds
Check how to declare the default controls and declare them 1 by 1
Screenshots or screen recordings
Additional context
### Tasks
- [ ] Implement `default_controls` helper
- [ ] Improve documentation with snippets of defaults for all customizable controls
- [ ] Improve documentation and be more explicit that custom controlls overrides the defaults
- [ ] Default controls should respect authorization rules (ex: Pundit
The one thing I'm afraid of is that you can only add links to the start or end of the default controls, but sure. let's do it!
This issue has been marked as stale because there was no activity for the past 15 days.
The one thing I'm afraid of is that you can only add links to the start or end of the default controls, but sure. let's do it!
I think yes, maybe insert in the array with some custom logic, but the goal of this feature is exactly that: to have all default controls and append or prepend to it custom controls.
This issue has been marked as stale because there was no activity for the past 15 days.
Closing this because there was no activity for the past 15 days. Feel free to reopen if new information pops up ✌️
Closing this because there was no activity for the past 15 days. Feel free to reopen if new information pops up ✌️
This issue has been marked as stale because there was no activity for the past 15 days.