mediawiki-extensions-Echo/modules/viewmodel
Roan Kattouw bfbfa6be62 Sort wikis by timestamp of most recent notification
Both in the order of the cross-wiki bundles themselves, and
in the message in the notification body.

ForeignNotifications tracks timestamps per wiki per section,
and exposes these through getWikiTimestamp(). ApiEchoNotifications
adds these timestamps to the sources manifest, and also sorts
the list of wikis by timestamp (it'd be nicer to do this in
ForeignPresentationModel instead, but then we'd have to create a new
ForeignNotifications instance which causes a duplicated DB query).

NotificationsModel receives the timestamp for its wiki as its
fallback timestamp, and makes getTimestamp() return this value
during the pre-population phase. This causes its parent to
automatically sort it correctly.

Because the timestamp of a wiki depends on the section (alerts vs messages),
we can't put it in the global sources manifest at the top level
of the API response. Instead, get rid of this global sources
manifest and put all the sources data in the foreign notifications
directly. This allows us to specify different timestamps, and also
allows us to get rid of code in EchoApi that was already remapping
the API response to this format.

Bug: T130298
Change-Id: Ie083fbb1ccaf74fbe804633d87ef03c9e71b120f
2016-03-17 14:21:16 -07:00
..
mw.echo.dm.js Split alerts and messages in Echo 2015-09-02 15:36:37 -07:00
mw.echo.dm.List.js build: Enable jscs jsDoc rule 'requireNewlineAfterDescription' and make pass 2016-03-07 14:29:15 +01:00
mw.echo.dm.NotificationGroupItem.js Sort wikis by timestamp of most recent notification 2016-03-17 14:21:16 -07:00
mw.echo.dm.NotificationItem.js build: Enable jscs jsDoc rule 'requireNewlineAfterDescription' and make pass 2016-03-07 14:29:15 +01:00
mw.echo.dm.NotificationList.js build: Enable jscs jsDoc rule 'requireNewlineAfterDescription' and make pass 2016-03-07 14:29:15 +01:00
mw.echo.dm.NotificationsModel.js Sort wikis by timestamp of most recent notification 2016-03-17 14:21:16 -07:00
mw.echo.dm.SortedList.js Implement SortedList in Echo notifications 2015-11-06 11:01:10 -08:00