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

GTL - use miqSparkle-style spinner when loading #4844

Merged
merged 2 commits into from
Nov 1, 2018
Merged

GTL - use miqSparkle-style spinner when loading #4844

merged 2 commits into from
Nov 1, 2018

Conversation

himdel
Copy link
Contributor

@himdel himdel commented Oct 29, 2018

this changes the GTL spinner code to show the ManageIQ spinner when the content is loading
this should prevent timing issues when trying to switch views (tree_select) when a GTL view is being loaded

using ManageIQ.gtl.loading in miqSparkleOff is ...sub-optimal,
but I'm currently seeing no way not to do that without the spinner disappearing and reapearring when the ajax request finishes but before the angular gtl code finishes initializing

Probably needs quite some testing :).

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

@himdel
Copy link
Contributor Author

himdel commented Oct 29, 2018

Cc @hstastna (because that BZ)

@hstastna
Copy link

hstastna commented Oct 29, 2018

I am ok with this PR, but not able to recreate the BZ, too. But @h-kataria I think you were able to recreate the BZ. Maybe you could also to test this PR 😏 Maybe also @kbrock Thanks! ❇️

@miq-bot
Copy link
Member

miq-bot commented Oct 30, 2018

This pull request is not mergeable. Please rebase and repush.

@miq-bot
Copy link
Member

miq-bot commented Oct 30, 2018

Checked commit https://github.com/himdel/manageiq-ui-classic/commit/825a368705fb19e7ab66278c5c948c6c1e96fbcc with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 0 offenses detected
Everything looks fine. ⭐

@h-kataria
Copy link
Contributor

@himdel i was not able to recreate on upstream, was only randomly able to recreate on Gaprindashvili. But i have tested this on several explorer screen with and without some sleep statements in code, seems to be working good. Should this be marked as Gaprindashvili/yes ?

@h-kataria
Copy link
Contributor

@himdel can you knock down code climate issues? other then those i am good with merging this PR.

@himdel
Copy link
Contributor Author

himdel commented Oct 31, 2018

@h-kataria Aah, good catch, added gaprindashvili/yes :).

Re CC, I don't see a good way of fixing those...

I don't think doing

  ReportDataController.prototype.loading = function(loading) {
    this.$window.ManageIQ.gtl.loading = loading;
    this.settings.isLoading = loading;
    loading ? miqSparkleOn() : miqSparleOff();
  };

increases readability much, do you?

@dclarizio
Copy link

@himdel how about something like this, a little clearer (I even fixed your typo):

  ReportDataController.prototype.setLoadingState = function(state) {
    this.$window.ManageIQ.gtl.loading = state;
    this.settings.isLoading = state;
    state ? miqSparkleOn() : miqSparkleOff();
  };

this changes the GTL spinner code to show the ManageIQ spinner when the content is loading
this should prevent timing issues when trying to switch views (tree_select) when a GTL view is being loaded

using ManageIQ.gtl.loading in miqSparkleOff is ...sub-optimal,
but I'm currently seeing no way not to do that without the spinner disappearing and reapearring when the ajax request finishes but before the angular gtl code finishes initializing

https://bugzilla.redhat.com/show_bug.cgi?id=1626627
@@ -355,7 +361,6 @@
ReportDataController.prototype.setDefaults = function() {
this.settings.selectAllTitle = __('Select All');
this.settings.sortedByTitle = __('Sorted By');
this.settings.isLoading = false;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

(removed because setDefaults is only called from the same getData response handler as that setLoading in $timeout above, but too early because no timeout)

@himdel
Copy link
Contributor Author

himdel commented Nov 1, 2018

Ok ok, fixed & rebased :)

@h-kataria h-kataria self-assigned this Nov 1, 2018
@h-kataria h-kataria added this to the Sprint 98 Ending Nov 5, 2018 milestone Nov 1, 2018
@h-kataria h-kataria merged commit 249138c into ManageIQ:master Nov 1, 2018
@himdel himdel deleted the gtl-loader branch November 2, 2018 11:45
simaishi pushed a commit that referenced this pull request Nov 2, 2018
GTL - use miqSparkle-style spinner when loading

(cherry picked from commit 249138c)

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

simaishi commented Nov 2, 2018

Hammer backport details:

$ git log -1
commit 9f47c18cdc37c74aa4bf0597f9efb16a514083cc
Author: Harpreet Kataria <[email protected]>
Date:   Thu Nov 1 15:51:02 2018 -0400

    Merge pull request #4844 from himdel/gtl-loader
    
    GTL - use miqSparkle-style spinner when loading
    
    (cherry picked from commit 249138c4ea4227cb98c572b1914259275274bd72)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1626627

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.

6 participants