* Using the new ConfigHelper, support disabling night mode on certain
pages via configuration options
* In addition, adds test coverage for this case and the query parameter
case (in a new integration test file as we now require accessing the
service container for request context)
* Finally, supply a default configuration in skin.json with all the
values set to null
For the easiest possible approach while we evaulate our general feature
management system, this logic is handled inside of getFeatureBodyClass
using the new shouldDisable general function. In the future, it may
make sense to break this out into its own requirement class, but for now
that feels premature
Bug: T359606
Change-Id: I3e7a4720ec3cc2afd9777e36f59aa56b682258f0
This class is being used in both vector and minerva, and we are
currently depending on it working for our night mode rollout, so let's
add some test coverage! Also fixed a small spacing issue in production
code that was bothering me lol
Note: these are not totally exhaustive - next steps would be to ensure
that the exclusions/inclusions work with arrays and not only single
elements, but hopefully this helps build some confidence ☺️
Change-Id: Iebea43eae6b1517fd778763db4f5db3b0fd9c30f
Unblocks CI for Wikibase extension.
CI failed in I824acad352c366a35a243dac2086e3c5e98bc6eb
Bug: T350338
Change-Id: Id9926ff9a60cb0cac56a612a792d5ffde55c4c63
- Loaded new skins.vector.search.codex.scripts module in skin.json, with only the CdxTypeaheadSearch component with codexScriptOnly flag set to true.
- Included skins.vector.search.codex.scripts in the script loading configuration for Vector22 within skin.json.
- Turned off the "interface-message-box" feature within Vector22's skins.vector.styles configuration in skin.json, as Codex now supplies these styles.
- Fix the style selector to add `.cdx-button` to `.vector-limited-width-toggle` in BottomDock.less since using the codex style
- Substituted "codex-search-styles" with "skins.vector.search.codex.styles" in the existing configuration.
- Ensured the availability of skins.vector.search.codex.scripts module for use, marking it in the list of modules in skin.js.
- Modified App.vue to utilize skins.vector.search.codex.scripts instead of @wikimedia/codex-search.
- Update App.test.js.snap to the latest output form
- Update bundlesize.config.json with newest values
Bug: T356677
Change-Id: I7fc223db01171efe6656792530d4b625be4c8edc
Some feature requirements needs access to the request user or title.
Currently the context is given in the ServiceWiring callback,
access to RequestContext::getMain() should be avoided during service
wiring (T218555).
Create a factory to hold the code from the service wiring and call the
factory with the request context from the skin to get a feature manager.
Bug: T359665
Change-Id: I57515ec02ed454620f729a109d0ace43b447b6ce
Adds tests for LanguageService in Vector skin.
Covered:
- `testConstruct`: Validates property initialization.
- `canWordsBeSplitSafely`: Tests that the language is splittable or not.
Change-Id: Icc1c269c56e0e53c624074516aee95ba242a55d7
Adds tests for VectorComponentMenu in Vector skin.
The test suite includes the following validations:
- Constructor initialization with expected parameters and behaviors.
- Validate counting logic for menu items.
- Validates `getTemplateData` method's output for correctness.
Change-Id: Ia52aa70e9213f6627d063d520fdbb2e353f0bfcb
Adds tests for VectorComponentMainMenu in Vector skin.
The test suite includes the following validations:
- Constructor initialization with expected parameters and behaviors.
- Correct identification of 'is-pinned' state
- Inclusion of data for first portlet and rest portlets
- Handling of pin/unpin actions and language alert considerations
- Proper integration of menu elements based on user and feature flags
Change-Id: Ie408ff668893d1de2cf9dd1211a9c82c0b882f99
Adds tests for VectorComponentMainMenuAction in Vector skin.
The test suite includes the following validations:
- Constructor initialization with expected parameters and behaviors.
- Validates `getTemplateData` method's output for correctness.
Change-Id: I5deda64dc1bd3db85df69d0bb5a5a27f6fb8c1ff
Adds tests for VectorComponentLanguageDropdown in Vector skin.
The test suite includes the following validations:
- Proper handling based on page type (subject/talk).
- Correct labeling and icon selection.
- Accurate class and aria label configuration.
Change-Id: I145cb250c513f3f81e780195485907897788f5c4
Adds tests for VectorComponentDropdown in Vector skin.
The test suite includes the following validations:
- Correct template data generation.
- Proper label, tooltip, and icon handling.
- Accurate CSS class construction for various states.
Change-Id: Iafd28cfe62eb4b8c6039f819b9d8f005b0b32d48
Adds tests for VectorComponentClientPrefs in Vector skin.
The test suite includes the following validations:
- Both pinned and unpinned states
- Correct structuring of 'data-pinnable-header'
Change-Id: I745559b2f738b4bed0f152fc8de3af1653b96ecd
Adds tests for VectorComponentButton in Vector skin.
The test suite includes the following validations:
- Various button configurations and expected CSS classes.
- Accurate template data for label, icon, href, and custom attributes.
- CSS classes according to weight, action, and iconOnly.
Change-Id: I228c197e5adee59a79ab6e2aad74ff0f18ef6b38
Adds tests for VectorComponentPinnableHeader in Vector skin.
The test suite includes the following validations:
- Correct template data generation based on constructor parameters.
- Accurate label generation from MessageLocalizer.
- Conditional logic for 'moveElement' affecting container ID attributes.
Change-Id: I2412c86e08dfca088ca57330b4dd078c212513f9
Adds tests for VectorComponentPinnableContainer in Vector skin, ensuring:
- Proper initialization with ID and pin status.
- Correct template data based on init params.
- Consistent template data for pinned/unpinned states.
Change-Id: Iec33c11b0afbe2bea5b6708b83b9ea618f7e809b
Adds tests for VectorComponentPinnableElement in Vector skin, ensuring:
- Proper instantiation with an ID parameter.
- Correct return of template data containing the ID.
- Reliability in handling element ID for use in templates and UI.
Change-Id: I3758f042ad43b90ee94a3b5aa14537fa1b0657d1
Adds tests for VectorComponentLink in Vector skin, ensuring:
- Initialization with parameters.
- Generation of html-attributes string with title and aria-label.
- Consistency in link attributes for accessibility and UX.
Change-Id: I80b8a84d1d10bc7274ba5267910206d7f6e68534
This commit introduces several changes to improve the structure and
readability of the FeatureManagement code in the Vector skin. Key
changes include:
- In ABRequirementTest.php, improved test method names for clarity.
- In ABRequirement.php, simplified property declarations and cleaned up
code structure.
- In DynamicConfigRequirement.php, cleaned up property declarations.
- In LimitedWidthContentRequirement.php, cleaned up property
declarations and added type hints.
- In LoggedInRequirement.php, cleaned up property declarations.
- In OverridableConfigRequirement.php, cleaned up property declarations.
- In OverrideableRequirementHelper.php, cleaned up property declarations.
- In SimpleRequirement.php, cleaned up property declarations.
- In UserPreferenceRequirement.php, cleaned up property declarations.
Each change aims to enhance the codebase's maintainability and
understandability. No functional changes were introduced.
Change-Id: I23283c5a6799b1f03a6a9b5832c34c7dbbcca527
Changes to the use statements done automatically via script
Addition of missing use statements done manually
Change-Id: I9b8f447ea4d715bc815cc782184bca288ee001a0
User-options related classes are being moved to
the MediaWiki\User\Options namespace in MediaWiki Core;
reflect that change here.
Bug: T352284
Depends-On: I9822eb1553870b876d0b8a927e4e86c27d83bd52
Change-Id: Ie1ab46338a660686394c79f49f21e6c1e0fa4a0a
User-options related classes are being moved to the MediaWiki\User\Options namespace in MediaWiki Core; reflect that change here.
Bug: T352284
Depends-On: I9822eb1553870b876d0b8a927e4e86c27d83bd52
Change-Id: I084e01a29884f338fae22d7239d068823a2657c3
- Add appearance.svg file and classes
- Update the icon name in php
- Update icon name in test data and Snapshot
To test: change return value of
isClientPreferencesPinned() from SkinVector22
PHP Class to false
Bug: T351142
Change-Id: If61f3019430be3cb9c926b09bc397e27d8e636f2
With I1e45d0dacf58b2e03886d3b986309e13e754e324 this should no
longer be needed as the styles are now restricted to reviewers and
the default user is not a reviewer
After merging this change, please confirm that any open
FlaggedRevisions patches pass Jenkins CI.
Change-Id: I53e3f2c15ad6797f39747e5bc00039582edb8f61
- Account for 10 Kbs in the case wikibase is enabled for scripts budget
- Message generation centralised function
- Added bundlesize.config.json file path to message.
- Update the message to show in Kbs
Bug: T350338
Change-Id: I8490cd7aa4468b54bab05960c8c594093167cb72