From 89c4175832a0cdb334b7ce3fbd4cad66ccb5f319 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Tue, 26 Jul 2022 13:50:36 +0100 Subject: [PATCH] Add Multiselect to FilterDrawer --- .../bbui/src/Form/Core/Multiselect.svelte | 4 +-- .../controls/FilterEditor/FilterDrawer.svelte | 9 ++++- packages/server/yarn.lock | 35 +++++++++++-------- 3 files changed, 30 insertions(+), 18 deletions(-) diff --git a/packages/bbui/src/Form/Core/Multiselect.svelte b/packages/bbui/src/Form/Core/Multiselect.svelte index 3eb1add267..df9752f527 100644 --- a/packages/bbui/src/Form/Core/Multiselect.svelte +++ b/packages/bbui/src/Form/Core/Multiselect.svelte @@ -22,7 +22,7 @@ $: toggleOption = makeToggleOption(selectedLookupMap, value) const getFieldText = (value, map, placeholder) => { - if (value?.length) { + if (Array.isArray(value) && value.length > 0) { if (!map) { return "" } @@ -35,7 +35,7 @@ const getSelectedLookupMap = value => { let map = {} - if (value?.length) { + if (Array.isArray(value) && value.length > 0) { value.forEach(option => { if (option) { map[option] = true diff --git a/packages/builder/src/components/design/settings/controls/FilterEditor/FilterDrawer.svelte b/packages/builder/src/components/design/settings/controls/FilterEditor/FilterDrawer.svelte index aa191ce0ea..d99c0f43b8 100644 --- a/packages/builder/src/components/design/settings/controls/FilterEditor/FilterDrawer.svelte +++ b/packages/builder/src/components/design/settings/controls/FilterEditor/FilterDrawer.svelte @@ -3,6 +3,7 @@ Body, Button, Combobox, + Multiselect, DatePicker, DrawerContent, Icon, @@ -139,7 +140,13 @@ /> {:else if ["string", "longform", "number", "formula"].includes(filter.type)} - {:else if ["options", "array"].includes(filter.type)} + {:else if filter.type === "array"} + + {:else if filter.type === "options"}