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 service catalog service dialog refresh function behaving differently #814

Merged
merged 3 commits into from
Jun 12, 2017

Conversation

eclarizio
Copy link
Member

This is basically a re-do of #793, because that PR somehow had dropped the test coverage and highlighted some problems with the way the specs were written.

As such, this PR moves the triggering and listening to a specific AutoRefresh angular service that doesn't use jQuery's $(document).on, .off, or .trigger methods.

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

@miq-bot add_label euwe/yes, fine/yes, bug
@miq-bot assign @chriskacerguis

@chalettu Can you review and let me know if this is more along the lines of what you were thinking for the auto refresh communications?

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

This change no longer uses the jQuery '$' to trigger and listen to
messages but uses an angular service
@eclarizio
Copy link
Member Author

Fixing test failures...

@AllenBW AllenBW added this to the Sprint 63 Ending Jun 19, 2017 milestone Jun 8, 2017
@AllenBW AllenBW self-requested a review June 8, 2017 17:15
@AllenBW
Copy link
Member

AllenBW commented Jun 8, 2017

@eclarizio prepending unused params with _ will keep travis from whining about em as being unused

@eclarizio
Copy link
Member Author

@AllenBW I think there was just a problem with the rebase, because I was still working on the same branch that the old PR was made from, but that got reverted. So some of the changes I needed just didn't make it into the final push and I didn't notice after fixing the conflicts git raised.

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.

Only a few minor quibily things, love that code coverage increase!

Upon further reflection I realize most of my asks won't survive a backport to fine or euwe. Gonna make the horrible request prs directly to those branches rather than sacrifice the code base of master moving forward.

@@ -23,6 +23,7 @@ import { BaseModalController } from './modal/base-modal-controller.js';
import { BaseModalFactory } from './modal/base-modal.factory.js';
import { ChargebackFactory } from './chargeback.service.js';
import { CollectionsApiFactory } from './collections-api.factory.js';
import { AutoRefreshFactory } from '../services/auto-refresh.service.js';
Copy link
Member

Choose a reason for hiding this comment

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

If the factory is to be advertised on the core module it should be located in the core module folder

if (dialogField.trigger_auto_refresh === true || dialogField.triggerOverride === true) {
parent.postMessage({refreshableFieldIndex: dialogField.refreshableFieldIndex}, '*');
var triggerOptions = {};
Copy link
Member

Choose a reason for hiding this comment

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

Prefer let or const for declaring variables

};

function triggerAutoRefresh(data) {
angular.forEach(callbacks, (function(callback) {
Copy link
Member

Choose a reason for hiding this comment

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

consider using arrow function and .forEach markup

would result in the following rewrite:

callbacks.forEach((callback) => { callback(data) });

@miq-bot
Copy link
Member

miq-bot commented Jun 8, 2017

Checked commits eclarizio/manageiq-ui-service@2993a33~...3d1e769 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
0 files checked, 0 offenses detected
Everything looks fine. 🍰

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.

🌮 💃 👍

changes look good, thanks for addressing quickly!

@chriskacerguis
Copy link
Contributor

@eclarizio looking at what @AllenBW suggested (and said) this will probably need a separate PR for Fine and Euwe. Other than that, LGTM 👍

@chriskacerguis chriskacerguis merged commit 8c8cd0b into ManageIQ:master Jun 12, 2017
@simaishi
Copy link
Contributor

@AllenBW This can be backported to Fine branch without conflict. @eclarizio suggested that I check with you to make sure this can go in as is, in case something needs to be done differently in Fine branch. Please let me know. Thanks!

@AllenBW
Copy link
Member

AllenBW commented Jun 14, 2017

@simaishi well hot darn! yeah ok i see now, all good to go to fine, but not euwe, app structure is fundamentally different :-/

simaishi pushed a commit that referenced this pull request Jun 14, 2017
Fix for service catalog service dialog refresh function behaving differently
(cherry picked from commit 8c8cd0b)

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

@AllenBW thanks! Added euwe/conflict label.

@simaishi
Copy link
Contributor

Fine backport details:

$ git log -1
commit 7e41b7c23df5b8536897a3c67c9314c5e47b624c
Author: Chris Kacerguis <chriskacerguis@users.noreply.github.com>
Date:   Mon Jun 12 10:21:32 2017 -0500

    Merge pull request #814 from eclarizio/BZ1439761
    
    Fix for service catalog service dialog refresh function behaving differently
    (cherry picked from commit 8c8cd0b39386187a01d72b6076b016e8f1322348)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1461183

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