RED-8000: add ids for tests
This commit is contained in:
parent
91e33ebf81
commit
c446c27e68
@ -25,16 +25,17 @@
|
||||
<iqser-help-button [dialogButton]="false"></iqser-help-button>
|
||||
<redaction-notifications iqserHelpMode="open_notifications"></redaction-notifications>
|
||||
</div>
|
||||
<redaction-user-button [matMenuTriggerFor]="userMenu" [userId]="currentUser.id"></redaction-user-button>
|
||||
|
||||
<redaction-user-button [matMenuTriggerFor]="userMenu" [userId]="currentUser.id" id="userMenu"></redaction-user-button>
|
||||
|
||||
<mat-menu #userMenu="matMenu" xPosition="before">
|
||||
<ng-container *ngFor="let item of userMenuItems; trackBy: trackByName">
|
||||
<a (click)="(item.action)" *ngIf="item.show" [routerLink]="item.routerLink" mat-menu-item>
|
||||
<a (click)="(item.action)" *ngIf="item.show" [id]="item.id" [routerLink]="item.routerLink" mat-menu-item>
|
||||
{{ item.name | translate }}
|
||||
</a>
|
||||
</ng-container>
|
||||
|
||||
<button (click)="userService.logout()" mat-menu-item>
|
||||
<button (click)="userService.logout()" id="logout" mat-menu-item>
|
||||
<mat-icon svgIcon="iqser:logout"></mat-icon>
|
||||
<span translate="top-bar.navigation-items.my-account.children.logout"> </span>
|
||||
</button>
|
||||
|
||||
@ -13,6 +13,7 @@ import { FeaturesService } from '@services/features.service';
|
||||
import { DOSSIERS_ARCHIVE } from '@utils/constants';
|
||||
|
||||
interface MenuItem {
|
||||
readonly id: string;
|
||||
readonly name: string;
|
||||
readonly routerLink?: string;
|
||||
readonly show: boolean;
|
||||
@ -31,21 +32,25 @@ export class BaseScreenComponent {
|
||||
readonly currentUser = this.userService.currentUser;
|
||||
readonly userMenuItems: readonly MenuItem[] = [
|
||||
{
|
||||
id: 'account',
|
||||
name: _('top-bar.navigation-items.my-account.children.account'),
|
||||
routerLink: '/main/account',
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
id: 'admin',
|
||||
name: _('top-bar.navigation-items.my-account.children.admin'),
|
||||
routerLink: '/main/admin',
|
||||
show: this.currentUser.isManager || this.currentUser.isUserAdmin,
|
||||
},
|
||||
{
|
||||
id: 'downloads',
|
||||
name: _('top-bar.navigation-items.my-account.children.downloads'),
|
||||
routerLink: '/main/downloads',
|
||||
show: this.currentUser.isUser,
|
||||
},
|
||||
{
|
||||
id: 'trash',
|
||||
name: _('top-bar.navigation-items.my-account.children.trash'),
|
||||
routerLink: '/main/admin/trash',
|
||||
show: this.currentUser.isManager,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user