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 2021/09/20 15:03:16 UTC

[incubator-streampipes] 02/03: [STREAMPIPES-79] Set default widget name

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

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

commit 58d942f299536eeb0fa559f62e94fdb76de02e02
Author: Philipp Zehnder <ze...@fzi.de>
AuthorDate: Thu Sep 16 17:06:22 2021 +0200

    [STREAMPIPES-79] Set default widget name
---
 .../designer-panel/data-explorer-designer-panel.component.ts       | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/ui/src/app/data-explorer/components/designer-panel/data-explorer-designer-panel.component.ts b/ui/src/app/data-explorer/components/designer-panel/data-explorer-designer-panel.component.ts
index 168eee3..b102824 100644
--- a/ui/src/app/data-explorer/components/designer-panel/data-explorer-designer-panel.component.ts
+++ b/ui/src/app/data-explorer/components/designer-panel/data-explorer-designer-panel.component.ts
@@ -57,6 +57,13 @@ export class DataExplorerDesignerPanelComponent implements OnInit {
 
   createNewWidget() {
     this.newWidgetMode = false;
+
+    // Set default name to the measure name
+    if (this.currentlyConfiguredWidget.dataConfig.sourceConfigs.length > 0) {
+      this.currentlyConfiguredWidget.baseAppearanceConfig.widgetTitle =
+        this.currentlyConfiguredWidget.dataConfig.sourceConfigs[0].measureName;
+    }
+
     this.addWidgetEmitter.emit({ a: this.dataLakeMeasure, b: this.currentlyConfiguredWidget });
   }