From 2bbcf4ecdaeed30c9e9224a084acc816eda2ab7f Mon Sep 17 00:00:00 2001 From: Igor Kulikov Date: Wed, 17 Jun 2026 20:36:32 +0300 Subject: [PATCH] UI: move user menu into the side rail and turn it into a full-width trigger button MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit User-menu now lives at the bottom of the side-menu toolbar (separated by a 1px border) instead of in the top toolbar. Drop the displayUserInfo input and the lt-lg hide-name behaviour — the side rail always shows the name + authority next to the avatar via a single mat-menu trigger button that opens upward. Dashboard-page user-menu usages drop the now-unused displayUserInfo attribute. --- .../dashboard-page.component.html | 4 +- .../src/app/modules/home/home.component.html | 2 +- .../src/app/modules/home/home.component.scss | 5 +- .../components/user-menu.component.html | 53 ++++++++----------- .../components/user-menu.component.scss | 38 ++++++++----- .../shared/components/user-menu.component.ts | 5 +- 6 files changed, 56 insertions(+), 51 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html index c62c29555e..9683ddddc5 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html @@ -26,7 +26,7 @@
@if (!isPublicUser() && forceFullscreen) { - + } @if (isEdit) { @@ -88,7 +88,7 @@ arrow_forward @if (!isPublicUser() && forceFullscreen) { - + }
+ @@ -78,7 +79,6 @@ } - @if (!hideLoadingBar && (isLoading$ | async)) { -
- @if (displayUserInfo) { -
+ diff --git a/ui-ngx/src/app/shared/components/user-menu.component.scss b/ui-ngx/src/app/shared/components/user-menu.component.scss index 92befac2b1..995e82765a 100644 --- a/ui-ngx/src/app/shared/components/user-menu.component.scss +++ b/ui-ngx/src/app/shared/components/user-menu.component.scss @@ -14,37 +14,47 @@ * limitations under the License. */ :host { - div.tb-user-info { + button.tb-user-menu { + width: 250px; + height: 100%; + padding: 16px; + display: flex; + flex-direction: row; + justify-content: start; + gap: 8px; line-height: 1.5; span { text-transform: none; + text-align: start; } span.tb-user-display-name { - font-size: .8rem; - font-weight: 300; - letter-spacing: .008em; + color: rgba(0, 0, 0, 0.76); + font-size: 14px; + line-height: 16px; + font-weight: 500; + letter-spacing: 0.25px; } span.tb-user-authority { - font-size: .8rem; - font-weight: 300; - letter-spacing: .005em; - opacity: .8; + color: rgba(0, 0, 0, 0.54); + font-size: 12px; + line-height: 16px; + font-weight: 400; + letter-spacing: 0.25px; } } .mat-icon.tb-mini-avatar { - width: 36px; - height: 36px; - margin: auto 8px; - font-size: 36px; - cursor: default; + width: 32px; + height: 32px; + font-size: 32px; + margin: 0; } } .tb-user-menu-items { - min-width: 256px; + min-width: 250px; } diff --git a/ui-ngx/src/app/shared/components/user-menu.component.ts b/ui-ngx/src/app/shared/components/user-menu.component.ts index 15c56dfb3f..1fcde5a1b6 100644 --- a/ui-ngx/src/app/shared/components/user-menu.component.ts +++ b/ui-ngx/src/app/shared/components/user-menu.component.ts @@ -14,7 +14,7 @@ /// limitations under the License. /// -import { ChangeDetectionStrategy, Component, Input, OnDestroy, OnInit } from '@angular/core'; +import { ChangeDetectionStrategy, Component, Input, OnDestroy, OnInit, ViewChild } from '@angular/core'; import { User } from '@shared/models/user.model'; import { Authority } from '@shared/models/authority.enum'; import { select, Store } from '@ngrx/store'; @@ -23,6 +23,7 @@ import { selectAuthUser, selectUserDetails } from '@core/auth/auth.selectors'; import { map } from 'rxjs/operators'; import { AuthService } from '@core/auth/auth.service'; import { Router } from '@angular/router'; +import { MatMenu, MatMenuTrigger } from '@angular/material/menu'; @Component({ selector: 'tb-user-menu', @@ -33,8 +34,6 @@ import { Router } from '@angular/router'; }) export class UserMenuComponent implements OnInit, OnDestroy { - @Input() displayUserInfo: boolean; - authorities = Authority; authority$ = this.store.pipe(