Fix favorite seeds and prefill

This commit is contained in:
Charles Bochet
2023-11-17 16:44:26 +01:00
parent baf1260443
commit f58e4263bc
7 changed files with 60 additions and 26 deletions

View File

@ -45,7 +45,6 @@ export const useFavorites = ({
input: { input: {
[`${targetObjectName}Id`]: favoriteTargetObjectId, [`${targetObjectName}Id`]: favoriteTargetObjectId,
position: favorites.length + 1, position: favorites.length + 1,
// workspaceMember: currentWorkspaceMember?.id,
workspaceMemberId: currentWorkspaceMember?.id, workspaceMemberId: currentWorkspaceMember?.id,
}, },
}, },
@ -65,8 +64,8 @@ export const useFavorites = ({
[ [
apolloClient, apolloClient,
createOneMutation, createOneMutation,
currentWorkspaceMember?.id, currentWorkspaceMember,
favoriteTargetObjectMetadataItem, favoriteTargetObjectMetadataItem?.nameSingular,
], ],
); );

View File

@ -16,7 +16,7 @@ export enum SeedCompanyFieldMetadataIds {
DomainName = '20202020-5e4e-4007-a630-8a2617914889', DomainName = '20202020-5e4e-4007-a630-8a2617914889',
Address = '20202020-ad10-4117-a039-3f04b7a5f939', Address = '20202020-ad10-4117-a039-3f04b7a5f939',
Employees = '20202020-7fbd-41ad-b64d-25a15ff62f04', Employees = '20202020-7fbd-41ad-b64d-25a15ff62f04',
LinkedinUrl = '20202020-a61d-4b78-b998-3fd88b4f73a1', LinkedinLink = '20202020-a61d-4b78-b998-3fd88b4f73a1',
XUrl = '20202020-46e3-479a-b8f4-77137c74daa6', XUrl = '20202020-46e3-479a-b8f4-77137c74daa6',
AnnualRecurringRevenue = '20202020-4a5a-466f-92d9-c3870d9502a9', AnnualRecurringRevenue = '20202020-4a5a-466f-92d9-c3870d9502a9',
IdealCustomerProfile = '20202020-9e9f-4235-98b2-c76f3e2d281e', IdealCustomerProfile = '20202020-9e9f-4235-98b2-c76f3e2d281e',
@ -186,7 +186,7 @@ export const seedCompanyFieldMetadata = async (
defaultValue: undefined, defaultValue: undefined,
}, },
{ {
id: SeedCompanyFieldMetadataIds.LinkedinUrl, id: SeedCompanyFieldMetadataIds.LinkedinLink,
objectMetadataId: SeedObjectMetadataIds.Company, objectMetadataId: SeedObjectMetadataIds.Company,
isCustom: false, isCustom: false,
workspaceId: SeedWorkspaceId, workspaceId: SeedWorkspaceId,

View File

@ -151,7 +151,7 @@ export const seedFavoriteFieldMetadata = async (
targetColumnMap: {}, targetColumnMap: {},
description: 'Foreign key for workspace member', description: 'Foreign key for workspace member',
icon: undefined, icon: undefined,
isNullable: true, isNullable: false,
isSystem: true, isSystem: true,
defaultValue: undefined, defaultValue: undefined,
}, },

View File

@ -15,7 +15,7 @@ export enum SeedPersonFieldMetadataIds {
LastName = '20202020-b784-458a-869d-6c53fa85483d', LastName = '20202020-b784-458a-869d-6c53fa85483d',
Email = '20202020-8a96-4e4b-86fd-ea126530e0c1', Email = '20202020-8a96-4e4b-86fd-ea126530e0c1',
LinkedinUrl = '20202020-dcf6-445a-b543-37e55de43c25', LinkedinLink = '20202020-dcf6-445a-b543-37e55de43c25',
XUrl = '20202020-a3a7-4f63-9303-10226f6055be', XUrl = '20202020-a3a7-4f63-9303-10226f6055be',
JobTitle = '20202020-3b86-413e-ab56-0ebd1a583ff3', JobTitle = '20202020-3b86-413e-ab56-0ebd1a583ff3',
Phone = '20202020-486f-45f9-bbdf-aac18b1831c0', Phone = '20202020-486f-45f9-bbdf-aac18b1831c0',
@ -169,7 +169,7 @@ export const seedPersonFieldMetadata = async (
defaultValue: undefined, defaultValue: undefined,
}, },
{ {
id: SeedPersonFieldMetadataIds.LinkedinUrl, id: SeedPersonFieldMetadataIds.LinkedinLink,
objectMetadataId: SeedObjectMetadataIds.Person, objectMetadataId: SeedObjectMetadataIds.Person,
isCustom: false, isCustom: false,
workspaceId: SeedWorkspaceId, workspaceId: SeedWorkspaceId,

View File

@ -103,7 +103,7 @@ export const viewPrefillData = async (
size: 150, size: 150,
}, },
{ {
fieldMetadataId: objectMetadataMap['companyV2'].fields['linkedinUrl'], fieldMetadataId: objectMetadataMap['companyV2'].fields['linkedinLink'],
viewId: viewIdMap['All Companies (V2)'], viewId: viewIdMap['All Companies (V2)'],
position: 5, position: 5,
isVisible: true, isVisible: true,
@ -167,14 +167,14 @@ export const viewPrefillData = async (
size: 150, size: 150,
}, },
{ {
fieldMetadataId: objectMetadataMap['personV2'].fields['linkedinUrl'], fieldMetadataId: objectMetadataMap['personV2'].fields['linkedinLink'],
viewId: viewIdMap['All People (V2)'], viewId: viewIdMap['All People (V2)'],
position: 7, position: 7,
isVisible: true, isVisible: true,
size: 150, size: 150,
}, },
{ {
fieldMetadataId: objectMetadataMap['personV2'].fields['xUrl'], fieldMetadataId: objectMetadataMap['personV2'].fields['xLink'],
viewId: viewIdMap['All People (V2)'], viewId: viewIdMap['All People (V2)'],
position: 8, position: 8,
isVisible: true, isVisible: true,

View File

@ -31,12 +31,10 @@ const favoriteMetadata = {
type: FieldMetadataType.RELATION, type: FieldMetadataType.RELATION,
name: 'workspaceMember', name: 'workspaceMember',
label: 'Workspace Member', label: 'Workspace Member',
targetColumnMap: { targetColumnMap: {},
value: 'workspaceMemberId',
},
description: 'Favorite workspace member', description: 'Favorite workspace member',
icon: 'IconCircleUser', icon: 'IconCircleUser',
isNullable: false, isNullable: true,
}, },
{ {
isCustom: false, isCustom: false,
@ -44,12 +42,10 @@ const favoriteMetadata = {
type: FieldMetadataType.RELATION, type: FieldMetadataType.RELATION,
name: 'person', name: 'person',
label: 'Person', label: 'Person',
targetColumnMap: { targetColumnMap: {},
value: 'personId',
},
description: 'Favorite person', description: 'Favorite person',
icon: 'IconUser', icon: 'IconUser',
isNullable: false, isNullable: true,
}, },
{ {
isCustom: false, isCustom: false,
@ -57,12 +53,49 @@ const favoriteMetadata = {
type: FieldMetadataType.RELATION, type: FieldMetadataType.RELATION,
name: 'company', name: 'company',
label: 'Company', label: 'Company',
targetColumnMap: { targetColumnMap: {},
value: 'companyId',
},
description: 'Favorite company', description: 'Favorite company',
icon: 'IconBuildingSkyscraper', icon: 'IconBuildingSkyscraper',
isNullable: true,
},
{
isCustom: false,
isActive: true,
type: FieldMetadataType.UUID,
name: 'workspaceMemberId',
label: 'Workspace Member ID (foreign key)',
targetColumnMap: {},
description: 'Foreign key for workspace member',
icon: undefined,
isNullable: false, isNullable: false,
isSystem: true,
defaultValue: undefined,
},
{
isCustom: false,
isActive: true,
type: FieldMetadataType.UUID,
name: 'personId',
label: 'Person ID (foreign key)',
targetColumnMap: {},
description: 'Foreign key for person',
icon: undefined,
isNullable: true,
isSystem: true,
defaultValue: undefined,
},
{
isCustom: false,
isActive: true,
type: FieldMetadataType.UUID,
name: 'companyId',
label: 'Company ID (foreign key)',
targetColumnMap: {},
description: 'Foreign key for company',
icon: undefined,
isNullable: true,
isSystem: true,
defaultValue: undefined,
}, },
], ],
}; };

View File

@ -54,10 +54,11 @@ const personMetadata = {
isCustom: false, isCustom: false,
isActive: true, isActive: true,
type: FieldMetadataType.LINK, type: FieldMetadataType.LINK,
name: 'linkedinUrl', name: 'linkedinLink',
label: 'Linkedin', label: 'Linkedin',
targetColumnMap: { targetColumnMap: {
value: 'linkedinUrl', label: 'linkedinLinkLabel',
url: 'linkedinLinkUrl',
}, },
description: 'Contacts Linkedin account', description: 'Contacts Linkedin account',
icon: 'IconBrandLinkedin', icon: 'IconBrandLinkedin',
@ -67,10 +68,11 @@ const personMetadata = {
isCustom: false, isCustom: false,
isActive: true, isActive: true,
type: FieldMetadataType.LINK, type: FieldMetadataType.LINK,
name: 'xUrl', name: 'xLink',
label: 'X', label: 'X',
targetColumnMap: { targetColumnMap: {
value: 'xUrl', label: 'xLinkLabel',
url: 'xLinkUrl',
}, },
description: 'Contacts X/Twitter account', description: 'Contacts X/Twitter account',
icon: 'IconUser', icon: 'IconUser',