mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 22:26:26 +08:00
UX: do not show site header on wizard pages (#18037)
This commit is contained in:
parent
4ca6717994
commit
5d44c31bfa
|
@ -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
|
||||
|
|
|
@ -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 />
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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");
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user