Commit graph

561 commits

Author SHA1 Message Date
Justin Du 2c90793c41 Use new trash icon
*On deletion-related notifications

Bug: T125785
Change-Id: I9c23898ddc7bab70b069a03a2633c750a08a1740
2016-02-04 22:45:43 -06:00
Stephane Bisson 779b7030d9 Truncate usernames, titles and excerpts in notifications
Bug: T121822
Change-Id: Ia0a52926133ab7e04d7d9c2a095ef8f9d0871a49
2016-01-29 07:04:23 -05:00
Moriel Schottlender 3ece6b00c2 Hide 'mark as read' secondary button from foreign x-wiki bundles
Bug: T125155
Change-Id: I89a5eeb87ccfb875fa33dfac6d0a6b4df62699d3
2016-01-28 15:07:10 -08:00
jenkins-bot e28a912c3b Merge "Add 'mark as read' as secondary action to unread notifications" 2016-01-26 16:37:11 +00:00
jenkins-bot 73623d88b0 Merge "Truncate notification action button text" 2016-01-25 20:13:38 +00:00
Moriel Schottlender df3417e49c Fix table layout width for bundled notifications
Bug: T124023
Change-Id: I9b49ce5f066d93a6572c2dc5a859284a4ab182d4
2016-01-21 17:04:58 -08:00
Moriel Schottlender a85561d3d8 Create a specific message for CORS failure in cross-wiki API request
Bug: T123797
Change-Id: I877c826a5571fb1f664af496b9b3469aa24884f6
2016-01-21 15:03:39 -08:00
Moriel Schottlender 79ac8be7fd Truncate notification action button text
Bug: T123657
Change-Id: I995c3383e7b465849773e4deaaa0d4a14524f6ac
2016-01-21 13:18:28 -08:00
jenkins-bot ff5c8b4172 Merge "Revert "Follow-up 88d6f01c33: postpone greying out notification bodies for now"" 2016-01-21 19:57:14 +00:00
Moriel Schottlender 5c67c9110f Add 'mark as read' as secondary action to unread notifications
Bug: T121935
Change-Id: I0dda7335ba00492c5dc5a6f0e9f2faea1da612bc
2016-01-21 11:34:27 -08:00
Sbisson d2158aa70d Revert "Follow-up 88d6f01c33: postpone greying out notification bodies for now"
T121950 is merged.

This reverts commit 1b1fb5b9c7.

Change-Id: I8a02d485be2f54762fc32b3a82ef2cae16d371c5
2016-01-21 14:55:02 +00:00
jenkins-bot 9c57b20336 Merge "Set text color on header directly, not on <a>" 2016-01-19 03:23:47 +00:00
Pau Giner 419eb4e2e2 Tweak link-blue and revert icons
Make link-blue a bit bigger, revert a big smaller,
and change the blue used in link-blue.

Bug: T121624
Change-Id: I13d8667b4f2173c587330e1fc4604aa9f5632480
2016-01-18 18:59:46 -08:00
Roan Kattouw aa899d63d6 Set text color on header directly, not on <a>
The rules setting the text color on the <a> with
various strong specificity overrides were unnecessary.
Instead, simply set the text color on -header.
This also makes the text color apply if there is no
primary link, because there is no <a> in that case.

Bug: T123756
Change-Id: I02c7d28438678968fa64a59beeac3d8d26cb0702
2016-01-18 18:26:13 -08:00
Justin Du 7b5cf41e37 Adjust layout for new notification panel designs
Bug: T122646
Change-Id: I6cb6d121eb7e32737b1d73743061e1435e869c93
2016-01-18 18:00:14 -08:00
jenkins-bot 8e808fed77 Merge "Organize items in bundles with CSS table layout" 2016-01-19 01:04:11 +00:00
Moriel Schottlender 3472070b2b Organize items in bundles with CSS table layout
This will make the "flat" positioning of the bundle items a lot
more consistent and organized.

Bug: T121933
Bug: T123762
Change-Id: I472fcc89e540f1a886168069c547c6dc7e5ce613
2016-01-18 16:59:29 -08:00
Justin Du e02c06a46f Don't blur talk icon echo notifications
Keep padding around the icon at 0.5em on the left and 1em
on the right for now; we'll change this soon to make the
icon centered.

Bug: T123656
Change-Id: I8c04daee460dd72e2358c3aa315110e05a9a5312
2016-01-18 16:14:18 -08:00
Roan Kattouw d280df9a5b Fix content text alignment in GroupItemWidget
And add comments explaining what's going on.

Change-Id: I78700493e0eec922f1a9e95f397f0bf994a7cdde
2016-01-18 15:50:40 -08:00
Roan Kattouw ba61177e8a Follow-up 27092b7ae: add missing .prototype
Change-Id: Ie176bb98864f1ae755f0086eb1a55180a6b1635f
2016-01-18 15:37:05 -08:00
jenkins-bot c826294f30 Merge "Hide 'mark as read' for foreign NotificationGroupItem bundles" 2016-01-18 23:23:19 +00:00
Moriel Schottlender 27092b7ae9 Hide 'mark as read' for foreign NotificationGroupItem bundles
As a product decision it was decided that foreign notifications
cannot be 'mark all read' for their internal items.

Bug: T121930
Change-Id: I79292401b69adc4fad601192009296e02e8410b5
2016-01-18 15:17:57 -08:00
Roan Kattouw 76c550e018 ActionMenuPopupWidget: Close correctly when button is clicked
Bug: T123754
Change-Id: Ie0d97b820cd53c0cb09f6f998d49dc23d443d849
2016-01-18 15:01:17 -08:00
Roan Kattouw 10c4ff5f50 Reorganize NotificationBadgeWidget.less
Make the footer rules block a sibling of the header and body blocks.

Change-Id: I00f14d8a8a34987da059f7e915ffaa98b8136bf4
2016-01-18 14:32:36 -08:00
Roan Kattouw b80af26409 Set opacity:0.8; on the buttons in the footer of the notification popup too
Bug: T119378
Change-Id: I061d06dc13886618434b7022fc84f59feeaa426e
2016-01-18 14:28:19 -08:00
jenkins-bot a5e2466db4 Merge "Avoid pure black icons in Notification Panel" 2016-01-18 22:08:16 +00:00
jenkins-bot 4c910f87bc Merge "Mark bundles as read except when it is automatic" 2016-01-18 22:06:12 +00:00
Roan Kattouw 9042aa6c29 Remove unused icon files
Change-Id: Ifb698f62e5cae51bc73c5592fee9e8dee399ffe8
2016-01-18 12:55:48 -08:00
Moriel Schottlender 902aec4a38 Mark bundles as read except when it is automatic
Make sure bundles can be marked as read by marking their sub-items
as read in the UI and also in the API.

However, for automatic 'mark as read' action (like the one that happens
when the model is "markReadWhenSeen") make sure to not mark-as-read
the bundles automatically.

Bug: T121930
Change-Id: I9d6bf6904fa3ca6559370e58853d29069f55af9e
2016-01-18 12:07:20 -08:00
James D. Forrester 607c8b76b4 Crush all SVGs with svgo
Change-Id: I5dddfcb7cb9587b277de4253d4708da28f885821
2016-01-15 17:05:17 -08:00
Roan Kattouw 3c543215aa Use globe icon for cross-wiki bundle
Bug: T123757
Change-Id: Ib97c0abb43aacba19e6b8d8a329c836e332927a2
2016-01-15 16:43:14 -08:00
jenkins-bot 51246dc130 Merge "Use 'next' as the default icon for secondary actions" 2016-01-15 20:47:10 +00:00
Roan Kattouw c345bef598 Add icon to "View changes" secondary links
Bug: T121736
Change-Id: I7dda877c26c99392c17702265380f4ea2a6e8049
2016-01-14 22:53:51 -08:00
Roan Kattouw 90c7055439 Use 'next' as the default icon for secondary actions
This ensures we always render an icon, even if there isn't one defined.

Bug: T121957
Change-Id: Iefd3c8778ed8aecb7f8caebeaed98121186602e2
2016-01-14 18:00:01 -08:00
jenkins-bot 7bbd9dc9f5 Merge "Replace review icon" 2016-01-15 01:42:45 +00:00
Justin Du 5205d1ab4d Replace review icon
Bug: T121735
Change-Id: Ia2fc92e168bfafcccd05172de2fbdde3bed0bca6
2016-01-14 17:37:11 -08:00
jenkins-bot 9291cef3a6 Merge "Replace Talk icon with new chat icon" 2016-01-15 01:36:18 +00:00
Justin Du 16297ea72f Replace Talk icon with new chat icon
Bug: T121735
Change-Id: I9ecd019ce494cdbcade258e2f590540a1ca97586
2016-01-14 17:21:45 -08:00
jenkins-bot 33fe9a0038 Merge "Cross-wiki notifications integration" 2016-01-15 01:15:42 +00:00
haritha28 ddc3280c9d Avoid pure black icons in Notification Panel
The pure black icons which drew too much
attention when they are next to a lighter
text is changed by controlling the opacity
of the icons.

Bug: T119378
Change-Id: I2e6c8d47187621607a915e49cfe5380c744efe56
2016-01-14 18:53:28 +05:30
Justin Du 7d2a15d3bc Clarify some notification icons
* edit-user-talk
* mention
* user-rights
* emailuser

Bug: T121735
Change-Id: I72e382b9ff9d19c6acc0df507fdff65732b66450
2016-01-13 14:00:37 -08:00
Roan Kattouw 63eef35026 Cross-wiki notifications integration
Bug: T121829
Change-Id: Ifb52ad5605a56d27e5951479326689242a49430e
2016-01-13 09:47:57 -08:00
jenkins-bot b0fdb27436 Merge "Follow-up 88d6f01c33: postpone greying out notification bodies for now" 2016-01-12 22:46:17 +00:00
Roan Kattouw 1b1fb5b9c7 Follow-up 88d6f01c33: postpone greying out notification bodies for now
We want to wait until we have done T121950.

Change-Id: I46d37e2c4c9fb719e236ae6af4e2b15dbac7b1ba
2016-01-12 14:38:15 -08:00
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 4300f3e32b Merge "Follow-up d62649e62c: crush and clean up SVGs" 2016-01-11 22:27:39 +00: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
jenkins-bot 4233f09bf2 Merge "Only update seenTime in the local API" 2016-01-11 21:57:14 +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
jenkins-bot fe9db1b78c Merge "Make notification body text lighter" 2015-12-22 14:50:33 +00:00
Moriel Schottlender a7aae23806 Remove read item from counter after it was actually marked as read
We removed the item first from the 'unread' counter and then told
the API to mark it as read. The API, however, wisely first checks
if there is anything *to* mark as read, but by that point, the
unread count is zero, so it gracefully refuses and returns an
empty resolved promise.

That is clearly not the way to go. Remove the read item from its
smart unread counter only **after** it was sent to the API to be
marked as read.

Note: We shouldn't wait for the API promise to resolve to remove
the item from the counter, but the API should run its preliminary
tests before the item is removed.

Bug: T122087
Change-Id: Ia5fc35c7435db8c4742238897da67681cee23c41
2015-12-21 15:13:29 -08:00
Moriel Schottlender 3828f29160 Only update seenTime in the local API
Do not send an update to 'seenTime' to remote wikis; only update
the items that are in the local API.

Bug: T121928
Change-Id: I291ecdb53364327dbdcb769c0d93512eeed3ab29
2015-12-21 10:49:11 -08: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
Roan Kattouw 6c6d283c19 Follow-up d62649e62c: crush and clean up SVGs
Change-Id: I98b158f3ef0ea611e8d0211f7599b798c3e09a4c
2015-12-17 14:16:10 -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
jenkins-bot 55d30ecb26 Merge "Add intermediate metrics for API and ext.echo.ui loading response times" 2015-09-24 23:06:01 +00:00
Kunal Mehta 480f8863c6 Add intermediate metrics for API and ext.echo.ui loading response times
And add a FIXME for our existing metric possibly being wrong if the API
request finishes before the ext.echo.ui module is loaded.

Change-Id: I918187dd276193b7602f60527b423ca06cb7e2d0
2015-09-24 14:33:21 -07: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
Roan Kattouw 6efd060169 Make middle-clicking badge work
* Ignore non-left-button click events on initial badge
* Pass href into OOUI badge widget

Bug: T113555
Change-Id: I963aa5193435c46075df6d7204de335b51ecffd4
2015-09-24 10:35:55 -07:00
jenkins-bot 286aab802d Merge "Remove 'initiallyUnseen' class when the popup closes" 2015-09-24 01:37:37 +00: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 c4485b91a7 Prevent the badge icon from flashing red when updating notifications
If the popup is open, whatever is coming in is immediately 'seen',
so we shouldn't flash the badge as red.

Bug: T112823
Change-Id: I9fe78ed11506de3c82043141f994e1ca96c5880b
2015-09-22 17:24:58 -07:00
Moriel Schottlender 091587142d Replace the orange bar with talk-page link, don't remove it
The orange bar is replacing the 'talk' link; when it is removed, it
should actually be replaced back to being a regular 'talk' page
and not be completely removed from the page.

Change-Id: I930d321952e85ee79acbbd162ab763b4eea63ff1
2015-09-22 15:36:14 -07:00
jenkins-bot 32d8991013 Merge "Move timing.MediaWiki.echo.overlay stats into ext.echo.init" 2015-09-22 21:41:03 +00:00
Kunal Mehta c8eea64259 Move timing.MediaWiki.echo.overlay stats into ext.echo.init
We really only care about measuring the timing of the first click,
because that is the one that loads OOjs UI and fires an API request.

Bug: T113387
Change-Id: Ib37d31b07c45d546c75251a57a848e3ae0f4bf1b
2015-09-22 12:04:35 -07:00
Moriel Schottlender 8bc0c98b6f Remove talk page notification bar if all messages are read
Bug: T106033
Change-Id: I5133896c204be701e0fae582af91c906175f39d1
2015-09-21 12:06:34 -07:00
jenkins-bot 61158920f8 Merge "Replace entire <li> element to produce button and popup separately" 2015-09-19 15:59:19 +00:00
Moriel Schottlender 429b11148b Replace entire <li> element to produce button and popup separately
We need the button to remain a standalone <a> element so it preserves
the exact same styling as the output we're getting from the PHP. the
only way to do this is to create the widget as the entire <li> and then
replace the original.

Bug: T112218
Change-Id: Ib6fd4369d46cb7f37b14675d63bbce9950abcd48
2015-09-19 17:56:29 +02:00
Moriel Schottlender 0e02fb2cde Update the API when a single notification is marked as read
The status changed internally but was never passed to the API.
This commit fixes that mishap.

Bug: T112826
Change-Id: I1a6d2a871eae837860eb1f21df28134d5e747cd7
2015-09-18 16:05:35 -07:00
jenkins-bot 09ba053c57 Merge "Correct unseen animation in notifications" 2015-09-18 11:10:09 +00: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
jenkins-bot 1b590d4308 Merge "Show a default message if no notifications are available" 2015-09-17 23:52:48 +00:00
Moriel Schottlender 1474a21d4a Fix a code comment to make it much clearer
Change-Id: Ibd7c1e050f0d0790c1712a950568e3f9b09965ca
2015-09-17 16:43:36 -07:00
Moriel Schottlender 5e8e18ee48 Show a default message if no notifications are available
Bug: T112251
Change-Id: Ia17c50a11ea0a49041795332ba79bd3cbda5b548
2015-09-17 16:25:54 -07:00
jenkins-bot 24d83a8a32 Merge "Make the footer links readable in Modern" 2015-09-17 22:19:52 +00:00
Kunal Mehta 233da11ebd Make the footer links readable in Modern
White on white isn't readable :(

Change-Id: Ie352961048ef9788a53da4b1cfeddd5808284b68
2015-09-17 15:15:54 -07:00
jenkins-bot c64cdbd293 Merge "Handle API fetching errors" 2015-09-17 22:11:14 +00:00
Moriel Schottlender fd0aed5ae4 Handle API fetching errors
Bug: T112251
Change-Id: Ifb9c63cd056b0cc0e7076c73e98155cef445038f
2015-09-17 15:03:28 -07:00
Kunal Mehta 31c770741a Don't depend upon ext.echo.logger in ext.echo.init
The logger code for clicktracking is only needed after something has
been clicked, so we don't need it in init.

* Move EventLogging initialization into Logger.js
* Add ext.eventLogging dependency server-side if needed

Change-Id: I46ff3c62b05c24dd2bb18a1574df17f9d2823125
2015-09-16 12:52:07 -07:00
Kunal Mehta c726c1ecab Measure how likely users open flyout if they have unseen notifications
If users are likely to open the flyout whenever they have unseen
notifications, we should preload some more resources to make those
intial openings faster instead of lazy-loading everything.

On the server-side, we will increment the MediaWiki.echo.unseen metric
whenever we serve a page when the user has unseen notifications. Then on
the client we will increment MediaWiki.echo.unseen.click if they opened
the flyout while having unseen notifications.
By comparing the two graphs, we can determine how likely users are to
click on the flyout whenever they have unread notifications, and how
useful preloading extra resources will be.

Change-Id: I14e9aa7f03d6ef275042b8a2c4cb0e5b5a64c0d7
2015-09-16 10:18:17 -07:00
Moriel Schottlender 8a8d1c4ff9 Adjust margins for the notification badge in MonoBook
Change-Id: Iae8c9a855fa407990548691d46974303fcc77ad9
2015-09-16 17:03:46 +00:00
Moriel Schottlender c5905962ab Only load ext.echo.ui if the user clicks the echo badge
There is no need to load the entire of Echo's ui module (especially
since that includes ooui widgets and their styles) on every page load.
There's only need to load the entire module if and when a user clicks
the Echo notification badge.

Also, make the echo.dm model accept an external fetchNotifications
promise so we can send the API request alongside loading the echo UI
and "feed" it into the DM for processing.

CSS adjusted to make the "jump" between the nojs and the js buttons
seem less jumpy.

Bug: T112401
Change-Id: I516e655ffd198511d694489a0702c5c713a5fd68
2015-09-15 17:11:46 -07:00
Roan Kattouw 5b1fc2b818 Hack around OOUI's icon pack being too large by creating our own
Bug: T112401
Change-Id: Id2a527dc1f4846985beb2cc4d5562a27d5636d55
2015-09-14 22:21:45 +02:00
Roan Kattouw 0c5869c216 Use math to compute badge padding in nojs
More clearly indicates how those numbers get there, and fixes
a discrepancy of 0.02em.

Change-Id: Idbc33878953fda85185cada5550f99a1076b9036
2015-09-14 18:47:29 +02:00
Roan Kattouw b046a1062d Don't load oojs-ui.styles on every page
We don't really need it to render the no-JS version
of the notification badges (the only rule we were missing
was background-repeat: no-repeat;) and it significantly
increased the amount of render-blocking CSS.

This means we do need to call setupOOUI() ourselves
in order for our get_class( OOUI\Theme::singleton() ) hack
to keep working.

Bug: T112401
Change-Id: I148f8ac19dfe62cc84abe03e1a2ff00683d515c1
2015-09-14 12:38:44 +02:00
jenkins-bot d72a235854 Merge "Fix vertical alignment of 'Mark all as read' button" 2015-09-13 19:19:34 +00:00
jenkins-bot c73d29e324 Merge "Don't clear notifications when refetching" 2015-09-12 10:51:17 +00:00
jenkins-bot bfe49365db Merge "Link directly to notification preferences in flyout" 2015-09-11 17:53:51 +00:00
jenkins-bot 3b58c3985f Merge "Let action buttons center align" 2015-09-11 17:07:57 +00:00
jenkins-bot 158cab5c24 Merge "Wrap notifications with a link for native click behavior" 2015-09-11 17:07:54 +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
jenkins-bot 6de9f78a4d Merge "Make links non-white in the notification popup in Modern" 2015-09-11 16:45:14 +00:00