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

Feature/modal global loading indicator #229

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Zarlex
Copy link

@Zarlex Zarlex commented Oct 15, 2018

Fix #229

  • Add global loading service to mwUI.Utils where loading processes can register.
  • Add http request interceptor to register a loading process on outgoing requests and unregister on response
  • Add loading indicator to modal header when a global loading process is in progress

itemsAlreadyLoaded = 0;
};

var executeCallbacks = function (cbs, args, scope) {

Choose a reason for hiding this comment

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

Didn't know that the letters a,l,l,a,c,k are expensive. Please fix param names for better reading. Also args should be arguments

Copy link
Author

Choose a reason for hiding this comment

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

arguments can not be used because it is a reserved JavaScript word

Copy link

@ywachendorfer ywachendorfer Oct 16, 2018

Choose a reason for hiding this comment

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

valid reason for not using arguments

* @description
* This service manages loading processes. It can be used e.g. by a httpInterceptor to register a loading process
*/
.service('Loading', function ($timeout) {

Choose a reason for hiding this comment

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

We already have a service called 'Loading' (see relution/common). How are name collisions handled

Copy link
Author

Choose a reason for hiding this comment

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

It will use the one the is registered first, the other one is just ignored. Next step is to remove the Loading service from the portal

Choose a reason for hiding this comment

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

So in fact you moved the loading service into the UI-Kit...

Copy link
Author

Choose a reason for hiding this comment

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

Yes with some small modifications, a merge request for the portal will come as soon as this mr is released in a new uikit version

service.start();

service.done();

Choose a reason for hiding this comment

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

Add $timeout.flush()... i expect that the test will crash

Copy link
Author

Choose a reason for hiding this comment

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

Yes it will fail because there are no $timeouts to flush but this is the expected behaviour

Copy link
Author

Choose a reason for hiding this comment

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

I added a check in afterEach to verify that there is no outstanding $timeout task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants