From 1ea856304618c89a7932ffe16ed0c9cb5b996a5e Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 10 Nov 2021 11:48:02 +0000 Subject: [PATCH] Update block search so that string fields do a 'starts with' search rather than an exact match --- .../client/src/components/app/blocks/CardListWithSearch.svelte | 3 ++- .../client/src/components/app/blocks/TableWithSearch.svelte | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/client/src/components/app/blocks/CardListWithSearch.svelte b/packages/client/src/components/app/blocks/CardListWithSearch.svelte index a750a37361..7c9a067bd6 100644 --- a/packages/client/src/components/app/blocks/CardListWithSearch.svelte +++ b/packages/client/src/components/app/blocks/CardListWithSearch.svelte @@ -49,7 +49,7 @@ columns?.forEach(column => { enrichedFilter.push({ field: column.name, - operator: "equal", + operator: column.type === "string" ? "string" : "equal", type: "string", valueType: "Binding", value: `{{ [${formId}].[${column.name}] }}`, @@ -68,6 +68,7 @@ enrichedColumns.push({ name: column, componentType, + type: schemaType, }) } }) diff --git a/packages/client/src/components/app/blocks/TableWithSearch.svelte b/packages/client/src/components/app/blocks/TableWithSearch.svelte index 378a111571..12a2022686 100644 --- a/packages/client/src/components/app/blocks/TableWithSearch.svelte +++ b/packages/client/src/components/app/blocks/TableWithSearch.svelte @@ -48,7 +48,7 @@ columns?.forEach(column => { enrichedFilter.push({ field: column.name, - operator: "equal", + operator: column.type === "string" ? "string" : "equal", type: "string", valueType: "Binding", value: `{{ [${formId}].[${column.name}] }}`, @@ -67,6 +67,7 @@ enrichedColumns.push({ name: column, componentType, + type: schemaType, }) } })