From ebaaff1f8ce0bf3b8f875e63816c42f4b9714381 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Tue, 8 Mar 2022 13:31:14 +0000 Subject: [PATCH] account for blocks within export button action --- .../actions/ExportData.svelte | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/ExportData.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/ExportData.svelte index 5a10e1eca8..062b9abd4c 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/ExportData.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/ExportData.svelte @@ -5,9 +5,23 @@ import { onMount } from "svelte" export let parameters - $: components = findAllMatchingComponents($currentAsset?.props, component => + + $: tables = findAllMatchingComponents($currentAsset?.props, component => component._component.endsWith("table") - ) + ).map(table => ({ + label: table._instanceName, + value: table._id, + })) + + $: tableBlocks = findAllMatchingComponents($currentAsset?.props, component => + component._component.endsWith("tableblock") + ).map(block => ({ + label: block._instanceName, + value: `${block._id}-table`, + })) + + $: componentOptions = tables.concat(tableBlocks) + const FORMATS = [ { label: "CSV", @@ -38,9 +52,7 @@