-
Notifications
You must be signed in to change notification settings - Fork 897
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
Expose Custom Button visability/enablement #15911
Expose Custom Button visability/enablement #15911
Conversation
0b7d159
to
98216b9
Compare
98216b9
to
906d915
Compare
Checked commits imtayadeway/manageiq@e40f7d4~...906d915 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
ALL HAIL 💃 🕺 |
yes you are right 👍 |
@lpichler it was my understanding that https://github.com/ManageIQ/manageiq/blob/master/app/models/custom_button_set.rb#L29-L62 was made in support of this PR, but as you can see it's not being utilized here, and AFAICT anywhere else yet. Did I miss something? |
yes, probably you can use it (if it would be helpful) but now, it used only in controller repo |
@lpichler thanks! 🙇 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good 👍
Resolves https://www.pivotaltracker.com/story/show/149699953
Does a couple of things:
custom_actions
orcustom_action_buttons
, will only return things whosevisibility_expression
evaluates totrue
for the object at handcustom_actions
, serializes the result of theenablement_expression
evaluated in the context of the object at hand, along with the rest of the button's attributesFrom what I understand, buttons have an attribute
disabled_text
which I am assuming is there to explain the reason for its being disabled - if correct then this is already serialized and returned in the response, so nothing further needs to be done here./cc @AllenBW
@miq-bot add-label enhancement
@miq-bot assign @gtanzillo