RED-8000: add ids for tests

This commit is contained in:
Dan Percic 2022-04-29 15:18:53 +03:00
parent 91e33ebf81
commit c446c27e68
2 changed files with 9 additions and 3 deletions

View File

@ -25,16 +25,17 @@
<iqser-help-button [dialogButton]="false"></iqser-help-button> <iqser-help-button [dialogButton]="false"></iqser-help-button>
<redaction-notifications iqserHelpMode="open_notifications"></redaction-notifications> <redaction-notifications iqserHelpMode="open_notifications"></redaction-notifications>
</div> </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"> <mat-menu #userMenu="matMenu" xPosition="before">
<ng-container *ngFor="let item of userMenuItems; trackBy: trackByName"> <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 }} {{ item.name | translate }}
</a> </a>
</ng-container> </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> <mat-icon svgIcon="iqser:logout"></mat-icon>
<span translate="top-bar.navigation-items.my-account.children.logout"> </span> <span translate="top-bar.navigation-items.my-account.children.logout"> </span>
</button> </button>

View File

@ -13,6 +13,7 @@ import { FeaturesService } from '@services/features.service';
import { DOSSIERS_ARCHIVE } from '@utils/constants'; import { DOSSIERS_ARCHIVE } from '@utils/constants';
interface MenuItem { interface MenuItem {
readonly id: string;
readonly name: string; readonly name: string;
readonly routerLink?: string; readonly routerLink?: string;
readonly show: boolean; readonly show: boolean;
@ -31,21 +32,25 @@ export class BaseScreenComponent {
readonly currentUser = this.userService.currentUser; readonly currentUser = this.userService.currentUser;
readonly userMenuItems: readonly MenuItem[] = [ readonly userMenuItems: readonly MenuItem[] = [
{ {
id: 'account',
name: _('top-bar.navigation-items.my-account.children.account'), name: _('top-bar.navigation-items.my-account.children.account'),
routerLink: '/main/account', routerLink: '/main/account',
show: true, show: true,
}, },
{ {
id: 'admin',
name: _('top-bar.navigation-items.my-account.children.admin'), name: _('top-bar.navigation-items.my-account.children.admin'),
routerLink: '/main/admin', routerLink: '/main/admin',
show: this.currentUser.isManager || this.currentUser.isUserAdmin, show: this.currentUser.isManager || this.currentUser.isUserAdmin,
}, },
{ {
id: 'downloads',
name: _('top-bar.navigation-items.my-account.children.downloads'), name: _('top-bar.navigation-items.my-account.children.downloads'),
routerLink: '/main/downloads', routerLink: '/main/downloads',
show: this.currentUser.isUser, show: this.currentUser.isUser,
}, },
{ {
id: 'trash',
name: _('top-bar.navigation-items.my-account.children.trash'), name: _('top-bar.navigation-items.my-account.children.trash'),
routerLink: '/main/admin/trash', routerLink: '/main/admin/trash',
show: this.currentUser.isManager, show: this.currentUser.isManager,