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 PreloadStore from "discourse/lib/preload-store";
|
||||
import { deepMerge } from "discourse-common/lib/object";
|
||||
import DisableSidebar from "discourse/mixins/disable-sidebar";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
export default DiscourseRoute.extend(DisableSidebar, {
|
||||
titleToken() {
|
||||
return I18n.t("invites.accept_title");
|
||||
},
|
||||
|
|
|
@ -2,8 +2,9 @@ import DiscourseRoute from "discourse/routes/discourse";
|
|||
import PreloadStore from "discourse/lib/preload-store";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import { extractError } from "discourse/lib/ajax-error";
|
||||
import DisableSidebar from "discourse/mixins/disable-sidebar";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
export default DiscourseRoute.extend(DisableSidebar, {
|
||||
queryParams: {
|
||||
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) {
|
||||
this._super(...arguments);
|
||||
controller.resetState();
|
||||
|
|
|
@ -97,6 +97,12 @@ acceptance("Invite accept", function (needs) {
|
|||
});
|
||||
|
||||
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-username"), "shows the username input");
|
||||
assert.strictEqual(
|
||||
|
|
|
@ -1,28 +1,31 @@
|
|||
import Route from "@ember/routing/route";
|
||||
import { findWizard } from "wizard/models/wizard";
|
||||
import DisableSidebar from "discourse/mixins/disable-sidebar";
|
||||
|
||||
export default Route.extend({
|
||||
export default Route.extend(DisableSidebar, {
|
||||
model() {
|
||||
return findWizard();
|
||||
},
|
||||
|
||||
activate() {
|
||||
this._super(...arguments);
|
||||
|
||||
document.body.classList.add("wizard");
|
||||
|
||||
this.controllerFor("application").setProperties({
|
||||
showTop: false,
|
||||
showFooter: false,
|
||||
sidebarDisabledRouteOverride: true,
|
||||
showSiteHeader: false,
|
||||
});
|
||||
},
|
||||
|
||||
deactivate() {
|
||||
this._super(...arguments);
|
||||
|
||||
document.body.classList.remove("wizard");
|
||||
|
||||
this.controllerFor("application").setProperties({
|
||||
showTop: true,
|
||||
sidebarDisabledRouteOverride: false,
|
||||
showSiteHeader: true,
|
||||
});
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue