From 3c85b285c4b144f12210cc0c014b166780a23172 Mon Sep 17 00:00:00 2001 From: Neil MacDougall Date: Thu, 21 Mar 2019 11:34:23 +0000 Subject: [PATCH] Unknown endpoint types handled correctly --- .../endpoint/endpoint-card/endpoint-card.component.html | 4 ++-- .../endpoint/endpoint-card/endpoint-card.component.ts | 4 ++-- .../table-cell-endpoint-details.component.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/endpoint-card/endpoint-card.component.html b/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/endpoint-card/endpoint-card.component.html index fba8e0bb1e..3c5ba312a9 100644 --- a/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/endpoint-card/endpoint-card.component.html +++ b/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/endpoint-card/endpoint-card.component.html @@ -1,12 +1,12 @@
-
+
{{ row?.name }} -
{{endpointConfig.label}}
+
{{!endpointConfig ? 'Unknown' : endpointConfig.label}}
diff --git a/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/endpoint-card/endpoint-card.component.ts b/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/endpoint-card/endpoint-card.component.ts index 44961170ae..e2ccc77249 100644 --- a/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/endpoint-card/endpoint-card.component.ts +++ b/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/endpoint-card/endpoint-card.component.ts @@ -89,7 +89,7 @@ export class EndpointCardComponent extends CardCell implements On ngOnInit() { this.favorite = this.pRow.cnsi_type === 'cf' ? getFavoriteFromEndpointEntity(this.row) : null; const e = getEndpointType(this.pRow.cnsi_type); - this.hasDetails = !!e.listDetailsComponent; + this.hasDetails = !!e && !!e.listDetailsComponent; } ngOnDestroy(): void { @@ -105,7 +105,7 @@ export class EndpointCardComponent extends CardCell implements On return; } const e = getEndpointType(this.pRow.cnsi_type); - if (!e.listDetailsComponent) { + if (!!e || !e.listDetailsComponent) { return; } diff --git a/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/table-cell-endpoint-details/table-cell-endpoint-details.component.ts b/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/table-cell-endpoint-details/table-cell-endpoint-details.component.ts index 2bb2f65cb5..6bf977419c 100644 --- a/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/table-cell-endpoint-details/table-cell-endpoint-details.component.ts +++ b/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/table-cell-endpoint-details/table-cell-endpoint-details.component.ts @@ -27,7 +27,7 @@ export class TableCellEndpointDetailsComponent extends TableCellCustom