From 9e29b3305577ef7d0a66d88637160b44494c9b82 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 26 Jan 2021 10:57:57 +0000 Subject: [PATCH] Fix settings to select fields and fix chart settings not showing fields --- packages/builder/src/builderStore/dataBinding.js | 2 +- .../PropertyControls/TableViewFieldSelect.svelte | 2 +- packages/standard-components/manifest.json | 3 --- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/builder/src/builderStore/dataBinding.js b/packages/builder/src/builderStore/dataBinding.js index 004c7170d3..022e78c637 100644 --- a/packages/builder/src/builderStore/dataBinding.js +++ b/packages/builder/src/builderStore/dataBinding.js @@ -46,7 +46,7 @@ export const getDatasourceForProvider = component => { // Extract datasource from component instance const datasourceSetting = def.settings.find(setting => { - return setting.key === def.datasourceSetting + return setting.type === "datasource" || setting.type === "table" }) if (!datasourceSetting) { return null diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/TableViewFieldSelect.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/TableViewFieldSelect.svelte index 0e93c3e73a..32935d8d0a 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/TableViewFieldSelect.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/TableViewFieldSelect.svelte @@ -12,7 +12,7 @@ export let multiselect = false $: datasource = getDatasourceForProvider(componentInstance) - $: schema = getSchemaForDatasource(datasource) + $: schema = getSchemaForDatasource(datasource).schema $: options = Object.keys(schema || {}) diff --git a/packages/standard-components/manifest.json b/packages/standard-components/manifest.json index 901ea0df3c..65352761b9 100644 --- a/packages/standard-components/manifest.json +++ b/packages/standard-components/manifest.json @@ -106,7 +106,6 @@ "styleable": true, "hasChildren": true, "dataProvider": true, - "datasourceSetting": "datasource", "settings": [ { "type": "datasource", @@ -418,7 +417,6 @@ "styleable": true, "hasChildren": true, "dataProvider": true, - "datasourceSetting": "table", "settings": [ { "type": "table", @@ -434,7 +432,6 @@ "hasChildren": true, "styleable": true, "dataProvider": true, - "datasourceSetting": "table", "settings": [ { "type": "table",