Commit graph

1233 commits

Author SHA1 Message Date
jenkins-bot 5128e3c288 Merge "Fix improper @private documentation in .js code" 2024-10-08 11:23:15 +00:00
Sjoerd de Bruin e289b69f20 Set Codex-token for @notification-background-unseen
Bug: T370042
Change-Id: Ic91a853431a813aa77e8d7dcfadf863da56182c1
2024-09-02 17:31:47 +02:00
Dr4goniez 14b06b78e5 Consistent Casing for "iconUrl"
Replaced all occurrences of "iconURL" in the extension's repo with
"iconUrl" after spotting a typo in `mw.echo.dm.NotificationItem.js#13`,
"iconUrl" (find the correct "iconURL" in `mw.echo.Controller.js#394` in
the diff). Thankfully the typo was only in the documentation block, but
given the casing of other config object properties like "primaryUrl"
and "secondaryUrl", it would be best to make them all consistent to
prevent any bug that could happen in the future.

Change-Id: I56e6a1d2c7695204b35e767679a27ee22b3fe4bc
2024-08-17 07:09:41 +09:00
thiemowmde fbcb1a5831 Fix improper @private documentation in .js code
@private usually means "cannot be used outside of this class". But
this is used. I assume it's meant to be @internal as in "internal to
this codebase".

Change-Id: I9326e17f706af336ea0d4b7c0af95330ed575810
2024-08-11 17:51:26 +02:00
Jon Robson ccbe3feadb Dark mode styles should not apply to printed content
Bug: T371331
Change-Id: Ia5f1293dba2e7037de6058475b603d0928dbb3b0
2024-08-08 20:28:40 +00:00
Rummskartoffel 17b4f21ff0 Immediately show middle-clicked notifications as read
Before this patch, middle-clicking notifications would still mark them
as read, but the user would only find out upon closing and re-opening
the notification tray or reloading the page.

Bug: T340179
Change-Id: Ic29af0c70354087cf5f783b5a7370241a86b4bf3
2024-08-04 22:45:38 +02:00
Hannah Okwelum d5c8e435b7 Prepare Less styles for math=parens-division
Bug: T368921
Change-Id: If675d293fd625b20dba935b56ebf85f1b03ca5e8
2024-07-31 20:18:16 +01:00
Dr4goniez 68aa29fb80 Fix type error caused by spread operator on number
`groupItems[ i ].id` is of type number, and using the spread operator
on it results in a type error. This prevented users from marking
multiple cross-wiki notifications as read, with the associated button.

Bug: T368643
Change-Id: I53d404445956de288aeda8fbfe1bdd1256214839
2024-07-24 15:45:54 +00:00
bwang 8e635e0bca Fix dark mode issues on Special:Notifications
Bug: T358405
Change-Id: I3c7e1c1884484386df9ef8f54d48af06e9a6c2d2
2024-06-25 19:18:52 +00:00
jenkins-bot b818832d4e Merge "Adjust notification popup arrow in small screens" 2024-06-21 19:07:21 +00:00
Sergio Gimeno 1d0b6052e6 Adjust notification popup arrow in small screens
Use the max width breakpoint from wikimedia-ui-base
to add or remove popup container padding. That is
because the container has no padding in small
screens (when Vector's header breaks in two rows).

Bug: T366672
Change-Id: Idb0f844189cc221009cbb3e06c8c3fe0096bd0c2
2024-06-21 18:17:32 +02:00
bwang 781d532180 Enable dark mode for echo overlay
Bug: T366322
Depends-on: I01cdde979b2ddf64d54013466a3fe51a493860cc
Change-Id: I90f2c3c5098a418a7e40204c9b2384711b6ddce3
2024-06-20 14:40:17 -08:00
Michael Große 6a9528fd11 Fix Special:Notifications
This was broken when replacing `$.extend` by `Object.assign` in
I1e603647c161bf940690f85f676edd7ebde7917d (commit 47ea647).

`Object.assign` fails when the first argument is `undefined`, but
`$.extend` doesn't.

Bug: T368029
Change-Id: I13025a783c7f4d173dce096efa47f659273f0dd5
2024-06-20 12:49:32 +02:00
Ed Sanders c191982a81 build: Update stylelint-config-wikimedia to 0.17.2
Change-Id: Ide5b1395ea50e3d9fb15ca4690bce1cb9be90715
2024-06-13 16:12:07 +00:00
Ed Sanders 47ea647e45 build: Update eslint-config-wikimedia to 0.28.2 and autofix
Change-Id: I1e603647c161bf940690f85f676edd7ebde7917d
2024-06-13 16:11:59 +00:00
Ed Sanders 83024319a4 Convert some local functions to arrow functions
Change-Id: Ib16745cea5502e296d05255ec836c24779aeca64
2024-06-13 16:15:19 +01:00
Ed Sanders 45ba7840da Convert local function to arrow function to fix context
Bug: T367366
Change-Id: Ie6554c869ce804445b6678d74eee9550b9dc82f9
2024-06-13 15:59:19 +01:00
jenkins-bot 58e577c3a4 Merge "Allow sidebar to be slightly smaller" 2024-06-08 04:30:52 +00:00
jenkins-bot 7008980df0 Merge "Special:Notifications: Add additional wrapping" 2024-06-08 04:30:39 +00:00
Derk-Jan Hartman 7eec6f5829 Allow sidebar to be slightly smaller
This reduces the sidebar to 15em using flexbox when required. This
keeps the layout as columns just slightly longer, when compressing
which especially on vector-2022 will happen quite a bit.

This required making the lines in the optionwidget flex as well,
so that the ellipsis doesn't depend on a fixed value any more.

Bug: T337954
Change-Id: I8aadb1799da33161abc703344e9ab90bb747c604
2024-06-08 03:57:02 +00:00
Derk-Jan Hartman 1594089142 Special:Notifications: Add additional wrapping
Bug: T337954
Change-Id: Ia34e68eff3bcd52bd4ba0017bd5b8b271fd528c6
2024-06-07 20:35:15 +00:00
libraryupgrader 0d8e740635 build: Updating npm dependencies
* eslint-config-wikimedia: 0.27.0 → 0.28.0
  The following rules are failing and were disabled:
  * modules:
    * no-jquery/no-extend

* grunt-stylelint: 0.19.0 → 0.20.0
* stylelint-config-wikimedia: 0.16.1 → 0.17.1

Change-Id: I45a64d80ef5aa50b4a1abd871605f52682ab9b5b
2024-06-06 16:47:09 +00:00
Ed Sanders f830764f11 Remove unnecessary context variables
Change-Id: I3c5e4e2093b1fceb575d345b04f390a0dfec5f66
2024-06-03 14:49:40 +01:00
Ed Sanders d79f8858aa Use variadic args
Change-Id: I4c12dfbbfa86aace78ad6cc1d154e46ca0707072
2024-06-03 14:49:39 +01:00
Ed Sanders 2dd3780966 ESLint: Prefer arrow callbacks (autofixed)
Change-Id: I01da3714b1f5d9b1926ee4394c15f594efb01245
2024-06-03 14:49:38 +01:00
Ed Sanders 573e7c74ee Remove unnecessary item.disconnect
This button doesn't have any events connected, and
the wrong `this` is used anyway.

Change-Id: Idbb407d63921c19c596268ad4fe274c423ea81c7
2024-06-03 14:14:08 +01:00
Ed Sanders e164a32afe ESLint: Manually fix no-var and prefer-const errors
Change-Id: I9d1588ac4d414b5e7d65d14aa26d2c3eb79878ad
2024-06-03 13:25:03 +01:00
Ed Sanders 1d3be2c605 ESLint: Autofix no-var errors
Keep the rule and prefer-const disabled as they will
require manual fixing.

Change-Id: Idd31eb7d7a456b10c07b905b4b837dd4c890eb71
2024-06-03 13:22:48 +01:00
jenkins-bot b2d397dea9 Merge "Simplify Special:Notifications layout using flexbox" 2024-05-30 18:18:25 +00:00
Novem Linguae 030bc26ae9 JSDoc: convert @cfg to @param
- convert @cfg to @param
- in mw.echo.dm.NotificationItem.js, add backticks around
  a block of code in a docblock so that it renders nicely
  in the generated /docs/

Bug: T138401
Change-Id: If7df2ab72fa835af662a8f01cc0c5edb1cb79c2b
2024-05-26 18:43:21 -07:00
jenkins-bot fa61b08243 Merge "Remove unused FooterNoticeWidget" 2024-05-16 20:52:15 +00:00
Bartosz Dziewoński b6b19e1a2f Simplify Special:Notifications layout using flexbox
Compared to the previous approach using table layouts, it is much
easier to control which elements are allowed to extend to maximum
available width, and to provide alternative layouts for mobile.
There should be no visual changes.

It doesn't require using `white-space: nowrap` to prevent elements
from being squished, which will help with T237244.

(These styles are only loaded on Special:Notifications, they don't
apply to the flyout.)

Bug: T237244
Change-Id: I09e692e427f61fabd53b3824a1ed7e4f8e76fad4
2024-05-15 23:41:59 +02:00
Bartosz Dziewoński 9699c06f1a Remove unused FooterNoticeWidget
Unused since 1eef6eeee3. After 6 years
we can probably say we're not going to need them again ;)

Change-Id: I9bab88cf56a5ecbcf8e1557f1635dd42e29deefb
2024-05-15 22:10:22 +02:00
Novem Linguae 08f8890055 eslint: remove redundant ruleset wikimedia/jsdoc
According to my testing, rulesets wikimedia/client-es6
and wikimedia/server already contain the ruleset
wikimedia/jsdoc. So I don't think it needs to be declared
twice.

Bug: T365047
Change-Id: I5d7fef0c9594cc4c8765877aa6f783543e8a00ed
2024-05-15 17:31:36 +00:00
bwang b5d2cb2b22 Add notheme class to Echo
Bug: T363779
Change-Id: I80f7005b189a51cbc1d526efc64efa76c706cc5b
2024-05-07 13:34:14 -05:00
Siddharth VP e27f4937ff Add API module for sending notifications
Allows users to send notifications to themselves (T306211). For sending
notifications to others, a new permission is created (echo-create),
assigned only to bots by default. For now, only one user can be notified
in one API request.

If the email flag is set in the API params, the notification is also
sent as an email, provided the user hasn't disabled email notifications
for the "api-triggered" category.

This feature is behind a feature flag. Set $wgEchoEnableApiEvents = true
to use.

Adapted from If0267a38be7d454e3d284d30f93c93a828288dd7.
Co-authored-by: TheresNoTime <starling-ctr@wikimedia.org>

Bug: T58362
Bug: T306211
Change-Id: I94642bff5dcb075cb9db862206d59c19edad9fd1
2024-05-04 17:43:39 +03:00
Ed Sanders df8fbfed38 Replace jsduck with jsdoc
Change-Id: I2a1bfedeba66c9ec1b3ee2640a77d5ef8782530c
2024-04-30 15:29:06 +01:00
libraryupgrader 049709a167 build: Updating eslint-config-wikimedia to 0.27.0
Change-Id: I682039a6f58a820ab46ab5d596922264f36509c9
2024-04-17 04:55:13 +00:00
Reedy 2b58f29d8c Fix casing of MediaWiki
Change-Id: If581a54ac1025bb13ff8fce5e8f64b92c71de986
2024-03-12 15:25:19 +00:00
Ed Sanders 2cac61da34 Move var declarations inline
Change-Id: I8734c30880bcb416a4945f6653555dc1189e7733
2024-03-05 22:39:09 +00:00
Ed Sanders 1b5116d668 Use native URL API, instead of deprecated mw.Uri
Change-Id: Ia6bf82de647eb051f2719c13ceff5a2b07a3721f
2024-03-05 22:08:59 +00:00
Jan Drewniak 7f23c77614 Support night mode in Minerva with .skin-invert class
Adds support for the night-mode theme in Minerva by
adding the `.skin-invert` class to the mobile overlay content.

Bug: T356425
Change-Id: I5ccb486d7af798a9e3da83c28246dafb49b72443
2024-02-22 14:02:43 -05:00
Volker E 5255d40496 build: Update 'svgo' to latest v3.2.0
This update of 'svgo' dependency includes three optimizations on
converting path commands, which
- improves closing paths and how we determine if to use absolute or
  relative commands.
- round arc or convert to lines based on the geometric sagitta
- convert cubic Bézier curves to quadratic Bézier curves where possible

Bug: T354875
Change-Id: Ia2e8e947c7d10fa754885c8d917dc0616708fbaf
2024-01-11 19:07:46 +01:00
jenkins-bot 17ec20e0d6 Merge "Prevent clicks on bundled notif list from activating the bundle link" 2024-01-02 13:00:29 +00:00
jenkins-bot 8641483ac4 Merge "Fix borders of bundled notifications inside a bundle" 2024-01-02 13:00:26 +00:00
Bartosz Dziewoński de94e4ebe0 Prevent clicks on bundled notif list from activating the bundle link
If you click "Expand" on a notification bundle, the list of individual
notifications appears below. The list has a thin band of whitespace
around it (with grey background). Clicking inside that whitespace,
outside of the list items, would activate the bundle's primary link,
even though the cursor state did not show that would happen.

Change-Id: Id8c60503fa45f61df5bfaa07e0184634a5263c61
2023-12-16 02:28:13 +00:00
Bartosz Dziewoński 113da4ec5d Fix borders of bundled notifications inside a bundle
Follow-up to 00d6928144. I simplified
the styles too much :( They worked for cross-wiki notifications, but
not regular bundled notifications. I didn't realize they were styled
differently…

* Add the border to bundled non-cross-wiki notifs
  (this requires changes in SortedListWidget.js to add a wrapper)
* Hide the border until the list loads
* Remove unnecessary margin

Change-Id: I30c5bec11ddb49defa5957f0917f01057a3c21e7
2023-12-16 02:13:09 +00:00
Ed Sanders 2f61c46cf0 build: Update linters
Change-Id: I234e460ce1d1887af17c90cb9536aea76e295ca8
2023-12-04 14:11:35 +00:00
jenkins-bot 70051070e4 Merge "Simplify notification widget border styles" 2023-11-28 23:19:44 +00:00
jenkins-bot cf9ba679be Merge "Fix deprecated code paths" 2023-11-27 12:58:08 +00:00