From 86acb3fea366ba012bc4c84c5d5e079e32227aa2 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 18 Feb 2022 20:29:20 +0000 Subject: [PATCH] Update client table component to be more generic about passing table customisation options --- .../client/src/components/app/table/Table.svelte | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/client/src/components/app/table/Table.svelte b/packages/client/src/components/app/table/Table.svelte index 0a599424ff..0fc17abe6d 100644 --- a/packages/client/src/components/app/table/Table.svelte +++ b/packages/client/src/components/app/table/Table.svelte @@ -86,11 +86,13 @@ if (UnsortableTypes.includes(schema[columnName].type)) { newSchema[columnName].sortable = false } - if (field?.displayName) { - newSchema[columnName].displayName = field?.displayName - } - if (field?.width) { - newSchema[columnName].width = field?.width + + // Add additional settings like width etc + if (typeof field === "object") { + newSchema[columnName] = { + ...newSchema[columnName], + ...field, + } } }) return newSchema