Fix display items

This commit is contained in:
Adria Navarro 2024-04-22 13:11:13 +02:00
parent 95cf28a417
commit b13d47e88d
2 changed files with 17 additions and 7 deletions

View File

@ -186,7 +186,10 @@
// don't make field IDs for auto types
if (type === AUTO_TYPE || autocolumn) {
return type.toUpperCase()
} else if (type === FieldType.BB_REFERENCE) {
} else if (
type === FieldType.BB_REFERENCE ||
type === FieldType.BB_REFERENCE_SINGLE
) {
return `${type}${subtype || ""}`.toUpperCase()
} else {
return type.toUpperCase()
@ -363,13 +366,11 @@
function getAllowedTypes() {
if (originalName) {
const possibleTypes = (
SWITCHABLE_TYPES[field.type] || [editableColumn.type]
).map(t => t.toLowerCase())
const possibleTypes = SWITCHABLE_TYPES[field.type] || [
editableColumn.type,
]
return Object.entries(FIELDS)
.filter(([fieldType]) =>
possibleTypes.includes(fieldType.toLowerCase())
)
.filter(([_, field]) => possibleTypes.includes(field.type))
.map(([_, fieldDefinition]) => fieldDefinition)
}

View File

@ -166,6 +166,15 @@ export const FIELDS = {
FieldTypeSubtypes.BB_REFERENCE.USER
],
},
// Used for display of editing existing columns
OLD_USER: {
name: "User",
type: FieldType.BB_REFERENCE,
subtype: FieldSubtype.USER,
icon: TypeIconMap[FieldType.BB_REFERENCE_SINGLE][
FieldTypeSubtypes.BB_REFERENCE.USER
],
},
USERS: {
name: "Users",
type: FieldType.BB_REFERENCE,