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 code to show Bottlenecks report download buttons. #4903

Merged

Conversation

h-kataria
Copy link
Contributor

multiple issues fixed:

1 Download button toolbar was not being rendered for Bottlenecks explorer
2 change_tab transaction was not working because the tab id being passed in miq_tabs_init had typo, also fixed typo in method name bottleneck_get_node_info it should be get_node_info
3 download button was always disabled, added condition to enable download buttons on report tab
4 added missing routes for change_tab and report_download
5 report_download method was missing in controller
Issue was introduced in #1966

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

before
before

after
after

multiple issues fixed:

1 Download button toolbar was not being rendered for Bottlenecks explorer
2 `change_tab` transaction was not working because the tab id being passed in miq_tabs_init had typo, also fixed typo in method name `bottleneck_get_node_info` it should be `get_node_info`
3 download button was always disabled, added condition to enable download buttons on report tab
4 added missing routes for `change_tab` and `report_download`
5 `report_download` method was missing in controller
Issue was introduced in ManageIQ#1966

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1648500
@h-kataria h-kataria changed the title [WIP] - Fixed code to show Bottlenecks report download buttons. Fixed code to show Bottlenecks report download buttons. Nov 12, 2018
@h-kataria h-kataria removed the wip label Nov 12, 2018
@h-kataria h-kataria requested a review from skateman November 12, 2018 16:22
@martinpovolny
Copy link
Member

@h-kataria : given the high number of regression you are fixing do you thing that it would make sense to improve the test coverage of this code?

If you need to get the fix quickly in we can do that in a follow up PR.

@h-kataria
Copy link
Contributor Author

@martinpovolny since this is not a blocker, I can try to add spec tests to this PR

@h-kataria h-kataria force-pushed the bottlenecks_report_download_fix branch from c1dc95c to 30ed201 Compare November 12, 2018 20:39
@miq-bot
Copy link
Member

miq-bot commented Nov 12, 2018

Checked commits h-kataria/manageiq-ui-classic@c754f2b~...30ed201 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
9 files checked, 0 offenses detected
Everything looks fine. ⭐

it "displays toolbar" do
@sb = {:active_tab => 'summary'}
expect(ApplicationHelper::ToolbarChooser.new(nil, nil, :record => @record, :explorer => true, :layout => 'miq_capacity_bottlenecks', :sb => @sb).send(:x_view_toolbar_filename)).to eq("miq_capacity_view_tb")
end
Copy link
Member

@martinpovolny martinpovolny Nov 13, 2018

Choose a reason for hiding this comment

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

There's a simpler way to chect that a particula toolbar is instantiated when a given action is requested.

Example from spec/controllers/physical_switch_controller_spec.rb:

        expect(ApplicationHelper::Toolbar::PhysicalSwitchesCenter).to receive(:definition).and_call_original

Not sure if it's applicable to your situation but generally it does not need much mocking.

@martinpovolny
Copy link
Member

martinpovolny commented Nov 13, 2018

@h-kataria : shall I merge the PR as it is or do you want to take a look at the possibly simpler way of testing toolbar creation?

@h-kataria
Copy link
Contributor Author

@martinpovolny i tried to implement your suggested change but doesn't seem to be working for me. i can try to simplify that in a follow up PR

@martinpovolny martinpovolny merged commit e1e7030 into ManageIQ:master Nov 13, 2018
@martinpovolny martinpovolny added this to the Sprint 99 Ending Nov 19, 2018 milestone Nov 13, 2018
@dclarizio dclarizio assigned martinpovolny and unassigned dclarizio Nov 13, 2018
simaishi pushed a commit that referenced this pull request Nov 14, 2018
Fixed code to show Bottlenecks report download buttons.

(cherry picked from commit e1e7030)

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

Hammer backport details:

$ git log -1
commit d7908e291efa9e29697f55d2db6f5b12d3d0c514
Author: Martin Povolny <[email protected]>
Date:   Tue Nov 13 16:58:21 2018 +0100

    Merge pull request #4903 from h-kataria/bottlenecks_report_download_fix
    
    Fixed code to show Bottlenecks report download buttons.
    
    (cherry picked from commit e1e703045c303cf1ecee0f3d9588b40b86256373)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1648500

@h-kataria h-kataria deleted the bottlenecks_report_download_fix branch April 9, 2019 22:04
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.

5 participants