Commit graph

773 commits

Author SHA1 Message Date
Moriel Schottlender 879ff56756 Log the mark entire cross-wiki bundle as read action
Bug: T127955
Change-Id: Iddff3592915c1f7d71622c1137abc725985fb3c2
2016-08-15 17:18:27 -07:00
Moriel Schottlender 951f146b54 Emit sortChange only for read/unread actions
Do not emit sortChange for toggleSeen, because every sortChange
creates a fake widget with a flipped 'read' state. There is no
reason to emit the sortChange event in toggleSeen anyways so it
is safer when only emitted in togglRead.

Also, make sure the controller always updates the correct seenTime
from the API when fetching local notifications. This was done for
the special page method but was overlooked for the fetching of local
notifications. For the most part, it shouldn't be affecting too much
because the SeenTimeModel is initialized with wgEchoSeenTime (which
is local) but updating the controller with the API response is the
safe thing to do, and will also cover cases where a tab was open,
notifications were seen in a different tab, and now the popup was
reopened in a "stale" tab again.

Bug: T143067
Change-Id: Ie261e32db28926d04fe14f7badd9d287ddc52749
2016-08-15 16:53:09 -07:00
Roan Kattouw a4caed52cd Make footer notice link blue in Monobook
We have to override a CSS rule that tries to make all <a>s blue,
but not override it so powerfully that the real link in the footer
notice isn't blue.

Change-Id: I5a91419aab7cf6d6fe10c8e707168b52c2451cd8
2016-08-15 11:13:01 -07:00
WMDE-Fisch 272cb9a960 Bundle mention success and failure notifications
Adds common bundling including messages and icons.
Bundling relates to revision now.
Changed order how notifications are generated. Now errors will
show first, since they are generated last.

Bug: T140224
Change-Id: I1069aeb5523db8710da4e8e21065bf447d031e3c
2016-08-13 08:08:12 +00:00
jenkins-bot 6886c18c03 Merge "Revert "Hack around browser bug in IE breaking badge alignment in Monobook"" 2016-08-11 23:27:25 +00:00
Catrope 092c4c64fb Revert "Hack around browser bug in IE breaking badge alignment in Monobook"
Seems to be fixed by different changes, and now this change
is causing trouble, moving the badges up off-screen.

This reverts commit 0b7f8712a9.

Change-Id: Ia5a0a6b6be3698436a043aee111f251709c22f20
2016-08-11 23:15:15 +00:00
jenkins-bot ccab1d8351 Merge "Log 'mark all read' button click actions" 2016-08-11 20:58:31 +00:00
jenkins-bot 7ee4ffd1f4 Merge "Reduce the amount of space between the badges a bit" 2016-08-08 20:52:45 +00:00
jenkins-bot 515d38fb85 Merge "Follow-up de795bdbc5: actually hide badge number in Monobook" 2016-08-08 18:39:36 +00:00
jenkins-bot 96f11311b7 Merge "Don't truncate bundled item content in mobile view" 2016-08-06 04:58:18 +00:00
jenkins-bot 65d4368860 Merge "Round timestamps to the day when displaying date titles in Special:Notifications" 2016-08-06 04:49:21 +00:00
Roan Kattouw 68479f7442 Reduce the amount of space between the badges a bit
What this really does is:
* Change the forced width of the <a> to the width of the icon
  (rather than 1.25x the width of the icon)
* Change the alignment of the :before from 40% to 50% so it
  stays in the middle (1.25*40=50)

Change-Id: I0399a20fc84e59fcbcf69da509a4d8bfa9b54a08
2016-08-05 18:01:48 -07:00
Roan Kattouw a27d748f6a Follow-up de795bdbc5: actually hide badge number in Monobook
The color: transparent; hack was being overridden by a color rule
that's only in effect after the popup is opened.

Change-Id: I2f415619603ccadb625ed2482c25fde78765fee4
2016-08-06 01:00:33 +00:00
Moriel Schottlender adab7f087b Fix top position of badges in monobook
Change-Id: Ie2638445d020baf1be79ac1689b446ac1abc2f63
2016-08-05 16:00:49 -07:00
jenkins-bot 181c0b9557 Merge "Enable local bundles on mobile" 2016-08-05 22:00:35 +00:00
jenkins-bot c9f48a80bb Merge "mw.echo.badge: Use 'color: transparent' rather than 'font-size: 0' to hide text" 2016-08-05 21:58:02 +00:00
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