Skip to content

Commit

Permalink
Merge pull request #3445 from cloudfoundry-incubator/fix-unknown-endp…
Browse files Browse the repository at this point in the history
…oint-types

Ensure unknown endpoint types are handled correctly
  • Loading branch information
richard-cox authored Mar 25, 2019
2 parents 4bedfc9 + 3c85b28 commit 6ee680d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
[statusBackground]="true">
<app-meta-card-title>
<div class="endpoint-card__title">
<div *ngIf="endpointConfig.imagePath" class="endpoint-card__image">
<div *ngIf="!!endpointConfig && endpointConfig.imagePath" class="endpoint-card__image">
<img class="endpoint-card__image--img" src="{{endpointConfig.imagePath}}" />
</div>
<div class="endpoint-card__title__text">
<app-multiline-title class="endpoint-card__title-link">{{ row?.name }}</app-multiline-title>
<div class="endpoint-card__title__text--subtext">{{endpointConfig.label}}</div>
<div class="endpoint-card__title__text--subtext">{{!endpointConfig ? 'Unknown' : endpointConfig.label}}</div>
</div>
</div>
</app-meta-card-title>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export class EndpointCardComponent extends CardCell<EndpointModel> 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 {
Expand All @@ -127,7 +127,7 @@ export class EndpointCardComponent extends CardCell<EndpointModel> implements On
return;
}
const e = getEndpointType(this.pRow.cnsi_type);
if (!e.listDetailsComponent) {
if (!!e || !e.listDetailsComponent) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class TableCellEndpointDetailsComponent extends TableCellCustom<EndpointM
this.pRow = row;

const e = getEndpointType(row.cnsi_type);
if (!e.listDetailsComponent) {
if (!e || !e.listDetailsComponent) {
return;
}
if (!this.cell) {
Expand Down

0 comments on commit 6ee680d

Please sign in to comment.