Page MenuHomePhabricator

Community configuration: Allow client extensions to define their own editor capability
Closed, ResolvedPublic

Description

MediaWiki-extensions-CommunityConfiguration has the concept of editor capabilities. This is used to give complete control over the editor subpage, empowering other extensions to replace the default editor with their own logic. An example usecase is Adiutor by @Dogu, which has a fairly complex configuration pages with tabs and so on, something which is unfortunately not possible to do within MediaWiki-extensions-CommunityConfiguration itself.

In this task, we should allow client extensions to define their own editor capabilities. This can look like this (snippet from extension.json):

{
	[...],
	"attributes": {
		"CommunityConfiguration": {
			"EditorCapabilities": {
				"BlockCategories": {
					"class": "MediaWiki\\Extension\\StructuredBlockReasons\\EditorCapabilities\\BlockCategoriesEditorCapability"
				}
			},
			"Providers": {
				"BlockCategories": {
					"store": {
						"type": "wikipage",
						"args": ["MediaWiki:BlockCategories.json"]
					},
					"validator": {
						"type": "jsonschema",
						"args": ["MediaWiki\\Extension\\StructuredBlockReasons\\Schemas\\BlockCategoriesSchema"]
					},
					"options": {
						"editorCapability": "BlockCategories"
					}
				}
			}
		}
	},
	[...]
}

Event Timeline

Change #1027159 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/CommunityConfiguration@master] Allow client extensions to define editor capabilities

https://gerrit.wikimedia.org/r/1027159

Change #1027159 merged by jenkins-bot:

[mediawiki/extensions/CommunityConfiguration@master] Allow client extensions to define editor capabilities

https://gerrit.wikimedia.org/r/1027159

@Urbanecm_WMF - a couple of questions:

(1) In the task description snippet, an example of MediaWiki page was given as "MediaWiki:BlockCategories.json". Should it be created for CommunityConfiguration and what would be the format?
(2 I didn't find any references EditorCapabilities on Extension:CommunityConfiguration#Glossary or
Extension:CommunityConfiguration/Technical_documentation. Or it should not be documented at all?