commit | f00a0c0c6b57120660ca9195870c8ac6f139dd36 | [log] [tgz] |
---|---|---|
author | Cyndy <[email protected]> | Tue Aug 27 16:40:45 2024 +0300 |
committer | Cyndywikime <[email protected]> | Mon Sep 02 13:24:49 2024 +0000 |
tree | 69c7b775a2e37157f74932d32246987324fd7109 | |
parent | 0060b631765571123fac8afeadc0dc4f4323f6a5 [diff] |
Fix main namespace label in HelpPanel namespace selector The main namespace (index 0) was displayed without a label in the HelpPanel namespace selector. Bug: T367045 Change-Id: Ic3464381755309278aef6bfb28df14082e89e3a1
This extension is a part of the Community configuration 2.0 project of the Wikimedia Foundation's Growth team. It backs Community configuration itself and is accompanied by the CommunityConfigurationExample as an example usage of Community configuration in a feature.
An end to end setup of Community configuration depends on three components:
CommunityConfiguration
CommunityConfigurationExample
To set up Community configuration 2.0, please follow those instructions:
# clone the necessary extensions core $ git clone https://gitlab.wikimedia.org/repos/growth/community-configuration-example extensions/CommunityConfigurationExample core $ git clone https://gitlab.wikimedia.org/repos/growth/community-configuration extensions/CommunityConfiguration # enable extensions in LocalSettings.php core $ echo "wfLoadExtensions( ['CommunityConfiguration', 'CommunityConfigurationExample' ] );" >> LocalSettings.php
Once done, you should be able to access CommunityConfiguration from Special:CommunityConfigurationExample
. Interacting with the Community configuration interface should be also working:
core $ php maintenance/run.php shell > $config = \MediaWiki\MediaWikiServices::getInstance()->get('CommunityConfiguration.ProviderFactory')->newProvider('static-example')->loadValidConfiguration() = StatusValue {#5739 +value: [ "wgFooBar" => 42, ], +success: [], +successCount: 0, +failCount: 0, } > $config->isOK() = true > $config->getValue() = [ "wgFooBar" => 42, ] >
For a given JSON schema defintion, eg: community-configuration-example/src/Schemas/schema_draft-07.json
core $ php maintenance/run.php shell > $provider = \MediaWiki\MediaWikiServices::getInstance()->get('CommunityConfiguration.ProviderFactory')->newProvider('FooBar'); = MediaWiki\Extension\CommunityConfiguration\Provider\DataConfigurationProvider {#5696} > $provider->getValidator()->validate( [ 'FooBar' => 1 ] )->isOk(); = false > $provider->getValidator()->validate( [ 'FooBar' => 1 ] )->getErrors(); = [ [ "type" => "error", "message" => "communityconfiguration-schema-validation-error", "params" => [ "/FooBar", "The data (integer) must match the type: string", Opis\JsonSchema\Errors\ValidationError {#6802}, ], ], ] >