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

Change reconfigure setup to include values configured with originally #4226

Merged
merged 2 commits into from
Jun 29, 2018

Conversation

eclarizio
Copy link
Member

This PR is the UI counterpart to the backend PR found here. I decided to write a new javascript controller and haml file corresponding to the reconfigure action instead of reusing dialogUserController because there were enough differences that I felt it would be much cleaner and easier to understand this way.

Essentially, when clicking on the reconfigure button, it now will make an API call to get the reconfigure dialog, which will return the dialog with the correct "default" values (they are not actually the default values, they are the values which the service was originally configured with).

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

@miq-bot add_label gaprindashvili/yes, bug, blocker
/cc @gmcculloug @tinaafitz

@d-m-u Can you test this in conjunction with the main repo PR please?
@syncrou Can you review this as well please?

_.forEach(allErrorMessages, (function(errorMessage) {
add_flash(errorMessage, 'error');
}));
console.log(err);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do ... do we need this?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd use console.error instead, to match what miqService.handleFailure does

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Well in that case, maybe you can move it to a shared service?

@d-m-u
Copy link
Contributor

d-m-u commented Jun 28, 2018

Other than the one silly nit, looks great.

var vm = this;

vm.$onInit = function() {
var apiCall = new Promise(function(resolve) {
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't this whole thing just

API.get(url)
  .then(init)
  .then(miqService.refreshSelectpicker);

?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I thought so too, but when I tried to use .then(miqService.refreshSelectpicker) in #4063, it did not work and had to manually resolve the promise first.

@himdel
Copy link
Contributor

himdel commented Jun 28, 2018

Not seeing any angular problems either :) 👍

@dclarizio
Copy link

@eclarizio can you see if you can fix some of the CC issues? Thx, Dan

@simaishi
Copy link
Contributor

@eclarizio If you're going to push another commit, please update BZ link to the 'master' BZ (https://bugzilla.redhat.com/show_bug.cgi?id=1580987), so the correct BZ will be commented.

Copy link
Contributor

@syncrou syncrou left a comment

Choose a reason for hiding this comment

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

👍 LGTM

@miq-bot
Copy link
Member

miq-bot commented Jun 28, 2018

Checked commits eclarizio/manageiq-ui-classic@f11151d~...4b7bfdb with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
5 files checked, 0 offenses detected
Everything looks fine. 🏆

@JPrause
Copy link
Member

JPrause commented Jun 29, 2018

Just confirming that this PR is complete, and that we're just waiting on PR17647 to be merge first.

@gmcculloug
Copy link
Member

Backend PR is merged.

@JPrause
Copy link
Member

JPrause commented Jun 29, 2018

@mzazrivec with the PR Greg mentioned merged, and the approvals on this PR, can you merge this asap.

@mzazrivec
Copy link
Contributor

@mzazrivec with the PR Greg mentioned merged, and the approvals on this PR, can you merge this asap.

I'll merge this PR once I also review it. Not ASAP.

@JPrause
Copy link
Member

JPrause commented Jun 29, 2018

Thanks @mzazrivec that's perfect. 👍
This PR is for a blocker BZ and we need it for the final build.

@mzazrivec mzazrivec added this to the Sprint 89 Ending Jul 2, 2018 milestone Jun 29, 2018
@mzazrivec mzazrivec merged commit ffa5c39 into ManageIQ:master Jun 29, 2018
@JPrause
Copy link
Member

JPrause commented Jun 29, 2018

Thanks @mzazrivec !! Appreciate your help.

@simaishi
Copy link
Contributor

@eclarizio I see a conflict backporting to Gaprindashvili for compress id

156 <<<<<<< HEAD
157     s = Service.find_by_id(from_cid(params[:id]))
.....
172 =======
173     service = Service.find_by(:id => params[:id])
.....
180 >>>>>>> ffa5c39... Merge pull request #4226 from eclarizio/BZ1591484-Reconfigure

Can you clarify there will be no spec change needed for backport? I've seen compress id conflicts requiring spec change in the past, so double-checking...

@eclarizio
Copy link
Member Author

@simaishi The spec for the method that conflict is in was created with this PR. I don't know exactly how lookup with the compressed ids works, so we may need to leave the find_by_id(from_cid(params[:id])) as it is in Gaprindashvili. Then, as you mentioned, the spec would definitely need to change because it's expecting find_by(:id => params[:id]).

@simaishi
Copy link
Contributor

@eclarizio In that case... please create a separate PR for G-branch. Thanks!

@simaishi
Copy link
Contributor

Backported to Gaprindashvili via #4236

@himdel
Copy link
Contributor

himdel commented Jul 9, 2018

Looks like ManageIQ/manageiq#17647 was merged 10 days ago, removing pending core ;).

@miq-bot remove_label pending core

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.

10 participants