UX: Hide sidebar on invites page (#22125)
This hides the sidebar to make the signup experience less confusing. Co-authored-by: Ella E <ella.estigoy@gmail.com>
This commit is contained in:
parent
fcaefc9f2f
commit
1bbb41a901
|
@ -0,0 +1,15 @@
|
||||||
|
import Mixin from "@ember/object/mixin";
|
||||||
|
|
||||||
|
export default Mixin.create({
|
||||||
|
activate() {
|
||||||
|
this.controllerFor("application").setProperties({
|
||||||
|
sidebarDisabledRouteOverride: true,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
deactivate() {
|
||||||
|
this.controllerFor("application").setProperties({
|
||||||
|
sidebarDisabledRouteOverride: false,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
|
@ -2,8 +2,9 @@ import DiscourseRoute from "discourse/routes/discourse";
|
||||||
import I18n from "I18n";
|
import I18n from "I18n";
|
||||||
import PreloadStore from "discourse/lib/preload-store";
|
import PreloadStore from "discourse/lib/preload-store";
|
||||||
import { deepMerge } from "discourse-common/lib/object";
|
import { deepMerge } from "discourse-common/lib/object";
|
||||||
|
import DisableSidebar from "discourse/mixins/disable-sidebar";
|
||||||
|
|
||||||
export default DiscourseRoute.extend({
|
export default DiscourseRoute.extend(DisableSidebar, {
|
||||||
titleToken() {
|
titleToken() {
|
||||||
return I18n.t("invites.accept_title");
|
return I18n.t("invites.accept_title");
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,8 +2,9 @@ import DiscourseRoute from "discourse/routes/discourse";
|
||||||
import PreloadStore from "discourse/lib/preload-store";
|
import PreloadStore from "discourse/lib/preload-store";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import { extractError } from "discourse/lib/ajax-error";
|
import { extractError } from "discourse/lib/ajax-error";
|
||||||
|
import DisableSidebar from "discourse/mixins/disable-sidebar";
|
||||||
|
|
||||||
export default DiscourseRoute.extend({
|
export default DiscourseRoute.extend(DisableSidebar, {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
nonce: { refreshModel: true },
|
nonce: { refreshModel: true },
|
||||||
},
|
},
|
||||||
|
@ -26,18 +27,6 @@ export default DiscourseRoute.extend({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
activate() {
|
|
||||||
this.controllerFor("application").setProperties({
|
|
||||||
sidebarDisabledRouteOverride: true,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
deactivate() {
|
|
||||||
this.controllerFor("application").setProperties({
|
|
||||||
sidebarDisabledRouteOverride: false,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
setupController(controller, model) {
|
setupController(controller, model) {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
controller.resetState();
|
controller.resetState();
|
||||||
|
|
|
@ -97,6 +97,12 @@ acceptance("Invite accept", function (needs) {
|
||||||
});
|
});
|
||||||
|
|
||||||
await visit("/invites/my-valid-invite-token");
|
await visit("/invites/my-valid-invite-token");
|
||||||
|
|
||||||
|
assert.notOk(
|
||||||
|
document.body.classList.contains("has-sidebar-page"),
|
||||||
|
"does not display the sidebar on the invites page"
|
||||||
|
);
|
||||||
|
|
||||||
assert.ok(exists("#new-account-email"), "shows the email input");
|
assert.ok(exists("#new-account-email"), "shows the email input");
|
||||||
assert.ok(exists("#new-account-username"), "shows the username input");
|
assert.ok(exists("#new-account-username"), "shows the username input");
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
|
|
|
@ -1,28 +1,31 @@
|
||||||
import Route from "@ember/routing/route";
|
import Route from "@ember/routing/route";
|
||||||
import { findWizard } from "wizard/models/wizard";
|
import { findWizard } from "wizard/models/wizard";
|
||||||
|
import DisableSidebar from "discourse/mixins/disable-sidebar";
|
||||||
|
|
||||||
export default Route.extend({
|
export default Route.extend(DisableSidebar, {
|
||||||
model() {
|
model() {
|
||||||
return findWizard();
|
return findWizard();
|
||||||
},
|
},
|
||||||
|
|
||||||
activate() {
|
activate() {
|
||||||
|
this._super(...arguments);
|
||||||
|
|
||||||
document.body.classList.add("wizard");
|
document.body.classList.add("wizard");
|
||||||
|
|
||||||
this.controllerFor("application").setProperties({
|
this.controllerFor("application").setProperties({
|
||||||
showTop: false,
|
showTop: false,
|
||||||
showFooter: false,
|
showFooter: false,
|
||||||
sidebarDisabledRouteOverride: true,
|
|
||||||
showSiteHeader: false,
|
showSiteHeader: false,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
deactivate() {
|
deactivate() {
|
||||||
|
this._super(...arguments);
|
||||||
|
|
||||||
document.body.classList.remove("wizard");
|
document.body.classList.remove("wizard");
|
||||||
|
|
||||||
this.controllerFor("application").setProperties({
|
this.controllerFor("application").setProperties({
|
||||||
showTop: true,
|
showTop: true,
|
||||||
sidebarDisabledRouteOverride: false,
|
|
||||||
showSiteHeader: true,
|
showSiteHeader: true,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue