-
Notifications
You must be signed in to change notification settings - Fork 356
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
GOD's button group can have buttons assign/unassign during create/edit #4913
Conversation
80feae4
to
d141114
Compare
1bf1ed5
to
7d58993
Compare
@miq-bot add_label generic objects, automation/automate, hammer/yes, gaprindashvili/yes |
764408f
to
4b8a26a
Compare
TODO: - fix includes or use includes from lodash |
@miq-bot add_label pending core Depends on ManageIQ/manageiq#18368 |
Probably shouldn't, given |
@himdel I'll remove related commit to that dependency and remove the label. Thanks 👍 |
c91045c
to
fb34c15
Compare
@miq-bot remove_label wip, pending core |
@@ -148,6 +149,28 @@ def add_button_in_group | |||
custom_button_set.save! | |||
end | |||
|
|||
def add_custom_buttons_in_set | |||
custom_button_set = CustomButtonSet.find(params[:custom_button_set_id]) |
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.
find_record_with_rbac
@@ -94,7 +117,17 @@ function mainCustomButtonGroupFormController(API, miqService) { | |||
vm.saveWithAPI = function(method, url, saveObject, saveMsg) { | |||
miqService.sparkleOn(); | |||
API[method](url, saveObject) | |||
.then(miqService.redirectBack.bind(vm, saveMsg, 'success', vm.redirectUrl)) | |||
// TODO remove once API supports adding/removing buttons from button set |
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.
I think this is done in ManageIQ/manageiq#18368
@@ -148,6 +149,28 @@ def add_button_in_group | |||
custom_button_set.save! | |||
end | |||
|
|||
def add_custom_buttons_in_set |
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.
(probably not needed - the API now does it too)
|
||
def custom_buttons_in_set | ||
assigned_buttons = if params[:custom_button_set_id].present? | ||
button_set = CustomButtonSet.find(params[:custom_button_set_id]) |
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.
find_record_with_rbac
else | ||
[] | ||
end | ||
generic_object_definition = GenericObjectDefinition.find(params[:generic_object_definition_id]) |
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.
rbac
2333233
to
0f8c328
Compare
@miq-bot remove_label wip @romanblanco please review, thanks :) |
@miq-bot add_label ivanchuk/yes |
@miq-bot add_reviewer @romanblanco |
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.
Tested, works 👍
I only have a comment about adding move
inside the ManageIQ scope or make it as a library
@@ -0,0 +1,61 @@ | |||
/* globals move */ |
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.
no longer needed
c51abc9
to
03d6c5f
Compare
LGTM, merging when green :) Note: if/when backporting to gaprindashvili or hammer, this will either need an additional commit to update not only button_order but also CustomButtonSet#children, or be backported with ManageIQ/manageiq#18368 |
Checked commits ZitaNemeckova/manageiq-ui-classic@831bda5~...03d6c5f with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 |
One note - I'm not sure we're ever showing the custom buttons now for generic objects. I was not able to see any custom button toolbars in GOD > Instances under definition, or in GO > instance detail, or in GO > show_list. (Neither for buttons added here, or for buttons added in ae customization) But the button group form seems to be working fine now :) |
GOD's button group can have buttons assign/unassign during create/edit (cherry picked from commit 1fc6e61) https://bugzilla.redhat.com/show_bug.cgi?id=1534529
Ivanchuk backport details:
|
Before:
After:
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1534529
@miq-bot add_label bug, wip