From 2665734b101be5a77545a512ea4580c8d7770e6f Mon Sep 17 00:00:00 2001 From: Svantje Lilienthal Date: Fri, 7 May 2021 11:32:20 +0200 Subject: [PATCH] Renaming temporary config variable and splitting it from cirrus search lookup This allows using the config variable independendly from the cirrus search extension. This way it can be used for all subtickets of T271802. Bug: T277028 Change-Id: I1b3bdda5fa6fbfe5c531c3b51c2c8e2a28ed1faf --- extension.json | 4 ++-- includes/VisualEditorHooks.php | 3 ++- modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js | 2 +- modules/ve-mw/ui/pages/ve.ui.MWTemplatePlaceholderPage.js | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/extension.json b/extension.json index 0f9b9418a3..d6522cde8a 100644 --- a/extension.json +++ b/extension.json @@ -182,8 +182,8 @@ "description": "Temporary flag to enable inline parameter descriptions in the transclusion dialog.", "value": false }, - "VisualEditorCirrusSearchLookup": { - "description": "Temporary feature flag to replace prefixsearch with fulltext CirrusSearch when searching for template names. (T274903)", + "VisualEditorTemplateSearchImprovements": { + "description": "Temporary feature flag to enable various changes around searching for template names. (T271802)", "value": false } }, diff --git a/includes/VisualEditorHooks.php b/includes/VisualEditorHooks.php index c8ec04c38b..6ab396fc9c 100644 --- a/includes/VisualEditorHooks.php +++ b/includes/VisualEditorHooks.php @@ -1051,7 +1051,8 @@ class VisualEditorHooks { 'transclusionDialogInlineDescriptions' => $veConfig->get( 'VisualEditorTransclusionDialogInlineDescriptions' ), 'cirrusSearchLookup' => $extensionRegistry->isLoaded( 'CirrusSearch' ) - && $veConfig->get( 'VisualEditorCirrusSearchLookup' ), + && $veConfig->get( 'VisualEditorTemplateSearchImprovements' ), + 'templateSearchImprovements' => $veConfig->get( 'VisualEditorTemplateSearchImprovements' ), ]; } diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js index a2673c0341..f689f9d2d5 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js @@ -346,7 +346,7 @@ ve.ui.MWTransclusionDialog.prototype.initialize = function () { icon: 'puzzle', title: ve.msg( // Temporary switch for verbose template search. - mw.config.get( 'wgVisualEditorConfig' ).cirrusSearchLookup ? + mw.config.get( 'wgVisualEditorConfig' ).templateSearchImprovements ? 'visualeditor-dialog-transclusion-template-search' : 'visualeditor-dialog-transclusion-add-template' ) diff --git a/modules/ve-mw/ui/pages/ve.ui.MWTemplatePlaceholderPage.js b/modules/ve-mw/ui/pages/ve.ui.MWTemplatePlaceholderPage.js index cc96e1eb6e..95c5a47a1c 100644 --- a/modules/ve-mw/ui/pages/ve.ui.MWTemplatePlaceholderPage.js +++ b/modules/ve-mw/ui/pages/ve.ui.MWTemplatePlaceholderPage.js @@ -81,7 +81,7 @@ ve.ui.MWTemplatePlaceholderPage = function VeUiMWTemplatePlaceholderPage( placeh items: [ addTemplateActionFieldLayout ] }; // Temporary switch for verbose template search. - if ( mw.config.get( 'wgVisualEditorConfig' ).cirrusSearchLookup ) { + if ( mw.config.get( 'wgVisualEditorConfig' ).templateSearchImprovements ) { addTemplateFieldsetConfig = ve.extendObject( addTemplateFieldsetConfig, { label: ve.msg( 'visualeditor-dialog-transclusion-template-search' ), help: ve.msg( 'visualeditor-dialog-transclusion-template-search-help' ), @@ -117,7 +117,7 @@ ve.ui.MWTemplatePlaceholderPage.prototype.setOutlineItem = function () { .setFlags( [ 'placeholder' ] ) .setLabel( ve.msg( // Temporary switch for verbose template search. - mw.config.get( 'wgVisualEditorConfig' ).cirrusSearchLookup ? + mw.config.get( 'wgVisualEditorConfig' ).templateSearchImprovements ? 'visualeditor-dialog-transclusion-template-search' : 'visualeditor-dialog-transclusion-placeholder' ) );