From 87f08dcf5b9d6c731ec3b82d9243ebbf1daa49bb Mon Sep 17 00:00:00 2001 From: jdlrobson Date: Wed, 17 Jun 2020 11:06:45 -0700 Subject: [PATCH] [refactor] Drop form-id template property In preparation for using the SkinMustache class and core buildSearchProps method [1], and to reduce the risk of that change, move the ID from the template data to the template itself: [1] https://github.com/wikimedia/mediawiki/blob/master/includes/skins/SkinMustache.php#L93 Change-Id: I8d62ea6b1adf6ef0cbfa20e1876806eba70b169f --- includes/VectorTemplate.php | 1 - includes/templates/SearchBox.mustache | 2 +- stories/SearchBox.stories.data.js | 1 - stories/types.js | 1 - 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/includes/VectorTemplate.php b/includes/VectorTemplate.php index 0de3878..18e4e54 100644 --- a/includes/VectorTemplate.php +++ b/includes/VectorTemplate.php @@ -498,7 +498,6 @@ class VectorTemplate extends BaseTemplate { $config = $this->getConfig(); $props = [ 'form-action' => $config->get( 'Script' ), - 'form-id' => 'simpleSearch', 'html-button-search-fallback' => $this->makeSearchButton( 'fulltext', [ 'id' => 'mw-searchButton', 'class' => 'searchButton mw-fallbackSearchButton' ] diff --git a/includes/templates/SearchBox.mustache b/includes/templates/SearchBox.mustache index c5db583..9a68542 100644 --- a/includes/templates/SearchBox.mustache +++ b/includes/templates/SearchBox.mustache @@ -6,7 +6,7 @@
-
+
{{{html-input}}} {{! We construct two buttons (for 'go' and 'fulltext' search modes), but only one will be diff --git a/stories/SearchBox.stories.data.js b/stories/SearchBox.stories.data.js index cc54fca..db13183 100644 --- a/stories/SearchBox.stories.data.js +++ b/stories/SearchBox.stories.data.js @@ -10,7 +10,6 @@ export const searchBoxData = { 'form-action': '/w/index.php', 'html-userlangattributes': htmluserlangattributes, 'msg-search': 'Search', - 'form-id': 'simpleSearch', 'html-input': '', 'page-title': 'Special:Search', 'html-button-search-fallback': '', diff --git a/stories/types.js b/stories/types.js index d076816..a3fa1da 100644 --- a/stories/types.js +++ b/stories/types.js @@ -42,7 +42,6 @@ * @prop {string|null} msg-search * @prop {string} [html-userlangattributes] * @prop {string} form-action URL - * @prop {string} form-id * @prop {string|null} html-input * @prop {string|null} page-title the title of the search page * @prop {string|null} html-button-search-fallback