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

Display user info after clicking on Lookup while provisioning VM #6391

Merged
merged 1 commit into from Nov 15, 2019

Conversation

hstastna
Copy link
Contributor

@hstastna hstastna commented Nov 8, 2019

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

After clicking on Lookup button, the LDAP user's info was not displayed in the form as expected, while provisioning VM. The page was not properly updated, after clicking on the button. A simple change in retrieve_email method fixes the problem.

While going to the other tab and going back (as mentioned in the BZ), prov_field_changed method was called. In this method, render is called to update the page according to the changes on the provision form, and it works fine. This is why going to the other tab and going back 'solves' the missing info in the fields, after clicking on Lookup. The page is updated properly especially because of this line, comparing to the situation when it is not properly updated. Focus especially on the dialog_name variable. And now check the changes in my PR.

When the content of the page is generated, _prov_wf.html.haml is rendered. In this haml, miq_tab_content is called. These are dialog names as arguments for miq_tab_content method in our situation (when first time in, after clicking on Provision VMs in the toolbar):

[1] pry(#<#<Class:0x00007fdc2354bcd8>>)> wf.get_dialog_order
=> [:requester, :purpose, :service, :environment, :hardware, :network, :customize, :schedule]

Now see this - in this line a html block with the type :div with the id id (and some other content) is returned, "_div" is not added to the id of appropriate div, there's nothing like that.
And if we call render_html, only appropriate divs are updated. We need to use "requester" as a name of the div if we are in the Request tab, instead of "requester_div", to achieve that appropriate parts of the page will be updated.


Before: (nothing happens after clicking on Lookup)
lookup_before

After: (user's info is displayed in the fields)
lookup_after


Note:
You will not be able to reproduce the bug always, especially if the email will not be the same as user principal name. See the BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1769517

@hstastna
Copy link
Contributor Author

hstastna commented Nov 8, 2019

@miq-bot add_label bug, ivanchuk/yes, hammer/yes

@hstastna
Copy link
Contributor Author

hstastna commented Nov 8, 2019

Just a note that failing Travis is not related to the changes in this PR.

@hstastna hstastna force-pushed the ProvisionVM_LDAP_Lookup_btn branch 4 times, most recently from b0c53e1 to 81e9e94 Compare November 12, 2019 11:45
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1765691

Make also small changes in the specs for appropriate
controller, add new specs for retrieve_email method.
@miq-bot
Copy link
Member

miq-bot commented Nov 12, 2019

Checked commit hstastna@c492811 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. ⭐

@ZitaNemeckova
Copy link
Contributor

Tested in UI. LGTM 👍

@martinpovolny martinpovolny self-assigned this Nov 15, 2019
@martinpovolny martinpovolny added this to the Sprint 125 Ending Nov 25, 2019 milestone Nov 15, 2019
@martinpovolny martinpovolny merged commit 31f7ba5 into ManageIQ:master Nov 15, 2019
simaishi pushed a commit that referenced this pull request Dec 16, 2019
Display user info after clicking on Lookup while provisioning VM

(cherry picked from commit 31f7ba5)

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

Ivanchuk backport details:

$ git log -1
commit c7698fa0c68788548f3917883388fbe884c2ebea
Author: Martin Povolny <mpovolny@redhat.com>
Date:   Fri Nov 15 08:20:17 2019 +0100

    Merge pull request #6391 from hstastna/ProvisionVM_LDAP_Lookup_btn

    Display user info after clicking on Lookup while provisioning VM

    (cherry picked from commit 31f7ba5f7c42fa24dc18e704cd20d0d6e6568cf6)

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

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.

None yet

6 participants