Fix display items
This commit is contained in:
parent
95cf28a417
commit
b13d47e88d
|
@ -186,7 +186,10 @@
|
||||||
// don't make field IDs for auto types
|
// don't make field IDs for auto types
|
||||||
if (type === AUTO_TYPE || autocolumn) {
|
if (type === AUTO_TYPE || autocolumn) {
|
||||||
return type.toUpperCase()
|
return type.toUpperCase()
|
||||||
} else if (type === FieldType.BB_REFERENCE) {
|
} else if (
|
||||||
|
type === FieldType.BB_REFERENCE ||
|
||||||
|
type === FieldType.BB_REFERENCE_SINGLE
|
||||||
|
) {
|
||||||
return `${type}${subtype || ""}`.toUpperCase()
|
return `${type}${subtype || ""}`.toUpperCase()
|
||||||
} else {
|
} else {
|
||||||
return type.toUpperCase()
|
return type.toUpperCase()
|
||||||
|
@ -363,13 +366,11 @@
|
||||||
|
|
||||||
function getAllowedTypes() {
|
function getAllowedTypes() {
|
||||||
if (originalName) {
|
if (originalName) {
|
||||||
const possibleTypes = (
|
const possibleTypes = SWITCHABLE_TYPES[field.type] || [
|
||||||
SWITCHABLE_TYPES[field.type] || [editableColumn.type]
|
editableColumn.type,
|
||||||
).map(t => t.toLowerCase())
|
]
|
||||||
return Object.entries(FIELDS)
|
return Object.entries(FIELDS)
|
||||||
.filter(([fieldType]) =>
|
.filter(([_, field]) => possibleTypes.includes(field.type))
|
||||||
possibleTypes.includes(fieldType.toLowerCase())
|
|
||||||
)
|
|
||||||
.map(([_, fieldDefinition]) => fieldDefinition)
|
.map(([_, fieldDefinition]) => fieldDefinition)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -166,6 +166,15 @@ export const FIELDS = {
|
||||||
FieldTypeSubtypes.BB_REFERENCE.USER
|
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: {
|
USERS: {
|
||||||
name: "Users",
|
name: "Users",
|
||||||
type: FieldType.BB_REFERENCE,
|
type: FieldType.BB_REFERENCE,
|
||||||
|
|
Loading…
Reference in New Issue