Don't allow users on spreadsheets

This commit is contained in:
Adria Navarro 2024-04-25 14:31:46 +02:00
parent 7f4ffc46d7
commit 2a690c3cdf
1 changed files with 6 additions and 3 deletions

View File

@ -226,7 +226,7 @@
editableColumn.autocolumn editableColumn.autocolumn
) )
allowedTypes = getAllowedTypes().map(t => ({ allowedTypes = getAllowedTypes(datasource).map(t => ({
fieldId: makeFieldId(t.type, t.subtype), fieldId: makeFieldId(t.type, t.subtype),
...t, ...t,
})) }))
@ -355,7 +355,7 @@
deleteColName = "" deleteColName = ""
} }
function getAllowedTypes() { function getAllowedTypes(datasource) {
if (originalName) { if (originalName) {
const possibleTypes = SWITCHABLE_TYPES[field.type] || [ const possibleTypes = SWITCHABLE_TYPES[field.type] || [
editableColumn.type, editableColumn.type,
@ -397,8 +397,11 @@
FIELDS.FORMULA, FIELDS.FORMULA,
FIELDS.BIGINT, FIELDS.BIGINT,
FIELDS.USER, FIELDS.USER,
FIELDS.USERS,
] ]
if (datasource && datasource.source !== SourceName.GOOGLE_SHEETS) {
fields.push(FIELDS.USERS)
}
// no-sql or a spreadsheet // no-sql or a spreadsheet
if (!externalTable || table.sql) { if (!externalTable || table.sql) {
fields = [...fields, FIELDS.LINK, FIELDS.ARRAY] fields = [...fields, FIELDS.LINK, FIELDS.ARRAY]