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

Remove record.id from live migrate submit and cancel buttons #2891

Conversation

mansam
Copy link
Contributor

@mansam mansam commented Nov 30, 2017

Remove erroneous reference to @record.id from the submit and cancel buttons that are displayed when viewing the live migrate form outside of an explorer view. IDs of instances to migrate are tracked by @live_migrate_items.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1518436
Obsoletes #2877

@mansam
Copy link
Contributor Author

mansam commented Nov 30, 2017

@miq_bot add_label bug
@miq_bot add_label compute/cloud
@miq_bot add_label gaprindashvili/yes

@miq-bot
Copy link
Member

miq-bot commented Nov 30, 2017

Checked commit mansam@5dfeb89 with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0
0 files checked, 0 offenses detected
Everything looks fine. 🍪

@martinpovolny
Copy link
Member

@aufi : please, confim, this fixes the issue. Thx!

@martinpovolny
Copy link
Member

@mansam : do you need any help with writing a simple test for this one?

@mansam
Copy link
Contributor Author

mansam commented Dec 4, 2017

@martinpovolny Some guidance about how to write a test for this would be helpful.

@martinpovolny
Copy link
Member

You are fixing a crash. So you can write a test that will check that the page renders ok.

Create a VM. And run the request that is run then you press the button.

I don't know if the id of the VM is passwd in the request or is stored beforehand in the session. You can easily see what's going on in the browser development tools.

There's a grid on that page so you can check that the GTL rendering is called with the proper params. You can also check that the /report_data returns the proper VMs to be displayed in the grid. Example: https://github.com/ManageIQ/manageiq-ui-classic/pull/2842/files

Ping me when you have some WIP and you need any help.

@aufi
Copy link
Member

aufi commented Dec 5, 2017

Works for me 👍 (but there are some warnings, not sure if it is related to this PR)
image

@mansam
Copy link
Contributor Author

mansam commented Dec 5, 2017

@martinpovolny I am having trouble rendering the request outside of explorer mode. Calling "post :x_button, :params => :pressed => "instance_live_migrate" renders the form in an explorer with no apparent way to change that, and doing post :button, :etc,etc,etc doesn't work-- it returns a 500 saying the button is unimplemented.

    session[:live_migrate_items] = [vm_openstack.id]
    post :button, :params => {:pressed => 'instance_live_migrate'}
    expect(response.status).to eq(200)
    expect(response).to render_template(:partial => 'vm_common/_live_migrate')

@martinpovolny
Copy link
Member

ok, @mansam, let me look if I can craft a spec tomorrow.

@martinpovolny martinpovolny merged commit 5e3c9a5 into ManageIQ:master Dec 7, 2017
@martinpovolny martinpovolny added this to the Sprint 75 Ending Dec 11, 2017 milestone Dec 7, 2017
simaishi pushed a commit that referenced this pull request Dec 11, 2017
…r-views

Remove record.id from live migrate submit and cancel buttons
(cherry picked from commit 5e3c9a5)

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

Gaprindashvili backport details:

$ git log -1
commit 10ad9d813cc83da4be0dea4600a4feb62f9f2522
Author: Martin Povolny <[email protected]>
Date:   Thu Dec 7 21:36:36 2017 +0100

    Merge pull request #2891 from mansam/fix-live-migrate-outside-explorer-views
    
    Remove record.id from live migrate submit and cancel buttons
    (cherry picked from commit 5e3c9a5c85e08ec254d59b6a16799548a83ab19c)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1524676

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