This is an automated email from the ASF dual-hosted git repository.
zehnder pushed a commit to branch 3380-editing-a-time-series-chart-widget-fails
in repository https://gitbox.apache.org/repos/asf/streampipes.git
The following commit(s) were added to
refs/heads/3380-editing-a-time-series-chart-widget-fails by this push:
new 6d23fd39a1 fix(#3380): Fix editing of data views
6d23fd39a1 is described below
commit 6d23fd39a19939c6ef7629d97684e513387a9a19
Author: Philipp Zehnder <[email protected]>
AuthorDate: Thu Dec 19 15:11:35 2024 +0100
fix(#3380): Fix editing of data views
---
.../data-explorer-widget-data-settings.component.ts | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git
a/ui/src/app/data-explorer/components/data-view/data-view-designer-panel/data-settings/data-explorer-widget-data-settings.component.ts
b/ui/src/app/data-explorer/components/data-view/data-view-designer-panel/data-settings/data-explorer-widget-data-settings.component.ts
index c2de37bfd2..3a6c2e3f2b 100644
---
a/ui/src/app/data-explorer/components/data-view/data-view-designer-panel/data-settings/data-explorer-widget-data-settings.component.ts
+++
b/ui/src/app/data-explorer/components/data-view/data-view-designer-panel/data-settings/data-explorer-widget-data-settings.component.ts
@@ -239,7 +239,7 @@ export class DataExplorerWidgetDataSettingsComponent
implements OnInit {
}
createDefaultWidget(): void {
- if (this.dataConfig.sourceConfigs.length === 1) {
+ if (this.checkIfDefaultTableShouldBeShown()) {
const fields = this.fieldProviderService.generateFieldLists(
this.dataConfig.sourceConfigs,
);
@@ -253,6 +253,16 @@ export class DataExplorerWidgetDataSettingsComponent
implements OnInit {
}
}
+ /**
+ * This method checks if there is at least one data source and that no
widget type is already configured.
+ */
+ checkIfDefaultTableShouldBeShown(): boolean {
+ return (
+ this.dataConfig.sourceConfigs.length === 1 &&
+ !this.currentlyConfiguredWidget.widgetType
+ );
+ }
+
removeSourceConfig(index: number) {
this.dataConfig.sourceConfigs.splice(index, 1);
}