From 2a690c3cdf23cc51ff3dd19dcf86f3c41b97843e Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 25 Apr 2024 14:31:46 +0200 Subject: [PATCH] Don't allow users on spreadsheets --- .../backend/DataTable/modals/CreateEditColumn.svelte | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 905abaa9e3..69a7417ef4 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -226,7 +226,7 @@ editableColumn.autocolumn ) - allowedTypes = getAllowedTypes().map(t => ({ + allowedTypes = getAllowedTypes(datasource).map(t => ({ fieldId: makeFieldId(t.type, t.subtype), ...t, })) @@ -355,7 +355,7 @@ deleteColName = "" } - function getAllowedTypes() { + function getAllowedTypes(datasource) { if (originalName) { const possibleTypes = SWITCHABLE_TYPES[field.type] || [ editableColumn.type, @@ -397,8 +397,11 @@ FIELDS.FORMULA, FIELDS.BIGINT, FIELDS.USER, - FIELDS.USERS, ] + + if (datasource && datasource.source !== SourceName.GOOGLE_SHEETS) { + fields.push(FIELDS.USERS) + } // no-sql or a spreadsheet if (!externalTable || table.sql) { fields = [...fields, FIELDS.LINK, FIELDS.ARRAY]