diff --git a/app/assets/javascripts/discourse/app/controllers/user.js b/app/assets/javascripts/discourse/app/controllers/user.js index c46e2c34868..72d6967ec92 100644 --- a/app/assets/javascripts/discourse/app/controllers/user.js +++ b/app/assets/javascripts/discourse/app/controllers/user.js @@ -194,11 +194,8 @@ export default Controller.extend(CanCheckEmails, { if (!this.currentUser?.staff) { return false; } - if (this.currentUser?.redesigned_user_page_nav_enabled) { - return this.site.desktopView; - } else { - return true; - } + + return this.site.desktopView; }, @action diff --git a/app/assets/javascripts/discourse/app/templates/user.hbs b/app/assets/javascripts/discourse/app/templates/user.hbs index 9b332241b2d..fd72ddbbe97 100644 --- a/app/assets/javascripts/discourse/app/templates/user.hbs +++ b/app/assets/javascripts/discourse/app/templates/user.hbs @@ -431,81 +431,22 @@ - {{#if this.currentUser.redesigned_user_page_nav_enabled}} -
- - -
- {{outlet}} -
-
- {{else}} -
-
- - {{#unless this.model.profile_hidden}} -
  • {{i18n - "user.summary.title" - }}
  • -
  • {{i18n - "user.activity_stream" - }}
  • - {{/unless}} - - {{#if this.showNotificationsTab}} -
  • - - {{d-icon "bell" class="glyph"}}{{i18n "user.notifications"}} - -
  • - {{/if}} - - {{#if this.showPrivateMessages}} -
  • {{d-icon "envelope"}}{{i18n - "user.private_messages" - }}
  • - {{/if}} - - {{#if this.canInviteToForum}} -
  • {{d-icon - "user-plus" - }}{{i18n "user.invited.title"}}
  • - {{/if}} - - {{#if this.showBadges}} -
  • {{d-icon - "certificate" - }}{{i18n "badges.title"}}
  • - {{/if}} - - - - {{#if this.model.can_edit}} -
  • {{d-icon - "cog" - }}{{i18n "user.preferences"}}
  • - {{/if}} -
    -
    +
    + +
    {{outlet}}
    - {{/if}} +
    \ No newline at end of file diff --git a/app/assets/javascripts/discourse/tests/acceptance/user-test.js b/app/assets/javascripts/discourse/tests/acceptance/user-test.js index 4e143fe3f08..143bdfb4d12 100644 --- a/app/assets/javascripts/discourse/tests/acceptance/user-test.js +++ b/app/assets/javascripts/discourse/tests/acceptance/user-test.js @@ -24,6 +24,7 @@ acceptance("User Routes", function (needs) { helper.response(400, {}) ); }); + test("Invalid usernames", async function (assert) { try { await visit("/u/eviltrout%2F..%2F..%2F/summary"); @@ -52,6 +53,7 @@ acceptance("User Routes", function (needs) { test("Notifications", async function (assert) { await visit("/u/eviltrout/notifications"); + assert.ok( document.body.classList.contains("user-notifications-page"), "has the body class" @@ -66,16 +68,20 @@ acceptance("User Routes", function (needs) { ); updateCurrentUser({ moderator: true, admin: false }); + await visit("/u/charlie/summary"); + assert.notOk( - exists(".user-nav > .user-notifications"), + exists(".user-nav > .user-nav__notifications"), "does not have the notifications tab" ); updateCurrentUser({ moderator: false, admin: true }); + await visit("/u/charlie/summary"); + assert.ok( - exists(".user-nav > .user-notifications"), + exists(".user-nav > .user-nav__notifications"), "has the notifications tab" ); });