Skip to content

Commit

Permalink
NAS-125535 / 24.04 / Make username and settings icon in topbar one it…
Browse files Browse the repository at this point in the history
…em (#9292)

* NAS-125535: Make username and settings icon in topbar one item

* NAS-125535: PR update

* NAS-125535: PR update
  • Loading branch information
AlexKarpov98 authored Dec 8, 2023
1 parent f1547cf commit ffc5a66
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
<div *ngIf="(loggedInUser$ | async) as user" class="user-menu-wrapper">
<span
*ngIf="user?.username"
[matTooltip]="user.username"
[matMenuTriggerFor]="userMenu"
>
{{ user.username }}
</span>

<button
name="Settings"
mat-icon-button
Expand All @@ -15,6 +7,15 @@
[matTooltip]="tooltips.settings | translate"
[matMenuTriggerFor]="userMenu"
>
<span
*ngIf="user?.username"
class="username"
[matTooltip]="user.username"
[matMenuTriggerFor]="userMenu"
>
{{ user.username }}
</span>

<ix-icon name="account_circle"></ix-icon>
</button>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@
align-items: center;
display: flex;

> span {
> button {
border-radius: 4px !important;
padding: 4px !important;
width: inherit !important;
}

.username {
-webkit-box-orient: vertical;
cursor: pointer;
display: inline-box;
font-size: 14px;
-webkit-line-clamp: 1;
margin-left: 0.5rem;
margin-right: 0.5rem;
max-width: 200px;
overflow: hidden;
white-space: normal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ describe('UserMenuComponent', () => {
});

it('should display correct username to the left of user icon in top bar', () => {
const usernameSpan = spectator.query('span');
expect(usernameSpan).toBeTruthy();
expect(usernameSpan.textContent).toContain('root');
const button = spectator.query('button');
expect(button).toBeTruthy();
expect(button.textContent).toContain('root');
});
});

Expand Down

0 comments on commit ffc5a66

Please sign in to comment.