diff --git a/includes/SkinVector.php b/includes/SkinVector.php index 6507e258d..12cb50b3d 100644 --- a/includes/SkinVector.php +++ b/includes/SkinVector.php @@ -139,7 +139,7 @@ class SkinVector extends SkinMustache { if ( $skin->getUser()->isLoggedIn() ) { // Note: This data is also passed to legacy template where it is unused. - $commonSkinData['data-sidebar']['data-emphasized-sidebar-action'] = [ + $commonSkinData['data-emphasized-sidebar-action'] = [ 'href' => SpecialPage::getTitleFor( 'Preferences', false, diff --git a/stories/Sidebar.stories.data.js b/stories/Sidebar.stories.data.js index 64d14c968..60d58a0bd 100644 --- a/stories/Sidebar.stories.data.js +++ b/stories/Sidebar.stories.data.js @@ -15,25 +15,19 @@ export const SIDEBAR_TEMPLATE_PARTIALS = { Menu: vectorMenuTemplate }; +export const OPT_OUT_DATA = { + 'data-emphasized-sidebar-action': { + href: '#', + 'msg-vector-opt-out': 'Switch to old look', + 'msg-vector-opt-out-tooltip': 'Change your settings to go back to the old look of the skin (legacy Vector)' + } +}; + export const SIDEBAR_DATA = { withNoPortals: { 'array-portals-rest': [], 'html-logo-attributes': HTML_LOGO_ATTRIBUTES }, - withPortalsAndOptOut: { - 'data-portals-first': PORTALS.navigation, - 'data-emphasized-sidebar-action': { - href: '#', - 'msg-vector-opt-out': 'Switch to old look', - 'msg-vector-opt-out-tooltip': 'Change your settings to go back to the old look of the skin (legacy Vector)' - }, - 'array-portals-rest': [ - PORTALS.toolbox, - PORTALS.otherProjects - ], - 'data-portals-languages': PORTALS.langlinks, - 'html-logo-attributes': HTML_LOGO_ATTRIBUTES - }, withPortals: { 'data-portals-first': PORTALS.navigation, 'array-portals-rest': [ diff --git a/stories/skin.stories.data.js b/stories/skin.stories.data.js index 1cf8710d5..eb5d055fb 100644 --- a/stories/skin.stories.data.js +++ b/stories/skin.stories.data.js @@ -11,23 +11,23 @@ import { PERSONAL_MENU_TEMPLATE_DATA, menuTemplate } from './Menu.stories.data'; import { pageActionsData, namespaceTabsData } from './MenuTabs.stories.data'; import { vectorMenuTemplate, moreData, variantsData } from './MenuDropdown.stories.data'; import { searchBoxData, searchBoxTemplate } from './SearchBox.stories.data'; -import { SIDEBAR_DATA, SIDEBAR_TEMPLATE_PARTIALS, +import { SIDEBAR_DATA, SIDEBAR_TEMPLATE_PARTIALS, OPT_OUT_DATA, sidebarLegacyTemplate, sidebarTemplate } from './Sidebar.stories.data'; import { FOOTER_TEMPLATE_DATA, FOOTER_TEMPLATE_PARTIALS, footerTemplate } from './Footer.stories.data'; import { logoTemplate } from './Logo.stories.data'; export const NAVIGATION_TEMPLATE_DATA = { - loggedInWithVariantsAndOptOut: { + loggedInWithVariantsAndOptOut: Object.assign( {}, { 'data-personal-menu': PERSONAL_MENU_TEMPLATE_DATA.loggedInWithEcho, 'data-namespace-tabs': namespaceTabsData, 'data-page-actions': pageActionsData, 'data-variants': variantsData, 'data-search-box': searchBoxData, - 'data-sidebar': SIDEBAR_DATA.withPortalsAndOptOut, + 'data-sidebar': SIDEBAR_DATA.withPortals, 'msg-navigation-heading': 'Navigation menu', 'html-logo-attributes': `class="mw-wiki-logo" href="/wiki/Main_Page" title="Visit the main page"` - }, + }, OPT_OUT_DATA ), loggedOutWithVariants: { 'data-personal-menu': PERSONAL_MENU_TEMPLATE_DATA.loggedOut, 'data-namespace-tabs': namespaceTabsData,