mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-10-01 14:41:14 +00:00
cleanup user profile menu item
This commit is contained in:
committed by
Sheena Malhotra
parent
c9dba27892
commit
69a8fbc9c5
@@ -1,15 +1,10 @@
|
|||||||
<button mat-icon-button [matMenuTriggerFor]="menu" aria-label="matMenu" class="app-menu-button">
|
<button mat-icon-button [matMenuTriggerFor]="menu" aria-label="matMenu">
|
||||||
<mat-icon title="{{'APP.TOOLTIPS.OPTIONS_SETTINGS' | translate}}">apps</mat-icon>
|
<mat-icon title="{{'APP.TOOLTIPS.OPTIONS_SETTINGS' | translate}}">apps</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<mat-menu #menu="matMenu" xPosition="before">
|
<mat-menu #menu="matMenu" xPosition="before">
|
||||||
<div mat-menu-item class="app-menu-user-details" [routerLink]="['/profile']" title="{{'APP.TOOLTIPS.MY_PROFILE' | translate}}">
|
<div mat-menu-item [routerLink]="['/profile']" title="{{'APP.TOOLTIPS.MY_PROFILE' | translate}}">
|
||||||
<button class="app-menu-user-details-button" aria-label="matMenu">
|
|
||||||
<mat-icon>account_circle</mat-icon>
|
<mat-icon>account_circle</mat-icon>
|
||||||
</button>
|
<span>{{ displayName }}</span>
|
||||||
<div class="app-menu-user-details-name-mail">
|
|
||||||
<div class="app-menu-user-details-name">{{ userName }}</div>
|
|
||||||
<div class="app-menu-user-details-name">{{ userEmail }}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
<button mat-menu-item data-automation-id="language-menu-button" [matMenuTriggerFor]="langMenu">
|
<button mat-menu-item data-automation-id="language-menu-button" [matMenuTriggerFor]="langMenu">
|
||||||
|
@@ -1,32 +0,0 @@
|
|||||||
app-navigation-menu {
|
|
||||||
.app-menu-button {
|
|
||||||
height: 32px;
|
|
||||||
background: none;
|
|
||||||
line-height: 24px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.mat-menu-panel {
|
|
||||||
.app-menu-user-details {
|
|
||||||
display: flex;
|
|
||||||
height: 66px;
|
|
||||||
|
|
||||||
&-button {
|
|
||||||
height: 32px;
|
|
||||||
padding: 0;
|
|
||||||
line-height: 24px;
|
|
||||||
background: none;
|
|
||||||
border: none;
|
|
||||||
margin-top: 14px;
|
|
||||||
transform: scale(1.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
&-name-mail {
|
|
||||||
line-height: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-name {
|
|
||||||
height: 24px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -12,20 +12,22 @@ import { ContentApiService } from '@alfresco/aca-shared';
|
|||||||
@Component({
|
@Component({
|
||||||
selector: 'app-navigation-menu',
|
selector: 'app-navigation-menu',
|
||||||
templateUrl: './navigation-menu.component.html',
|
templateUrl: './navigation-menu.component.html',
|
||||||
styleUrls: ['./navigation-menu.component.scss'],
|
|
||||||
encapsulation: ViewEncapsulation.None
|
encapsulation: ViewEncapsulation.None
|
||||||
})
|
})
|
||||||
export class NavigationMenuComponent implements OnInit {
|
export class NavigationMenuComponent implements OnInit {
|
||||||
userName = '';
|
displayName = 'Unknown user';
|
||||||
userEmail = '';
|
|
||||||
|
|
||||||
constructor(private contentApi: ContentApiService) {}
|
constructor(private contentApi: ContentApiService) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.contentApi.getPerson('-me-').subscribe((person) => {
|
this.contentApi.getPerson('-me-').subscribe((person) => {
|
||||||
const personDetails = person?.entry;
|
const personDetails = person?.entry;
|
||||||
this.userName = personDetails.displayName;
|
|
||||||
this.userEmail = personDetails.email;
|
this.displayName = personDetails.displayName;
|
||||||
|
|
||||||
|
if (personDetails.email) {
|
||||||
|
this.displayName = `${personDetails.displayName} (${personDetails.email})`;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user