- import { getBindableProperties } from "builderStore/dataBinding"
+ import {
+ getBindableProperties,
+ getDataProviderComponents,
+ } from "builderStore/dataBinding"
import {
Button,
Popover,
@@ -61,6 +64,17 @@
$currentAsset,
$store.selectedComponentId
)
+ $: dataProviders = getDataProviderComponents(
+ $currentAsset,
+ $store.selectedComponentId
+ ).map(provider => ({
+ label: provider._instanceName,
+ name: provider._instanceName,
+ providerId: provider._id,
+ value: `{{ literal [${provider._id}] }}`,
+ type: "provider",
+ schema: provider.schema,
+ }))
$: queryBindableProperties = bindableProperties.map(property => ({
...property,
category: property.type === "instance" ? "Component" : "Table",
@@ -182,7 +196,20 @@
{/each}
-
+
+
+ Data Providers
+
+
+ {#each dataProviders as provider}
+ - handleSelected(provider)}
+ >
+ {provider.label}
+
+ {/each}
+
{#if otherSources?.length}
diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/SaveRow.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/SaveRow.svelte
index 70e44ea83a..664129ee02 100644
--- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/SaveRow.svelte
+++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/SaveRow.svelte
@@ -14,11 +14,11 @@
$currentAsset,
$store.selectedComponentId
)
- $: schemaFields = getSchemaFields(parameters?.tableId)
+ $: schemaFields = getSchemaFields($currentAsset, parameters?.tableId)
$: tableOptions = $tables.list || []
- const getSchemaFields = tableId => {
- const { schema } = getSchemaForDatasource({ type: "table", tableId })
+ const getSchemaFields = (asset, tableId) => {
+ const { schema } = getSchemaForDatasource(asset, { type: "table", tableId })
return Object.values(schema || {})
}
diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/index.js b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/index.js
index e851bdb4be..a3e43cb045 100644
--- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/index.js
+++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/index.js
@@ -5,11 +5,13 @@ import ExecuteQuery from "./ExecuteQuery.svelte"
import TriggerAutomation from "./TriggerAutomation.svelte"
import ValidateForm from "./ValidateForm.svelte"
-// defines what actions are available, when adding a new one
-// the component is the setup panel for the action
-// NOTE that the "name" is used by the client library,
-// so if you want to change it, you must change it client lib too
-
+// Defines which actions are available to configure in the front end.
+// Unfortunately the "name" property is used as the identifier so please don't
+// change them.
+// The client library removes any spaces when processing actions, so they can
+// be considered as camel case too.
+// There is technical debt here to sanitize all these and standardise them
+// across the packages but it's a breaking change to existing apps.
export default [
{
name: "Save Row",
diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FieldSelect.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FieldSelect.svelte
index dd5436c1f7..9b6aec4584 100644
--- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FieldSelect.svelte
+++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FieldSelect.svelte
@@ -14,7 +14,7 @@
const dispatch = createEventDispatcher()
$: datasource = getDatasourceForProvider($currentAsset, componentInstance)
- $: schema = getSchemaForDatasource(datasource).schema
+ $: schema = getSchemaForDatasource($currentAsset, datasource).schema
$: options = Object.keys(schema || {})
$: boundValue = getValidValue(value, options)
diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterEditor.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterEditor.svelte
index 1662337409..20a7b9d9ff 100644
--- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterEditor.svelte
+++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterEditor.svelte
@@ -27,19 +27,16 @@
? tempValue.length
: Object.keys(tempValue || {}).length
$: dataSource = getDatasourceForProvider($currentAsset, componentInstance)
- $: schema = getSchemaForDatasource(dataSource)?.schema
+ $: schema = getSchemaForDatasource($currentAsset, dataSource)?.schema
$: schemaFields = Object.values(schema || {})
$: internalTable = dataSource?.type === "table"
// Reset value if value is wrong type for the datasource.
// Lucene editor needs an array, and simple editor needs an object.
$: {
- if (internalTable && !Array.isArray(value)) {
+ if (!Array.isArray(value)) {
tempValue = []
dispatch("change", [])
- } else if (!internalTable && Array.isArray(value)) {
- tempValue = {}
- dispatch("change", {})
}
}
@@ -63,28 +60,7 @@
constaints.
{/if}