UI: disabled originartor column details page links in alarms table for entities that can not have alarm

This commit is contained in:
rusikv 2024-01-12 16:23:54 +02:00
parent 201c2a994e
commit f77711ec5a
2 changed files with 3 additions and 3 deletions

View File

@ -711,7 +711,7 @@ export function randomAlphanumeric(length: number): string {
} }
export function getEntityDetailsPageURL(id: string, entityType: EntityType): string { export function getEntityDetailsPageURL(id: string, entityType: EntityType): string {
return `${baseDetailsPageByEntityType.get(entityType)}/${id}`; return baseDetailsPageByEntityType.has(entityType) ? `${baseDetailsPageByEntityType.get(entityType)}/${id}` : '';
} }
export function parseHttpErrorMessage(errorResponse: HttpErrorResponse, export function parseHttpErrorMessage(errorResponse: HttpErrorResponse,

View File

@ -165,8 +165,8 @@
[matTooltip]="cellTooltip(entity, column, row)" [matTooltip]="cellTooltip(entity, column, row)"
matTooltipPosition="above" matTooltipPosition="above"
[ngStyle]="cellStyle(entity, column, row)"> [ngStyle]="cellStyle(entity, column, row)">
<ng-container *ngIf="column.type == 'link'; else defaultContent"> <ng-container *ngIf="column.type == 'link' && column.entityURL(entity) as detailsPageURl; else defaultContent">
<a [routerLink]="column.entityURL(entity)" [innerHTML]="cellContent(entity, column, row)" (click)="$event.stopPropagation();"></a> <a [routerLink]="detailsPageURl" [innerHTML]="cellContent(entity, column, row)" (click)="$event.stopPropagation();"></a>
</ng-container> </ng-container>
<ng-template #defaultContent> <ng-template #defaultContent>
<span [innerHTML]="cellContent(entity, column, row)"></span> <span [innerHTML]="cellContent(entity, column, row)"></span>