FIX: Hide experimental user navigation changes when disabled (#18327)

Followup to b066955838
This commit is contained in:
David Taylor 2022-09-22 10:26:01 +01:00 committed by GitHub
parent da47e448ac
commit 7a622f22bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -198,6 +198,17 @@ export default Controller.extend(CanCheckEmails, {
this.toggleProperty("displayUserNav");
},
get displayTopLevelAdminButton() {
if (!this.currentUser?.staff) {
return false;
}
if (this.currentUser?.redesigned_user_page_nav_enabled) {
return this.site.desktopView;
} else {
return true;
}
},
actions: {
collapseProfile() {
this.set("forceExpand", false);

View File

@ -66,7 +66,7 @@
</li>
{{/if}}
{{#if (and this.site.desktopView this.currentUser.staff)}}
{{#if this.displayTopLevelAdminButton}}
<li><a href={{this.model.adminPath}} class="btn btn-default">{{d-icon "wrench"}}<span class="d-button-label">{{i18n "admin.user.show_admin_profile"}}</span></a></li>
{{/if}}
@ -78,7 +78,7 @@
</li>
{{/if}}
{{#if this.site.mobileView}}
{{#if (and this.site.mobileView this.currentUser.redesigned_user_page_nav_enabled)}}
<li>
<DButton @class="btn-default toggle-mobile-user-menu" @action={{this.toggleUserNav}} @icon="bars" @label="hamburger_menu" />
</li>