From 50451c8c4307bcf244474c438df1934583a58592 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 11 Jul 2023 11:14:02 +0100 Subject: [PATCH] Update columns setting to show the number of columns --- .../controls/ColumnEditor/ColumnEditor.svelte | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/design/settings/controls/ColumnEditor/ColumnEditor.svelte b/packages/builder/src/components/design/settings/controls/ColumnEditor/ColumnEditor.svelte index 5f1abdbeca..cebb429ac4 100644 --- a/packages/builder/src/components/design/settings/controls/ColumnEditor/ColumnEditor.svelte +++ b/packages/builder/src/components/design/settings/controls/ColumnEditor/ColumnEditor.svelte @@ -20,6 +20,7 @@ let drawer let boundValue + $: text = getText(value) $: datasource = getDatasourceForProvider($currentAsset, componentInstance) $: schema = getSchema($currentAsset, datasource) $: options = allowCellEditing @@ -31,6 +32,17 @@ allowLinks: true, }) + const getText = value => { + if (!value?.length) { + return "All columns" + } + let text = `${value.length} column` + if (value.length !== 1) { + text += "s" + } + return text + } + const getSchema = (asset, datasource) => { const schema = getSchemaForDatasource(asset, datasource).schema @@ -76,7 +88,7 @@
- Configure columns + {text}