diff --git a/apps/red-ui/src/app/components/base-screen/base-screen.component.ts b/apps/red-ui/src/app/components/base-screen/base-screen.component.ts index 3bfa76673..90bcddc2d 100644 --- a/apps/red-ui/src/app/components/base-screen/base-screen.component.ts +++ b/apps/red-ui/src/app/components/base-screen/base-screen.component.ts @@ -34,7 +34,7 @@ export class BaseScreenComponent { { name: _('top-bar.navigation-items.my-account.children.account'), routerLink: '/main/account', - show: this.currentUser.isUser, + show: true, action: this.appStateService.reset, showDot: () => false, }, diff --git a/apps/red-ui/src/app/modules/account/account-routing.module.ts b/apps/red-ui/src/app/modules/account/account-routing.module.ts index 777b82c0c..9c77d73a2 100644 --- a/apps/red-ui/src/app/modules/account/account-routing.module.ts +++ b/apps/red-ui/src/app/modules/account/account-routing.module.ts @@ -14,7 +14,6 @@ const routes = [ canActivate: [CompositeRouteGuard], data: { routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard], - requiredRoles: ['RED_USER'], }, loadChildren: () => import('./screens/user-profile/user-profile.module').then(m => m.UserProfileModule), }, @@ -24,6 +23,7 @@ const routes = [ canActivate: [CompositeRouteGuard], data: { routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard], + requiredRoles: ['RED_USER'], }, loadChildren: () => import('./screens/notifications/notifications.module').then(m => m.NotificationsModule), }, diff --git a/apps/red-ui/src/app/modules/account/account-side-nav/account-side-nav.component.html b/apps/red-ui/src/app/modules/account/account-side-nav/account-side-nav.component.html index 8ebc033dc..aeb6611a0 100644 --- a/apps/red-ui/src/app/modules/account/account-side-nav/account-side-nav.component.html +++ b/apps/red-ui/src/app/modules/account/account-side-nav/account-side-nav.component.html @@ -1,6 +1,7 @@ -
+
{{ item.label | translate }}
diff --git a/apps/red-ui/src/app/modules/account/account-side-nav/account-side-nav.component.ts b/apps/red-ui/src/app/modules/account/account-side-nav/account-side-nav.component.ts index f4cf007ae..9aafdd008 100644 --- a/apps/red-ui/src/app/modules/account/account-side-nav/account-side-nav.component.ts +++ b/apps/red-ui/src/app/modules/account/account-side-nav/account-side-nav.component.ts @@ -1,9 +1,11 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { UserService } from '@services/user.service'; interface NavItem { readonly label: string; readonly screen: string; + readonly hideIf?: boolean; } @Component({ @@ -21,6 +23,9 @@ export class AccountSideNavComponent { { screen: 'notifications', label: _('notifications'), + hideIf: !this._userService.currentUser.isUser, }, ]; + + constructor(private readonly _userService: UserService) {} }