[Refactor] Rename Portal component to MainMenuGroup

The Portal component is only ever used inside the MainMenu component

Change-Id: I3a3c58b11416f28c58f02a8bdfdacfbb7df6de9b
This commit is contained in:
Jon Robson 2022-11-22 08:57:25 -08:00
parent 27bb20e37d
commit 769818514d
7 changed files with 18 additions and 15 deletions

View file

@ -10,17 +10,10 @@
}} }}
<div class="vector-main-menu-container {{^data-toc}}vector-sidebar-container-no-toc{{/data-toc}}"> <div class="vector-main-menu-container {{^data-toc}}vector-sidebar-container-no-toc{{/data-toc}}">
<div id="mw-navigation"> <div id="mw-navigation">
{{#data-portlets-main-menu}}
<nav id="mw-panel" class="vector-main-menu" aria-label="{{msg-vector-site-nav-label}}" role="navigation"> <nav id="mw-panel" class="vector-main-menu" aria-label="{{msg-vector-site-nav-label}}" role="navigation">
{{#data-portlets-first}}{{>Portal}}{{/data-portlets-first}} {{#data-portlets-main-menu}}
{{#data-main-menu-action}}{{>MainMenuAction}}{{/data-main-menu-action}} {{>MainMenuContents}}
{{#array-portlets-rest}}{{>Portal}}{{/array-portlets-rest}} {{/data-portlets-main-menu}}
{{^is-language-in-content}}
{{#data-portlets.data-languages}}{{>Portal}}{{/data-portlets.data-languages}}
{{/is-language-in-content}}
{{! T295555 Add language switch alert message temporarily (to be removed). }}
{{#data-vector-language-switch-alert}}{{>MainMenuAction}}{{/data-vector-language-switch-alert}}
</nav> </nav>
{{/data-portlets-main-menu}}
</div> </div>
</div> </div>

View file

@ -0,0 +1,10 @@
<div class="vector-main-menu-contents">
{{#data-portlets-first}}{{>MainMenuGroup}}{{/data-portlets-first}}
{{#data-main-menu-action}}{{>MainMenuAction}}{{/data-main-menu-action}}
{{#array-portlets-rest}}{{>MainMenuGroup}}{{/array-portlets-rest}}
{{^is-language-in-content}}
{{#data-portlets.data-languages}}{{>MainMenuGroup}}{{/data-portlets.data-languages}}
{{/is-language-in-content}}
{{! T295555 Add language switch alert message. }}
{{#data-vector-language-switch-alert}}{{>MainMenuAction}}{{/data-vector-language-switch-alert}}
</div>

View file

@ -1,7 +1,7 @@
{{! {{!
See @typedef MenuDefinition See @typedef MenuDefinition
}} }}
<div id="{{id}}" class="vector-menu vector-menu-portal portal{{#class}} {{.}}{{/class}}" {{{html-tooltip}}} {{{html-user-language-attributes}}}> <div id="{{id}}" class="vector-main-menu-group vector-menu vector-menu-portal portal{{#class}} {{.}}{{/class}}" {{{html-tooltip}}} {{{html-user-language-attributes}}}>
<div <div
id="{{id}}-label" id="{{id}}-label"
class="vector-menu-heading{{#heading-class}} {{.}}{{/heading-class}}" class="vector-menu-heading{{#heading-class}} {{.}}{{/heading-class}}"

View file

@ -1,7 +1,9 @@
@import '../../common/variables.less'; @import '../../common/variables.less';
@import 'mediawiki.mixins.less'; @import 'mediawiki.mixins.less';
.vector-menu-portal { // FIXME: Remove .vector-menu-portal when cache has cleared
.vector-menu-portal,
.vector-main-menu-group {
margin: 0 @margin-end-portal 0 @margin-start-portal; margin: 0 @margin-end-portal 0 @margin-start-portal;
padding: 0.25em 0; padding: 0.25em 0;
direction: ltr; direction: ltr;

View file

@ -21,7 +21,7 @@
@import './components/Menu.less'; @import './components/Menu.less';
@import './components/Dropdown.less'; @import './components/Dropdown.less';
@import './components/MenuTabs.less'; @import './components/MenuTabs.less';
@import './components/MenuPortal.less'; @import './components/MainMenuGroup.less';
@import './components/PageTitlebar.less'; @import './components/PageTitlebar.less';
@import './components/PageToolbar.less'; @import './components/PageToolbar.less';
@import './components/PageTools.less'; @import './components/PageTools.less';

View file

@ -1,6 +1,5 @@
import mustache from 'mustache'; import mustache from 'mustache';
import { vectorMenuTemplate as portalTemplate } from './MenuDropdown.stories.data'; import { vectorMenuTemplate as portalTemplate } from './MenuDropdown.stories.data';
import '../resources/skins.vector.styles/MenuPortal.less';
import { placeholder, htmlUserLanguageAttributes, portletAfter } from './utils'; import { placeholder, htmlUserLanguageAttributes, portletAfter } from './utils';
/** /**

View file

@ -1,7 +1,6 @@
import mustache from 'mustache'; import mustache from 'mustache';
import '../resources/skins.vector.styles/MainMenu.less'; import '../resources/skins.vector.styles/MainMenu.less';
import '../resources/skins.vector.styles/SidebarLogo.less'; import '../resources/skins.vector.styles/SidebarLogo.less';
import '../resources/skins.vector.styles/MenuPortal.less';
import { sidebarTemplate, import { sidebarTemplate,
sidebarLegacyTemplate, SIDEBAR_DATA, SIDEBAR_TEMPLATE_PARTIALS } from './Sidebar.stories.data'; sidebarLegacyTemplate, SIDEBAR_DATA, SIDEBAR_TEMPLATE_PARTIALS } from './Sidebar.stories.data';