Commit graph

470 commits

Author SHA1 Message Date
lmora ee47c3d0bb Create new skins.minerva.styles module
This merges the existing modules skins.minerva.base.styles
and skins.minerva.mainMenu.styles into a new module
skins.minerva.styles which is named consistently with
Vector's style module.

The old modules will be kept for caching reasons
for at least one, and possibly two deploy cycles,
after which we will continue this task.

Additional change:
* drop .minerva-icon--{name}-base20 and .minerva-icon--{name}-disabled variants
since these are no longer utilized and only serve cached HTML

Bug: T266361
Change-Id: Iccf415a22e9535603befae25b8cea467f9905437
2024-11-07 22:40:28 +00:00
Reedy ae6dc84fed Use explicit nullable type on parameter arguments
Bug: T376276
Change-Id: I646483668294133240d43a34ce74b6ca1060f848
2024-10-28 22:23:56 +00:00
Fomafix 229a610ae7 Use PHP type hints in PHPUnit tests
* Add PHP type hints to private functions.
* Remove @param and @return if redundant to type declaration.

Change-Id: I40df9579af92ad1af820d3706a8cd907e9950ce2
2024-10-21 19:20:00 +00:00
Umherirrender 8ade6611aa Use namespaced classes
Changes to the use statements done automatically via script

Change-Id: I17aa533bb81078ec68f67e81e44f9a66477b61ab
2024-10-20 09:28:03 +02:00
Jon Robson 98521bbb68 Drop base20 icon class suffix
Following the migration to Codex, icons do not need suffixes for
their icons.

If we merge this now, we don't need to worry about caching when working
on Bug T266361.

Bug: T266361
Change-Id: Iafeb21858c89df1af35660eb63889fa5335e2b34
2024-10-16 15:15:47 -07:00
Željko Filipin b85fdb68d7 selenium: Delete tests disabled more than a year ago
Tests in the three deleted files were all disabled in 2022 and 2023.

Bug: T280652
Change-Id: I727acd43726075282f10811c4529daad91ad71c5
2024-10-16 12:36:54 +02:00
Jdlrobson 43ed38c2bc Revert "Fix missing wikibase link in Minerva sidebar"
This reverts commit 0585dea9f9.

Reason for revert: Moved logic for wikibase link into Wikibase repo (see 1079302)

Change-Id: I780baa6cd17f8b52ae4bae88e6686c22760f410d
2024-10-11 11:58:51 +00:00
jenkins-bot ad43e50cc8 Merge "selenium: Document when, how and why a test is skipped" 2024-10-07 14:32:12 +00:00
Željko Filipin 35800f195b selenium: Document when, how and why a test is skipped
Bug: T280652
Change-Id: I444ae022d34c7a263abfc60370fb9341413efb4b
2024-10-07 15:58:11 +02:00
Jon Robson 3bf80a62ef Fixes Watchstar display when clicked
Bug: T376359
Change-Id: Iaeda67b6ef063596a9c4ba43084aa6bc2472e0e7
2024-10-04 19:52:18 +00:00
Željko Filipin aa876e4b92 selenium: Document when, how and why a test is skipped
Bug: T280652
Change-Id: I9f71a95bcf605dbf83b78c198a593fddbc6863db
2024-10-02 11:31:13 +02:00
Sean Leong (WMDE) 92a0197c9f feat: additional test coverage for Minerva 'TOOLBOX'
Bug: T66315

Change-Id: I03cb66a55fddcbae31e6f59f268ccfa7a31318ef
2024-09-16 10:48:15 +00:00
joelyrookewmde 0585dea9f9 Fix missing wikibase link in Minerva sidebar
Bug: T66315
Change-Id: I01b5fa5be48d3521d57267084b420dcdcbba92f9
2024-09-10 16:21:45 +02:00
Fomafix 93945857b8 Fix eslint warnings in Selenium JavaScript code
Change-Id: I02d2114e668d1ea9d2a28d2823dc6f9bfa032b8a
2024-09-04 08:33:13 +00:00
Timo Tijhof 4ca4febd89 tests: Adopt private require() for skins.minerva.scripts (take 2)
Resubmission of Ib68f45d93a (548e94da98), which caused an error due
to `require('../../`)` not working outside the module base directory.
This is fixed with regression test in T373065.

Further confirmed in this repo by viewing
`/wiki/Special:CreateAccount?campaign=loginCTA&useskin=minerva`
with this patch applied. Without the T373065 fix, the console warns:
> Error: Cannot require undefined file …/ToggleList.js

-------

Support for private require() in tests is available since MW 1.41:
https://mediawiki.org/wiki/RL/PKG#Private_export_and_import
https://mediawiki.org/wiki/RL/PKG#Virtual_files_in_traditional_modules

This fixes a confusing assertion in page-issues/index.test.js,
where for "insertBannersOrNotice()" it was asserting that the HTML
contain "⧼skin-minerva-issue-learn-more⧽", where the ⧼ character
indicates the message is not found (i.e. an error).

The test had to be written this way in order to pass, because
the skins.minerva.scripts module was not actually loaded, and thus
its templates and messages are not present either. This lack was
filled in by index.js for mw.templates, but not mw.messages.

By adopting private require(), these workarounds can all be removed.

== Motivation ==

In change I3a4024ccf90e505581, I'm working on improving the testrunner
config to enforce uselang=qqx on all tests. This is passing except
for GrowthExperiments and Minerva, both of which have the above
workarounds in place that caused a message to be undefined, and then
kept in the assertion expectation. When using uselang=qqx, values are
returned as (key) instead of ⧼key⧽, which exposes these message
existence errors.

By removing this workaround, the test will simply import the module
in the test as normal, thus the messages will exist, and thus it
will expect (key), and thus it will continue to pass even after
enforcing uselang=qqx.

Bug: T373482
Depends-On: I777f2c12e845a738edeac00e19818d4c939a1ef1
Change-Id: I6348e5ae00776c2c01d91fa90a431b6ffe3da25d
2024-08-29 20:34:16 +00:00
Jdrewniak dbe79167e5 Revert "tests: Adopt private require() for skins.minerva.scripts"
This reverts commit 548e94da98.

Reason for revert: The patch was causing the following error on pageload

    Error: Cannot require undefined file includes/Skins/ToggleList/ToggleList.js
    require startup.js:1006

Bug: T373482
Change-Id: I22751109c124795af7d2e0ad6c4104745b2d6632
2024-08-27 20:06:24 +00:00
Timo Tijhof 548e94da98 tests: Adopt private require() for skins.minerva.scripts
Added to MediaWiki core last year with I9fca9fdf9b7623b1.

This fixes a confusing assertion in page-issues/index.test.js,
where for "insertBannersOrNotice()" it was asserting that the HTML
contain "⧼skin-minerva-issue-learn-more⧽", where the ⧼ character
indicates the message is not found (i.e. an error).

The test had to be written this way in order to pass, because
the skins.minerva.scripts module was not actually loaded, and thus
its templates and messages are not present either. This lack was
filled in by index.js for mw.templates, but not mw.messages.

By adopting private require(), these workarounds can all be removed.

== Motivation ==

In change I3a4024ccf90e505581, I'm working on improving the testrunner
config to enforce uselang=qqx on all tests. This is passing except
for GrowthExperiments and Minerva, both of which have the above
workarounds in place that caused a message to be undefined, and then
kept in the assertion expectation. When using uselang=qqx, values are
returned as (key) instead of ⧼key⧽, which exposes these message
existence errors.

By removing this workaround, the test will simply import the module
in the test as normal, thus the messages will exist, and thus it
will expect (key), and thus it will continue to pass even after
enforcing uselang=qqx.

Change-Id: Ib68f45d93a7054ed8bd35fc5644e2852f2f90248
2024-08-23 19:04:36 +00:00
libraryupgrader 842a91590a build: Updating npm dependencies
* eslint-config-wikimedia: 0.27.0 → 0.28.2
  The following rules are failing and were disabled:
  * tests/selenium:
    * implicit-arrow-linebreak
    * no-mixed-spaces-and-tabs
* grunt-banana-checker: 0.11.1 → 0.13.0
* stylelint-config-wikimedia: 0.16.1 → 0.17.2
  The following rules no longer exist and were removed:
  * stylistic/selector-list-comma-newline-after
* braces: 3.0.2 → 3.0.3
  * https://github.com/advisories/GHSA-grv7-fg5c-xmjg

Change-Id: Ia94454c1da778f241085714e1601a0233d547570
2024-08-01 15:27:33 +01:00
shyblumer 46a0597a4f selenium: Add date and bug ID to skipped tests
- Include date and bug ID in skipped test comments
- Helps track and identify unfixed tests

Bug: T280652
Change-Id: I2e78385e3ed5f0cb073677d4b4d0bcb74454c66f
2024-07-14 22:53:20 -04:00
Umherirrender 77fe39e565 tests: Use renamed class BundleSizeTestBase
Follow-Up: I131e0d85bd14e75aaebd6f212b2e64a45d4c73a2
Change-Id: I964bd25209fa07406e57a7571c2a06b572f590c4
2024-06-12 20:37:51 +02:00
Fomafix 4e4caef154 Migrate service 'Minerva.Menu.PageActionsDirector' into new class PageActions
The service 'Minerva.Menu.PageActionsDirector' is bad because it depends
on the global state.

Create a new service 'Minerva.Menu.PageActions' and inject this.

Change-Id: Ie84d02ef29d3b7809f490a1593cb2f3cef60b3a3
2024-06-04 20:10:41 +00:00
jenkins-bot 4eb77c4801 Merge "SkinUserPageHelper: Reset fetchedData on setTile" 2024-06-04 20:07:26 +00:00
Fomafix ad1fa7fbb7 SkinUserPageHelper: Reset fetchedData on setTile
This change restores the special toolbar behavior on user talk pages
lost in I80342e5168435c5318c378e2ac8a9a3c7a28eb4c.

Also add a test case that checks the cache on multiple setTitle calls.

Bug: T366645
Change-Id: Ifb481c546f2f77bd502cd9390d371a6e82bd5e69
2024-06-04 19:42:35 +00:00
Ed Sanders a6ab8d6da3 Prefer arrow callbacks (ESLint autofix)
Change-Id: I52b2feacd6216e99e04f193ba963e897b3e1a771
2024-06-04 08:01:54 -07:00
Ed Sanders 5732926921 ESLint: Enforce no-underscore-dangle
The rule is only broken once in reference to a MF class,
so just switch those to inline disables.

Change-Id: I96ebd7f034246da13788b8c8673bff203c18b2db
2024-06-03 12:59:48 +01:00
Ed Sanders a5c9a506c9 ESLint: Remove unnecessary config no-var:error
This is the upstream default.

Change-Id: I09797b9e9243707f0b2a7942d34d27b1271d9eb4
2024-06-03 12:56:30 +01:00
Fomafix 342beaeb18 Update namespace of PHP classes
Change-Id: Ia8a8d643a8e96372ecc7e481c0e3d50a31ccd4e8
2024-05-21 15:08:47 +00:00
Fomafix 7f4c7d2db2 Add eslint-disable-next-line security/detect-non-literal-regexp
Change-Id: Ie85cdab8d2407fd432ae420ae46970490c2f693d
2024-05-14 12:41:50 +00:00
jenkins-bot 88d092021d Merge "Selenium: Drop dead code" 2024-05-10 13:57:31 +00:00
Fomafix e85265ada5 Improve PHP class references
* Declare class names from other namespaces in the `use` block.
* Use Foo::class instead of 'Foo' to reference a class name.

Change-Id: I5a1aba6b0cc8842d71b6b6df0a0b67e16e5b6453
2024-05-07 18:30:43 +00:00
Jon Robson 14ca9d0ad9 Selenium: Drop dead code
All these tests and associated steps are skipped and apply to pages that
no longer exist - Special:MobileDiff and Special:MobileHistory and can
safely be removed.

Change-Id: I15edf8c2fc88fbc01585c2b7e1243daa6d9210b9
2024-04-26 10:15:10 -07:00
Fomafix c43cdce48c Some small JavaScript/jQuery improvements
Change-Id: I33feb8bccbd870f589a01dc187e6155b7498714c
2024-04-08 19:45:22 +00:00
Fomafix effd4fe133 Use eslint rule "no-var": "error" and replace all var
Change-Id: I67acf88e1b8de55054248d7cf8ca622d5772ea6f
2024-03-29 07:40:22 +00:00
jenkins-bot 90470423ac Merge "Use alphabetic order for eslintrc rules" 2024-03-29 01:26:50 +00:00
Fomafix 05eb2ac47d Integrate service 'Minerva.Menu.MainDirector' into SkinMinerva
The service 'Minerva.Menu.MainDirector' is bad because it depends
on the global state.

Change-Id: I170653006356932ecdd909b14c193f42c4a5f511
2024-03-28 17:33:18 +00:00
Fomafix c50069252d Integrate service 'Minerva.Menu.UserMenuDirector' into SkinMinerva
The service 'Minerva.Menu.UserMenuDirector' is bad because it depends
on the global state.

Change-Id: Ife13188745b39844356e7976379582d5f451f5a3
2024-03-28 17:32:42 +00:00
Fomafix 86fb2a8d18 Inject service 'Minerva.SkinUserPageHelper'
Change-Id: I91d8066ea860bd4aa5f19f4c326fad032be5b9d0
2024-03-28 17:30:01 +00:00
Fomafix 0adbe80280 Use service 'Minerva.SkinUserPageHelper' in SkinOptions
Change-Id: I014e61c6692adbbe449f1e6aa9c6ae73dbcff925
2024-03-28 17:27:45 +00:00
Fomafix f8b8a83dc5 SkinUserPageHelper: Use alphabetical order of the parameters
Change-Id: I2bce7abfa2740ca7f3fb87968462cdc8eacbde7d
2024-03-28 15:20:36 +00:00
Fomafix 1c26798431 SkinUserPageHelper: Remove global state from constructor
* Move global state parameters to new methods setContext and setTitle.

This change solves the circular dependency error for service
'SkinUserPageHelper'. The service will used in SkinOptions in the
follow-up change I014e61c6692adbbe449f1e6aa9c6ae73dbcff925.

Change-Id: I80342e5168435c5318c378e2ac8a9a3c7a28eb4c
2024-03-28 13:10:48 +00:00
Fomafix dfa61af611 Use alphabetic order for eslintrc rules
Change-Id: Ic7afff052c004ba179a8814f79e7722fb66bdbbc
2024-03-27 19:54:21 +00:00
Fomafix 220bf6ff89 Inject service 'Minerva.LanguagesHelper' into SkinMinerva
Change-Id: Ie81195f31194bab819491576681b02660ec057b4
2024-03-25 22:36:07 +00:00
Fomafix f68b218076 LanguagesHelper: Move $out from contructor to doesTitleHasLanguagesOrVariants
Services MUST NOT vary their behaviour on global state, especially not
WebRequest, RequestContext (T218555).

Change-Id: I4b73ef713166d8b254023c1eebbb45c963880a99
2024-03-25 22:34:37 +00:00
Fomafix 57d1f15d64 Inject service 'Minerva.Permissions' into SkinMinerva
Change-Id: Ie68691d7030ea622f2bc232fea2df49b70484e19
2024-03-25 21:44:13 +00:00
Fomafix 999f04c366 Inject service 'Minerva.SkinOptions' into SkinMinerva
Change-Id: Ia7e7660c55e16731366bdf6332d5237188e9bbb1
2024-03-25 13:17:32 +00:00
Moh'd Khier Abualruz 5d6b866890 Rename the skin night mode classes to more readable classes
The classes:
- skin-night-mode-clientpref-0
- skin-night-mode-clientpref-1
- skin-night-mode-clientpref-2
is being replaced with
- skin-theme-clientpref-day
- skin-theme-clientpref-night
- skin-theme-clientpref-os
- Moved $forceNightMode to be a text parameter (dat|night|os)
- Keep adding the old classes to the html element, to give the ability of gradual deployment

The preference is renamed from minerva-night-mode to minerva-theme (a follow up to consider
migrating existing values will follow).

The query string minervanightmode continues to behave the same but now
accepts other values such as day, night and os.

Bug: T359983
Change-Id: Ia253de68f94236e7fe2219b736dd6084c64ce838
2024-03-19 23:12:59 +00:00
jenkins-bot 5b9fcf1260 Merge "Move Hooks::setMinervaSkinOptions to class SkinOptions" 2024-03-11 23:15:42 +00:00
jenkins-bot 6954616670 Merge "LanguagesHelperTest: Use @dataProvider to configure test cases" 2024-03-11 07:18:51 +00:00
Umherirrender 88b78b247c build: Upgrade mediawiki/mediawiki-codesniffer to v43.0.0
Change-Id: I693651564cc544b881e1a45ea8abeff8d58d8fb6
2024-03-11 00:34:07 +01:00
Fomafix 52dd233f5e Move Hooks::setMinervaSkinOptions to class SkinOptions
This allows to inject the services.

Change-Id: If091c7c5df2d498cdb7d82db89876dab8a82c3fc
2024-03-09 22:34:28 +00:00