diff --git a/webapp/frontend/src/app/layout/common/dashboard-device/dashboard-device.component.html b/webapp/frontend/src/app/layout/common/dashboard-device/dashboard-device.component.html index 05ef6dc..5e21f3c 100644 --- a/webapp/frontend/src/app/layout/common/dashboard-device/dashboard-device.component.html +++ b/webapp/frontend/src/app/layout/common/dashboard-device/dashboard-device.component.html @@ -1,4 +1,4 @@ -
diff --git a/webapp/frontend/src/app/layout/common/dashboard-device/dashboard-device.component.ts b/webapp/frontend/src/app/layout/common/dashboard-device/dashboard-device.component.ts index 050f650..5639eb8 100644 --- a/webapp/frontend/src/app/layout/common/dashboard-device/dashboard-device.component.ts +++ b/webapp/frontend/src/app/layout/common/dashboard-device/dashboard-device.component.ts @@ -1,4 +1,4 @@ -import {ChangeDetectorRef, Component, Input, OnInit} from '@angular/core'; +import { Component, Input, Output, OnInit, EventEmitter} from '@angular/core'; import * as moment from "moment"; import {takeUntil} from "rxjs/operators"; import {AppConfig} from "app/core/config/app.config"; @@ -16,7 +16,7 @@ import {DashboardDeviceDeleteDialogComponent} from "app/layout/common/dashboard- export class DashboardDeviceComponent implements OnInit { @Input() deviceSummary: any; @Input() deviceWWN: string; - deleted = false; + @Output() deviceDeleted = new EventEmitter(); config: AppConfig; @@ -25,7 +25,6 @@ export class DashboardDeviceComponent implements OnInit { constructor( private _configService: TreoConfigService, public dialog: MatDialog, - private cdRef: ChangeDetectorRef, ) { // Set the private defaults this._unsubscribeAll = new Subject(); @@ -97,8 +96,9 @@ export class DashboardDeviceComponent implements OnInit { dialogRef.afterClosed().subscribe(result => { console.log('The dialog was closed', result); - this.deleted = result.success - this.cdRef.detectChanges() + if(result.success){ + this.deviceDeleted.emit(this.deviceWWN) + } }); } } diff --git a/webapp/frontend/src/app/modules/dashboard/dashboard.component.html b/webapp/frontend/src/app/modules/dashboard/dashboard.component.html index 26043dd..cbb19a4 100644 --- a/webapp/frontend/src/app/modules/dashboard/dashboard.component.html +++ b/webapp/frontend/src/app/modules/dashboard/dashboard.component.html @@ -51,7 +51,7 @@

{{hostId.key}}

- +
diff --git a/webapp/frontend/src/app/modules/dashboard/dashboard.component.ts b/webapp/frontend/src/app/modules/dashboard/dashboard.component.ts index bc45ea7..b3ba874 100644 --- a/webapp/frontend/src/app/modules/dashboard/dashboard.component.ts +++ b/webapp/frontend/src/app/modules/dashboard/dashboard.component.ts @@ -229,7 +229,9 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy deviceSummariesForHostGroup(hostGroupWWNs: string[]) { let deviceSummaries = [] for(let wwn of hostGroupWWNs){ - deviceSummaries.push(this.data.data.summary[wwn]) + if(this.data.data.summary[wwn]){ + deviceSummaries.push(this.data.data.summary[wwn]) + } } return deviceSummaries } @@ -242,6 +244,10 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy }); } + onDeviceDeleted(wwn: string) { + delete this.data.data.summary[wwn] // remove the device from the summary list. + } + /* DURATION_KEY_WEEK = "week"