-
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
Creating miq_request for CustomButton request call with open_url. #17802
Creating miq_request for CustomButton request call with open_url. #17802
Conversation
Works like a charm with |
Is this still a WIP? |
Should be good to merge. I merged the UI part. |
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.
👍
@@ -38,7 +38,11 @@ def process_request(state) | |||
result[:request] = generate_request(state, values) | |||
else | |||
ra = load_resource_action(values) | |||
ra.deliver_to_automate_from_dialog(values, @target, @requester) | |||
if ra.resource_type == 'CustomButton' && CustomButton.find(ra.resource_id).options[:open_url] |
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.
This object should not have intimate knowledge of the CustomButton
model. I would expect that the CustomButton
model should be updated to include a open_url?
method which would look into the options
hash.
Also, I would prefer not using resource_type
to identify the object. It would be better to use ra.resource.kind_of?(CustomButton)
but in this case I think you just want: if ra.resource.try(:open_url?)
Checked commit pkomanek@6be7df7 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
ManageIQ#17802 added a line that called [] on options and if nil, it would raise NoMethodError where it should have returned nil
ManageIQ#17802 added a line that called [] on options and if nil, it would raise NoMethodError where it should have returned nil
…od_from_custom_button_with_open_url Creating miq_request for CustomButton request call with open_url. (cherry picked from commit 5bcea52) https://bugzilla.redhat.com/show_bug.cgi?id=1618800
Gaprindashvili backport details:
|
Creating a new miq_task for CustomButton request call with open_url. This miq_task is used to track ae_method progress, which is used to open specified url when the method is finished. This PR is based on BZ bellow and it is also part of the ManageIQ/manageiq-ui-classic#4334.
Links
https://bugzilla.redhat.com/show_bug.cgi?id=1602023