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
)
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]