From dcc357f00a7ec9b1d2d3d797f691ce1265c2aac3 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 3 May 2024 18:10:18 +0200 Subject: [PATCH] Fix header icon --- .../frontend-core/src/components/grid/lib/utils.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/frontend-core/src/components/grid/lib/utils.js b/packages/frontend-core/src/components/grid/lib/utils.js index 02e6d66e0e..096409b925 100644 --- a/packages/frontend-core/src/components/grid/lib/utils.js +++ b/packages/frontend-core/src/components/grid/lib/utils.js @@ -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