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

Add app status indicator #5

Closed
vojtajina opened this issue Jul 28, 2011 · 0 comments
Closed

Add app status indicator #5

vojtajina opened this issue Jul 28, 2011 · 0 comments
Assignees
Labels

Comments

@vojtajina
Copy link
Owner

We should display status messages whenever the user is waiting...

UI - design

Add yellow box with the message into black toolbar at the top or bit bigger message to center of the screen...
These are just ideas feel free to listen to your head / heart...

Messages

LOADING, when:

  • page navigation
  • loading tickets
  • loading projects
  • loading ticket revisions
  • waiting for authentication

SAVING, when:

  • creating ticket
  • creating project
  • creating ticket revision

DELETING, when:

  • deleting ticket
  • deleting project

Implementation

Note these ideas are just suggestions, feel free to do it your way ! You might come up with better idea then me...

All this logic should be in one place. I would create service $status or something like that. This service has one property message and couple of methods loading, deleting, saving or just generic set...

The main controller publishes this service into the scope, so that we can display the message in the UI - template. This message should be visible only when non-empty. Use ng:show to do so...

The service should use $browser.notifyWhenNoOutstandingRequests to be notified when no outstanding request and clear the message. Note this event the registered callback is always called just once, so you have to register at all over again. You will probably need $defer service as well, as this needs to be aynchronous, otherwise the callback will be called even before actual request...

So when anyone sets the message, the service should handle everything - change the message property, register callback to clear the message when all requests are finished. (should register always just one callback...)

Write unit test for this service first !

When this service is ready - use it in the controller. E.g. when creating ticket createTicket method is called, so inside this method, call $status.saving()...

Again unit test that - try to cover all cases...

The $status methods could take optional argument to display more verbosing messages like "saving ticket", "deleting project", ...

@ghost ghost assigned alenkacz Jul 28, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants