Commit graph

12 commits

Author SHA1 Message Date
Moriel Schottlender 4bbaf77c2a Change the naming of 'notification option' to 'notification item' widgets
This is in preparation of adding more item models and widget types,
and in preparation of switching the notification widget away from being
a select widget.

Change-Id: I518fb3d80f4f67d677c21ca5593638269acfa544
2015-11-19 16:52:04 -08:00
jenkins-bot 14a5bc371d Merge "Add browser test for notifications in Echo" 2015-10-13 17:29:02 +00:00
Roan Kattouw 877e621a6a Fix various bugs in mw.echo.Logger and its callers
* Fix typo that caused logInteraction() to never do anything
* Fix incorrect context parameter passed by NotificationBadgeWidget
* Consistently use mw.Echo.Logger.static.context.* constants for the
  context parameter everywhere

Bug: T114833
Change-Id: I140e4222169ad9e78c6bf016d9765828513adcbb
2015-10-08 15:20:31 -07:00
Moriel Schottlender f9e8c5057c Log notification impressions and clicks
This logging was taken out by accident during the split notifications
rewrite.

Bug: T114833
Change-Id: I7672c20bb12e06f3efc63763aacbe81fd0f34ece
2015-10-06 23:15:56 +00:00
Moriel Schottlender 8b2c6355cc Add browser test for notifications in Echo
This browser test checks that mentions go to alerts and talk page
messages go to messages popup. This also upgrades the MW-Selenium
version in Echo tests to 1.6.1.

Depends on MW-Selenium version 1.6.1 (See T114061)

Bug: T113081
Change-Id: I40a17500cdfb838420c04dc0b9268ba56515cc2c
2015-10-04 22:23:51 -07:00
Moriel Schottlender 287d383acf Initialize 'mark as read' button hidden unless needed
Only show the button if the notification is unread and also not
markReadWhenSeen.

Bug: T113629
Change-Id: I68c6bc43a9e5996e9c8377f36f07cfe430d6e5e6
2015-09-30 11:36:41 -07:00
Moriel Schottlender 9514aa01ab Remove 'initiallyUnseen' class when the popup closes
The popup automatically updates itself every time it is opened.
If there are unseen notifications, they should be updated when the
next fetch happens, which means we must take off that class so
that the animation doesn't repeat itself.

Change-Id: Ib4173631efa1c5a3a3509e0797e60397397bd009
2015-09-23 16:58:57 -07:00
Moriel Schottlender d67e474d46 Correct unseen animation in notifications
The unseen animation should display whether the option is unread or
read, because it should point out notifications that were unseen/new in
this session even if they are immediately marked as read (in cases
where the configuration is 'mark read when seen', like in alerts).

However, the animation itself switched by default to white background
which is an 'unread' state. This made cases like "mark all as read"
mark the notifications as read but still have a white background as
if they are unread, and yet have no 'x' button because they are actually
read. (Bear with me here)

This commit organizes the animation better. We now have a proper clear
naming for the two animations - unseen-to-read and unseen-to-unread and
we use unseen-to-read as default. unseen-to-unread is used when
the -unread class is applied and the other cases should reflect the
correct state of the option read/unread status.

Bug: T112826
Change-Id: I7fe8ea5dcf8c3e31d16213313be34b2350d03655
2015-09-18 11:02:38 +00:00
Moriel Schottlender bfd27ae712 Wrap notifications with a link for native click behavior
Remove the behavior of the SelectWidget 'choose' and instead wrap
the notifications with their primary url links. That way, the click
handler returns to browser native response, and we gain automatic
behavior for ctrl+click, middle click, and regular click.

CSS had to be adjusted as well.

Bug: T112004
Change-Id: If10a4d3be71a8cf3ce966f15b922da0b9a2ddcc7
2015-09-11 09:48:00 -07:00
Moriel Schottlender fc2711ebc4 Create an 'initiallyUnseen' class for initially unseen notifications
This is so that the animation definition remains on the notification even
after it is marked as seen.

Change-Id: Ifd19cd5cd003a4e29d0c42788d51aca985e0b859
2015-09-03 15:37:02 -07:00
Moriel Schottlender f6a12f1051 Correct 'primaryLink' to 'primaryUrl' everywhere
Change-Id: Id42940460f7825541f9bc6e65ff864035591f47e
2015-09-02 16:59:55 -07:00
Moriel Schottlender 1ac72cc01a Split alerts and messages in Echo
Split the notifications into 'alert' and 'message' badget with two
different flyouts. Also clean up styling and module behavior.

** Depends on ooui change Id4bbe14ba0bf6c for footers in popups.
** Depends on ooui change Ie93e4d6ed5637c for fixing a bug in
   inverted icons.

** MobileFrontend must also be updated to support the new modules
   in this patch  I168f485d6e54cb4067

In this change:
* Split notifcations into alert and messages and display those in
  two different badges.
* Create two separate flyout/popups for each category with their
  notifications.
* Create a view-model to control notification state and emit events
  for both the popup and the badge to intercept and react to.
* Clean up module load and distribution:
  * Create an ext.echo.ui module for javascript-ui support and ooui
    widgets.
  * Create an ext.echo.nojs module that unifies all base classes that
    are needed for both nojs and js support, that the js version
    builds upon.
  * Create a separate ext.echo.logger module as a singleton that can
    be called to perform all logging.
* Clean up style uses
  * Move the special page LESS file into nojs module so all styles
    load properly even in nojs mode.
  * Transfer some of the styling from JS to LESS for consistency.
  * Make the 'read more' button load already with the styles it
    needs to look like a button, since its behavior is similar in
    nojs and js vesions, but before its classes were applied only
    by the js, making it inconsistent and also making its appearance
    'jump' from a link to a button.
* Delete and clean up all old and unused files.
* Moved 'Help.png' icon from modules/overlay to modules/icons for
  later use.

Bug: T108190
Change-Id: I55f440ed9f64c46817f620328a6bb522d44c9ca9
2015-09-02 15:36:37 -07:00