New Notification service: Let Plugin developers easily output info, notice, warning, error messages on screen #4179

Closed
mattab opened this Issue Sep 25, 2013 · 46 comments

2 participants

@mattab
Piwik Open Source Analytics member

Right now our Notification mechanism is not quite consistent.

We use for example several techniques:

  • we add &updated=X to URL, which is then detected by Javascript or controller to display a particular message
  • Various messages are printed in the views using the class="ajaxSuccess" style.
  • setting ->errorMessage on the View object
  • etc.

Instead we could introduce a new Notification class or so, that would:

  • Let user easily Notify one or more messages to users
    • Choose between Info, Notice, Warning, Error
  • We would display the messages in the next page view (messages are stored in the session)
    • This way developer does not need to display its own HTML
  • If several messages are to be displayed, they are displayed on top of one another (one colored box each)
  • We'd use boostrap styles for notifications (4 colors)
  • The ajaxSuccess and ajaxError css styles should reuse the Success + Error notification CSS
    • Maybe the notification should be implemented as JS class (and have PHP helper output code to call this class in the View)

Optional:

  • make a message persistent. If set to persistent, display with a [Until user clicks X this message is displayed on all page views
  • by default messages are displayed only once
@tsteur
Piwik Open Source Analytics member

In 7b5943a: refs #4179 started to work on notifications

@tsteur
Piwik Open Source Analytics member

In 98fa154: refs #4179 set default properties

@tsteur
Piwik Open Source Analytics member

In 7c4d56e: refs #4179 render a list of notifications so they can be rendered by javascript

@tsteur
Piwik Open Source Analytics member

In c7ffd57: refs #4179 parse notifications

@tsteur
Piwik Open Source Analytics member

In 2220899: refs #4179 render a simple dom node for each notification

@tsteur
Piwik Open Source Analytics member

In a208bf4: refs #4179 added some less definitions

@tsteur
Piwik Open Source Analytics member

In b134848: refs #4179 fix notification is floated

@tsteur
Piwik Open Source Analytics member

In 93282a8: refs #4179 we do not support icons for now

@tsteur
Piwik Open Source Analytics member

In 1cebbce: refs #4179 handle options like title, noclear, message, ...

@tsteur
Piwik Open Source Analytics member

In d99772c: refs #4179 sort notifications by priority

@tsteur
Piwik Open Source Analytics member

In fe5cddd: refs #4179 display notifications in admin where they used to be displayed and use same font size

@tsteur
Piwik Open Source Analytics member

In 80bce10: refs #4179 throw errors if invalid params given, handle close event

@tsteur
Piwik Open Source Analytics member

In 1cda21f: refs #4179 handle toast notifications

@tsteur
Piwik Open Source Analytics member

In 3068233: refs #4179 set default type to transient

@tsteur
Piwik Open Source Analytics member

In e793504: refs #4179 handle persistent notifications

@tsteur
Piwik Open Source Analytics member

In 2a51eb4: refs #4179 better var naming

@tsteur
Piwik Open Source Analytics member

In c46a68e: refs #4179 validate id

@tsteur
Piwik Open Source Analytics member

In d4363aa: refs #4179 escape html attributes

@tsteur
Piwik Open Source Analytics member

In 91160d9: refs #4179 added some documentation

@tsteur
Piwik Open Source Analytics member

In eb7370f: refs #4179 coding style

@tsteur
Piwik Open Source Analytics member

In 442185c: refs #4179 added example

@tsteur
Piwik Open Source Analytics member

In c877300: refs #4179 save notifications until delivered

@tsteur
Piwik Open Source Analytics member

In 38a6c59: refs #4179 fade notifications in

@tsteur
Piwik Open Source Analytics member

In aa1ff54: refs #4179 do not expose the whole class for plugin developers, only the notify method

@tsteur
Piwik Open Source Analytics member

In 5018227: refs #4179 fix title is hardcoded

@tsteur
Piwik Open Source Analytics member

In be25ab0: refs #4179 extract some code into functions, added possibility to place notification in any node by specifying property placeAt

@tsteur
Piwik Open Source Analytics member

In a5ff495: refs #4179 added jsdoc

@tsteur
Piwik Open Source Analytics member

In 14b1a01: refs #4179 added possibility to disable animations and fixed animation

@tsteur
Piwik Open Source Analytics member

In 076c4ee: refs #4179 as we do not get the notification id in the iterator, the cancel of all notification did not work

@tsteur
Piwik Open Source Analytics member

In 867da50: refs #4179 code cleanup

@tsteur
Piwik Open Source Analytics member

In 2fe4063: refs #4179 improved UI in admin and added possibility to define links in message

@tsteur
Piwik Open Source Analytics member

In b2a59cc: refs #4179 use new notification system to display notification

@tsteur
Piwik Open Source Analytics member

In b7109c4: refs #4179 use notification to display plugin successfully activated message

@tsteur
Piwik Open Source Analytics member

In d3c0212: refs #4179 use a twig filter to generate html for notification so it is reusable

@tsteur
Piwik Open Source Analytics member

In 167c9f0: refs #4179 make sure it works with 1024px screen width

@tsteur
Piwik Open Source Analytics member

In 024d784: refs #4179 fix property should be lowercase otherwise it does not work with data attribute

@tsteur
Piwik Open Source Analytics member

In 000e6c2: refs #4179 make sure notification class is unique, use an inline notification

@tsteur
Piwik Open Source Analytics member

In 02917cb: refs #4179 better id skip

@tsteur
Piwik Open Source Analytics member

In 755583f: refs #4179 removed some unused styles skip

@tsteur
Piwik Open Source Analytics member

In 7d5058f: refs #4179 display notifications below report menu

@tsteur
Piwik Open Source Analytics member

In 79157be: refs #4179 fix notifications are not displayed on sites like AllWebsites, Widgets and API

@tsteur
Piwik Open Source Analytics member

In d14feb0: refs #4179 set noClear flag by default

@tsteur
Piwik Open Source Analytics member

In f619427: refs #4179 do not set a default priority, detect it by type by default

@tsteur
Piwik Open Source Analytics member

In ed14857: refs #4179 added possibility to scroll to notifications and close notification if there is one having same id

@tsteur
Piwik Open Source Analytics member

In ac7ef82: refs #4179 added some notification examples

@mattab
Piwik Open Source Analytics member

Great new feature for developers!

is there any work left before closing this ticket?

@mattab mattab added this to the 2.0 - Piwik 2.0 milestone Jul 8, 2014
@tsteur tsteur was assigned by mattab Jul 8, 2014
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 started to work on notifications 7b5943a
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 set default properties 98fa154
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 render a list of notifications so they can be rendered by …
…javascript
7c4d56e
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 parse notifications c7ffd57
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 render a simple dom node for each notification 2220899
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 added some less definitions a208bf4
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 fix notification is floated b134848
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 we do not support icons for now 93282a8
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 handle options like title, noclear, message, ... 1cebbce
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 sort notifications by priority d99772c
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 display notifications in admin where they used to be displ…
…ayed and use same font size
fe5cddd
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 handle toast notifications 1cda21f
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 set default type to transient 3068233
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 handle persistent notifications e793504
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 better var naming 2a51eb4
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 validate id c46a68e
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 escape html attributes d4363aa
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 added some documentation 91160d9
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 coding style eb7370f
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 added example 442185c
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 save notifications until delivered c877300
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 fade notifications in 38a6c59
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 do not expose the whole class for plugin developers, only …
…the notify method
aa1ff54
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 fix title is hardcoded 5018227
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 extract some code into functions, added possibility to pla…
…ce notification in any node by specifying property placeAt
be25ab0
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 added jsdoc a5ff495
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 as we do not get the notification id in the iterator, the …
…cancel of all notification did not work
076c4ee
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 code cleanup 867da50
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 improved UI in admin and added possibility to define links…
… in message
2fe4063
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 use new notification system to display notification b2a59cc
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 use notification to display plugin successfully activated …
…message
b7109c4
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 use a twig filter to generate html for notification so it …
…is reusable
d3c0212
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 make sure it works with 1024px screen width 167c9f0
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 fix property should be lowercase otherwise it does not wor…
…k with data attribute
024d784
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 make sure notification class is unique, use an inline noti…
…fication
000e6c2
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 better id [ci skip] 02917cb
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 removed some unused styles [ci skip] 755583f
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 display notifications below report menu 7d5058f
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 fix notifications are not displayed on sites like AllWebsi…
…tes, Widgets and API
79157be
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 set noClear flag by default d14feb0
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 added possibility to scroll to notifications and close not…
…ification if there is one having same id
ed14857
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4179 added some notification examples ac7ef82
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment