From 851ce73609c56d508efac31af11da674100c04dc Mon Sep 17 00:00:00 2001 From: Weiko Date: Fri, 24 Nov 2023 10:00:45 +0100 Subject: [PATCH] Fix company update with accountOwner (#2687) --- .../standard-objects-prefill-data/view.ts | 38 ++++++++++++++++--- .../standard-objects/company.ts | 12 ++++++ .../standard-objects/person.ts | 2 +- 3 files changed, 46 insertions(+), 6 deletions(-) diff --git a/server/src/workspace/workspace-manager/standard-objects-prefill-data/view.ts b/server/src/workspace/workspace-manager/standard-objects-prefill-data/view.ts index 38370154e..ac5e7a25d 100644 --- a/server/src/workspace/workspace-manager/standard-objects-prefill-data/view.ts +++ b/server/src/workspace/workspace-manager/standard-objects-prefill-data/view.ts @@ -66,6 +66,20 @@ export const viewPrefillData = async ( isVisible: true, size: 100, }, + { + fieldMetadataId: objectMetadataMap['company'].fields['accountOwner'], + viewId: viewIdMap['All Companies'], + position: 2, + isVisible: true, + size: 150, + }, + { + fieldMetadataId: objectMetadataMap['company'].fields['createdAt'], + viewId: viewIdMap['All Companies'], + position: 3, + isVisible: true, + size: 150, + }, { fieldMetadataId: objectMetadataMap['company'].fields['employees'], viewId: viewIdMap['All Companies'], @@ -102,6 +116,13 @@ export const viewPrefillData = async ( isVisible: true, size: 150, }, + { + fieldMetadataId: objectMetadataMap['person'].fields['company'], + viewId: viewIdMap['All People'], + position: 2, + isVisible: true, + size: 150, + }, { fieldMetadataId: objectMetadataMap['person'].fields['phone'], viewId: viewIdMap['All People'], @@ -109,6 +130,13 @@ export const viewPrefillData = async ( isVisible: true, size: 150, }, + { + fieldMetadataId: objectMetadataMap['person'].fields['createdAt'], + viewId: viewIdMap['All People'], + position: 4, + isVisible: true, + size: 150, + }, { fieldMetadataId: objectMetadataMap['person'].fields['city'], viewId: viewIdMap['All People'], @@ -143,27 +171,27 @@ export const viewPrefillData = async ( viewId: viewIdMap['All Opportunities'], position: 0, isVisible: true, - size: 180, + size: 150, }, { - fieldMetadataId: objectMetadataMap['opportunity'].fields['probability'], + fieldMetadataId: objectMetadataMap['opportunity'].fields['closeDate'], viewId: viewIdMap['All Opportunities'], position: 1, isVisible: true, size: 150, }, { - fieldMetadataId: objectMetadataMap['opportunity'].fields['closeDate'], + fieldMetadataId: objectMetadataMap['opportunity'].fields['probability'], viewId: viewIdMap['All Opportunities'], position: 2, isVisible: true, - size: 100, + size: 150, }, { fieldMetadataId: objectMetadataMap['opportunity'].fields['pointOfContact'], viewId: viewIdMap['All Opportunities'], - position: 5, + position: 3, isVisible: true, size: 150, }, diff --git a/server/src/workspace/workspace-manager/standard-objects/company.ts b/server/src/workspace/workspace-manager/standard-objects/company.ts index 3a3221caf..704b5bc15 100644 --- a/server/src/workspace/workspace-manager/standard-objects/company.ts +++ b/server/src/workspace/workspace-manager/standard-objects/company.ts @@ -150,6 +150,18 @@ const companyMetadata = { icon: 'IconUserCircle', isNullable: true, }, + { + isCustom: false, + isActive: true, + type: FieldMetadataType.UUID, + name: 'accountOwnerId', + label: 'Account Owner ID (foreign key)', + targetColumnMap: {}, + description: 'Foreign key for account owner', + icon: undefined, + isNullable: true, + isSystem: true, + }, { isCustom: false, isActive: true, diff --git a/server/src/workspace/workspace-manager/standard-objects/person.ts b/server/src/workspace/workspace-manager/standard-objects/person.ts index 6384cc694..1b35445e4 100644 --- a/server/src/workspace/workspace-manager/standard-objects/person.ts +++ b/server/src/workspace/workspace-manager/standard-objects/person.ts @@ -63,7 +63,7 @@ const personMetadata = { url: 'xLinkUrl', }, description: 'Contact’s X/Twitter account', - icon: 'IconUser', + icon: 'IconBrandX', isNullable: true, }, {