Rename `wgVectorUseCoreSearch` to `wgVectorUseWvuiSearch`

This allows better compatibility with FeatureManager (e.g. can use
requirements such as REQUIREMENT_LATEST_SKIN_VERSION). It will become
especially useful in I70277c1082a504fbd5f6023e9873e8071de7e35d and when
A/B testing search.

Bug: T270202
Change-Id: I3a063e0b085765ea1db3c4478fb30c11b0942b75
This commit is contained in:
Nicholas Ray 2021-01-22 16:16:31 -07:00
parent 87dfbda424
commit 53f49c5c64
5 changed files with 10 additions and 10 deletions

View File

@ -37,7 +37,7 @@ class Hooks {
) {
return [
'wgVectorSearchHost' => $config->get( 'VectorSearchHost' ),
'wgVectorUseCoreSearch' => $config->get( 'VectorUseCoreSearch' ),
'wgVectorUseWvuiSearch' => $config->get( 'VectorUseWvuiSearch' ),
];
}
@ -103,7 +103,7 @@ class Hooks {
}
// Tell the `mediawiki.page.ready` module not to wire up search.
// This allows us to use $wgVectorUseCoreSearch to decide to load
// This allows us to use $wgVectorUseWvuiSearch to decide to load
// the historic jquery autocomplete search or the new Vue implementation.
// ResourceLoaderContext has no knowledge of legacy / modern Vector
// and from its point of view they are the same thing.
@ -281,7 +281,7 @@ class Hooks {
$config = $sk->getConfig();
if ( !$config->get( 'VectorUseCoreSearch' ) ) {
if ( $config->get( 'VectorUseWvuiSearch' ) ) {
$bodyAttrs['class'] .= ' skin-vector-search-vue';
}

View File

@ -3,5 +3,5 @@ interface VectorResourceLoaderVirtualConfig {
/**
* The name of the ResourceLoader module that contains search.
*/
wgVectorUseCoreSearch: boolean
wgVectorUseWvuiSearch: boolean
}

View File

@ -14,7 +14,7 @@ var /** @type {VectorResourceLoaderVirtualConfig} */
// T251544: Collect search performance metrics to compare Vue search with
// mediawiki.searchSuggest performance.
SHOULD_TEST_SEARCH = !!(
!config.wgVectorUseCoreSearch &&
config.wgVectorUseWvuiSearch &&
window.performance &&
performance.mark &&
performance.measure &&
@ -142,14 +142,14 @@ function initSearchLoader( document ) {
}
/**
* 1. If $wgVectorUseCoreSearch is true,
* 1. If $wgVectorUseWvuiSearch is false,
* or we are in a browser that doesn't support fetch
* load the legacy searchSuggest module. The check for window.fetch
* can be removed when IE11 support is finally officially dropped.
* 2. If we're using a different search module, enable the loading indicator
* before the search module loads.
**/
if ( config.wgVectorUseCoreSearch || !window.fetch ) {
if ( !config.wgVectorUseWvuiSearch || !window.fetch ) {
loadSearchModule( searchInput, 'mediawiki.searchSuggest', function () {} );
} else {
// Remove tooltips while Vue search is still loading

View File

@ -44,7 +44,7 @@
}
// Only apply the following WVUI-related rules to clients who have js enabled.
// TODO: .skin-vector-search-vue class can be removed when $wgVectorUseCoreSearch is no longer supported.
// TODO: .skin-vector-search-vue class can be removed when $wgVectorUseWvuiSearch is no longer supported.
.client-js .skin-vector-search-vue {
// Derived from @size-search-figure in WVUI
// https://gerrit.wikimedia.org/r/plugins/gitiles/wvui/+/e32b54f3b8d1118b6a25cdc46b5638d6d048533e/src/themes/wikimedia-ui.less#21

View File

@ -219,8 +219,8 @@
"value": "1",
"description": "@var string:['2'|'1'] The version ('2' for latest, '1' for legacy) of the Vector skin to **set** for newly created user accounts. **The value is persisted as a user preference.** This configuration is not used for preexisting accounts (see VectorDefaultSkinVersionForExistingAccounts) and only ever executed once at new account creation time."
},
"VectorUseCoreSearch": {
"value": true
"VectorUseWvuiSearch": {
"value": false
},
"VectorWvuiSearchOptions": {
"value": {