UX: in sidebar dropdown mode expose 'more' items (#21372)
This commit is contained in:
parent
c636fcf4fc
commit
36c3a2422b
|
@ -33,8 +33,17 @@
|
|||
/>
|
||||
{{/each}}
|
||||
|
||||
<Sidebar::MoreSectionLinks
|
||||
@sectionLinks={{this.moreSectionLinks}}
|
||||
@secondarySectionLinks={{this.moreSecondarySectionLinks}}
|
||||
/>
|
||||
{{#if this.isDesktopDropdownMode}}
|
||||
{{#each this.moreSectionLinks as |sectionLink|}}
|
||||
<Sidebar::MoreSectionLink @sectionLink={{sectionLink}} />
|
||||
{{/each}}
|
||||
{{#each this.moreSecondarySectionLinks as |sectionLink|}}
|
||||
<Sidebar::MoreSectionLink @sectionLink={{sectionLink}} />
|
||||
{{/each}}
|
||||
{{else}}
|
||||
<Sidebar::MoreSectionLinks
|
||||
@sectionLinks={{this.moreSectionLinks}}
|
||||
@secondarySectionLinks={{this.moreSecondarySectionLinks}}
|
||||
/>
|
||||
{{/if}}
|
||||
</Sidebar::Section>
|
|
@ -12,6 +12,7 @@ export default class SidebarCommunitySection extends Component {
|
|||
@service topicTrackingState;
|
||||
@service currentUser;
|
||||
@service appEvents;
|
||||
@service site;
|
||||
@service siteSettings;
|
||||
|
||||
@tracked sectionLinks;
|
||||
|
@ -77,6 +78,13 @@ export default class SidebarCommunitySection extends Component {
|
|||
return [];
|
||||
}
|
||||
|
||||
get isDesktopDropdownMode() {
|
||||
const headerDropdownMode =
|
||||
this.siteSettings.navigation_menu === "header dropdown";
|
||||
|
||||
return !this.site.mobileView && headerDropdownMode;
|
||||
}
|
||||
|
||||
#initializeSectionLinks(sectionLinkClasses, { inMoreDrawer } = {}) {
|
||||
return sectionLinkClasses.map((sectionLinkClass) => {
|
||||
return this.#initializeSectionLink(sectionLinkClass, inMoreDrawer);
|
||||
|
|
|
@ -51,6 +51,21 @@ acceptance(
|
|||
"hides the sidebar dropdown"
|
||||
);
|
||||
});
|
||||
|
||||
test("'more' dropdown should display as regular list items in header dropdown mode", async function (assert) {
|
||||
await visit("/");
|
||||
await click(".hamburger-dropdown");
|
||||
|
||||
assert.ok(
|
||||
exists("[data-link-name='admin']"),
|
||||
"the admin link is not within the 'more' dropdown"
|
||||
);
|
||||
|
||||
assert.notOk(
|
||||
exists(".sidebar-more-section-links-details-summary"),
|
||||
"the 'more' dropdown should not be present in header dropdown mode"
|
||||
);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue