Finish hooking up the frontend from T377575: [POC] Initial community configuration page for Cite: reflist backlink label symbol selection to the community configuration backend storage. The configuration variable for backlink symbol set will be a single string.
- Define backlink configuration in CiteSchema.php.
- Root schema should be an Object, to leave space for additional features to be configured.
- Backlink configuration is a String naming the current alphabet. The variable name can be something like "BacklinkAlphabet".
- Backlink config defaults to some kind of undefined, which is a clear signal to use the legacy value. We allow null or empty string.
- See example schema
- Implement a new subclass of AbstractEditorCapability (see below).
- Needs to show up as a subpage like Special:CommunityConfiguration/Cite .
- Introduce a feature flag, enabled only when $wgCiteBacklinkCommunityConfiguration === true.
- Load stored configurations into the UI on page opens
- Save changes back to the store when the submit button is clicked.
- Make sure the whole Config page is not shown when the feature flag is of T385158: Hide Cite community config when the CiteBacklinkCommunityConfiguration flag is off
- Load stored configurations and use them for the backlinks T385411: Use Cite backlinks community configuration from store
Implementation
- Implement the page following the basic structure of https://github.com/wikimedia/mediawiki-extensions-CommunityConfiguration/blob/master/src/EditorCapabilities/GenericFormEditorCapability.php and implement a new subclass of AbstractEditorCapability. Register in extension.json using code like this,
- See also https://www.mediawiki.org/wiki/Extension:CommunityConfiguration/Technical_documentation for basic technical documentation
- And an example extension using it in https://gitlab.wikimedia.org/repos/growth/community-configuration-example
"attributes": {
"CommunityConfiguration": {
"EditorCapabilities": {
"citeEditor": {
// must be an implementation of IEditorCapability; AbstractEditorCapability is provided as an optional (but recommended) helper
"class": "MediaWiki\\Extension\\Cite\\CiteEditorCapability"
"services": [...]
}
},
"Providers": {
"cite": {
"store": {
"type": "wikipage",
"args": [ "MediaWiki:CiteConfig.json" ]
},
"validator": {
"type": "jsonschema",
"args": [...]
},
"type": "mw-config" // or "data",
"options": {
"editorCapability": "citeEditor" // or whatever the capability was registered as in the above
}
}
}
}
}