Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-72149

Improve js notification api to support alert timeouts, and de-duplication of messages

XMLWordPrintable

      Most notification api's in various places have various ways to make the notifications either go away after some time, or to replace a notification, and if there is a bunch of them if they automatically stack up and then after some threshold the oldest ones go away.

      JS notifications

      https://developer.mozilla.org/en-US/docs/Web/API/notification

      notify-send

      http://manpages.ubuntu.com/manpages/xenial/en/man1/notify-send.1.html

       

      So proposing to extend the JS notification api:

      1) An expiry timeout after which the notification fades away

      2) Allow an id to be set on the notification, if a new notification comes in with the same id as an existing on it deletes it and adds the new one to the top. (Even better might be an animation to move it to the top as its contents is replaced)

      3) There is also valid use cases for when a notification could be removed. Although if this is required it may be better to use the de-duplicating above to replace it with something else.

      4) The notification system could have some sort of maximum queue, eg 5 notifications, and if this is exceeded then the oldest one is automatically removed

       

       

            Unassigned Unassigned
            brendanheywood Brendan Heywood
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.