account for blocks within export button action
This commit is contained in:
parent
064aee5e2e
commit
ebaaff1f8c
|
@ -5,9 +5,23 @@
|
||||||
import { onMount } from "svelte"
|
import { onMount } from "svelte"
|
||||||
|
|
||||||
export let parameters
|
export let parameters
|
||||||
$: components = findAllMatchingComponents($currentAsset?.props, component =>
|
|
||||||
|
$: tables = findAllMatchingComponents($currentAsset?.props, component =>
|
||||||
component._component.endsWith("table")
|
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 = [
|
const FORMATS = [
|
||||||
{
|
{
|
||||||
label: "CSV",
|
label: "CSV",
|
||||||
|
@ -38,9 +52,7 @@
|
||||||
<Label small>Table</Label>
|
<Label small>Table</Label>
|
||||||
<Select
|
<Select
|
||||||
bind:value={parameters.tableComponentId}
|
bind:value={parameters.tableComponentId}
|
||||||
options={components}
|
options={componentOptions}
|
||||||
getOptionLabel={option => option._instanceName}
|
|
||||||
getOptionValue={option => option._id}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Label small>Export as</Label>
|
<Label small>Export as</Label>
|
||||||
|
|
Loading…
Reference in New Issue