UX: do not show site header on wizard pages (#18037)

This commit is contained in:
Arpit Jalan 2022-08-23 10:17:37 +05:30 committed by GitHub
parent 4ca6717994
commit 5d44c31bfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 17 deletions

View File

@ -81,6 +81,11 @@ export default Controller.extend({
return enableSidebar;
},
@discourseComputed("router.currentRouteName")
showSiteHeader(currentRouteName) {
return !currentRouteName.startsWith("wizard");
},
@action
toggleSidebar() {
// enables CSS transitions, but not on did-insert

View File

@ -3,16 +3,18 @@
<DDocument />
<PluginOutlet @name="above-site-header" @connectorTagName="div" />
<SiteHeader
@canSignUp={{this.canSignUp}}
@showCreateAccount={{route-action "showCreateAccount"}}
@showLogin={{route-action "showLogin"}}
@showKeyboard={{route-action "showKeyboardShortcutsHelp"}}
@toggleMobileView={{route-action "toggleMobileView"}}
@toggleAnonymous={{route-action "toggleAnonymous"}}
@logout={{route-action "logout"}}
@sidebarEnabled={{this.sidebarEnabled}}
@toggleSidebar={{action "toggleSidebar"}} />
{{#if this.showSiteHeader}}
<SiteHeader
@canSignUp={{this.canSignUp}}
@showCreateAccount={{route-action "showCreateAccount"}}
@showLogin={{route-action "showLogin"}}
@showKeyboard={{route-action "showKeyboardShortcutsHelp"}}
@toggleMobileView={{route-action "toggleMobileView"}}
@toggleAnonymous={{route-action "toggleAnonymous"}}
@logout={{route-action "logout"}}
@sidebarEnabled={{this.sidebarEnabled}}
@toggleSidebar={{action "toggleSidebar"}} />
{{/if}}
<SoftwareUpdatePrompt />

View File

@ -101,13 +101,6 @@ acceptance(
exists(".sidebar-container"),
"does not display the sidebar on wizard route"
);
await click(".hamburger-dropdown");
assert.ok(
exists(".sidebar-hamburger-dropdown"),
"navigation around the site can still be done via the sidebar hamburger"
);
});
test("showing and hiding sidebar", async function (assert) {

View File

@ -14,6 +14,10 @@ acceptance("Wizard", function (needs) {
test("Wizard starts", async function (assert) {
await visit("/wizard");
assert.ok(exists(".wizard-container"));
assert.notOk(
exists(".d-header-wrap"),
"header is not rendered on wizard pages"
);
assert.strictEqual(currentRouteName(), "wizard.step");
});