Commit graph

102 commits

Author SHA1 Message Date
Stephane Bisson 60ddc76880 Update page-linked notification text
Bug: T121812
Change-Id: Ie875f105230c8364291a918b869b9c26dbdf1e83
2016-01-12 10:11:31 -08:00
jenkins-bot 99222dc95d Merge "Resized notification panel footer to be the same size as header" 2016-01-12 01:21:44 +00:00
jenkins-bot db9b8fe037 Merge "Log cross-wiki & bundle items impressions and add their source wiki" 2016-01-12 01:19:20 +00:00
Moriel Schottlender d123364035 Log cross-wiki & bundle items impressions and add their source wiki
Bug: T120158
Change-Id: Ibcd1923aaff4e1fd6fb1f54eefbc010122caa398
2016-01-11 17:12:38 -08:00
jenkins-bot edb74b9c63 Merge "Log the expand action of a notification group item" 2016-01-11 22:04:12 +00:00
jenkins-bot ec5107ece9 Merge "Expand group item on click" 2016-01-11 22:00:57 +00:00
mhutti1 033cba15c6 Resized notification panel footer to be the same size as header
Changed footer buttons height to match the headers height.

Bug: T119375
Change-Id: If215f109b74f2a645615fd89b7cbde6b2e6566d3
2015-12-28 13:24:34 +01:00
jenkins-bot 97f64ee855 Merge "Display readable API error message" 2015-12-23 20:18:34 +00:00
Moriel Schottlender 0d8bd17dd9 Log the expand action of a notification group item
Bug: T121945
Change-Id: I171d3e99a5529172177c9ddb9f17429609180321
2015-12-23 11:36:29 -08:00
Moriel Schottlender c387ac2a63 Add space between notification item buttons
Bug: T121955
Change-Id: Ica5123193ee6fc5252e27cdf3214072c6b9c3624
2015-12-23 09:32:22 -08:00
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
Matthias Mullie 089d922ac7 Use UTC timestamps in flyout
We already output unix timestamp both in user preference timezone as well as
utc, but we only had the user timezone version for TS_MW format.
While we could change the frontend to use the unix timestamp format, I don't see
any reason not to also include the MW format in utc. Frontend can now easily use
that.

Also fixed creation of the moment object. The timestamp was created as UTC, but
the way it got there was wrong: it expects the timezone offset (Z) to be
included in the timestamp, which is not the case (so it just ended up at +0:00,
which was fine, but confusing). I removed the 'Z' and forced it to be
interpreted as utc.

Bug: T121813
Change-Id: I09403615a1ffbde5dd69af9914afdbdd86cbfe4d
2015-12-22 17:07:31 +01:00
Moriel Schottlender 57a746f45f Expand group item on click
Have the group item expand itself not only when clicking the literal
'expand' button, but also when we click the entire item itself, as
if to open the notification item.

Renamed the expanding method so it is not specific for the button
event alone; also renamed the 'toggleExpand' to 'toggleExpanded',
as it toggles the inner 'expanded' state withot the API request
expansion process.

Bug: T121929
Change-Id: Iac23e06d1c17be4e1c5f63663fb0f81261f50070
2015-12-21 08:49:46 -08:00
Roan Kattouw 88d6f01c33 Make notification body text lighter
Use #888 instead of #666 to match secondary link text
(which is #000 with 50% opacity), both in the flyout and
on the special page.

Bonus: use LESS variables for these colors.

Change-Id: Ifc1182a001e9b25f6ff7c213b6fcde3dc2f0acd2
2015-12-18 13:13:22 -08: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
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
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 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 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
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
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
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
Moriel Schottlender e664cb220f Update seen time only if the popup is actually open
The notifications can be populated from the popup and outside of it.
We should update the seen time only if the request came from the popup
itself, and only if it is still open by the time the api request
has finished.

Bug: T113645
Change-Id: Id91ddabb85fd582be1890ea420d0559e0cdca167
2015-09-24 14:23:23 -07:00