Skip to content
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

Merged
merged 1 commit into from
Aug 22, 2018
Merged

Creating miq_request for CustomButton request call with open_url. #17802

merged 1 commit into from
Aug 22, 2018

Conversation

pkomanek
Copy link
Contributor

@pkomanek pkomanek commented Aug 6, 2018

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

@ZitaNemeckova
Copy link
Contributor

Works like a charm with
ManageIQ/manageiq-ui-classic#4334 👍

@martinpovolny
Copy link
Member

Is this still a WIP?

@pkomanek pkomanek changed the title [WIP]Creating miq_request for CustomButton request call with open_url. Creating miq_request for CustomButton request call with open_url. Aug 13, 2018
@miq-bot miq-bot removed the wip label Aug 13, 2018
@gmcculloug gmcculloug requested a review from eclarizio August 17, 2018 12:38
@gmcculloug gmcculloug self-assigned this Aug 17, 2018
@martinpovolny
Copy link
Member

Should be good to merge. I merged the UI part.

Copy link
Member

@eclarizio eclarizio left a 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]
Copy link
Member

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?)

@pkomanek pkomanek changed the title Creating miq_request for CustomButton request call with open_url. [WIP]Creating miq_request for CustomButton request call with open_url. Aug 22, 2018
@miq-bot miq-bot added the wip label Aug 22, 2018
@miq-bot
Copy link
Member

miq-bot commented Aug 22, 2018

Checked commit pkomanek@6be7df7 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
5 files checked, 0 offenses detected
Everything looks fine. 🍪

@pkomanek pkomanek changed the title [WIP]Creating miq_request for CustomButton request call with open_url. Creating miq_request for CustomButton request call with open_url. Aug 22, 2018
@miq-bot miq-bot removed the wip label Aug 22, 2018
@gmcculloug gmcculloug merged commit 5bcea52 into ManageIQ:master Aug 22, 2018
@gmcculloug gmcculloug added this to the Sprint 93 Ending Aug 27, 2018 milestone Aug 22, 2018
@pkomanek pkomanek deleted the creating_miq_task_for_ae_method_from_custom_button_with_open_url branch August 22, 2018 12:43
bdunne added a commit to bdunne/manageiq that referenced this pull request Aug 28, 2018
ManageIQ#17802 added a line that called []
on options and if nil, it would raise NoMethodError where it should have
returned nil
bdunne added a commit to bdunne/manageiq that referenced this pull request Aug 28, 2018
ManageIQ#17802 added a line that called []
on options and if nil, it would raise NoMethodError where it should have
returned nil
simaishi pushed a commit that referenced this pull request Sep 11, 2018
…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
@simaishi
Copy link
Contributor

Gaprindashvili backport details:

$ git log -1
commit 530c20d7a7aa9b1b7e85d222544062971d0906d3
Author: Greg McCullough <[email protected]>
Date:   Wed Aug 22 08:34:49 2018 -0400

    Merge pull request #17802 from pkomanek/creating_miq_task_for_ae_method_from_custom_button_with_open_url
    
    Creating miq_request for CustomButton request call with open_url.
    (cherry picked from commit 5bcea523d62989c0fc6e65d1169e057f904ed338)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1618800

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants