Fix header icon

This commit is contained in:
Adria Navarro 2024-05-03 18:10:18 +02:00
parent 9a6e6ed115
commit dcc357f00a
1 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,4 @@
import { BBReferenceFieldSubType, FieldType } from "@budibase/types"
import { TypeIconMap } from "../../../constants" import { TypeIconMap } from "../../../constants"
export const getColor = (idx, opacity = 0.3) => { export const getColor = (idx, opacity = 0.3) => {
@ -11,7 +12,16 @@ export const getColumnIcon = column => {
if (column.schema.autocolumn) { if (column.schema.autocolumn) {
return "MagicWand" 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 = const result =
typeof TypeIconMap[type] === "object" && subtype typeof TypeIconMap[type] === "object" && subtype