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

Fixed API endpoint for GO object custom button dialogs. #6052

Merged

Conversation

h-kataria
Copy link
Contributor

Need to pass in correct parent record id and generic_object id to build endpoint url correctly when pressing a GO custom button from list view or details view.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1729341

In favor of #6049

@tinaafitz @pkomanek please review/test. Please test pressing custom button from List view and details view.

Need to pass in correct parent record id and generic_object id to build endpoint url correctly when pressing a GO custom button from list view or details view.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1729341
@miq-bot
Copy link
Member

miq-bot commented Aug 16, 2019

Checked commit h-kataria@8b0e5ac with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. 👍

@h-kataria
Copy link
Contributor Author

Note: @himdel @Hyperkid123 this PR is needed for GA build on 08/19

@martinpovolny
Copy link
Member

I definitely like this one better than the alternative.

@pkomanek
Copy link
Contributor

LGTM 👍

@@ -31,7 +31,8 @@ def generic_object_custom_buttons
display_options = {}
ids = @lastaction == 'generic_object' ? @sb[:rec_id] : 'LIST'
display_options[:display] = @display
display_options[:display_id] = params[:id]
display_options[:record_id] = @sb['trees']['svcs_tree']['active_node'].split('-').last
Copy link
Contributor

@himdel himdel Aug 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sb['trees']['svcs_tree']['active_node']

x_node ?

(I think the canonical way is _type, id = parse_nodetype_and_id(x_node) or parse_nodetype_and_id(x_node).last)

@himdel
Copy link
Contributor

himdel commented Aug 19, 2019

Note: I'm on /service/show/48?display=generic_objects&generic_object_id=9 (with this PR),
and when I click the toolbar button (so before the dialog), it does a request to /service/button/9.

But that seems to work fine, verified fix 👍 :)

@himdel himdel merged commit f817e80 into ManageIQ:master Aug 19, 2019
@himdel himdel self-assigned this Aug 19, 2019
@himdel himdel added this to the Sprint 118 Ending Aug 19, 2019 milestone Aug 19, 2019
@himdel
Copy link
Contributor

himdel commented Aug 19, 2019

this PR is needed for GA build on 08/19

Merged, the @sb vs x_node issue won't affect functionality, addressing in #6057

simaishi pushed a commit that referenced this pull request Aug 19, 2019
…m_buttons

Fixed API endpoint for GO object custom button dialogs.

(cherry picked from commit f817e80)

https://bugzilla.redhat.com/show_bug.cgi?id=1729341
@simaishi
Copy link
Contributor

Ivanchuk backport details:

$ git log -1
commit 8a9d219923eb17d214c0062af83052f83200219e
Author: Martin Hradil <[email protected]>
Date:   Mon Aug 19 15:25:27 2019 +0200

    Merge pull request #6052 from h-kataria/fix_api_endpoint_for_go_custom_buttons
    
    Fixed API endpoint for GO object custom button dialogs.
    
    (cherry picked from commit f817e80391785e5fb3f050576e9b4246909d6398)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1729341

simaishi pushed a commit that referenced this pull request Aug 19, 2019
…m_buttons

Fixed API endpoint for GO object custom button dialogs.

(cherry picked from commit f817e80)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1743266
@simaishi
Copy link
Contributor

Hammer backport details:

$ git log -1
commit b66edb37accff6e598b054fe479da891ad1f9e8e
Author: Martin Hradil <[email protected]>
Date:   Mon Aug 19 15:25:27 2019 +0200

    Merge pull request #6052 from h-kataria/fix_api_endpoint_for_go_custom_buttons
    
    Fixed API endpoint for GO object custom button dialogs.
    
    (cherry picked from commit f817e80391785e5fb3f050576e9b4246909d6398)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1743266

@h-kataria h-kataria deleted the fix_api_endpoint_for_go_custom_buttons branch August 22, 2019 17:46
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.

6 participants