From aaa448cca89ee17c0a0d9f33c2c638734b637f19 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 12 Nov 2021 14:48:53 +0000 Subject: [PATCH] Update settings bar to account for new block settings structure --- .../src/components/app/blocks/DataBlock.svelte | 0 .../src/components/preview/SettingsBar.svelte | 14 +++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 packages/client/src/components/app/blocks/DataBlock.svelte diff --git a/packages/client/src/components/app/blocks/DataBlock.svelte b/packages/client/src/components/app/blocks/DataBlock.svelte new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/client/src/components/preview/SettingsBar.svelte b/packages/client/src/components/preview/SettingsBar.svelte index 43c77ef1e6..e1d88b1367 100644 --- a/packages/client/src/components/preview/SettingsBar.svelte +++ b/packages/client/src/components/preview/SettingsBar.svelte @@ -17,7 +17,19 @@ $: definition = $builderStore.selectedComponentDefinition $: showBar = definition?.showSettingsBar && !$builderStore.isDragging - $: settings = definition?.settings?.filter(setting => setting.showInBar) ?? [] + $: settings = getBarSettings(definition) + + const getBarSettings = definition => { + let allSettings = [] + definition?.settings?.forEach(setting => { + if (setting.section) { + allSettings = allSettings.concat(setting.settings || []) + } else { + allSettings.push(setting) + } + }) + return allSettings.filter(setting => setting.showInBar) + } const updatePosition = () => { if (!showBar) {