Merge "Remove code to disable new search on Wikidata"

This commit is contained in:
jenkins-bot 2023-01-23 14:25:22 +00:00 committed by Gerrit Code Review
commit 9650eae741

View file

@ -138,9 +138,7 @@ function markLoadEnd( startMarker, endMarker, measureMarker ) {
* @param {Document} document * @param {Document} document
*/ */
function initSearchLoader( document ) { function initSearchLoader( document ) {
var searchBoxes = document.querySelectorAll( '.vector-search-box' ), var searchBoxes = document.querySelectorAll( '.vector-search-box' );
wikibaseNeedsLegacySearch = [ 'loading', 'loaded', 'executing', 'ready' ]
.indexOf( mw.loader.getState( 'wikibase.ui.entitysearch' ) ) !== -1;
// Allow developers to defined $wgVectorSearchApiUrl in LocalSettings to target different APIs // Allow developers to defined $wgVectorSearchApiUrl in LocalSettings to target different APIs
if ( config.wgVectorSearchApiUrl ) { if ( config.wgVectorSearchApiUrl ) {
@ -152,10 +150,9 @@ function initSearchLoader( document ) {
} }
/** /**
* 1. If we are in a browser that doesn't support ES6 fall back to non-JS version. * If we are in a browser that doesn't support ES6 fall back to non-JS version.
* 2. Disable on Wikidata per T281318 until the REST API is ready.
*/ */
if ( wikibaseNeedsLegacySearch || mw.loader.getState( 'skins.vector.search' ) === null ) { if ( mw.loader.getState( 'skins.vector.search' ) === null ) {
document.body.classList.remove( document.body.classList.remove(
'skin-vector-search-vue' 'skin-vector-search-vue'
); );