Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
mattab opened this Issue · 46 comments

2 participants

Matthieu Aubry Thomas Steur
Matthieu Aubry
Owner

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
Thomas Steur
Owner

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

Thomas Steur
Owner

In 98fa154: refs #4179 set default properties

Thomas Steur
Owner

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

Thomas Steur
Owner

In c7ffd57: refs #4179 parse notifications

Thomas Steur
Owner

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

Thomas Steur
Owner

In a208bf4: refs #4179 added some less definitions

Thomas Steur
Owner

In b134848: refs #4179 fix notification is floated

Thomas Steur
Owner

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

Thomas Steur
Owner

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

Thomas Steur
Owner

In d99772c: refs #4179 sort notifications by priority

Thomas Steur
Owner

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

Thomas Steur
Owner

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

Thomas Steur
Owner

In 1cda21f: refs #4179 handle toast notifications

Thomas Steur
Owner

In 3068233: refs #4179 set default type to transient

Thomas Steur
Owner

In e793504: refs #4179 handle persistent notifications

Thomas Steur
Owner

In 2a51eb4: refs #4179 better var naming

Thomas Steur
Owner

In c46a68e: refs #4179 validate id

Thomas Steur
Owner

In d4363aa: refs #4179 escape html attributes

Thomas Steur
Owner

In 91160d9: refs #4179 added some documentation

Thomas Steur
Owner

In eb7370f: refs #4179 coding style

Thomas Steur
Owner

In 442185c: refs #4179 added example

Thomas Steur
Owner

In c877300: refs #4179 save notifications until delivered

Thomas Steur
Owner

In 38a6c59: refs #4179 fade notifications in

Thomas Steur
Owner

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

Thomas Steur
Owner

In 5018227: refs #4179 fix title is hardcoded

Thomas Steur
Owner

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

Thomas Steur
Owner

In a5ff495: refs #4179 added jsdoc

Thomas Steur
Owner

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

Thomas Steur
Owner

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

Thomas Steur
Owner

In 867da50: refs #4179 code cleanup

Thomas Steur
Owner

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

Thomas Steur
Owner

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

Thomas Steur
Owner

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

Thomas Steur
Owner

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

Thomas Steur
Owner

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

Thomas Steur
Owner

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

Thomas Steur
Owner

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

Thomas Steur
Owner

In 02917cb: refs #4179 better id skip

Thomas Steur
Owner

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

Thomas Steur
Owner

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

Thomas Steur
Owner

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

Thomas Steur
Owner

In d14feb0: refs #4179 set noClear flag by default

Thomas Steur
Owner

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

Thomas Steur
Owner

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

Thomas Steur
Owner

In ac7ef82: refs #4179 added some notification examples

Matthieu Aubry
Owner

Great new feature for developers!

is there any work left before closing this ticket?

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