1
0
Fork 0
mirror of synced 2024-09-12 23:43:09 +12:00

Fix header icon

This commit is contained in:
Adria Navarro 2024-05-03 18:10:18 +02:00
parent 9a6e6ed115
commit dcc357f00a

View file

@ -1,3 +1,4 @@
import { BBReferenceFieldSubType, FieldType } from "@budibase/types"
import { TypeIconMap } from "../../../constants"
export const getColor = (idx, opacity = 0.3) => {
@ -11,7 +12,16 @@ export const getColumnIcon = column => {
if (column.schema.autocolumn) {
return "MagicWand"
}
const { type, subtype } = column.schema
const { type, subtype, constraints } = column.schema
if (
type === FieldType.BB_REFERENCE &&
subtype === BBReferenceFieldSubType.USER &&
constraints?.type !== "array"
) {
// This will handle old single users columns
return "User"
}
const result =
typeof TypeIconMap[type] === "object" && subtype