Commit graph

13 commits

Author SHA1 Message Date
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 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
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
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
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 ac9bbb8e07 Allow for overriding parameters in fetch notifications API request
Change-Id: I677d6d1b3a8f9424820969a12005d7a457d938b1
2016-05-26 11:42:14 -07:00
Matthias Mullie 84b016e695 Make sure APIHandler has this.api
this.api is used in APIHandler.createNewFetchNotificationPromise,
so we should make sure it always has a valid this.api

Change-Id: Id476661fb427adbbb3c5741737c293c32ad8a27e
2016-05-13 17:29:56 +00:00
Moriel Schottlender 7055f83fe0 Use server-side cross-wiki requests in the frontend
Fetch cross-wiki notifications by asking the local API, but still
maintain the ability to send remote requests to the foreign wikis
for mark-as-read operations.

Bug: T130636
Change-Id: I48524cb9dff43257a401d7483e939edfb042b928
2016-05-04 21:21:08 +00:00
Matthias Mullie e8d1f6a888 Remove param index
It's (mostly) unused, and it would become problematic once we have
notifications from multiple places (where those ids could conflict)

Change-Id: Ib3bb5ae1e5689037b38290c9ce3d8691f52582b0
2016-04-21 13:33:15 +02:00
Roan Kattouw df8e97173f jscs: Enable checkRedundantReturns and make pass
Change-Id: I8013198fdb5852246a0f8360b931334740eaa147
2016-03-25 11:54:55 -07:00
Kunal Mehta 7d4ac2a76b Have mw.echo.api.APIHandler.markItemRead actually return a promise
Per its docs which say it does.

Change-Id: I2a4fb393c1bc3eba31a1bad34342a11800767fb0
2016-03-14 15:23:08 -07:00
Moriel Schottlender 8657ef5e90 Allow mark-as-unread in notifications
Add a 'mark as unread' to all unread notifications and allow them
to be marked unread. These notifications will no longer be automatically
marked as read when the pages they refer to are visited.

Bug: T73564
Change-Id: I677d3c0399e46fd7c35531df1cc0e61db2d4eb1b
2016-03-11 14:05:10 -08:00
Moriel Schottlender 0834b91f56 Echo API layer
Split and refactor Echo network handling and create a proper API
layer for the UI to use consistently. Split Echo's API methods into
its own module so they can be loaded along with the initialization
script and manage the API requests.

Change-Id: I0526a14bb8cc0d9729a303e24ab6e43259cc86bb
2016-03-03 23:40:12 +00:00