Commit graph

398 commits

Author SHA1 Message Date
Moriel Schottlender 4b7520af90 Display readable API error message
If an error has occurred while fetching from the API, the
placeholder item should display the API error information.

If the error is specifically a login issue, a specific
error message is displayed.

Also, adjusted the mw.echo.ui.PlaceholderItemWidget to
accept a clickable link; when valid (currently only with
login error) the link is applied so the user can click
the notification and be taken to the login page.
For general notices (like API error or a general 'no
notifications found' message) the link does nothing.

Bug: T121923
Change-Id: I89a43c7c0eb2cf8e63d03704536e0938ab57dd4d
2015-12-22 10:34:01 -08:00
Justin Du d62649e62c Clarify link and revert icons on notifications
Bug: T121624
Change-Id: I0bd1121226b655f82d6a4d46e8c5547ef4726cc2
2015-12-17 20:04:33 +00:00
Justin Du 889dcc6584 Use the double speech bubble icon in the Messages panel
Bug: T119377
Change-Id: Icc7d751ef307fab9f8914728aac229fa28f1a860
2015-12-16 18:02:48 -06:00
Moriel Schottlender a4659baec5 Add OOUI widgets for cross-wiki bundled notifications
* Add the ability to use bundled expandable
  notification groups
* Display bundled cross-wiki notifications following
  the design

Bug: T115419
Bug: T115423
Bug: T115422
Change-Id: I8c3eba6d627c3f06d51d74fc9774e3fc2d02915d
2015-12-14 17:22:34 -08:00
Kunal Mehta 479d7a2dd9 Add support for cross-wiki notifications to Schema:EchoInteraction
Adds support in the logger code that is unused for now.

Note that I9bf6f4bcd41d8da5 must be deployed before this can be used on
Wikimedia sites.

Bug: T120158
Change-Id: I1968f36e21139975d25231ac25c22a73dea6fd0d
2015-12-10 10:07:20 -08:00
Kunal Mehta 2892108b65 Special:Notifications formatter
I'm not really sure where to stick the primary link. I could wrap the
entire notification in a <a> tag, but all the text becomes ugly (I
suppose we could hack around it with CSS?). For now I just added it
before all the secondary links.

Change-Id: I4f6add9ecfb367660d1a6346825382ad415bdb77
2015-11-25 10:22:04 -08:00
Moriel Schottlender 7d419bd128 Add a global overlay to Echo
This is preparing for nested popups inside the master popup.

Change-Id: I3bb86acd1bf841d5b27018565f5aa8f4a3295d9d
2015-11-23 18:47:57 +00:00
jenkins-bot 7a68a05083 Merge "Prevent link color on hover for the body ("payload") as well as the header" 2015-11-20 23:39:37 +00:00
jenkins-bot acdcdb29f0 Merge "Remove styling for nonexistent mw-echo-title-heading class" 2015-11-20 23:38:58 +00:00
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
Moriel Schottlender 24a8bc23ef Add a NetworkHandler as a central API authority to Echo
This is in preparation for dealing with cross-wiki notifications
where we may need several types of operations to extract bundled
notifications from local and external APIs.

Also, renamed files:
* mw.echo.dm.AbstractAPIHandler -> mw.echo.dm.APIHandler
* mw.echo.dm.APIHandler -> mw.echo.dm.LocalAPIHandler
* All API-related handler files moved to their own folder
  for better organization.

Change-Id: Ib730c780ea52c93a6026c5d0b22012b6f39bb50d
2015-11-19 15:25:03 -08:00
Roan Kattouw c8d0115fd5 Prevent link color on hover for the body ("payload") as well as the header
Change-Id: Id221af75ed76122b03f741c184053e73bd2f4ee5
2015-11-18 20:10:40 -08:00
Roan Kattouw 8e46160210 Remove styling for nonexistent mw-echo-title-heading class
Change-Id: Ia1ce2889ec0e740d0fcc7d49809d5c64d24a696c
2015-11-18 20:07:53 -08:00
jenkins-bot b46fcf57b3 Merge "Separate skin specific styles and improve Monobook appearance" 2015-11-11 02:18:59 +00:00
Ed Sanders 219b3d8b28 Separate skin specific styles and improve Monobook appearance
Bug: T112290
Change-Id: I1e73c92c69cf6df7c4d08b27a392f9c9bc19446f
2015-11-10 17:57:44 -08:00
Moriel Schottlender 02530f19e1 Implement SortedList in Echo notifications
This is especially important for combined notifications and
notification lists from different sources; the model list should
be sorted to reflect items by timestamp and unread status.

Note: The dm.List and dm.SortedList now mirror the structures
OO.EmitterList and OO.SortedEmitterList that are awaiting to be
added for oojs in Ib94e4e4a49 and  I3fd569691549 respectively.
Once those are available, the dm.List and dm.SortedList can
be removed, and the model can mixin OO.SortedEmitterList instead.

Change-Id: I97e1ecbe5dccc478be527a94f037500f78f74b14
2015-11-06 11:01:10 -08:00
Moriel Schottlender f4deb6829c Allow notification model and widget to show combined notifications
Make sure it's possible to create a combined notification widget
that features both alerts and messages.

Change-Id: I4b3f263039f54430a61acc1a261d8aca8e894a90
2015-11-06 18:50:06 +00:00
Moriel Schottlender 44c2afbfee Initialize notifications model outside of the widget
Change-Id: I19c239326b04eaa07b62e0b06f181c86ff0a0ef8
2015-11-06 10:49:11 -08:00
jenkins-bot 188310641a Merge "Add an APIHandler to Echo notifications" 2015-11-05 19:57:43 +00:00
Moriel Schottlender 61f75f4c1e Make 'x' button in notifications bigger
Bug: T112217
Change-Id: Id645a14406accb006736df038fab667cdd9aabd1
2015-11-05 19:44:24 +00:00
Moriel Schottlender 466858bbe8 Add an APIHandler to Echo notifications
This simplifies the operation of the API a bit, but more importantly
this will let us create a demo where we can manipulate the API result
and test various new notification formats while the work on the
backend API responses is ongoing, and also will allow us to have a
constant test for all notifications types, including backwards
compatibility.

Change-Id: I6081329a287cda4f5f1f1604ace5d04ff8d9fe3d
2015-11-05 10:50:03 -08:00
Moriel Schottlender c3787f4c51 Don't mark read notifications as unseen
If a notification is already read it is by definition seen. Don't
mark those as unseen. This can actually happen if our seenTime is
invalid (like a cache miss)

Change-Id: Id943691599116597b6c68d2cc40e7b89a25ce05e
2015-11-03 15:34:09 -08:00
Moriel Schottlender c4ad851fc3 Prep for mobile rewrite in Echo
Fix event documentation and add mobile target for ext.echo.ui

Change-Id: I86131293ec83359fa2dc6eaccf35a2824e0cf051
2015-11-03 14:51:20 -08:00
jenkins-bot 14a5bc371d Merge "Add browser test for notifications in Echo" 2015-10-13 17:29:02 +00:00
jenkins-bot 8feb8212ce Merge "Override footer buttons hover color in Modern" 2015-10-09 06:29:22 +00:00
Moriel Schottlender 9f1bedda1c Override footer buttons hover color in Modern
In Modern, the hover color for links in the #p-personal bar is
white, which is unhelpful for the buttons in the popup. Override
that style for hover.

Bug: T114080
Change-Id: I8b739f2a46c3eb3ce9f61e92b5025751047a451d
2015-10-08 16:28:30 -07: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
jenkins-bot bb89634306 Merge "NotificationBadgeWidget: Fix alignment of actions buttons" 2015-10-08 21:49:24 +00:00
Ed Sanders 017ee20365 NotificationBadgeWidget: Fix alignment of actions buttons
Making padding equal on either side, and use display:block
to avoid extra space underneath.

Bug: T115052
Change-Id: Icddb755cfe8892422661712d35eda4f01441207d
2015-10-08 21:15:54 +00:00
Roan Kattouw cacccc307a Follow-up f9e8c5057, 983c7a2463: fix JS error when there are no notifications
We have to account for the placeholder item, which doesn't have a
getModel method. We should ensure the real items and the placeholder
item implement a common interface so we don't need these kinds of
checks all over the place.

Bug: T114853
Change-Id: Iff6f0e85fb7737e09a34e72038b6b41681d95595
2015-10-07 08:20:35 -07:00
Roan Kattouw 983c7a2463 Follow-up f9e8c5057: fix JS error
Bug: T114833
Change-Id: I73d37a0688165125db56c1d6c088f215b19f421e
2015-10-06 18:24:14 -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
Siebrand Mazeland 33126b69aa Update formatting
In preparation of Code Sniffer based updates.

Change-Id: Id5d43332b44a37665d57dc24ef8c432bc65b2f6a
2015-10-03 23:28:54 -04:00
Moriel Schottlender 29e7bd568d Add a comment to counting unread page notifications
Change-Id: Ic2cd5e06ddf926da9fe9c924e5f46e0e4601fde9
2015-10-01 13:35:35 -07:00
Roan Kattouw 545b9c170b Fix lowercasing and bolding of text in popups in Modern skin
There was CSS trying to counteract this, but it wasn't strong
enough to override Modern's styles.

Bug: T114080
Change-Id: I96d9b32353fbabc8f720ecb869904639009c894f
2015-10-01 12:04:14 -07:00
Moriel Schottlender 55e9d8e819 Remove orange bar when all talk notifications are read
Don't just remove it when all notifications are read, but when all
specifically talk notifications are read even if there are other
unread notifications in the popup.

Change-Id: I5aa65a4060d64f374b47fe91d8e53c92ded5fab2
2015-10-01 10:56:40 -07:00
jenkins-bot d27daff8cb Merge "Initialize 'mark as read' button hidden unless needed" 2015-09-30 20:31:56 +00:00
jenkins-bot a2741d9eb2 Merge "Also override Modern's :hover styles" 2015-09-30 20:27:09 +00:00
Moriel Schottlender f6c9e68577 Mark notifications as automatically read only after the popup loads
We've corrected this behavior for updating seenTime but not for setting
the notifications as read if the widget is configured as
'markReadWhenSeen' which produced unexpected issues with updating alerts.

This is fixed in this commit.

Change-Id: I4d2420a81d2b8409749ad1621b2d56bdd14e8c6e
2015-09-30 11:42:53 -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
Kunal Mehta bae6ac30b8 Also override Modern's :hover styles
Modern has duplicated styles for `#p-personal li a` and
`#p-personal li a:hover`, so duplicate our styles too to make sure they
fully override Modern.

Bug: T114080
Change-Id: Ib3da29532e9f0939379f3988a629bd6b7b1fabb8
2015-09-30 11:25:59 -07:00
Roan Kattouw d15615ea89 Close popup when badge is clicked
Bug: T114106
Change-Id: I9c1e9bb9826bd301bff8f80bedee011184843f72
2015-09-29 17:02:48 -07:00
Roan Kattouw 07754e8b71 NotificationBadgeWidget: Fix button icon positioning for change in OOUI
OOUI now uses absolute positioning for these icons, which breaks
the centered text model we'd like to use. Longer-term we should
use a different widget for these buttons, or perhaps a widget of
our own, but for now let's hack around that by undoing the
absolute positioning.

Change-Id: I8cc1fd69eeedde00facec80d82a21d5cc5610992
2015-09-29 16:23:10 -07:00
jenkins-bot 156dad4faf Merge "Fix Echo popup alignment in RTL" 2015-09-29 23:10:08 +00:00
Moriel Schottlender 16ddd5c7d7 Fix Echo popup alignment in RTL
Bug: T114184
Change-Id: I2b2b8c332efbcf0e646bf77f688433559da7b628
2015-09-29 16:05:31 -07:00
Moriel Schottlender 44bf7ac839 Do not reset an option that has no reset method
The placeholder method has no reset, skip it when resetting the
options.

Change-Id: I4936c5c9dde870b574b035384abcdf0b746d9b4a
2015-09-29 15:58:34 -07:00
Moriel Schottlender e0cd881aeb Mark all read button should always start invisible
Whether the button should appear or not is updated when the badge
is updated, based on having unread notifications. But during construction
the button should be hidden.

When we do update the badge, the button should only appear if there
are unread messages and if the current widget is not 'markReadWhenSeen'
to avoid having the button 'flash' while notifications are marked
read.

Bug: T113629
Change-Id: I002db9e3d8990b5a2cd67bf5d120b1c7eb454362
2015-09-28 20:37:01 +00:00
Moriel Schottlender 3ea86361a4 Rewrite browser tests for Echo
The new oouified echo popup makes the tests invalid; this commit
rewrites those tests.

Also by doing this commit we are upgrading to Selenium 1.4.

Change-Id: I26215558768d55be449276c55b4b745c3a458ecb
2015-09-25 15:50:59 -07:00
jenkins-bot a206bdd9ef Merge "Make middle-clicking badge work" 2015-09-24 23:16:07 +00:00