Go to file
Ammarpad 02dfbd4acb Do not show empty user links dropdown in private wikis
In situations where anon account creation is disabled or when
combined login link would be used, the usermenu array contains
single element (for 'login' or 'login/create') instead of two
elements ('login' and 'create account' items separately)

If $wgWikimediaMessagesAnonDonateLink is enabled through the
WikimediaMessages extension, the third element 'sitesupport'
exists, making the number of anon items either 1 or 2 or 3.

This patch fixes $isDefaultAnonUserLinks variable to account
for all the cases

Additionally, if even login is disabled, the element count can be
zero and in such case we need to hide the dropdown in all cases
(not only on large viewports) because it would always be empty.

This patch passes the userlinks count to ::getDropdown() and adds
CSS class when appropriate to hide the drowpdown completely.

Bug: T332743
Change-Id: I1ce5e1ea30917a6e80ef00f3c1703cbd0ecb6968
2024-11-04 11:35:23 +01:00
.phan Only show notification after CentralAuth autologin on Vector 2022 2023-08-30 08:53:53 -04:00
doc Remove old limited width toggle 2024-09-03 11:25:23 -07:00
i18n Localisation updates from https://translatewiki.net. 2024-11-01 08:39:12 +01:00
includes Do not show empty user links dropdown in private wikis 2024-11-04 11:35:23 +01:00
resources Do not show empty user links dropdown in private wikis 2024-11-04 11:35:23 +01:00
screenshots
skinStyles Align Vector link styles with Minerva 2024-10-23 03:22:17 +00:00
tests tests: Use fresh RequestContext in FeatureManagerTest 2024-10-30 21:12:18 +01:00
.eslintignore Avoid nullish coalescing operators 2023-11-06 11:10:44 -08:00
.eslintrc.json build: Use wikimedia/server for root folder eslint config 2023-09-04 18:13:32 +01:00
.gitignore Remove wmf-a11y dependency and tests 2023-08-17 12:38:55 -05:00
.gitreview
.nvmrc .nvmrc: Update version from 18.17.0 to 18.20.2 2024-04-17 14:01:41 +00:00
.phpcs.xml build: Updating mediawiki/mediawiki-codesniffer to 33.0.0 2020-11-17 23:33:50 +01:00
.stylelintignore Remove Storybook and jsdoc and its dependencies 2023-04-04 21:27:45 +00:00
.stylelintrc.json Align Vector link styles with Minerva 2024-10-23 03:22:17 +00:00
.svgo.config.js build: Use wikimedia/server for root folder eslint config 2023-09-04 18:13:32 +01:00
bundlesize.config.json Adjustments to bundle size testing 2024-11-01 00:35:46 +00:00
CODE_OF_CONDUCT.md
composer.json build: Updating mediawiki/mediawiki-codesniffer to 45.0.0 2024-11-03 13:27:04 +00:00
COPYING
Doxyfile docs: Generate documentation with Doxygen 2020-02-24 16:49:38 +00:00
jest.config.js Cleanup: Remove dark mode banner code 2024-09-06 21:11:04 +00:00
jest.setup.js build: Use wikimedia/server for root folder eslint config 2023-09-04 18:13:32 +01:00
package-lock.json build: Updating npm dependencies 2024-10-30 04:28:06 +00:00
package.json build: Updating npm dependencies 2024-10-30 04:28:06 +00:00
README.md Adds config flag documentation 2024-02-22 14:50:29 -06:00
skin.json Match production for night mode configuration 2024-10-16 19:55:18 +00:00
tsconfig.json Make the limited width and font size controls work for logged in users 2023-11-21 02:16:52 +00:00

Vector Skin

Installation

See https://www.mediawiki.org/wiki/Skin:Vector.

Configuration options

See skin.json.

Also see configuration.md

Development

Node version

It is recommended to use nvm to use the version of node defined in .nvmrc during local development. This ensures consistency amongst development environments.

Coding conventions

We strive for compliance with MediaWiki conventions:

https://www.mediawiki.org/wiki/Manual:Coding_conventions

Additions and deviations from those conventions that are more tailored to this project are noted at:

https://www.mediawiki.org/wiki/Reading/Web/Coding_conventions

Pre-commit tests

A pre-commit hook is installed when executing npm install. By default, it runs npm test which is useful for automatically validating everything that can be in a reasonable amount of time. If you wish to defer these tests to be executed by continuous integration only, set the PRE_COMMIT environment variable to 0:

$ export PRE_COMMIT=0
$ git commit

Or more succinctly:

$ PRE_COMMIT=0 git commit

Skipping the pre-commit tests has no impact on Gerrit change identifier hooks.

Hooks

See hooks.txt.