Commit graph

1067 commits

Author SHA1 Message Date
jdlrobson 4a62746f87 Echo badges should have transparent text
While working on the new Vector, it exposed some issues with
the label due to the change in position of the personal tools.
This change should be safe in legacy version since the label is
never displayed to end users visually.

Change-Id: I5aaac22af689ce74b9d9214453681c0250dade7f
2020-07-07 15:43:02 -07:00
jenkins-bot f87a6a1a19 Merge "Remove unnecessary table markup announcement in notification item widget" 2020-06-30 00:06:40 +00:00
bkudiess-msft 172fb93f14 Remove unnecessary table markup announcement in notification item widget
Bug: T253406
Change-Id: Ibc9d3101b86c4dfb534d37ac2ca42e965fa45ad3
2020-06-23 22:51:12 +00:00
jdlrobson 1f995c93a3 self.hide is not a function
This is a factory function. self.hide is replaced with overlay.hide
and a local variable to correct.

Bug: T255630
Bug: T253045
Change-Id: I3dae26e798b0c2e7520c2f01b017c257cc81e995
2020-06-17 22:02:14 +00:00
Ed Sanders ffe3363d09 build: Update eslint-config-wikimedia to 0.16.1
Change-Id: I2ce14429f9440e69e36fa349847f58fb32862f2a
2020-06-15 16:19:00 +01:00
Roan Kattouw 7658e151d6 Fix positioning of the secondary actions menu
- Automatically flip the position if there's no room
- Always flip the position in bundled notifications
- Remove menuWidth and related hacks, they didn't work anyway
- Increase maximum label width a bit

Change-Id: I490a925b6265bfbb8bbedae11672fd19d4efba44
2020-06-03 04:41:13 +00:00
Roan Kattouw 28f432b150
Add dynamic secondary action to mute/unmute page-linked notifications
Also adds an API module for muting and unmuting pages (and users).

Bug: T46787
Bug: T115264
Change-Id: Icf4e4bfa9fd7fa27b4c40892e3d5ce000eb22d5a
2020-05-27 15:20:08 +02:00
Volker E a569321595 Add aria-label to SpecialHelpMenuWidget
Bug: T244543
Change-Id: I04c2c47c5d20cf69f9f0602a2e535c05b01f5f3c
2020-05-18 12:35:43 -07:00
Ed Sanders 04100d4083 SpecialHelpMenuWidget: Use ButtonMenuSelectWidget
Bug: T178387
Change-Id: I521aa3749e1009e5bb028ee1359f732f21226689
2020-05-06 16:21:52 +00:00
Volker E 9ee48977f1 Use '.text-overflow()' mixin from 'mediawiki.mixins'
And remove Echo's own mixin.

Depends-On: Ia8d6e7229b49598b0f4cb19dff463ffe2f11a43d
Change-Id: I68d5726f01484ef5b94a606de9669207944dff54
2020-04-23 18:16:01 -07:00
Volker E e85d881817 Replace static border radius value with var
In a distant future those might be replaced by core WikimediaUI Base
and this is a sane preparation for it.

Change-Id: I8907c8908f3b775be36b16a6782d7e9719e30c4c
2020-04-15 18:09:48 -07:00
Volker E 32c1c8e5f1 Amend Base10 color, add and amend WikimediaUI Base variables notation
Amending Base10 to slightly darker `#202122` to fulfill WCAG
requirements in connection to Accent50.
Also adding and amending WikimediaUI Base variables where in connection
with the color change.

Bug: T248393
Change-Id: I3b0c1666f7f883908a3778aa9e3fcbf51b57fefe
2020-04-15 18:02:21 -07:00
jenkins-bot ce186cf03e Merge "Add aria-label to Notifications page “Recent activity” filter widget" 2020-04-03 21:18:37 +00:00
Akinwale Alagbe b49fdb88c3 Add aria-label to Notifications page “Recent activity” filter widget
Adding `aria-label` to the filter widget, with `listbox` role assigned 
to allow screen readers parse read the content.

Bug: T244543
Change-Id: I72a4045abe9a7c391ee3fe471ed944d96259b79e
2020-04-03 20:00:22 +00:00
jenkins-bot f3862d3e5e Merge "Updated notices icon images ARIA role to presentation" 2020-02-24 20:37:38 +00:00
Akinwale Alagbe f3baccbfb2 Updated notices icon images ARIA role to presentation
Also adding empty `alt` attribute for browsers incapable of 
`presentation` role yet.

Bug: T244814
Change-Id: Ia7b9961aa4210244df0f8e87880b32d9de41a3a9
2020-02-24 20:22:13 +00:00
jdlrobson d7cc28fbcb Properly scoped style improvements to Echo OOUI dialog in desktop Minerva
This reverts commit ca5e5c85af and then
scopes the rules.

Bug: T241090
Bug: T242493
Change-Id: I0e6a4f6d235f34dc8f05a5e7ea5272d6465b80aa
2020-02-11 07:41:23 +08:00
Esanders ca5e5c85af Revert "Style improvements to Echo OOUI dialog in desktop Minerva"
This reverts commit 5b628b5109.

Bug: T241090
Bug: T242493
Change-Id: Id4a7ac9748ed7f934e9c47f4ade0c2f87da4488d
2020-02-10 20:24:17 +00:00
Roan Kattouw 0ff7678377 Document ext.echo.unseen counters
There are two counters (ext.echo.unseen and ext.echo.unseen.click) that
are incremented in two different places. It's hard to see how they're
connected unless you know where to look.

Add comments to each of these counters pointing to the other one and
explaining what they're for.

Change-Id: I0699cba85bf797e4f7ef42cc6a7a996aa35510f0
2020-01-16 17:46:08 -08:00
Roan Kattouw b2f816d0af Use GET rather than POST for action=markseen
This seems strange, because markseen sounds like a write action, but it
writes to the seentime cache rather than the database. For multi-DC
support, we need writes to the seentime cache to happen in the local
data center, and the easiest way to do that is to make it a GET request
rather than a POST request.

It would be nice if marking as seen could be consolidated into the GET
request for fetching notifications, but I didn't do that because the
code for those fetches is pretty complicated, and some fetches (like
polling) should not mark as seen.

Bug: T222851
Change-Id: If4c504a9dc562b1d4e626e155fba8ebb5cdb0579
2020-01-10 16:12:18 -08:00
jenkins-bot 1f96009221 Merge "Use document.body instead of 'body' as jQuery selector" 2020-01-05 23:33:24 +00:00
jdlrobson 5b628b5109 Style improvements to Echo OOUI dialog in desktop Minerva
* Make sure the badge for desktop when initialised points to the
right thing
* Make sure the dialog takes up the full screen and the Clippable bug
does not interfere with the display of the pane

Bug: T241090
Change-Id: I6c5588ee689633cef413ef27449aeeea341d7a97
2019-12-20 20:38:36 +00:00
Fomafix 99dc512ef8 Use document.body instead of 'body' as jQuery selector
Also use the shorter .appendTo() instead of .append().

Change-Id: I1e0aaff4790a6ca5c9e5d2f6e5926e15f8574cee
2019-12-16 11:51:03 +01:00
jenkins-bot 19d88be6cf Merge "build: Update linters" 2019-12-12 17:52:35 +00:00
Ed Sanders 80ddee3956 build: Update linters
Change-Id: I713aafb891306fc21a776a7d4622c6a039798753
2019-12-12 11:20:49 +00:00
Ben Houghton aeafb09d80 Allow marking all as read from popout window
Clicking 'mark all as read' would only mark the notifications you are viewing as read
instead of all of them - now it will mark all of them as read.

Bug: T156425
Change-Id: If46a85f91dfddd4ac158e5c3a4f942c9c3d9aac1
2019-12-03 20:08:35 +00:00
Volker E 415b7b9851 hygiene: Make LESS imports non-ambigious
Some LESS parsers will get confused with the lack of file extension.
It's better to be explicit and in alignment with recent change in core
I379334d7729e587a2a00.
It was already weirdly mixed in this repo with some imports featuring
extension and some not.

Change-Id: Ib208607c850fa2492b13cd3d449c04ebc2c21a01
2019-10-25 13:53:39 -07:00
Zoranzoki21 5a05e94a1e Remove comment related to skins.minerva.scripts after removal of it in 1053997
Bug: T221007
Change-Id: I0ca3e195aa623cff7ef437dc177179dee13c7cd1
2019-10-16 10:30:57 +00:00
jdlrobson 10539971f1 No longer check for skins.minerva.scripts
Echo is now in complete control. Cleanup after ourselves.

Change-Id: I9a26c7a88f5e3ff19ec5b17b08a0d05c4f9e60ce
Depends-On: I9a6b06158d9083317aea46510c0c47980a25e50a
Bug: T221007
2019-10-16 09:27:24 +00:00
jdlrobson d3c0494a17 Dormant mobile notifications overlay lives in Echo
This code will be enabled when Iba1d7863171268066bf7597182c57a0a2041497f
relinquishes the responsibility for rendering the Echo notification badge
and wiring up of the related JS.

It makes 3 assumptions:
1) Minerva will expose a VERSION property on the skins.minerva.scripts module
to tell Echo it can begin control of the functionality
2) A new hook `SkinMinervaReplaceNotificationsBadge` will run on the server side
allowing Echo extension to render the Notifications badge in Minerva.
3) A new client side hook (echo.mobile) will fire whenever the Echo dialog is opened or
closed.

All code relating to Echo inside MobileFrontend and Minerva is
moved here.
CSS for the modules is kept in Minerva as skinStyles

This code remains dormant until Iba1d7863171268066bf7597182c57a0a2041497f lands.
It pre-registers a "to-be-created" hook SkinMinervaReplaceNotificationsBadge that
substitutes the Minerva badge.

It also watches the export value of skins.minerva.scripts for a VERSION value - when
this appears it will take the signal that it should manage the frontend code.

In the new system the mobile specific code is limited to the mobile version of
Minerva. The desktop version of Echo loads on Minerva desktop - presenting an
opportunity in future to consolidate both implementations to use the same component.
The mobile version of Vector and Timeless for example will load the mobile overlay
(with existing styling issues that we don't need to worry about right now given
we don't officially support skins other than Minerva as mobile)

Testers:
* Check require( 'ext.echo.mobile' )(); inside initMobile
inside ext.echo.init does not fire until
Iba1d7863171268066bf7597182c57a0a2041497f is checked out.

Depends-On:  I1a66939d2b596094b419de40b370e79f09c85581
Bug: T221007
Change-Id: I09c27a084100b223662f84de6cbe01bebe1fe774
2019-10-09 12:36:11 -07:00
Volker E dce5173703 Remove IE 6 & 7 hacks
Bug: T234582
Change-Id: I5208a57ab3b1b95e97ca8a0d3d9c1df6c57ebc3b
2019-10-03 19:05:38 -07:00
Roan Kattouw 83f8949dc5 Stop exporting wgWikiId, use wgWikiID from core
Update usages of the variable for the capitalization difference.

Depends-On: I4d289267991f1f9a8e0710ec6ee5a2131306c510
Change-Id: Ie49e898b33765aa0723501be8c0c30622e7cbd2f
2019-09-25 18:14:40 +00:00
jenkins-bot 30dbae4c02 Merge "Render HTML in notification snippet" 2019-08-21 08:11:28 +00:00
shivanshbindal9 2406462c01 Render HTML in notification snippet
The HTML tags are not parsed in notification snippet.

Bug: T226130
Change-Id: I94cd63d351ac034d80b58a934a823aa0efe18cf5
2019-08-20 23:54:15 +05:30
Kosta Harlan 2a4fde702a Use utility functions to improve code readability
Change-Id: Idf39028d41293b33153254f7648babc3a0cb2b82
Follows-Up: I8cdeb9ee920d3ec943e270eb00a6ef7f3a7449e2
Bug: T226127
2019-08-16 22:25:51 +02:00
shivanshbindal9 8821563955 Add unseen class to alert/message icons
When there are some new notifications during polling,
the unseen state of alert/message icons does not change.

Bug: T226127
Change-Id: I8cdeb9ee920d3ec943e270eb00a6ef7f3a7449e2
2019-08-16 20:32:11 +05:30
shivanshbindal9 2528e3394f Define preference for poll updates
New preference added so that user can set
* Displaying (n) total unread count in the title
* Displaying notification snippet for incoming notification

Bug: T229732
Change-Id: I35eb68dedf1e087b4668bfec404935f1244b3d0b
2019-08-06 19:42:49 +05:30
Roan Kattouw 092615db27 ext.echo.init: Un-dim badge if loading RL modules failed
We didn't have any error handling for this scenario previously, but the
recent refactor of this code made it more obvious that it was missing.

Change-Id: I146de3ed2cde1a9bd553fc4825c0e4e06130de65
2019-07-31 22:55:25 +00:00
shivanshbindal9 6be1eee1db Display notification text for incoming notification
As now polling is used to update the notification count on header icons.
If there are any new notifications then a snippet containing the header
part of the notification will appear using mw.notify().

Bug: T226130
Change-Id: Id38c8ebedebd4c68b9cef0635043d6f9304784dd
2019-07-31 17:54:20 +05:30
Roan Kattouw a3bfd725ea Bundle logger-related config vars with ext.echo.logger module
There's no real reason for these to be in MakeGlobalVariablesScript
because they don't really depend on the request context: they were being
omitted if the user was not logged in, but we can just check the user's
logged-in status in JS instead.

Bug: T221151
Change-Id: I2df6d7e061545d342bc3068dccd5ce2f6e85fe78
2019-07-23 21:48:42 +00:00
Roan Kattouw d378e4e3b9 Use packageFiles instead of startup module for config vars
Remove wgEchoMaxNotificationCount and wgEchoPollForUpdates from the
startup module and put them in the ext.echo.init module.

Change-Id: I03f9a3953aa97ead1a29c13a992a02404a6d0b68
2019-07-18 15:29:27 -07:00
shivanshbindal9 795b87d55b Change polling rate when document not visible
We currently poll for the count of notifications after some fixed amount of time even when the user is not using it.
There is no need to poll at same rate in that case and we can poll at slower rate.
The rate now is decreased by 5 times.

Bug: T227501
Change-Id: Id53a88e0d5659edb0dac77dd3e346e2d88e95f94
2019-07-13 17:11:08 +05:30
jenkins-bot e5cd928e13 Merge "Add visual cue to indicate change in notification count" 2019-07-02 00:19:37 +00:00
shivanshbindal9 1a035e1287 Add visual cue to indicate change in notification count
* Adds notification count(alert+messages) to the title
* The count is updated immediately when notification count changes
* This functionality is feature flagged(wgEchoPollForUpdates)

Bug: T225259
Change-Id: Ic92c50d9885b0e4325b253338023d37adf8d35d0
2019-07-01 14:31:36 -07:00
Isarra 0c0c0e596f MonoBook: Remove outdated skin styles and clean up some
Due to using ooui, and a lot of the styles being a lot more generic
in general these days for wider skin support, most of the skin
styles still included with Echo are no longer necessary or may even
be actively breaking things.

Remove a bunch of that, including some of the stuff for T226594 etc,
as we now have a more elegant solution in the skin itself.

Bug: T226684
Bug: T226594
Depends-On: I0ed21a78feb1b1298c30b969a1c80a4323e74043
Change-Id: Id3193a07f023eb0abc30fa24afe10da042fea876
2019-06-28 03:18:24 +00:00
Isarra 28dd2e0413 Modern: Remove outdated skin styles
Due to using ooui, and a lot of the styles being a lot more generic
in general these days for wider skin support, most of the skin
styles still included with Echo are no longer necessary or may even
be actively breaking things.

For Modern, basically just remove everything; nothing here seems to
apply anymore. Also frees us up to just fix the badge positioning
in the skin itself, and leave future maintenance up to the skin
maintainers, if anyone cares.

Bug: T226684
Change-Id: Id28bbc01b3b344dfeb39be1380a64c1368924289
2019-06-28 02:40:10 +00:00
Roan Kattouw d3653c649a Follow-up ea856105f2: fix horizontal scrollbars in Monobook
A positive text-indent causes horizontal scrollbars, so just hide the
screenreader text by making it transparent, and accept that we're going
to have the hover tooltip issue (T161302) in Monobook.

Bug: T226594
Change-Id: I6cb9ec146c2b469cbfb1fdc57937794d237e46db
2019-06-26 15:48:58 -07:00
jenkins-bot 1c3cb04618 Merge "NotificationBadgeWidget: Don't double-convert numbers" 2019-06-25 21:24:14 +00:00
Roan Kattouw d95b4bfaac NotificationBadgeWidget: Don't double-convert numbers
We shouldn't run numbers through convertNumber() twice.

Change-Id: If0ab0cad48761eaa1753f65e9d1557d84ec31961
2019-06-25 14:11:26 -07:00
Roan Kattouw ea856105f2 Fix badge icons in Monobook
In c86a1a5cf, the structure of the badge was changed, and the hack for
hiding the screenreader text in the badge was updated accordingly.
However, the Monobook styles were not updated, and this caused the badge
icons to be positioned off-screen.

Update the Monobook styles for the new badge structure, and use a
different hack for hiding the screenreader text because the one used for
other skins doesn't work in Monobook.

Bug: T226503
Change-Id: I190d2719addfbe50a7108193848bf23eef54bccf
2019-06-25 13:41:58 -07:00