This is in preparation for dealing with cross-wiki notifications
where we may need several types of operations to extract bundled
notifications from local and external APIs.
Also, renamed files:
* mw.echo.dm.AbstractAPIHandler -> mw.echo.dm.APIHandler
* mw.echo.dm.APIHandler -> mw.echo.dm.LocalAPIHandler
* All API-related handler files moved to their own folder
for better organization.
Change-Id: Ib730c780ea52c93a6026c5d0b22012b6f39bb50d
This is especially important for combined notifications and
notification lists from different sources; the model list should
be sorted to reflect items by timestamp and unread status.
Note: The dm.List and dm.SortedList now mirror the structures
OO.EmitterList and OO.SortedEmitterList that are awaiting to be
added for oojs in Ib94e4e4a49 and I3fd569691549 respectively.
Once those are available, the dm.List and dm.SortedList can
be removed, and the model can mixin OO.SortedEmitterList instead.
Change-Id: I97e1ecbe5dccc478be527a94f037500f78f74b14
Make sure it's possible to create a combined notification widget
that features both alerts and messages.
Change-Id: I4b3f263039f54430a61acc1a261d8aca8e894a90
This simplifies the operation of the API a bit, but more importantly
this will let us create a demo where we can manipulate the API result
and test various new notification formats while the work on the
backend API responses is ongoing, and also will allow us to have a
constant test for all notifications types, including backwards
compatibility.
Change-Id: I6081329a287cda4f5f1f1604ace5d04ff8d9fe3d
If a notification is already read it is by definition seen. Don't
mark those as unseen. This can actually happen if our seenTime is
invalid (like a cache miss)
Change-Id: Id943691599116597b6c68d2cc40e7b89a25ce05e
This browser test checks that mentions go to alerts and talk page
messages go to messages popup. This also upgrades the MW-Selenium
version in Echo tests to 1.6.1.
Depends on MW-Selenium version 1.6.1 (See T114061)
Bug: T113081
Change-Id: I40a17500cdfb838420c04dc0b9268ba56515cc2c
Don't just remove it when all notifications are read, but when all
specifically talk notifications are read even if there are other
unread notifications in the popup.
Change-Id: I5aa65a4060d64f374b47fe91d8e53c92ded5fab2
The status changed internally but was never passed to the API.
This commit fixes that mishap.
Bug: T112826
Change-Id: I1a6d2a871eae837860eb1f21df28134d5e747cd7
There is no need to load the entire of Echo's ui module (especially
since that includes ooui widgets and their styles) on every page load.
There's only need to load the entire module if and when a user clicks
the Echo notification badge.
Also, make the echo.dm model accept an external fetchNotifications
promise so we can send the API request alongside loading the echo UI
and "feed" it into the DM for processing.
CSS adjusted to make the "jump" between the nojs and the js buttons
seem less jumpy.
Bug: T112401
Change-Id: I516e655ffd198511d694489a0702c5c713a5fd68
Make the popup header the pending element to give the user a visual
indication that the notification widget is being updated, but don't
clear the notifications before loading more from the database.
Bug: T112186
Change-Id: If2b724fab07ef5b7caf5cab3e44fe326470ac0e7
First update the notifications as seen, then send the api request
for updating the seen time. Update the actual seen time from the
api response so the time is always in sync with server time.
Change-Id: I97717cfda7b665dcbc3add90712069700f44adf6
So we're not abusing user preferences for the last seen time.
EchoSeenTime is a small wrapper around ObjectCache that handles the
fallback to user preferences during the transition.
All JavaScript code now needs to use mw.config.get('wgEchoSeenTime').
Bug: T95839
Change-Id: Ia45ba5e30eb4564250539d04d5886d2598ebd49a
Split the notifications into 'alert' and 'message' badget with two
different flyouts. Also clean up styling and module behavior.
** Depends on ooui change Id4bbe14ba0bf6c for footers in popups.
** Depends on ooui change Ie93e4d6ed5637c for fixing a bug in
inverted icons.
** MobileFrontend must also be updated to support the new modules
in this patch I168f485d6e54cb4067
In this change:
* Split notifcations into alert and messages and display those in
two different badges.
* Create two separate flyout/popups for each category with their
notifications.
* Create a view-model to control notification state and emit events
for both the popup and the badge to intercept and react to.
* Clean up module load and distribution:
* Create an ext.echo.ui module for javascript-ui support and ooui
widgets.
* Create an ext.echo.nojs module that unifies all base classes that
are needed for both nojs and js support, that the js version
builds upon.
* Create a separate ext.echo.logger module as a singleton that can
be called to perform all logging.
* Clean up style uses
* Move the special page LESS file into nojs module so all styles
load properly even in nojs mode.
* Transfer some of the styling from JS to LESS for consistency.
* Make the 'read more' button load already with the styles it
needs to look like a button, since its behavior is similar in
nojs and js vesions, but before its classes were applied only
by the js, making it inconsistent and also making its appearance
'jump' from a link to a button.
* Delete and clean up all old and unused files.
* Moved 'Help.png' icon from modules/overlay to modules/icons for
later use.
Bug: T108190
Change-Id: I55f440ed9f64c46817f620328a6bb522d44c9ca9