-
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
Custom buttons for list views #796
Conversation
f26b61f
to
8c6ee08
Compare
33b39f1
to
b5aab53
Compare
@@ -1484,6 +1484,10 @@ function miqToolbarOnClick(_e) { | |||
} else { | |||
params = miqSerializeForm(button.data('url_parms')); | |||
} | |||
} else if (button.data('url_parms').match("id=LIST")) { |
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.
@@ -239,62 +245,68 @@ def create_custom_button_hash(input, record, options = {}) | |||
:enabled => options[:enabled], | |||
:klass => ApplicationHelper::Button::ButtonWithoutRbacCheck, | |||
:url => "button", | |||
:url_parms => "?id=#{record.id}&button_id=#{button_id}&cls=#{record.class}&pressed=custom_button&desc=#{button_name}" | |||
:url_parms => "?id=#{record_id}&button_id=#{button_id}&cls=#{model}&pressed=custom_button&desc=#{button_name}" |
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.
@@ -8,20 +8,23 @@ def custom_toolbar? | |||
end | |||
|
|||
def custom_toolbar_explorer? |
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.
Should probably no longer have the question mark in the name, since it returns nil or a string :)
6e3aabc
to
6834d56
Compare
b6408ee
to
2f087b5
Compare
Verified in the UI checklist:
|
When multiple items are selected (and for=list or both) it shows EDIT: aah, fixed when |
When no items are selected (and for=list or both), it dies with
EDIT: fixed, |
@martinpovolny Looks like you may have missed Storage > {Block, Object} Storage > Managers - you can see the Provider custom buttons in detail view, but not in list view. |
@himdel : Do you think that this mergeable w/o those added? I'll follow up with a PR making sure that the buttons are displayed there too. |
@martinpovolny Sure, no problem with that :). Another bug..
(Works in the detail for the same thing.) The same happens in Compute > Infrastructure > Virtual Machines, accordion Templates, and also happens in the "VMs & Templates" accordion when a Template is selected. ... so, any templates or images in list view. (Not sure if it makes sense to merge without this one..?) |
Looking into it. I am not sure what is the desired behavior here. It's probably not going to be a quick fix. |
Holy crappa. This is much complex, because for the explorer-based controller and lists being displayed the class of the elements displayed depends on the node selected in the tree. Not just simply There needs to be some logic that will tell the class of the stuff being shown in the GTL and that needs to be called for the custom toolbar. |
…m the list being displayed.
76cffec
to
7816308
Compare
@himdel : as for these: I don't have data to test or debug this, do you? There's To the point: I think I have fixed the issue that you have found and that has been a blocker here. For the issues about storages I think I need more input from the managers. I have no idea how that is supposed to work :-( |
Checked commits martinpovolny/manageiq-ui-classic@5fd1d21~...19f4fe9 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 app/helpers/application_helper/toolbar_builder.rb
app/views/shared/buttons/_ab_form.html.haml
app/views/shared/buttons/_ab_show.html.haml |
LGTM, tested in the UI 👍. The only screen this does not work on (except for the separate issues linked above), is the |
@martinpovolny is this |
Custom buttons for list views (cherry picked from commit 631a325)
Fine backport details:
|
Adding custom button support for lists.
pivotal: https://www.pivotaltracker.com/story/show/140944305
I have disabled the "submit all" option in the UI as it is not (yet) supported by the backend.