-
-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The action's visible
block is not respected in the action
show control
#1769
Comments
Let's add the self.show_controls = -> do
action ReleaseFish visible: -> {false}
end |
@adrianthedev I'm not sure about the visible block on the I think we should call the action's Example: (random logic) self.visible = -> {
if user.admin? && render_type == :show_control
true
elsif render_type == :row_control
true
else
false
end
} On the example above the action is rendered on In my opinion, employing a visible block to handle row, show, and other controls for actions, while relying on the |
Ok. I agree with you. One place to set the visibility. The use can render this action on:
So we can use the |
I think the suggested nomenclature is on point but Example: ...
if render_type == :row_control && inside_list?
... Not sure if this is easy to implement but I think this will offer the most granular configuration for the developers |
It's too complicated. You already need to remember view and renderr_type, now you also have to remember another boolean. Too many things to remember. Another suggestion I have is |
We already touched multiples possibilities: 1
2
3We can dynamically generate the methods and instead Personally I think that option 1 have much more to remember than option 2. But option 2 can be harder to implement. Anyway I would prefer to work with option 3 because we generate the methods and we can change the logic inside them, if necessary, without changing the API. I agree that it's a lot to remember in any of the 3 possibilities, it is crucial to thoroughly document the API. We can't give this level of granular configuration without some complexity. |
not sure how difficult version 3 is to implement. can you flesh out an MVP in 30 minutes? |
Check the related PR. The PR fixes the reported issue, the The MVP should be implemented on Avo3, there is where we have all the controls (row, index, edit, ...). Let me know if I should implement it right now or should we let it for later. |
Describe the bug
If an action has
self.visible = -> {false}
, the action is still displayed on the page if theshow_controls
uses itaction TheAction
The text was updated successfully, but these errors were encountered: