Skip to content

Commit

Permalink
fix(#3380): Fix editing of data views (#3381)
Browse files Browse the repository at this point in the history
  • Loading branch information
tenthe authored Dec 19, 2024
1 parent 88396aa commit 55230ac
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
Expand All @@ -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);
}
Expand Down

0 comments on commit 55230ac

Please sign in to comment.