From 36c3d41c6a08be7a62f4207214800727191cf38d Mon Sep 17 00:00:00 2001 From: Reception123 Date: Tue, 29 Oct 2024 13:26:36 +0100 Subject: [PATCH 1/2] add classification of wiki types field --- includes/HookHandlers/RequestWiki.php | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/includes/HookHandlers/RequestWiki.php b/includes/HookHandlers/RequestWiki.php index 2923c18e..8a329947 100644 --- a/includes/HookHandlers/RequestWiki.php +++ b/includes/HookHandlers/RequestWiki.php @@ -57,6 +57,22 @@ public function onRequestWikiFormDescriptorModify( array &$formDescriptor ): voi 'type' => 'url', ] ); + + RequestWikiFormUtils::insertFieldAfter( + $formDescriptor, + afterKey: 'prupose', + newKey: 'classification', + newField: [ + 'label-message' => 'requestwiki-label-classification', + 'type' => 'select', + 'options' => [ + 'Personal (notes, own ideas, etc.)' => 'Personal (notes, own ideas, etc.)', + 'Non-wiki community (Discord server, small group, etc.)' => 'Non-wiki community (Discord server, small group, etc.)' + 'Wiki community (existing)' => 'Wiki community (existing)', + 'Professional organization (company, university, association, etc.)' => 'Professional organization (company, university, association, etc.)', + 'Other' => 'Other', + ], + ); } public function onRequestWikiQueueFormDescriptorModify( @@ -114,6 +130,25 @@ public function onRequestWikiQueueFormDescriptorModify( ] ); + RequestWikiFormUtils::insertFieldAfter( + $formDescriptor, + afterKey: 'edit-purpose', + newKey: 'edit-classification', + newField: [ + 'label-message' => 'requestwiki-label-classification', + 'type' => 'select', + 'options' => [ + 'Personal (notes, own ideas, etc.)' => 'Personal (notes, own ideas, etc.)', + 'Non-wiki community (Discord server, small group, etc.)' => 'Non-wiki community (Discord server, small group, etc.)' + 'Wiki community (existing)' => 'Wiki community (existing)', + 'Professional organization (company, university, association, etc.)' => 'Professional organization (company, university, association, etc.)', + 'Other' => 'Other', + ], + 'section' => 'editing', + 'default' => $wikiRequestManager->getExtraFieldData( 'classification' ), + ] + ); + RequestWikiFormUtils::insertFieldAfter( $formDescriptor, afterKey: 'bio', From 6de6bfb4b7d725415a4864bd9dc1a05abd40813f Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 29 Oct 2024 12:28:30 +0000 Subject: [PATCH 2/2] CI: lint code to MediaWiki standards Check commit and GitHub actions for more details --- includes/HookHandlers/RequestWiki.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/HookHandlers/RequestWiki.php b/includes/HookHandlers/RequestWiki.php index 8a329947..b08e3405 100644 --- a/includes/HookHandlers/RequestWiki.php +++ b/includes/HookHandlers/RequestWiki.php @@ -62,7 +62,7 @@ public function onRequestWikiFormDescriptorModify( array &$formDescriptor ): voi $formDescriptor, afterKey: 'prupose', newKey: 'classification', - newField: [ + newField:[ 'label-message' => 'requestwiki-label-classification', 'type' => 'select', 'options' => [ @@ -70,8 +70,8 @@ public function onRequestWikiFormDescriptorModify( array &$formDescriptor ): voi 'Non-wiki community (Discord server, small group, etc.)' => 'Non-wiki community (Discord server, small group, etc.)' 'Wiki community (existing)' => 'Wiki community (existing)', 'Professional organization (company, university, association, etc.)' => 'Professional organization (company, university, association, etc.)', - 'Other' => 'Other', - ], + 'Other' => 'Other', + ], ); } @@ -142,7 +142,7 @@ public function onRequestWikiQueueFormDescriptorModify( 'Non-wiki community (Discord server, small group, etc.)' => 'Non-wiki community (Discord server, small group, etc.)' 'Wiki community (existing)' => 'Wiki community (existing)', 'Professional organization (company, university, association, etc.)' => 'Professional organization (company, university, association, etc.)', - 'Other' => 'Other', + 'Other' => 'Other', ], 'section' => 'editing', 'default' => $wikiRequestManager->getExtraFieldData( 'classification' ),