Commit graph

109 commits

Author SHA1 Message Date
Fomafix 0ec43738aa Add missing dependency to module 'mediawiki.api.options'
Change-Id: I4bdbfacebb7f5b0082fbec542b4c7356e703e837
2016-09-09 17:42:31 +00:00
jenkins-bot 32e8a8c845 Merge "Add confirmation popup widget" 2016-09-02 23:28:09 +00:00
Moriel Schottlender f449c68780 Add confirmation popup widget
Mainly used for mobile actions, and should be appended to the
overlay - this widget assumes it should appear and then fade out
with some confirmation message.

Also moved 'doubleCheck' icon to the ooui definitions, including
an inverted icon that is necessary for this widget.

Bug: T141404
Change-Id: I67a44962eaee6b7bd8cac26dcb5277177fa5d224
2016-08-31 14:47:59 -07:00
Moriel Schottlender 6e0076410c Fix sidebar counts Special:Notifications in monobook
Bug: T143845
Change-Id: Idf5922876f55aca6ed5d6800d0ff5066306c5fb1
2016-08-30 15:23:32 -07:00
Roan Kattouw 7b2fc76f88 Follow-up 191a3309eb: merge duplicate skinStyles for monobook
This caused text in the notifications popup to be right-aligned
in Monobook, because the stylesheet overriding this was ignored.

Change-Id: Ibf76465996abc7bc218dbf94f1d4a54e445d3693
2016-08-30 13:53:36 -07:00
jenkins-bot 76ea1746f9 Merge "Display a message when API fail due to session end" 2016-08-29 23:46:59 +00:00
Roan Kattouw 191a3309eb Fix font size for notifications dotdotdot menu in Monobook
Change-Id: Ie75ad192204a652885a82b0021340410b69864f4
2016-08-29 15:22:44 -07:00
Moriel Schottlender 4eab01b3b4 Display a message when API fail due to session end
Bug: T144231
Change-Id: I3ced44de097ba5b17d9edb91d4e3c527a5f18f03
2016-08-29 12:56:56 -07:00
jenkins-bot 4e99a5095f Merge "Add dynamic secondary actions to notification items" 2016-08-23 17:43:08 +00:00
Moriel Schottlender 480ce92bd8 Add dynamic secondary actions to notification items
Allow extensions to add dynamic actions that perform some
API request and display a confirmation message.

Bug: T132975
Change-Id: Ib16d57c3f1a11a9749564c6e2112bf1ca32c55e8
2016-08-22 16:04:48 -07:00
jenkins-bot 3fe453cd78 Merge "Make dotdotdot menu not be extremely wide" 2016-08-19 21:58:29 +00:00
Roan Kattouw b9b1363ca6 Make dotdotdot menu not be extremely wide
Work around new styles introduced in oojs-ui in I77cd5212c.

Bonus: remove useless styles targeting the dotdotdot popup
in NotificationItemWidget.less: it's not even a popupWidget
any more and it's located in an overlay anyway, so these
styles didn't do anything.

Change-Id: Ifb16b7bb0b01c1eb2551ba4c173042cc759e9b02
2016-08-19 14:48:29 -07:00
Moriel Schottlender 0b28b4c67a Mobile action menu should stick to bottom of screen
Just like we do in the mobile popup, the menu should be accessible
in mobile clicks/taps by being "stuck" at the bottom of the screen.

Bug: T142013
Change-Id: I730216e717c2a02ad98bbcc28f66b13c1cbe29ed
2016-08-18 13:12:22 -07:00
Moriel Schottlender 5fefbe4b03 Add a rasterized email icons to Echo modules for email
Make sure we send rasterized png emails instead of SVGs in the
email formatter.

Bug: T127794
Change-Id: Ia28757bda521ec182f75458c8e52d54847d15681
2016-08-16 00:21:13 +00: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 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
jenkins-bot 9db03278b8 Merge "Fix fade-in/out animation in sorting" 2016-08-01 22:08:30 +00: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
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
Moriel Schottlender 773552a6dc Add mediawiki.Uri to Special:Notifications dependencies
Change-Id: Ia3a0b46d6ec02b31287e6c756e0489cc9143b8be
2016-07-22 16:28:40 -07: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 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 7879f0c9f8 Change 'messages' to 'notices' throughout the interface
Bug: T139520
Change-Id: Ib7f4dc4ea1ff4c5d1fccdc5fdf0c66b049162cb2
2016-07-07 15:57:49 -07: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
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
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
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 4028160906 Use localized weekdays on Special:Notifications
Bug: T137634
Change-Id: I97d7058657782d1bbc878c30e0712b1a8833dda1
2016-06-13 13:09:51 +01:00
jenkins-bot 7c89fc0fa2 Merge "No-JS special page: One-click mark as read" 2016-06-01 18:21:56 +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
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
Moriel Schottlender e5e19dd0f1 Filter notifications by read state in Special:Notifications
Change-Id: I7b47e76ae48eaf4732d99616baa3b4b1ee4ddff5
2016-05-27 13:47:41 -07:00
Moriel Schottlender 9262614ded Initial version of Special:Notifications Javascript page
Bug: T129176
Change-Id: I2f55358c16f78e234ec19154b944a4edebfbe639
2016-05-27 13:42:25 -07:00
jenkins-bot b894c3407a Merge "Add style to the NotificationsWrapper" 2016-05-26 22:58:40 +00:00
Stephane Bisson 52525249e6 Adjust styling for "Mark group as read"
Bug: T134204
Change-Id: Ia0486fa400be7e96ffc4e1ad47f952c17f40042c
2016-05-26 13:30:49 -07:00
Moriel Schottlender 299adfe6b1 Add style to the NotificationsWrapper
We have to make sure that any notifications wrapper has the css
term overflow-y: auto; so that the popup menus behave properly.

Change-Id: I14a1a9f1c3610ef27fe04aa4b1e7197c08d1dfd4
2016-05-19 13:43:51 -07:00
Moriel Schottlender 8e76bc4126 Refactoring Echo's front end for MVC
Changing the way Echo's front-end architecture works to work with
model-view-controller methodology.

Change-Id: I97862402c41bc04dd41cd08d79f19ff677340249
2016-05-18 12:28:45 -07:00
Moriel Schottlender 15a44768f4 Add mark-as-read button to notifications in Special:Notifications
Bug: T115528
Change-Id: I54dba5f86d28a069659d66dede5b7ab9981213aa
2016-05-11 10:41:32 -07:00
Roan Kattouw 7942a2de79 Replace mark-as-read-on-click with ?markasread= URL parameter
Notifications were being marked as read in response to a click event
in JavaScript, but that causes a jarring effect in the UI, and it's
not reliable (the browser could abort the AJAX request).

Instead, add ?markasread=XYZ to the end of every primary link URL,
where XYZ is the event ID.

Bug: T133975
Depends-On: Icb99d5479836fea25a47451b5a758dd71f642f71
Change-Id: I8047d121584b43e6172463a50ad0e0de5f7fa73c
2016-05-03 00:20:03 -07:00
Roan Kattouw 4f7f1a3a09 Repurpose survey call-out in the footer for beta feature invitation
Removing the info popup because we don't have to show
a privacy notice when linking within the wiki.

This adds a database query to every page view for logged-in
users; If78bfc710, once merged, will fix that.

Bug: T117669
Change-Id: I8451db34ae8e94264e4921ecd6df6e4b32c7623a
2016-04-27 07:23:30 +00:00
Roan Kattouw c9332d8b50 Apply momentjs hack for short relative times on mobile too
Split the moment hack out into its own file and put it in
ext.echo.ui, so it gets picked up by both the desktop and
the mobile modules.

Bug: T133134
Change-Id: Ic5b3e63fb6941a310d85ea7776447d1d7153cf91
2016-04-19 17:53:02 -07:00
Stephane Bisson f3ce2de964 Add tooltips for 'mark as read' and 'more options'
Bug: T130831
Change-Id: I1533d20019157c05f9354a60661512a33920c336
2016-04-15 16:30:14 -04:00
Stephane Bisson 623d07011c Stop counting notifications objects on the client
The flyout loads no more than 25 notifications
from a given source. Using those in-memory notification
objects to count how many are currently unread (and
update the badge) produces a result of at most 25.

This patch extracts the responsibility or counting the
unread from the Model/Item/Groupitem structure into
a new UnreadNotificationCounter class. It receives
estimated updates from other components and synchronizes
with the server after markRead/markUnread operations
have completed.

Bug: T129726
Change-Id: I9af4defc00dd491ed2b355eb4e85073476e08ce7
2016-03-25 15:31:00 -04:00
Moriel Schottlender 94fa679568 Remove duplicate mobile module
Followup to I7891eb3fb46b3 this should be merged only after
the changes in MobileFrontend in Ie592ca738ac2d82 are merged.

Change-Id: I0f28e0757170e8a5b12075d3e9a2343fea7e7155
2016-03-23 20:00:52 +00:00
Moriel Schottlender 06ae707d6e Rename MobileNotificationsWrapper to NotificationsWrapper
We need to use it in more than just the context of mobile, and
there is nothing actually mobile-specific in it. Renaming the
class so it isn't awkward to use elsewhere.

This makes the ext.echo.ui.mobile module unnecessary, but
we leave it in until next patchset so that MobileFrontend
doesn't crash while we wait for the adjustments in
Ie592ca738ac2d8 to be merged.

Change-Id: I7891eb3fb46b350f0b325bf0a2b56b2cd55ff1d7
2016-03-23 19:47:23 +00:00
Moriel Schottlender e50ef3841a Add footer notice widget for invitations for feedback
Add a mw.echo.ui.FooterNoticeWidget that includes a link to
a feedback survey, and three config variables:

* $wgEchoShowFooterNotice: Enable this feature per wiki
  (Defaults to false)
* $wgEchoFooterNoticeURL: The URL for the survey
  (Defaults to '')
* User preference 'echo-dismiss-feedback-alert': determines
  whether the user permanently dismissed the feedback alert.
  (Defaults to false)

Bug: T128937
Change-Id: I918a70beaba7b173e764519fe4fe0f780b61082d
2016-03-18 17:02:31 -07:00
jenkins-bot 8b15325346 Merge "Make plural support for large values (100 or more) explicit in l10n" 2016-03-17 21:53:40 +00:00
Matthew Flaschen cac85b635f Make plural support for large values (100 or more) explicit in l10n
This involves:

* Making this value no longer admin-configurable.
* Changing getNotificationCountForOutput to return only a single value
  Since there is no + in the formatted value anymore, we can actually
  use the same value for both.

  This is a B/C break, but hopefully worth it to simplify the method
  call.

  For now, the excess parameter is just marked unused.  It could be
  removed at some point if the translations are updated.

This must be merged at the same time as:
* Flow - Ibfa56b1af9e8c56b4c5f900e0d487bc09688b2a2
* MobileFrontend - Ibf784b279d56773a227ff261b75f2b26125bbb63 (well, MF
  can be merged first)
* translatewiki - I2a4b6938aed49e4101deb6b9351c43656a863490

Also, change 1 to One/one, per Siebrand on the task.  This can easily
be dropped/undone if we don't want it.

Also, remove reference to no-longer-existent notification-page-linked-bundle

Bug: T127288
Change-Id: Iabeaae747f99980c0610d552f6b38f89d940b890
2016-03-16 18:43:16 -04:00