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

Fix for refresh of dialog fields not being called in some circumstances #1454

Merged
merged 1 commit into from
Jul 12, 2018

Conversation

eclarizio
Copy link
Member

The root cause is that we were defaulting to use the first resourceAction as long as the action was 'Provision'. However, in this case, serviceTemplate.resourceActions returned two, and the action property for the first one was 'Retirement' and the second was 'Provision'. However, since we were only checking the action for the first in the list, the id was ending up as an empty string and thus the API call was simply failing in the backend.

So, this piece of code now finds the correct provision resourceAction.

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

@miq-bot add_label gaprindashvili/yes, bug, blocker
/cc @tinaafitz , @d-m-u

@d-m-u Can you review?

@dclarizio Not sure who this should be assigned to, haven't done service-ui work in a while, please advise!

@miq-bot
Copy link
Member

miq-bot commented Jul 12, 2018

Checked commit eclarizio@119bd0f with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
0 files checked, 0 offenses detected
Everything looks fine. 👍

@dclarizio
Copy link

@AllenBW or @chalettu can you please review and look at the travis failure? @eclarizio doesn't think the travis failure has anything to do with the code changes. Thx, Dan

@chalettu
Copy link
Contributor

chalettu commented Jul 12, 2018

So one issue I see is that we have dialogs that are used in 3 places in Service UI and this PR seems to only cover 1 of those places. The other two places are custom button detail page and also service reconfigure page.
Here is the custom button detail page
https://github.com/ManageIQ/manageiq-ui-service/blob/master/client/app/states/services/custom_button_details/custom_button_details.state.js
Here is the reconfigure service page
https://github.com/ManageIQ/manageiq-ui-service/blob/master/client/app/states/services/reconfigure/reconfigure.state.js

Please take a look and ensure that this change if relevant is applied to these pages as well.
@eclarizio

@AllenBW
Copy link
Member

AllenBW commented Jul 12, 2018

@dclarizio, Travis sometimes fails, just gotta give it a kick, looks good now

@chalettu
Copy link
Contributor

@AllenBW , I kicked the job back off and it seems to be going ok.

@dclarizio dclarizio requested review from AllenBW and chalettu July 12, 2018 19:50
@eclarizio
Copy link
Member Author

@chalettu I think we're good to go here, those two places are unrelated to this change.

Copy link
Contributor

@chalettu chalettu left a comment

Choose a reason for hiding this comment

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

This change looks solid. Thank you for updating the tests.

@AllenBW
Copy link
Member

AllenBW commented Jul 12, 2018

@eclarizio if resourceActions is null, does looking for .id blow this up?

@eclarizio
Copy link
Member Author

@AllenBW You mean if the lodash.find ends up returning undefined? Theoretically, yes, but I don't think there's any instance where a service template would end up not having a 'Provision' resource action. If there is, then I think we'd have more problems (backend-wise) than just a missing ID, haha.

Copy link
Member

@AllenBW AllenBW left a comment

Choose a reason for hiding this comment

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

Lg2m!!!

@AllenBW AllenBW merged commit 8bbdd5e into ManageIQ:master Jul 12, 2018
@AllenBW AllenBW added this to the Sprint 90 Ending Jul 16, 2018 milestone Jul 12, 2018
simaishi pushed a commit that referenced this pull request Jul 12, 2018
Fix for refresh of dialog fields not being called in some circumstances
(cherry picked from commit 8bbdd5e)

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

Gaprindashvili backport details:

$ git log -1
commit 4818c77231c790d1127e5c789e5b5fb91df3eea5
Author: Allen Wight <allen.b.wight@gmail.com>
Date:   Thu Jul 12 16:50:24 2018 -0400

    Merge pull request #1454 from eclarizio/BZ1598475
    
    Fix for refresh of dialog fields not being called in some circumstances
    (cherry picked from commit 8bbdd5e40637edf06ff6f4293704e46fcbb0602a)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1600738

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