Commit graph

857 commits

Author SHA1 Message Date
jenkins-bot af3d0a4b0f Merge "mw.echo.badge: Use 'background-image' rather than 'content'" 2016-08-05 21:58:00 +00:00
jenkins-bot e86a21e1eb Merge "Hack around browser bug in IE breaking badge alignment in Monobook" 2016-08-05 21:53:03 +00:00
Bartosz Dziewoński de795bdbc5 mw.echo.badge: Use 'color: transparent' rather than 'font-size: 0' to hide text
It's a lot easier to set 'color' back to the desired value than 'font-size'.

As an amusing side-effect, the hidden text will appear when selected, and
it will be possible to copy it.

Change-Id: I7a7ef8e60f514743c9cb65bcef3ba4e869f5b7b7
2016-08-05 21:41:41 +00:00
Bartosz Dziewoński 3656c74fd1 mw.echo.badge: Use 'background-image' rather than 'content'
I think everything works the same. Some older browsers (IE 10-11,
Opera 12) have funny issues with SVGs in 'content'.

.mw-echo-notifications-badge now has 'height: 24px', as it must be
at least as high as the background to display it. We no longer need
.oo-ui-popupWidget to have 'margin-top: 7px', that was a workaround
for the badge having smaller dimensions in CSS than in reality.

This also allows us to significantly reduce the amount of Monobook-
specific CSS, because we now use the background-image approach for
all skins.

Bug: T142042
Bug: T142248
Change-Id: Iaa22202dbd5b5eb7a9b1ef47d068e80764ed982f
2016-08-05 14:34:08 -07:00
Moriel Schottlender b02a6e8b26 Log 'mark all read' button click actions
The actions logged:

* Popup: Mark all notifications in the popup as read
  - Event ID is omitted
  - Context 'flyout'
* Special page: Mark all notifications in current wiki
  as read
  - Event ID is omitted
  - Context 'archive'

Bug: T127955
Change-Id: Id7c091f9e0cf0dd3745d33e335ab44706581d7f3
2016-08-05 13:33:47 -07:00
jenkins-bot 23dcba0419 Merge "Don't use a smaller font size for the badge numbers in Monobook" 2016-08-04 23:17:56 +00:00
jenkins-bot ddc4738687 Merge "Remove allTalkRead listener for the messages popup" 2016-08-04 23:14:01 +00:00
Roan Kattouw 300c64ae1f Don't use a smaller font size for the badge numbers in Monobook
Bug: T142149
Change-Id: I1456581625f405512f448c2793c194c5ba199302
2016-08-04 16:04:25 -07:00
Moriel Schottlender df83d1d6dd Skip redundant bundle-id expansion when marking entire xwiki bundle read
When we mark an entire bundle as read, we don't care if it was opened
before or not - we call the API for the list of sources and their items
and build a list of IDs to mark as read in the remote source.

Then, we make sure that bundleIDs are expanded, added to that list.

Previously, we then sent those IDs to 'markCrossWikiItemsRead'
which marked the item IDs in the remote wikis as read.
markCrossWikiItemsRead is also expanding item bundle
IDs (correctly, because we also use it when we mark individual
xwiki items, and they should be expanded)

However, in cases where we mark individual xwiki items, the
model list is already filled, so markCrossWikiItemsRead trusts
the models to deliver the sub items (and then expand on their
IDs properly)

In the case of marking an entire xwiki bundle as read without
opening it first, however, that operation is not only redundant,
it produces a problem where the models were not yet filled
(because the xwiki bundle wasn't opened) and so we get empty
array of IDs, and the API has nothing to mark as read.

The solution is simple in this case - skip this method for working
with an entire bundle. It's both a redundant operation and the
wrong model to check. Send the information directly to the API
instead.

Bug: T142143
Change-Id: I4ed3bbc5c83290ed5791060b124840b1c3b12a75
2016-08-04 22:46:42 +00:00
Roan Kattouw 16d239c516 Remove allTalkRead listener for the messages popup
This fixes a bug where changing the read status of any notification
in the messages popup would remove the "You have new messages"
banner even though there are still unread talk page notifications
in the alerts popup.

Change-Id: Ic6b3d2c9fa764be2da8f9bd9b0d10311857f8509
2016-08-04 13:58:47 -07:00
Moriel Schottlender 9468ff0e1d Don't truncate bundled item content in mobile view
Bug: T140523
Change-Id: I8223d5596825bdd80c3c961576b46c7f2d4654cd
2016-08-04 13:03:35 -07:00
Moriel Schottlender 8d3b4fad2c Round timestamps to the day when displaying date titles in Special:Notifications
Bug: T141915
Change-Id: I5fcb78ac2fa168aa8bba90c467544fe3a6914ec3
2016-08-04 12:58:06 -07:00
Stephane Bisson 3600a271c5 Enable local bundles on mobile
Have the 'bundle' param always
controlled by the controller
instead of configured in the
API.

Change-Id: I08fb7c515f1af28fc01073702b552624cc14f2f0
2016-08-04 10:42:11 -04:00
Roan Kattouw 0b7f8712a9 Hack around browser bug in IE breaking badge alignment in Monobook
A browser bug causes the badges to be pushed down by 1em in IE11
and below, but not in Edge. The only way I could find to work
around this was to add top:-1em; in IE browsers using CSS hacks.

Bug: T142053
Change-Id: If240f7281dd795085c003af524da294d5bf5ff76
2016-08-03 17:08:58 -07:00
jenkins-bot adaccf56e4 Merge "Prevent IE from rendering the badge SVGs ridiculously big" 2016-08-03 22:31:44 +00:00
Roan Kattouw 59db7844e4 Prevent IE from rendering the badge SVGs ridiculously big
Not sure why it's doing that, because the SVG has explicit 24x24
dimensions, but adding these (theoretically unnecessary) CSS rules helps.
In Chrome/FF (as well as more modern IE versions), this is a no-op.

Bug: T142042
Change-Id: Ibb293f453dc79de90690ab48f522e43d3e66b8e8
2016-08-03 15:18:21 -07:00
Stephane Bisson 3b4e4d30a8 Mark all notifications in a foreign bundle as read
Foreign notifications, though non-expandable, can represent
bundles (4 new topics on your talk page). When marking one
as read, it's important to provide all the IDs that are
part of that bundle. Otherwise, only the dynamic base is
marked as read and the bundle shows up again on reload
(3 new topics on your talk page).

For bundles that do not include the count
(The description on Flow_Page was edited multiple times)
it looks like the mark-as-read action did not work.

Tagging with T140309 as it may explain it but not 100% sure.

Bug: T140309
Change-Id: I19c9eb18669b7cad8173c966392a6e5977018121
2016-08-03 17:27:56 -04:00
jenkins-bot 2d390bad2e Merge "Add a footer notice inviting users to visit the Special:Notifications page" 2016-08-03 19:51:08 +00:00
Moriel Schottlender c1e7fc2208 Adjust notification badges for monobook
Make everything a little smaller, decrease spacing. In order to
make the icons smaller, we had to override the content: url(...)
into using background-image with sizing.

Bug: T141923
Change-Id: Icacb15871c824ae845acc937973fb230b05b489a
2016-08-02 16:41:33 -07:00
jenkins-bot dedca66c8a Merge "Implement subject+talk and null+user page grouping" 2016-08-02 22:01:27 +00:00
Moriel Schottlender 75f6c11524 Add a footer notice inviting users to visit the Special:Notifications page
Bug: T141414
Change-Id: I6d9f9db62ecb85e70f72a9eb5a09e8ea1c8eebc2
2016-08-02 13:59:04 -07:00
Roan Kattouw 4e64643eb7 Implement subject+talk and null+user page grouping
Make it optional through the unpgrouppages parameter, so that
generic usage of the unreadnotificationpages API is still possible.

In the front-end, store which display title maps to what set of titles,
and pass in the full set rather than just the display title when
filtering by a page.

Bug: T137502
Change-Id: I443ca00ff5e5d36fd6910101226358942e6aa8ee
2016-08-02 13:48:48 -07:00
jenkins-bot 3be9a2e212 Merge "Update and fetch seenTime per source" 2016-08-02 19:57:12 +00:00
Moriel Schottlender 9e206ef8f5 Reduce number of prioritized actions in mobile
For mobile view, only display 1 prioritized action in the items,
and for general desktop view, stick to the default 2.

Bug: T141788
Change-Id: Ibf386ee598553ecfb717f07f02688034bbc338c8
2016-08-01 16:31:18 -07:00
jenkins-bot 9db03278b8 Merge "Fix fade-in/out animation in sorting" 2016-08-01 22:08:30 +00:00
Moriel Schottlender b5c0b2458d Align popup to center of the new badges
Bug: T141677
Change-Id: I24c1a12f325ca6a432d6fe9cc5635fbde10b1685
2016-08-01 13:57:40 -07:00
Moriel Schottlender f4a955efe9 Fix fade-in/out animation in sorting
The fade in/out animation is asynchronous. This means that if we are
sorting multiple items one after the other, by the time the item faded
out, it will be reinserted back into the wrong position, breaking the
sorting.

This also broke the promise of OO.SortedEmitterList whereby all its items
are always in order.

The way to fix this was to force a better synchronization with the item
order while we hide and show the item in its new place. To do that,
a new widget is created as a fake clone of the old one, in the original
position of the old one. The original item is then reinserted (while hidden)
to the proper location -- preserving order. The fake clone is then faded
out, and the real item is then faded in.

For this to work properly, the cloned item had to preserve some of the
original item's information, like timestamp, foreigness and id. However,
since both the real item and the fake new clone have the same details,
the clone fakes its ID by adding a fraction to it - promising that the
fallback in case of equal timestamps (which happens on the real and
cloned items) will still resolve with some decision about the placement
of the items rather than (falsely but understandably) decide they are
both the same.

Since this whole animation is somewhat of a hack, the list now has a
configuration parameter to turn the animation on.

The animation is on in the popups, but off in the special page.

Bug: T141419
Change-Id: Ic7c35e5ddefc51bf7fde497eab36414b4dddcd9e
2016-08-01 13:49:10 -07:00
WMDE-Fisch 78632108fd Echo notifications for successful mentions
Adds new notification type and icon for successful mentions.
Complements existing test to consider successful mentions.

Bug: T139623
Change-Id: I7a77b40e8b14c95cadb9023065ee916247feacf9
2016-08-01 13:40:55 +02:00
jenkins-bot d80e2a5896 Merge "Remove fixed width from notifications heading" 2016-07-30 00:29:39 +00:00
jenkins-bot 5f04fc334c Merge "Redo the notification badges" 2016-07-29 22:53:34 +00:00
Ed Sanders 72a1f292cf Remove fixed width from notifications heading
Bug: T141627
Change-Id: I7828cf8289baf04718233e8f8f1670670669ecf3
2016-07-29 16:38:50 +01:00
Moriel Schottlender 1553a1a520 Remove 'mark as unread' from dotdotdot menu in items
Bug: T140517
Change-Id: Ie6c0f003239d4a683a1651df9470074668faa4eb
2016-07-28 15:47:42 -07:00
Moriel Schottlender 51331f318a Update and fetch seenTime per source
Also update the seenTime of the remote wikis when opening the
cross-wiki bundle.

Bug: T134855
Change-Id: I10510fc612f7d5349f8b579ede70be647a119470
2016-07-27 17:39:45 -07:00
Moriel Schottlender 9ab351352f Redo the notification badges
Bug: T115845
Bug: T140900
Depends-On: Ic666540d70de52f
Change-Id: I34e2736490319989a3a251a43fbe8080ab960b00
2016-07-27 11:51:05 -07:00
jenkins-bot 0815c41560 Merge "Echo notifications for mention failures" 2016-07-27 11:27:55 +00:00
WMDE-Fisch 868190bbf6 Echo notifications for mention failures
- Adds global "$wgEchoMentionStatusNotifications"
   to activate mention status notifications.
   (must be set before extension is loaded)
 - Adds notification types and icon for some basic mention
   failures.
 - Adds failure and stats for anonymous IP.
 - Adds check for links to user subpages.
 - Adds config var for max mention notifications allowed.
 - Bundles notifications.
 - Refactors test for the event generation and adds tests
   for unknown users, user links with subpages and failures
   for too many mentions.

Bug: T136326
Change-Id: I388bdc3714feb9a2865a5ad10dbeabb0a6a09a4f
2016-07-27 13:00:25 +02:00
Matthew Flaschen c0a464e425 BREAKING CHANGE: More ISO 8601 for seen time
* Add ISO 8601 date format to notification output

  This is actually supposed to be the only output date format used,
  per https://www.mediawiki.org/wiki/API:Data_formats#Timestamps , but
  I'm not doing anything to deprecate the others right now.

* Change wgEchoSeenTime to use ISO 8601.  mwgrep and extension grep do
  not show any usages.  However, since it is a breaking change, to
  minimize disruption, I'm also using this opportunity to change
  'message' to 'notice'.

* Remove wgEchoInitialNotifCount.  I was going to also change 'message'
  to 'notice' here too, but then I saw it was totally unused.
  (It was read in Echo to populate a JS variable, but then it was
  unused.)

* Make sure the Special:Notifications page aggregation by days is
  done by local days, even though the timestamp per item is still
  UTC. This is to make sure the days are displayed correctly in
  the local timezone.

* Change all reverse sorting callbacks to handle comparisons of
  ISO 8601.

Bug: T141413
Change-Id: I20271345c7d350dc3e7f467288e5cdc98e6250cc
2016-07-27 02:42:08 +00:00
jenkins-bot 834c240948 Merge "Adjust mobile view for the new settings cog menu" 2016-07-25 20:12:38 +00:00
Moriel Schottlender 1dd3af10bb Adjust mobile view for the new settings cog menu
Now that we have the cog menu, it should be placed correctly in
mobile and the "preferences" link should be hidden.

Since MobileFrontend doesn't have the personal toolbar, and we
can't cheat by using jQuery and grabbing the url of preferences,
we have to get SpecialNotifications.php to output the urls
to a wg variable and reading it from there.

Bug: T115528
Change-Id: I6a69823d6f75c376c04e9a21d79916321e417178
2016-07-25 19:30:44 +00:00
jenkins-bot 5b7f24b11e Merge "Use body color (gray) for <em>s in bundle headers" 2016-07-25 14:23:13 +00:00
Roan Kattouw ebd995072f Use body color (gray) for <em>s in bundle headers
Bundles only have a header, no body, so when we include excerpts
in bundle headers, we wrap them in <em> tags. This change
makes these excerpts the same color as the excerpts in the
non-bundled case.

Bug: T139960
Bug: T141034
Change-Id: I6a14274b42ba672ab1366c0dd106ea0847db6404
2016-07-22 16:58:39 -07:00
jenkins-bot 53f39017f0 Merge "Follow-up d47f0bd3: only capitalize the first letter of date titles on Special:Notifications" 2016-07-22 23:53:21 +00:00
Roan Kattouw bb09f1f9fa Follow-up d47f0bd3: only capitalize the first letter of date titles on Special:Notifications
Bug: T141092
Change-Id: Ib68c118279b8fe248e8523801a7fd85cc79c2138
2016-07-22 16:43:31 -07:00
jenkins-bot 20dd822284 Merge "Hide the 'preferences' link from Special:Notifications JS" 2016-07-22 22:23:05 +00:00
Moriel Schottlender 4ac79a6253 Hide the 'preferences' link from Special:Notifications JS
In JS version, the preferences link is in the cog menu.

Bug: T115528
Bug: T141141
Change-Id: I18503f1deccf82c9f6580198570822e97f053f9b
2016-07-22 22:10:00 +00:00
Moriel Schottlender d739b89d77 Add a down indicator to the cog menu
As pointed out by Roan, this is the consistent way ooui elements
are displayed when they have a drop-down menu.

Change-Id: I36ecdd4cf6374dff34be15b24959548887788130
2016-07-22 15:06:28 -07:00
jenkins-bot 6fa22b5d49 Merge "Check for local unread talk notifications in alert popup too" 2016-07-22 01:54:32 +00:00
Moriel Schottlender 0431dbf235 Check for local unread talk notifications in alert popup too
Alert popup can now also have talk-page related notifications, so
we should make sure we listen to 'allTalkRead' event when it is
updating as well.

Bug: T141047
Change-Id: I1317efc63b503bd1a55734ebe377ff4c617fe485
2016-07-21 16:18:51 -07:00
jenkins-bot 7d29b6088e Merge "Make Special:Notifications responsive" 2016-07-21 21:07:56 +00:00
Moriel Schottlender 35a5384900 Change 'pt-notification-message' to 'pt-notification-notice'
And change all CSS and JS dependent calls/tags based on the new
tooltip message and ID of the personal tool <li> item.

Change-Id: I136fabe5710f90da10eb8d4afe92acdb77571eec
2016-07-21 11:19:17 -07:00
jenkins-bot e1b2823703 Merge "Add a mark-all-read button and a settings menu to Special:Notifications" 2016-07-21 14:04:39 +00:00
Moriel Schottlender 545d4e67ae Add a mark-all-read button and a settings menu to Special:Notifications
Add a global-wiki 'mark all as read' to the Special:Notifications page.
The 'mark all as read' will makr all notifications in the given
wiki. The context of the wiki changes when filters are chosen,
and so the message of the button changes as well.

Bug: T115528
Change-Id: Ibd9dcdf7072d6cbc1a268c18e558e6d0df28f929
2016-07-20 17:25:38 -07:00
Moriel Schottlender 8a69d86d18 Make Special:Notifications responsive
As a first step for mobile support, make the page responsive,
hide the sidebar, and slightly adjust button/title positions and
sizes so they fit in a small screen.

Bug: T140687
Change-Id: I98f264948a57924f6370a861381456ce9c82f8d8
2016-07-19 15:11:47 -07:00
jenkins-bot 1c7d93ba00 Merge "i18n: Native digits on PageNotificationsOptionWidget and PaginationWidget" 2016-07-19 21:53:38 +00:00
jenkins-bot 47de8691eb Merge "Show placeholder widget when there are no notifications" 2016-07-19 20:25:46 +00:00
Stephane Bisson c21c5cc821 Show placeholder widget when there are no notifications
When there are only foreign notifications, marking them all
as read empties the flyout completely. With this change,
we now show the placeholder widget with the 'no notifications'
message instead.

Bug: T132202
Change-Id: I7ee38b160ca03c08711670a3296ba4ab45a5eb6c
2016-07-19 20:14:39 +00:00
jenkins-bot 8b0dbd2031 Merge "Relate read-state filter and mark read/unread action" 2016-07-19 15:22:48 +00:00
jenkins-bot 060bc4e8b5 Merge "Fix truncation of notification headers" 2016-07-19 00:28:11 +00:00
jenkins-bot 184874473d Merge "Add tooltips to page filters" 2016-07-19 00:07:03 +00:00
Roan Kattouw d36c0ab123 Fix truncation of notification headers
We need a fixed-width CSS table with a number of fixed-width
cells and one cell that takes up the remaining width, with
text truncation. This is a pain to do with CSS tables,
but this trick I found on StackOverflow[1] works well:
wrap the contents of the cell in a div that's position: relative;,
containing another div that's position: absolute; width: 100%;

[1] http://stackoverflow.com/questions/7569436/css-constrain-a-table-with-long-cell-contents-to-page-width

Bug: T140349
Change-Id: I507f915f06185c767d7a5c8edbff6c341e07b6e2
2016-07-18 17:06:48 -07:00
Moriel Schottlender 5aaf6d26d8 Relate read-state filter and mark read/unread action
When we are viewing a certain read state filter ('read' or 'unread')
the visibility of items should correspond to that state even when
the user marks a specific item as read/unread. That means that the
system should remove these items from view when the action is taken.

In this commit:
* The controller makes the judgment of whether to remove items when
  read/unread action is taken, based on whether a filter is set.
* We clean up the terminology of discard - no more 'remove' - to
  make sure we have consistency in the code.
* Related: The 'discard' event is now scoped within the hierarchy;
  meaning, lists emit 'discard' when an item is removed, grouplist
  emits 'discard' when a group is removed, and the manager emits
  'discard' when an entire notification model is removed. This
  means we can actually have proper hierarchy and organization with
  a single event, and not worry about clashing between the intentional
  'discard' action and the event 'remove' that is also used while
  resorting happens.
* The model manager emits a discard event when a model is removed
  so that the general list can listen to the manager and remove an
  entire batch of items if needed.
* The pagination model now updates the count for the current page
  rather than some vague notion of the last page. This is also
  updated when the controller removes items, so we can get an
  accurate count in the page for the number of notifications that
  are displayed.

Bug: T136891
Change-Id: I247c618042ef256fadf09922f7b83bd1ad361f64
2016-07-18 13:23:57 -07:00
jenkins-bot d27cab59d6 Merge "Add a SeenTimeModel to handle seenTime in sources" 2016-07-18 13:01:35 +00:00
jenkins-bot 9352ce9756 Merge "Dim the title of current wiki if it has 0 notifications" 2016-07-15 19:09:43 +00:00
Moriel Schottlender eadaac1c84 Dim the title of current wiki if it has 0 notifications
Bug: T139646
Change-Id: I827cb43d5badd0a13666226691450a73ddcc85ea
2016-07-15 11:42:47 -07:00
Moriel Schottlender 3a710790d5 Add a SeenTimeModel to handle seenTime in sources
This organizes the operation of seenTime so we can store and
follow up on it based on different sources, as well as update
it correctly remotely when needed.

Change-Id: I629ecfc84999be998b45c9c7adb00ea7e3e51742
2016-07-15 11:25:38 -07:00
Moriel Schottlender 7660732bb7 Fade in/out elements that are moved in the notifications list
Bug: T126214
Change-Id: Iad5df1f56bfbd12cb6f42dd6e73860bdcc27cd68
2016-07-15 18:04:49 +00:00
jenkins-bot 880fb2a43d Merge "Fix messages/notices documentation" 2016-07-14 18:55:29 +00:00
jenkins-bot 1a9c47f527 Merge "Capitalize title dates in Special:Notifications" 2016-07-14 13:37:07 +00:00
Ed Sanders f000a82c1d Fix messages/notices documentation
Bug: T139682
Change-Id: I453b7377c13ca172774e103c1f097423bf68e9b2
2016-07-14 13:45:23 +01:00
Ed Sanders 1e4ed9cafe Remove extra 1px top border and margin from popup list
Bug: T140354
Change-Id: I06bfc014f485b9cd460dfda0a9c7f982de4f9bf6
2016-07-14 13:30:03 +01:00
Moriel Schottlender d47f0bd350 Capitalize title dates in Special:Notifications
Bug: T137634
Change-Id: I84b03f030f6182194a38a7bbfc200f5e0c187878
2016-07-13 13:56:17 -07:00
Moriel Schottlender ac5c9c17f8 Prevent click propogation when clicking 'mark as read' button
Bug: T139339
Change-Id: I3a19a0d01b036fe3c0379e3a5bc0c3f0e5f9473e
2016-07-13 11:30:55 -07:00
Stephane Bisson 35e782c3d8 Add tooltips to page filters
Bug: T139644
Change-Id: I6ae0d0e8c6c7dd79b9ab00db1d601f670764d3a4
2016-07-13 09:51:51 -04:00
jenkins-bot be3cca488d Merge "Make sure sidebar titles are under one another in Special:Notifications" 2016-07-11 15:23:12 +00:00
Ebrahim Byagowi 4eba4c1dd0 i18n: Native digits on PageNotificationsOptionWidget and PaginationWidget
Similar to Icdd52ea0267ffbaa0e103070655735eff8423ca1

Change-Id: I8667fc8b7027d2c9c8b42155a7b79ef18500dc2b
2016-07-09 07:52:23 +00:00
Moriel Schottlender 3f723ab7d1 Use 'uselang' when fetching unread page notifications
This would make the wiki names localized to the current user
interface language, rather than the wiki language.

Bug: T139807
Change-Id: I2b787e1486819d6833e169ac6db519cd36a3c3eb
2016-07-08 16:27:02 -07:00
Moriel Schottlender 4b204644a2 Make sure sidebar titles are under one another in Special:Notifications
Bug: T139807
Change-Id: I59621117835d5ba3f0314f3cdd0c7cd0f0cd6b7c
2016-07-08 16:00:59 -07:00
jenkins-bot 152bd3e622 Merge "Store local source as 'local' rather than dbName" 2016-07-08 14:27:51 +00:00
jenkins-bot 28aca00dce Merge "Properly aggregate the itemUpdate event" 2016-07-08 14:16:20 +00:00
jenkins-bot 39fef27775 Merge "Only fetch 'unreadfirst' for the Popup, not Special:Notifications" 2016-07-08 13:37:57 +00:00
Moriel Schottlender 4b137b3208 Followup Ib7f4dc4ea: Bring back message tooltip with 'notice' text
The message for tooltip-pt-notifications-message was removed to comply
with the new naming. The problem is that in the back end, sections are
still defined as 'message' vs 'alerts' and the sections in the user
toolbar are defined with those terms. In no-JS mode (which is before
the user clicks any of the badges) this tooltip is created automatically
by MediaWiki based on class names.

It's easier to return the message key with different text for translation
and wait for the bigger tech debt to correct all instances of 'message'
to 'notice' (including in the API, which would require a much more
massive work)

Bug: T139520
Change-Id: I6368b63e38f64aa065f2580df812de1c63a93716
2016-07-07 17:09:18 -07:00
Moriel Schottlender eea0dea7ce Only fetch 'unreadfirst' for the Popup, not Special:Notifications
We need the API to return the notifications for the special page
in timestamp order and not read/unread order, so that the 'continue'
value is still correct.

On top of that, if we have many unread notifications, they should
still be placed according to the dates, so the API must bring back
proper result.

In this fix, we add 'unreadFirst' to filters, and only use that
filter when needed (namely, in the popup)

Bug: T136885
Change-Id: I3018d09b009d735402d83074a5ffcd14ea1c242a
2016-07-07 16:29:40 -07:00
Moriel Schottlender 7879f0c9f8 Change 'messages' to 'notices' throughout the interface
Bug: T139520
Change-Id: Ib7f4dc4ea1ff4c5d1fccdc5fdf0c66b049162cb2
2016-07-07 15:57:49 -07:00
Moriel Schottlender fcd2f41151 Store local source as 'local' rather than dbName
When we fetch the pages per wiki, the API returns an object that
defines the local wiki we are in as its dbName; this then gets
stored into the model as the source, which forces us to check against
the dbName whenever we want to perform an operation so we can tell
the API layer to fetch and perform the actions locally, rather than
use a foreign API.

The term 'local' makes no sense for naming the model (and upcoming
tech debt work will fix this) but it makes sense in the context of
the API layer -- and hence, the source name should follow suit.

This fix makes sure that the local wiki objects always have their
sources defined to be 'local', and thus making us use the test for
dbName in very specific points (when we get the data) rather than
throughout the codebase, randonly.

This is also the first step to allow proper updating of things like
seenTime accross wikis, especially in cases where we view a remote
wiki as if it is local (in the Special:Notifications page)

Change-Id: I94633a1cd074580cbc5029d7c75d179e908e5c52
2016-07-07 12:20:39 -07:00
Moriel Schottlender 5c81ac8d3b Properly aggregate the itemUpdate event
Instead of 'cheating' and externally aggregating the itemUpdate event
we should just let the relevant (non-xwiki) models aggregate this
centrally and properly, and include it as an offered event.

Change-Id: Ibe528fe971e1be8309a97275b1a1be8979306ff5
2016-07-07 19:08:47 +00:00
Matthew Flaschen 5022af0b22 Correct section (alert/message/all)
Fix issue where it said 'View x messages' in the alerts popup.

Change-Id: I4b6d00f0ba704ec76c6b5068ab923e51d5804f07
2016-07-06 20:15:47 -04:00
Stephane Bisson db838e42ce Keep bundled notification compact header on one line
Bug: T139321
Change-Id: I4b0a7173bc06a0760efff544bcc28a59ba72ce7f
2016-07-06 20:44:00 +00:00
jenkins-bot 4d5e4505df Merge "Followup Iae32cbf82cdb: Set width to Special:Notifications" 2016-07-05 21:52:34 +00:00
jenkins-bot 27a1572d5c Merge "Use accessible colors on read status marker" 2016-07-05 21:50:03 +00:00
Moriel Schottlender f07a825b23 Followup Iae32cbf82cdb: Set width to Special:Notifications
Following up on setting max-width, this actually should be strict
width for the moment (until we decide on more responsive design)
since without restricting width, the notification view becomes really
thin and compact if the list contains notifications that have short
titles and descriptions.

Bug: T138433
Change-Id: Ia663f7968033b01f3553a326f70736cc6a6a54a9
2016-07-05 14:38:24 -07:00
Moriel Schottlender 0340611b72 Set a fixed max-width to the Special:Notifications page
This is to make sure that concatenation of text inside items works
properly given CSS table-layout.

Bug: T138433
Change-Id: Iae32cbf82cdb91880c7ccd7df14d167eb75527cf
2016-07-05 11:23:01 -07:00
Stephane Bisson cead7142c7 Fix mark xwiki as read
Marking local or xwiki notifications as read
are different operations that require different
information. Call different functions on the
controller.

Bug: T139114
Change-Id: I824ca668c31ab41d101c632442c91d3a8a1e5c5a
2016-07-04 10:00:59 -04:00
Volker E 135f96a13a Use accessible colors on read status marker
Using accessible colors on read status marker notifications.

Bug: T139167
Change-Id: I2dc35d02abe2fccaf1f9d13d7672b2e432e7d1f0
2016-07-01 21:56:08 +02:00
Moriel Schottlender 984441f8d9 Pad the content so it doesn't stretch beyond the markread button
Bug: T136572
Change-Id: I1db8289722526184b64dbb3e92827988a0e04afc
2016-06-30 15:45:34 -07:00
Moriel Schottlender ce354678b4 Limit 2 secondary actions outside the menu
If there are more than 2 prioritized actions, put those actions
in the dotdotdot menu.

Also, correct the name of a variable from "isInsideMenu" to what
it actually represents, which is, in fact, "isOutsideMenu"

Bug: T126617
Bug: T125949
Change-Id: I95fcae8f822e51d9353599c09f1550797e4ad673
2016-06-30 11:59:37 -07:00
jenkins-bot 95681a694c Merge "Clean up another bit of leftover OptionWidget styling" 2016-06-29 17:22:17 +00:00
jenkins-bot 8a8666637e Merge "Use pointer cursor when hovering CrossWikiNotificationItemWidget" 2016-06-29 12:46:41 +00:00
Roan Kattouw 2488cf0491 Clean up another bit of leftover OptionWidget styling
This rule ensures that long human-readable wiki names
don't cause horizontal scroll bars in the notifications
popup.

Change-Id: Id0c954d2059aeed875fa2eea7a45537aac4e2e58
2016-06-29 12:02:15 +02:00
Roan Kattouw 4ca406e4e8 NotificationItemWidget: Apply hover colors
Also remove OptionWidget-related styles that no longer apply.

Bug: T138917
Change-Id: I9e748549bcfa5aac5a68f0c51cbbe4c0a4537676
2016-06-29 11:55:30 +02:00
Roan Kattouw 254c3309e0 Use pointer cursor when hovering CrossWikiNotificationItemWidget
The bounding box of where this cursor effect is applied isn't
quite the same as with bundled notifications (which in turn isn't
the same as with normal notifications), but to fix that we need
to normalize the DOM structures of the three types. They
currently differ in the presence/absence of the <a> wrapper
and in how padding and margins are used.

Bug: T138913
Change-Id: I1ed32e0a9deca62b68d08acd0699431ddda8ca44
2016-06-29 11:22:10 +02:00
Stephane Bisson f8a8d392d6 Expandable bundle
Support bundles being expandable
to show their sub-notifications.

Bug: T114356
Change-Id: I1507cae360f45cc87f2d60e966b4d047abfa202d
2016-06-28 15:37:54 -04:00
jenkins-bot 731cde01b8 Merge "Dynamic bundles" 2016-06-28 19:34:42 +00:00
Moriel Schottlender e15c258d7b Remove initiallyUnseen before marking item read/unread
If we are marking the item as read/unread, we don't want the change
in class to trigger the unseen animation. When that happens, first
remove the 'initiallyUnseen' class (that triggers the animation)
and only then mark the item as read or unread.

Bug: T138522
Change-Id: I05e02518feb1fc166297594053a084718dcb7194
2016-06-28 11:25:39 -07:00
jenkins-bot 1cca7453b3 Merge "Add a PromisePrioritizer and use it for notifications fetching" 2016-06-27 17:42:41 +00:00
Roan Kattouw 9429e78e61 ToggleReadCircleButtonWidget: Tweak colors per Pau
Also add border-box to prevent the circle from appearing
to grow when a border appears.

Bug: T126214
Change-Id: Id5e89ff87759c4ae44851d5ad3061230a0e59ff0
2016-06-27 17:16:54 +02:00
Stephane Bisson 24caf50ff6 Dynamic bundles
To allow individual notifications to be
marked as read/unread or moderated,
bundles are created by grouping associated
notifications when they are fetched for display
instead of when they are created.

From a product perspective, this change doesn't
introduce moderation or expandable bundles but
it counts each individual notifications.
For instance, the bundled notification
"3 new topics on PageA" now counts as 3
notifications.

Bug: T93673
Bug: T120153
Change-Id: Iacd098573efd92bb1e3fcd7da4cd40cea9522f15
2016-06-27 09:49:13 -04:00
jenkins-bot 79aad8f479 Merge "Add support for querying notifications not associated with any page" 2016-06-27 13:35:02 +00:00
jenkins-bot 711e2f84c2 Merge "CrossWikiUnreadFilterWidget: Remove unused this.localSource" 2016-06-27 13:28:06 +00:00
Roan Kattouw 8bb8594940 Follow-up 6c4bf99da8: Fix incorrect comment
Change-Id: I14df92823d8e3c19b94cc225f00d45315e8300c5
2016-06-24 01:14:47 +02:00
Roan Kattouw 7d97881344 Add support for querying notifications not associated with any page
Uses the magic value '[]' to mean 'no title'. This is a bit ugly,
but I think introducing an additional &notwithouttitle=1 parameter
is uglier and results in more code.

Change-Id: I83278182aeaf3905eb0f3e24c4c6c247720b1e76
2016-06-24 00:37:21 +02:00
Moriel Schottlender a1ec29d06a Add a PromisePrioritizer and use it for notifications fetching
This will allow us to let the user click filters quickly, effectively
changing the promises sent to the API, but let the API only resolve
with the latest requested promise.

Bug: T136895
Change-Id: I698a2b8eced6d8ee997efef353697d27d92cfb2f
2016-06-23 14:12:00 -07:00
Stephane Bisson 462ef564e8 Fix position of page filters in firefox
Bug: T138454
Change-Id: Ib19f9ab1cedc4613c9ac3a07d40111dd39a55774
2016-06-23 16:18:50 -04:00
jenkins-bot c90176a2cb Merge "ApiUnreadNotificationPages: Output pages as an array rather than an object" 2016-06-23 19:35:37 +00:00
Roan Kattouw eae458801f CrossWikiUnreadFilterWidget: Remove unused this.localSource
This also means PageFilterWidget can stop worrying about being
given a nonexistent source.

Change-Id: Id999a117c66d0600a4386713c98501cc5ed4236a
2016-06-23 17:44:08 +02:00
Roan Kattouw 6c4bf99da8 ApiUnreadNotificationPages: Output pages as an array rather than an object
Make the frontend code based on page titles rather than page IDs.

Change-Id: I79c6a0e3a7178acdb14039a0c5208e90a7341044
2016-06-23 17:00:51 +02:00
jenkins-bot 190994bab2 Merge "Use the actual total notification count in the special page sidebar" 2016-06-23 11:05:14 +00:00
Stephane Bisson c93800e17c Support for PlaceholderWidget with no link
Bug: T137490
Change-Id: Ia861b5aa3f100124418956a0e09603a9ba29215a
2016-06-22 12:54:13 -04:00
Roan Kattouw e4b79c1bc2 Use the actual total notification count in the special page sidebar
Adding up numbers in the front-end is not enough, because it could
be that not all pages are listed (it's a top 10). So get the
total count from the backend.

Change-Id: Ibbc76691ef88333b92132a514fdba3cde3797e10
2016-06-22 17:11:34 +01:00
jenkins-bot 45d8fdf24f Merge "Add a cross-wiki sidebar to the Special:Notifications page" 2016-06-21 21:57:48 +00:00
Moriel Schottlender 820d2b0fa7 Add a cross-wiki sidebar to the Special:Notifications page
Add a sidebar with cross-wiki sources and pages of unread notifications.
The filter allows the user to fetch notifications from a foreign source
and specific pages if those exist.

Bug: T129366
Change-Id: I57d827a47f80274d75364c2099a9624049a26834
2016-06-21 14:49:42 -07:00
Ed Sanders 1f002745a7 Wrap table-cell buttons in table-row
Removes unwanted 2px bottom margin from footer buttons.

Change-Id: I67c1d5f21d7c62a436010932e3d7b6257e4b73ff
2016-06-21 20:24:20 +01:00
jenkins-bot b846c11910 Merge "Change mark as read buttons to circles" 2016-06-21 19:06:00 +00:00
Moriel Schottlender f84808b83a Change mark as read buttons to circles
Allow for mark read and mark unread through the side button, and
change its style according to spec in the ticket.

Bug: T126214
Change-Id: I78a93c0545bbe2d7c11a0c62557cd2e97e9d3866
2016-06-21 11:54:00 -07:00
Roan Kattouw 92d1d600ae SubGroupListWidget: use timestamp from model, not from listWidget
This ensures that the fallback timestamp is used if the list is
still empty. Not doing this causes the wikis in the cross-wiki bundle
to appear in the wrong order. Also, it makes more sense to use the
model as the source of truth regardless.

Bug: T138115
Change-Id: Icbfdc7e7c7f67179e50f0f692aef1a54568265e6
2016-06-21 13:41:45 +00:00
Stephane Bisson 5a5e1970c5 Improve client-side unread count estimation
- Remove duplicated counter adjustments.

- Differentiate between all IDs to mark as
  read vs. all IDs that represent visible
  notifications when adjusting the counter.

Change-Id: I1b3e52a929c6e920e3b782c9ef028539b3db0c99
2016-06-21 08:27:39 -04:00
Roan Kattouw 2872b5eae2 Remove automatic mark-as-read-when-seen
Bug: T132525
Change-Id: I095704252eaf2f8fe71950a4cfcd42a6fce431ff
2016-06-17 17:09:25 +01:00
jenkins-bot 1a9656691f Merge "Don't mark alerts as read when seen" 2016-06-14 15:34:11 +00:00
Stephane Bisson 26bc47c1b2 Don't mark alerts as read when seen
This is done the quick way by just turning
off a config option. The full cleanup
is in I095704252eaf2f8fe71950a4cfcd42a6fce431ff

Bug: T132525
Change-Id: I5becaa2f91b7eff6ebe4ce3943e86975c844c884
2016-06-14 08:50:47 -04:00
Roan Kattouw 65c6b8cbaf NotificationBadgeWidget: Fix header getting larger when "Mark all as read" present
The "Mark all as read" button had margins that made it just a little
bit taller than the header would otherwise be. This pushed the
bottom border of the header and the top border of the first notification
away from each other.

We only need top and right margins on this button, so drop the
bottom and left margins.

Bug: T137778
Change-Id: I8d47d84c79cbdad707b8cbaa8d43187c054755b3
2016-06-14 11:12:54 +01:00
jenkins-bot b98392824d Merge "Separate model's symbolic name and model's source" 2016-06-13 12:30:15 +00:00
Roan Kattouw 4028160906 Use localized weekdays on Special:Notifications
Bug: T137634
Change-Id: I97d7058657782d1bbc878c30e0712b1a8833dda1
2016-06-13 13:09:51 +01:00
Moriel Schottlender 3101bfc537 Separate model's symbolic name and model's source
This should have been done from the beginning; the model manager
pulls models by their symbolic names. So far, we've used the source
for that, but that assumes that two modules always have different
sources, and that is absolutely not necessarily the case.

For example, internal local bundles will each be a model, but have
the same ('local') source. They should still be differentiated in
the manager by their names, but the source should state clearly that
it is local.

For this, the models now have "getName" method and the name is
created separately from their source. Items also preserve a
reference to their parent's symbolic name so they can provide
that for items that require the controller to manipulate a specific
model.

Change-Id: I8c39d5d28383d11fb330addce21e07d5c424da6f
2016-06-09 16:20:57 -07:00
Moriel Schottlender df18946387 Listen to 'mark as read' secondary link in xwiki bundles
We weren't even listening to the choose event from that menu in
xwiki bundles.

Bug: T136878
Change-Id: Ib15bb6888dadd154b97e5820972cdcdf8bd89d2e
2016-06-03 12:37:18 -07:00
Stephane Bisson aa578a44a1 Mark bundled notifications as read
In the current bundling system, only the
bundle base is mark as read. It leaves all
the non-base bundled notifications without
a read_timestamp. They would all appear
as read in the new bundling system.

With this change, all notifications in
a bundled are update with a read_timestamp
when the bundle is read.

The implementation of this change is
somewhat temporary as the new bundling
system brings changes to the models
and controller.

Bug: T136368
Change-Id: I70b71d722d8d62cbdd1adc004293030ef900ac94
2016-06-02 13:48:33 -04:00
jenkins-bot 7c89fc0fa2 Merge "No-JS special page: One-click mark as read" 2016-06-01 18:21:56 +00:00
jenkins-bot 6824dbd020 Merge "Display a message if there are no notifications in Special:Notifications" 2016-05-31 23:22:43 +00:00
jenkins-bot 0d56040d06 Merge "Clean up the pagination in Special:Notifications" 2016-05-31 23:22:39 +00:00
Moriel Schottlender cf99479468 Display a message if there are no notifications in Special:Notifications
The zero results can either be because there are no notifications
at all for this user in the local wiki, or because there are no
results for the specific filter. Both messages are used for either
case.

Also, clean up the display of push/pop pending for the inbox widget
and hide the label in case the message count is 0 or 1 notifications
as it is unhelpful and irrelevant in these cases.

Bug: T136586
Bug: T136574
Bug: T129363
Change-Id: I1465f772bb9f5247df645d6612f951e5fd7d38cf
2016-05-31 23:13:48 +00:00
Moriel Schottlender 6e21a620ef Clean up the pagination in Special:Notifications
Add a pagination widget with events and separate the logic for
organization. Let the widget listen to events from the pagination
model so it always keeps itself updated.

Change-Id: Id1df112cbb0d90195217e88fbee97a59170b99c5
2016-05-31 16:12:09 -07:00
Moriel Schottlender acc672ca64 Darken the dates in the Special:Notifications groups
Bug: T132739
Change-Id: I8dd4d481fde239528620fb245e2733780f76c689
2016-05-31 14:26:05 -07:00
jenkins-bot 683ef3b737 Merge "Adjust styling for Special:Notification items" 2016-05-31 18:39:06 +00:00
Moriel Schottlender 070656731d Adjust styling for Special:Notification items
The items should resemble the popup items, but the styles clashed
with the popup's cross-wiki notification item, so the image size
was smaller and the border was incomplete.

Bug: T136572
Change-Id: I3c3f825d469ccee1e711da21f627eeb9491e9480
2016-05-31 11:30:35 -07:00
jenkins-bot 7647737b00 Merge "Styling changes to Special:Notifications headers and toolbar" 2016-05-31 00:48:15 +00:00
Moriel Schottlender fd45db9eb2 Styling changes to Special:Notifications headers and toolbar
Bug: T136580
Bug: T136568
Change-Id: I1a7f08cca8884ada42eca50ba802b4d1e0b788e0
2016-05-31 00:40:07 +00:00
Moriel Schottlender cc3e40b408 Make the notifications list the pending element
Change the pending element to be the notifications list rather than
the whole inbox widget in the Special:Notifications page.

Bug: T136581
Change-Id: I82b073c9cd628f30c13305510d6604e3ef636c2a
2016-05-30 17:24:12 -07:00
Roan Kattouw d6c340f591 Display error message on API failure or empty result
Show an API failure message if the request failed.
Also take this opportunity to show a message in case
there are no notifications at all.

Bug: T136467
Change-Id: If5761ec3d3df10a8774561bed06a4ade54458c4b
2016-05-30 15:01:33 -07:00
jenkins-bot a0aead0416 Merge "Fix JS error when API request fails" 2016-05-30 08:59:50 +00:00
Roan Kattouw ab1bcbefd4 Fix JS error when API request fails
We don't show an error message in this case, just an
empty popup, so that should be fixed regardless.

Bug: T136467
Change-Id: I06ddd5306bd8d7edeb8c75bdae7abd7215285e3d
2016-05-29 21:18:59 +00:00
Matthew Flaschen 188e8d7395 No-JS special page: One-click mark as read
Bug: T136361
Change-Id: I7896dbdf25d2c1624f97777f4c8d0af41b195ef0
Depends-On: Ic31f857c749d62a32cafae68dc3f1cbd86e1e382
2016-05-27 17:23:29 -07:00
Stephane Bisson 1bef12c3e7 Stop outputting $nextContinue in Special:Notifications
Bug: T129176
Change-Id: If0d05cb1df0b2e0f93c7367c0848fbcbb04fea8d
2016-05-27 16:46:20 -07:00