From c950395eacbecba86a700d823c29e3392a8b0e34 Mon Sep 17 00:00:00 2001 From: Charles Bochet Date: Mon, 9 Oct 2023 23:17:07 +0200 Subject: [PATCH] Fix tests --- .../companies/constants/companyShowFieldDefinition.tsx | 8 ++++++++ .../pages/people/constants/personShowFieldDefinition.tsx | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/front/src/pages/companies/constants/companyShowFieldDefinition.tsx b/front/src/pages/companies/constants/companyShowFieldDefinition.tsx index 816f79a3a..b3fd4f2eb 100644 --- a/front/src/pages/companies/constants/companyShowFieldDefinition.tsx +++ b/front/src/pages/companies/constants/companyShowFieldDefinition.tsx @@ -19,6 +19,7 @@ import { IconUsers, } from '@/ui/icon'; import { Entity } from '@/ui/input/relation-picker/types/EntityTypeForSelect'; +import { User } from '~/generated/graphql'; export const companyShowFieldDefinition: FieldDefinition[] = [ { @@ -41,6 +42,13 @@ export const companyShowFieldDefinition: FieldDefinition[] = [ fieldName: 'accountOwner', relationType: Entity.User, }, + entityChipDisplayMapper: (dataObject: User) => { + return { + name: dataObject?.displayName, + pictureUrl: dataObject?.avatarUrl ?? undefined, + avatarType: 'rounded', + }; + }, } satisfies FieldDefinition, { key: 'employees', diff --git a/front/src/pages/people/constants/personShowFieldDefinition.tsx b/front/src/pages/people/constants/personShowFieldDefinition.tsx index c2bdcb568..b0010fcff 100644 --- a/front/src/pages/people/constants/personShowFieldDefinition.tsx +++ b/front/src/pages/people/constants/personShowFieldDefinition.tsx @@ -19,6 +19,8 @@ import { IconPhone, } from '@/ui/icon'; import { Entity } from '@/ui/input/relation-picker/types/EntityTypeForSelect'; +import { Company } from '~/generated/graphql'; +import { getLogoUrlFromDomainName } from '~/utils'; export const personShowFieldDefinition: FieldDefinition[] = [ { @@ -41,6 +43,13 @@ export const personShowFieldDefinition: FieldDefinition[] = [ fieldName: 'company', relationType: Entity.Company, }, + entityChipDisplayMapper: (dataObject: Company) => { + return { + name: dataObject?.name, + pictureUrl: getLogoUrlFromDomainName(dataObject?.domainName), + avatarType: 'squared', + }; + }, } satisfies FieldDefinition, { key: 'phone',