diff --git a/packages/builder/cypress/integration/queryLevelTransformers.spec.js b/packages/builder/cypress/integration/queryLevelTransformers.spec.js
index 86aea8eafb..f1678655f4 100644
--- a/packages/builder/cypress/integration/queryLevelTransformers.spec.js
+++ b/packages/builder/cypress/integration/queryLevelTransformers.spec.js
@@ -47,7 +47,6 @@ filterTests(["smoke", "all"], () => {
cy.readFile(
"cypress/support/queryLevelTransformerFunctionWithData.js"
).then(transformerFunction => {
- //console.log(transformerFunction[1])
cy.get(".CodeMirror textarea")
// Highlight current text and overwrite with file contents
.type(Cypress.platform === "darwin" ? "{cmd}a" : "{ctrl}a", {
diff --git a/packages/builder/src/builderStore/dataBinding.js b/packages/builder/src/builderStore/dataBinding.js
index c8b4ae8de9..cd4b9d4187 100644
--- a/packages/builder/src/builderStore/dataBinding.js
+++ b/packages/builder/src/builderStore/dataBinding.js
@@ -65,7 +65,12 @@ export const getComponentBindableProperties = (asset, componentId) => {
/**
* Gets all data provider components above a component.
*/
-export const getContextProviderComponents = (asset, componentId, type) => {
+export const getContextProviderComponents = (
+ asset,
+ componentId,
+ type,
+ options = { includeSelf: false }
+) => {
if (!asset || !componentId) {
return []
}
@@ -73,7 +78,9 @@ export const getContextProviderComponents = (asset, componentId, type) => {
// Get the component tree leading up to this component, ignoring the component
// itself
const path = findComponentPath(asset.props, componentId)
- path.pop()
+ if (!options?.includeSelf) {
+ path.pop()
+ }
// Filter by only data provider components
return path.filter(component => {
@@ -138,19 +145,7 @@ export const getDatasourceForProvider = (asset, component) => {
if (!datasourceSetting) {
return null
}
-
- // There are different types of setting which can be a datasource, for
- // example an actual datasource object, or a table ID string.
- // Convert the datasource setting into a proper datasource object so that
- // we can use it properly
- if (datasourceSetting.type === "table") {
- return {
- tableId: component[datasourceSetting?.key],
- type: "table",
- }
- } else {
- return component[datasourceSetting?.key]
- }
+ return component[datasourceSetting?.key]
}
/**
@@ -643,6 +638,17 @@ const buildFormSchema = component => {
if (!component) {
return schema
}
+
+ // If this is a form block, simply use the fields setting
+ if (component._component.endsWith("formblock")) {
+ let schema = {}
+ component.fields?.forEach(field => {
+ schema[field] = { type: "string" }
+ })
+ return schema
+ }
+
+ // Otherwise find all field component children
const settings = getComponentSettings(component._component)
const fieldSetting = settings.find(
setting => setting.key === "field" && setting.type.startsWith("field/")
diff --git a/packages/builder/src/components/design/AppPreview/componentStructure.json b/packages/builder/src/components/design/AppPreview/componentStructure.json
index 6873ae547d..b49e546f32 100644
--- a/packages/builder/src/components/design/AppPreview/componentStructure.json
+++ b/packages/builder/src/components/design/AppPreview/componentStructure.json
@@ -5,26 +5,20 @@
"children": [
"tableblock",
"cardsblock",
- "repeaterblock"
+ "repeaterblock",
+ "formblock",
+ "formblockplus"
]
},
{
"name": "Layout",
"icon": "ClassicGridView",
- "children": [
- "container",
- "section"
- ]
+ "children": ["container", "section"]
},
{
"name": "Data",
"icon": "Data",
- "children": [
- "dataprovider",
- "repeater",
- "table",
- "dynamicfilter"
- ]
+ "children": ["dataprovider", "repeater", "table", "dynamicfilter"]
},
{
"name": "Form",
@@ -51,22 +45,12 @@
{
"name": "Card",
"icon": "Card",
- "children": [
- "spectrumcard",
- "cardstat"
- ]
+ "children": ["spectrumcard", "cardstat"]
},
{
"name": "Chart",
"icon": "GraphBarVertical",
- "children": [
- "bar",
- "line",
- "area",
- "pie",
- "donut",
- "candlestick"
- ]
+ "children": ["bar", "line", "area", "pie", "donut", "candlestick"]
},
{
"name": "Elements",
@@ -87,4 +71,3 @@
]
}
]
-
diff --git a/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/ScreenDropdownMenu.svelte b/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/ScreenDropdownMenu.svelte
index 76bb48a26c..08b9f9996d 100644
--- a/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/ScreenDropdownMenu.svelte
+++ b/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/ScreenDropdownMenu.svelte
@@ -49,7 +49,6 @@
}
} catch (error) {
notifications.error("Error duplicating screen")
- console.log(error)
}
}
diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/ButtonActionDrawer.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/ButtonActionDrawer.svelte
index 5b0ab4a6a3..24283ed2fe 100644
--- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/ButtonActionDrawer.svelte
+++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/ButtonActionDrawer.svelte
@@ -21,6 +21,7 @@
export let key
export let actions
export let bindings = []
+ export let nested
let selectedAction = actions?.length ? actions[0] : null
@@ -137,6 +138,7 @@
this={selectedActionComponent}
parameters={selectedAction.parameters}
bindings={allBindings}
+ {nested}
/>
{/key}
diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/ButtonActionEditor.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/ButtonActionEditor.svelte
index 550d982013..af198d169e 100644
--- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/ButtonActionEditor.svelte
+++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/ButtonActionEditor.svelte
@@ -12,6 +12,7 @@
export let value = []
export let name
export let bindings
+ export let nested
let drawer
let tmpValue
@@ -83,5 +84,6 @@
eventType={name}
{bindings}
{key}
+ {nested}
/>
diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/SaveRow.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/SaveRow.svelte
index c88b301fc9..bc5e6a7be7 100644
--- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/SaveRow.svelte
+++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/SaveRow.svelte
@@ -10,11 +10,13 @@
export let parameters
export let bindings = []
+ export let nested
$: formComponents = getContextProviderComponents(
$currentAsset,
$store.selectedComponentId,
- "form"
+ "form",
+ { includeSelf: nested }
)
$: schemaComponents = getContextProviderComponents(
$currentAsset,
diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte
index 617b1c83ab..e5889fbf23 100644
--- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte
+++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte
@@ -79,6 +79,7 @@
bindings={allBindings}
name={key}
text={label}
+ {nested}
{key}
{type}
{...props}
diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/TableSelect.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/TableSelect.svelte
index b41098da2d..384bbe1e3a 100644
--- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/TableSelect.svelte
+++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/TableSelect.svelte
@@ -1,26 +1,28 @@
-
-
-
-
-
+