From 8b510410035befc449080f2a625146cbec8942da Mon Sep 17 00:00:00 2001 From: Mortal303 Date: Thu, 24 Mar 2022 13:35:11 +0530 Subject: [PATCH] Move Vector menu class logic into Menu mustache template MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaced “vector-menu-heading” with ‘’(empty string) in “$portletData['heading-class'] = '';” in includes/SkinVector.php and updated accordingly the includes/templates/Menu.mustache file. Updated “vector-menu-heading” with ‘’(empty string) in stories/LanguageButton.stories.data.js, stories/UserLinks.stories.data.js, and tests/phpunit/integration/SkinVectorTest.php respectively SkinVector and Storybook are cleaned up. Bug: T290281 Change-Id: I4ca16953799b3dc52e45674bb398c78f14cfc842 --- includes/SkinVector.php | 10 +++------- includes/templates/Menu.mustache | 2 +- stories/LanguageButton.stories.data.js | 3 +-- stories/UserLinks.stories.data.js | 2 +- tests/phpunit/integration/SkinVectorTest.php | 2 +- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/includes/SkinVector.php b/includes/SkinVector.php index 6c3a7661f..ad6874593 100644 --- a/includes/SkinVector.php +++ b/includes/SkinVector.php @@ -353,7 +353,6 @@ abstract class SkinVector extends SkinMustache { 'class' => 'mw-portlet mw-portlet-personal-more vector-menu vector-user-menu-more', 'html-items' => $userMoreHtmlItems, 'label' => $this->msg( 'vector-personal-more-label' ), - 'heading-class' => 'vector-menu-heading', 'is-dropdown' => false, ]; @@ -741,11 +740,8 @@ abstract class SkinVector extends SkinMustache { // ext.uls.interface attaches click handler to this selector. 'checkbox-class' => ' mw-interlanguage-selector ', 'html-vector-heading-icon' => Hooks::makeIcon( 'wikimedia-language-progressive' ), - 'heading-class' => - ' vector-menu-heading ' . - self::CLASS_QUIET_BUTTON . ' ' . - self::CLASS_PROGRESSIVE - ]; + 'heading-class' => self::CLASS_QUIET_BUTTON . ' ' . self::CLASS_PROGRESSIVE + ]; // Adds class to hide language button // Temporary solution to T287206, can be removed when ULS dialog includes interwiki links @@ -773,7 +769,7 @@ abstract class SkinVector extends SkinMustache { self::MENU_TYPE_PORTAL => 'vector-menu vector-menu-portal portal', self::MENU_TYPE_DEFAULT => 'vector-menu', ]; - $portletData['heading-class'] = 'vector-menu-heading'; + $portletData['heading-class'] = ''; // Add target class to apply different icon to personal menu dropdown for logged in users. if ( $portletData['id'] === 'p-personal' ) { if ( $this->isLegacy() ) { diff --git a/includes/templates/Menu.mustache b/includes/templates/Menu.mustache index da603d9da..00b926b20 100644 --- a/includes/templates/Menu.mustache +++ b/includes/templates/Menu.mustache @@ -12,7 +12,7 @@ data-event-name="ui.dropdown-{{id}}" class="{{#checkbox-class}}{{.}} {{/checkbox-class}}vector-menu-checkbox" aria-labelledby="{{id}}-label" /> {{/is-dropdown}} -