You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ri...@apache.org on 2022/08/08 11:57:44 UTC

[incubator-streampipes] 01/03: [hotfix] Delete widgets on dashboard deletion

This is an automated email from the ASF dual-hosted git repository.

riemer pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git

commit e193d2b171dd52ea72dcadd036bbcc86c11482b7
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Mon Aug 8 13:56:55 2022 +0200

    [hotfix] Delete widgets on dashboard deletion
---
 .../app/dashboard/components/overview/dashboard-overview.component.ts | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ui/src/app/dashboard/components/overview/dashboard-overview.component.ts b/ui/src/app/dashboard/components/overview/dashboard-overview.component.ts
index e4e270f5a..ce728dc8b 100644
--- a/ui/src/app/dashboard/components/overview/dashboard-overview.component.ts
+++ b/ui/src/app/dashboard/components/overview/dashboard-overview.component.ts
@@ -28,6 +28,7 @@ import { UserRole } from '../../../_enums/user-role.enum';
 import { AuthService } from '../../../services/auth.service';
 import { UserPrivilege } from '../../../_enums/user-privilege.enum';
 import { SpDashboardRoutes } from '../../dashboard.routes';
+import { zip } from 'rxjs';
 
 @Component({
   selector: 'dashboard-overview',
@@ -102,7 +103,8 @@ export class DashboardOverviewComponent implements OnInit {
 
   openDeleteDashboardDialog(dashboard: Dashboard) {
     // TODO add confirm dialog
-    this.dashboardService.deleteDashboard(dashboard).subscribe(result => {
+    const widgetsToDelete = dashboard.widgets.map(widget => this.dashboardService.deleteWidget(widget.id));
+    zip(...widgetsToDelete, this.dashboardService.deleteDashboard(dashboard)).subscribe(result => {
       this.getDashboards();
     });
   }