diff --git a/lerna.json b/lerna.json index 4049d5d734..65f04ecf2c 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.15.6", + "version": "2.15.7", "npmClient": "yarn", "packages": [ "packages/*", diff --git a/packages/builder/src/builderStore/dataBinding.js b/packages/builder/src/builderStore/dataBinding.js index 85d5046d8c..56cea54ee9 100644 --- a/packages/builder/src/builderStore/dataBinding.js +++ b/packages/builder/src/builderStore/dataBinding.js @@ -1080,11 +1080,48 @@ export const getAllStateVariables = () => { getAllAssets().forEach(asset => { findAllMatchingComponents(asset.props, component => { const settings = getComponentSettings(component._component) - settings - .filter(setting => setting.type === "event") - .forEach(setting => { - eventSettings.push(component[setting.key]) - }) + + const parseEventSettings = (settings, comp) => { + settings + .filter(setting => setting.type === "event") + .forEach(setting => { + eventSettings.push(comp[setting.key]) + }) + } + + const parseComponentSettings = (settings, component) => { + // Parse the nested button configurations + settings + .filter(setting => setting.type === "buttonConfiguration") + .forEach(setting => { + const buttonConfig = component[setting.key] + + if (Array.isArray(buttonConfig)) { + buttonConfig.forEach(button => { + const nestedSettings = getComponentSettings(button._component) + parseEventSettings(nestedSettings, button) + }) + } + }) + + parseEventSettings(settings, component) + } + + // Parse the base component settings + parseComponentSettings(settings, component) + + // Parse step configuration + const stepSetting = settings.find( + setting => setting.type === "stepConfiguration" + ) + const steps = stepSetting ? component[stepSetting.key] : [] + const stepDefinition = getComponentSettings( + "@budibase/standard-components/multistepformblockstep" + ) + + steps.forEach(step => { + parseComponentSettings(stepDefinition, step) + }) }) }) diff --git a/packages/client/src/components/app/forms/RelationshipField.svelte b/packages/client/src/components/app/forms/RelationshipField.svelte index 9d0503be8e..7cd571f6d9 100644 --- a/packages/client/src/components/app/forms/RelationshipField.svelte +++ b/packages/client/src/components/app/forms/RelationshipField.svelte @@ -108,16 +108,13 @@ } } - $: forceFetchRows(filter, fieldApi) + $: forceFetchRows(filter) $: debouncedFetchRows(searchTerm, primaryDisplay, defaultValue) const forceFetchRows = async () => { - if (!fieldApi) { - return - } // if the filter has changed, then we need to reset the options, clear the selection, and re-fetch optionsObj = {} - fieldApi.setValue([]) + fieldApi?.setValue([]) selectedValue = [] debouncedFetchRows(searchTerm, primaryDisplay, defaultValue) }