DEV: Don't render header on invites page (#22138)

What this change?

Previous solution relied on CSS to hide the header which is first
wasteful since we're still rendering the header and second makes it
untestable. If we don't want the header to show, we should avoid
rendering it in the first place.
This commit is contained in:
Alan Guo Xiang Tan 2023-06-16 09:42:00 +08:00 committed by GitHub
parent 9fad71809c
commit 783bce4b2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 3 deletions

View File

@ -19,6 +19,22 @@ export default DiscourseRoute.extend(DisableSidebar, {
}
},
activate() {
this._super(...arguments);
this.controllerFor("application").setProperties({
showSiteHeader: false,
});
},
deactivate() {
this._super(...arguments);
this.controllerFor("application").setProperties({
showSiteHeader: true,
});
},
setupController(controller, model) {
this._super(...arguments);

View File

@ -103,6 +103,11 @@ acceptance("Invite accept", function (needs) {
"does not display the sidebar on the invites page"
);
assert.notOk(
exists(".d-header"),
"does not display the site header 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(

View File

@ -36,9 +36,6 @@ body.invite-page {
background-color: var(--primary-50);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
Oxygen-Sans, Ubuntu, Cantarell, Arial, sans-serif;
.d-header {
display: none;
}
}
// Create Account + Login