You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ze...@apache.org on 2022/01/18 15:53:54 UTC

[incubator-streampipes] branch STREAMPIPES-507 updated: [STREAMPIPES-507] Enable toggle for widget edit mode in data explorer

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

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


The following commit(s) were added to refs/heads/STREAMPIPES-507 by this push:
     new 0ee2757  [STREAMPIPES-507] Enable toggle for widget edit mode in data explorer
0ee2757 is described below

commit 0ee27572677332cfcacb864cfc3acb4e04b265ad
Author: Philipp Zehnder <ze...@fzi.de>
AuthorDate: Tue Jan 18 16:53:41 2022 +0100

    [STREAMPIPES-507] Enable toggle for widget edit mode in data explorer
---
 .../grid/data-explorer-dashboard-grid.component.ts        |  6 +++++-
 .../panel/data-explorer-dashboard-panel.component.ts      | 15 ++++++++++-----
 .../widget/data-explorer-dashboard-widget.component.html  |  2 +-
 .../widget/data-explorer-dashboard-widget.component.ts    |  6 +++++-
 4 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/ui/src/app/data-explorer/components/grid/data-explorer-dashboard-grid.component.ts b/ui/src/app/data-explorer/components/grid/data-explorer-dashboard-grid.component.ts
index 9dbb23a..af3d5ae 100644
--- a/ui/src/app/data-explorer/components/grid/data-explorer-dashboard-grid.component.ts
+++ b/ui/src/app/data-explorer/components/grid/data-explorer-dashboard-grid.component.ts
@@ -138,7 +138,11 @@ export class DataExplorerDashboardGridComponent implements OnInit, OnChanges {
 
   propagateWidgetSelection(configuredWidget: DataExplorerWidgetModel) {
     this.configureWidgetCallback.emit(configuredWidget);
-    this.currentlyConfiguredWidgetId = configuredWidget._id;
+    if (configuredWidget) {
+      this.currentlyConfiguredWidgetId = configuredWidget._id;
+    } else {
+      this.currentlyConfiguredWidgetId = undefined;
+    }
     this.options.api.optionsChanged();
   }
 
diff --git a/ui/src/app/data-explorer/components/panel/data-explorer-dashboard-panel.component.ts b/ui/src/app/data-explorer/components/panel/data-explorer-dashboard-panel.component.ts
index 99e9678..795532d 100644
--- a/ui/src/app/data-explorer/components/panel/data-explorer-dashboard-panel.component.ts
+++ b/ui/src/app/data-explorer/components/panel/data-explorer-dashboard-panel.component.ts
@@ -154,11 +154,16 @@ export class DataExplorerDashboardPanelComponent implements OnInit {
   }
 
   updateCurrentlyConfiguredWidget(currentWidget: DataExplorerWidgetModel) {
-    this.widgetsToUpdate.set(currentWidget._id, currentWidget);
-    this.currentlyConfiguredWidget = currentWidget;
-    this.currentlyConfiguredWidgetId = currentWidget._id;
-    this.designerPanel.modifyWidgetMode(currentWidget, false);
-    this.showDesignerPanel = true;
+    if (currentWidget) {
+      this.widgetsToUpdate.set(currentWidget._id, currentWidget);
+      this.currentlyConfiguredWidget = currentWidget;
+      this.currentlyConfiguredWidgetId = currentWidget._id;
+      this.designerPanel.modifyWidgetMode(currentWidget, false);
+      this.showDesignerPanel = true;
+    } else {
+      this.showDesignerPanel = false;
+    }
+
   }
 
   discardChanges() {
diff --git a/ui/src/app/data-explorer/components/widget/data-explorer-dashboard-widget.component.html b/ui/src/app/data-explorer/components/widget/data-explorer-dashboard-widget.component.html
index 47c49a8..9146c3f 100644
--- a/ui/src/app/data-explorer/components/widget/data-explorer-dashboard-widget.component.html
+++ b/ui/src/app/data-explorer/components/widget/data-explorer-dashboard-widget.component.html
@@ -75,7 +75,7 @@
                         (click)="removeWidget()"
                         matTooltip="Delete widget"
                         *ngIf="editMode && hasDataExplorerDeletePrivileges">
-                    <mat-icon>delete</mat-icon>
+                    <mat-icon>clear</mat-icon>
                 </button>
             </div>
         </div>
diff --git a/ui/src/app/data-explorer/components/widget/data-explorer-dashboard-widget.component.ts b/ui/src/app/data-explorer/components/widget/data-explorer-dashboard-widget.component.ts
index 61a4c08..51b841b 100644
--- a/ui/src/app/data-explorer/components/widget/data-explorer-dashboard-widget.component.ts
+++ b/ui/src/app/data-explorer/components/widget/data-explorer-dashboard-widget.component.ts
@@ -164,7 +164,11 @@ export class DataExplorerDashboardWidgetComponent implements OnInit {
   }
 
   triggerWidgetEditMode() {
-    this.configureWidgetCallback.emit(this.configuredWidget);
+    if (this.currentlyConfiguredWidgetId === this.configuredWidget._id) {
+      this.configureWidgetCallback.emit();
+    } else {
+      this.configureWidgetCallback.emit(this.configuredWidget);
+    }
   }
 
   startLoadingTimer() {