Deprecate address standard field (#6087)
Closes #5916 --------- Co-authored-by: Weiko <corentin@twenty.com>
This commit is contained in:
@ -145,7 +145,16 @@ export const mocks = [
|
|||||||
currencyCode
|
currencyCode
|
||||||
}
|
}
|
||||||
createdAt
|
createdAt
|
||||||
address
|
address {
|
||||||
|
addressStreet1
|
||||||
|
addressStreet2
|
||||||
|
addressCity
|
||||||
|
addressState
|
||||||
|
addressCountry
|
||||||
|
addressPostcode
|
||||||
|
addressLat
|
||||||
|
addressLng
|
||||||
|
}
|
||||||
updatedAt
|
updatedAt
|
||||||
name
|
name
|
||||||
accountOwnerId
|
accountOwnerId
|
||||||
@ -262,7 +271,16 @@ export const mocks = [
|
|||||||
currencyCode
|
currencyCode
|
||||||
}
|
}
|
||||||
createdAt
|
createdAt
|
||||||
address
|
address {
|
||||||
|
addressStreet1
|
||||||
|
addressStreet2
|
||||||
|
addressCity
|
||||||
|
addressState
|
||||||
|
addressCountry
|
||||||
|
addressPostcode
|
||||||
|
addressLat
|
||||||
|
addressLng
|
||||||
|
}
|
||||||
updatedAt
|
updatedAt
|
||||||
name
|
name
|
||||||
accountOwnerId
|
accountOwnerId
|
||||||
|
|||||||
@ -66,6 +66,16 @@ annualRecurringRevenue
|
|||||||
}
|
}
|
||||||
createdAt
|
createdAt
|
||||||
address
|
address
|
||||||
|
{
|
||||||
|
addressStreet1
|
||||||
|
addressStreet2
|
||||||
|
addressCity
|
||||||
|
addressState
|
||||||
|
addressCountry
|
||||||
|
addressPostcode
|
||||||
|
addressLat
|
||||||
|
addressLng
|
||||||
|
}
|
||||||
updatedAt
|
updatedAt
|
||||||
name
|
name
|
||||||
accountOwnerId
|
accountOwnerId
|
||||||
@ -86,7 +96,7 @@ idealCustomerProfile
|
|||||||
domainName: true,
|
domainName: true,
|
||||||
annualRecurringRevenue: true,
|
annualRecurringRevenue: true,
|
||||||
createdAt: true,
|
createdAt: true,
|
||||||
address: true,
|
address: { addressStreet1: true },
|
||||||
updatedAt: true,
|
updatedAt: true,
|
||||||
name: true,
|
name: true,
|
||||||
accountOwnerId: true,
|
accountOwnerId: true,
|
||||||
@ -129,6 +139,16 @@ annualRecurringRevenue
|
|||||||
}
|
}
|
||||||
createdAt
|
createdAt
|
||||||
address
|
address
|
||||||
|
{
|
||||||
|
addressStreet1
|
||||||
|
addressStreet2
|
||||||
|
addressCity
|
||||||
|
addressState
|
||||||
|
addressCountry
|
||||||
|
addressPostcode
|
||||||
|
addressLat
|
||||||
|
addressLng
|
||||||
|
}
|
||||||
updatedAt
|
updatedAt
|
||||||
people
|
people
|
||||||
{
|
{
|
||||||
|
|||||||
@ -65,6 +65,16 @@ annualRecurringRevenue
|
|||||||
}
|
}
|
||||||
createdAt
|
createdAt
|
||||||
address
|
address
|
||||||
|
{
|
||||||
|
addressStreet1
|
||||||
|
addressStreet2
|
||||||
|
addressCity
|
||||||
|
addressState
|
||||||
|
addressCountry
|
||||||
|
addressPostcode
|
||||||
|
addressLat
|
||||||
|
addressLng
|
||||||
|
}
|
||||||
updatedAt
|
updatedAt
|
||||||
name
|
name
|
||||||
accountOwnerId
|
accountOwnerId
|
||||||
|
|||||||
@ -3039,7 +3039,7 @@ export const getObjectMetadataItemsMock = () => {
|
|||||||
{
|
{
|
||||||
__typename: 'field',
|
__typename: 'field',
|
||||||
id: '20202020-ad10-4117-a039-3f04b7a5f939',
|
id: '20202020-ad10-4117-a039-3f04b7a5f939',
|
||||||
type: 'TEXT',
|
type: 'ADDRESS',
|
||||||
name: 'address',
|
name: 'address',
|
||||||
label: 'Address',
|
label: 'Address',
|
||||||
description: 'The company address',
|
description: 'The company address',
|
||||||
|
|||||||
@ -82,7 +82,16 @@ export const query = gql`
|
|||||||
currencyCode
|
currencyCode
|
||||||
}
|
}
|
||||||
createdAt
|
createdAt
|
||||||
address
|
address {
|
||||||
|
addressStreet1
|
||||||
|
addressStreet2
|
||||||
|
addressCity
|
||||||
|
addressState
|
||||||
|
addressCountry
|
||||||
|
addressPostcode
|
||||||
|
addressLat
|
||||||
|
addressLng
|
||||||
|
}
|
||||||
updatedAt
|
updatedAt
|
||||||
name
|
name
|
||||||
accountOwnerId
|
accountOwnerId
|
||||||
|
|||||||
@ -40,7 +40,16 @@ const mocks: MockedResponse[] = [
|
|||||||
currencyCode
|
currencyCode
|
||||||
}
|
}
|
||||||
createdAt
|
createdAt
|
||||||
address
|
address {
|
||||||
|
addressStreet1
|
||||||
|
addressStreet2
|
||||||
|
addressCity
|
||||||
|
addressState
|
||||||
|
addressCountry
|
||||||
|
addressPostcode
|
||||||
|
addressLat
|
||||||
|
addressLng
|
||||||
|
}
|
||||||
updatedAt
|
updatedAt
|
||||||
name
|
name
|
||||||
accountOwnerId
|
accountOwnerId
|
||||||
|
|||||||
@ -800,7 +800,9 @@ export const mockPerformance = {
|
|||||||
},
|
},
|
||||||
employees: null,
|
employees: null,
|
||||||
accountOwnerId: null,
|
accountOwnerId: null,
|
||||||
address: '',
|
address: {
|
||||||
|
addressCity: 'San Francisco',
|
||||||
|
},
|
||||||
idealCustomerProfile: false,
|
idealCustomerProfile: false,
|
||||||
createdAt: '2024-05-01T13:16:29.046Z',
|
createdAt: '2024-05-01T13:16:29.046Z',
|
||||||
id: '20202020-c21e-4ec2-873b-de4264d89025',
|
id: '20202020-c21e-4ec2-873b-de4264d89025',
|
||||||
@ -844,7 +846,7 @@ export const mockPerformance = {
|
|||||||
},
|
},
|
||||||
employees: null,
|
employees: null,
|
||||||
accountOwnerId: null,
|
accountOwnerId: null,
|
||||||
address: '',
|
address: { addressCity: 'San Francisco' },
|
||||||
idealCustomerProfile: false,
|
idealCustomerProfile: false,
|
||||||
createdAt: '2024-05-01T13:16:29.046Z',
|
createdAt: '2024-05-01T13:16:29.046Z',
|
||||||
id: '20202020-ed89-413a-b31a-962986e67bb4',
|
id: '20202020-ed89-413a-b31a-962986e67bb4',
|
||||||
|
|||||||
@ -40,7 +40,16 @@ const companyMocks = [
|
|||||||
currencyCode
|
currencyCode
|
||||||
}
|
}
|
||||||
createdAt
|
createdAt
|
||||||
address
|
address {
|
||||||
|
addressStreet1
|
||||||
|
addressStreet2
|
||||||
|
addressCity
|
||||||
|
addressState
|
||||||
|
addressCountry
|
||||||
|
addressPostcode
|
||||||
|
addressLat
|
||||||
|
addressLng
|
||||||
|
}
|
||||||
updatedAt
|
updatedAt
|
||||||
name
|
name
|
||||||
accountOwnerId
|
accountOwnerId
|
||||||
|
|||||||
@ -78,7 +78,9 @@ export const query = gql`
|
|||||||
currencyCode
|
currencyCode
|
||||||
}
|
}
|
||||||
createdAt
|
createdAt
|
||||||
address
|
address {
|
||||||
|
adressCity
|
||||||
|
}
|
||||||
updatedAt
|
updatedAt
|
||||||
name
|
name
|
||||||
accountOwnerId
|
accountOwnerId
|
||||||
|
|||||||
@ -78,7 +78,7 @@ export const SIGN_IN_BACKGROUND_MOCK_COLUMN_DEFINITIONS = (
|
|||||||
fieldMetadataId: '20202020-ad10-4117-a039-3f04b7a5f939',
|
fieldMetadataId: '20202020-ad10-4117-a039-3f04b7a5f939',
|
||||||
label: 'Address',
|
label: 'Address',
|
||||||
size: 100,
|
size: 100,
|
||||||
type: FieldMetadataType.Text,
|
type: FieldMetadataType.Address,
|
||||||
metadata: {
|
metadata: {
|
||||||
fieldName: 'address',
|
fieldName: 'address',
|
||||||
placeHolder: 'Address',
|
placeHolder: 'Address',
|
||||||
|
|||||||
@ -10,7 +10,12 @@ export const SIGN_IN_BACKGROUND_MOCK_COMPANIES = [
|
|||||||
__typename: 'FavoriteConnection',
|
__typename: 'FavoriteConnection',
|
||||||
edges: [],
|
edges: [],
|
||||||
},
|
},
|
||||||
address: 'OLINDA SAS. 18 rue de Navarin, 75009 Paris',
|
address: {
|
||||||
|
addressStreet1: 'OLINDA SAS',
|
||||||
|
addressStreet2: '18 rue de Navarin',
|
||||||
|
addressCity: 'Paris',
|
||||||
|
addressPostcode: '75009',
|
||||||
|
},
|
||||||
accountOwner: null,
|
accountOwner: null,
|
||||||
people: {
|
people: {
|
||||||
__typename: 'PersonConnection',
|
__typename: 'PersonConnection',
|
||||||
@ -115,7 +120,12 @@ export const SIGN_IN_BACKGROUND_MOCK_COMPANIES = [
|
|||||||
__typename: 'FavoriteConnection',
|
__typename: 'FavoriteConnection',
|
||||||
edges: [],
|
edges: [],
|
||||||
},
|
},
|
||||||
address: '1600 Amphitheatre Pkwy, Mountain View, CA 94043',
|
address: {
|
||||||
|
addressStreet1: '1600 Amphitheatre Pkwy',
|
||||||
|
addressStreet2: 'Mountain View',
|
||||||
|
addressState: 'CA',
|
||||||
|
addressPostcode: '94043',
|
||||||
|
},
|
||||||
accountOwner: null,
|
accountOwner: null,
|
||||||
people: {
|
people: {
|
||||||
__typename: 'PersonConnection',
|
__typename: 'PersonConnection',
|
||||||
@ -314,7 +324,12 @@ export const SIGN_IN_BACKGROUND_MOCK_COMPANIES = [
|
|||||||
__typename: 'FavoriteConnection',
|
__typename: 'FavoriteConnection',
|
||||||
edges: [],
|
edges: [],
|
||||||
},
|
},
|
||||||
address: '1 Hacker Way, Menlo Park, CA 94025',
|
address: {
|
||||||
|
addressStreet1: '1 Hacker Way',
|
||||||
|
addressStreet2: 'Menlo Park',
|
||||||
|
addressState: 'CA',
|
||||||
|
addressPostcode: '94025',
|
||||||
|
},
|
||||||
accountOwner: null,
|
accountOwner: null,
|
||||||
people: {
|
people: {
|
||||||
__typename: 'PersonConnection',
|
__typename: 'PersonConnection',
|
||||||
@ -444,7 +459,12 @@ export const SIGN_IN_BACKGROUND_MOCK_COMPANIES = [
|
|||||||
__typename: 'FavoriteConnection',
|
__typename: 'FavoriteConnection',
|
||||||
edges: [],
|
edges: [],
|
||||||
},
|
},
|
||||||
address: '121 Albright Way, Los Gatos, CA 95032',
|
address: {
|
||||||
|
addressStreet1: '121 Albright Way',
|
||||||
|
addressStreet2: 'Los Gatos',
|
||||||
|
addressState: 'CA',
|
||||||
|
addressPostcode: '95032',
|
||||||
|
},
|
||||||
accountOwner: null,
|
accountOwner: null,
|
||||||
people: {
|
people: {
|
||||||
__typename: 'PersonConnection',
|
__typename: 'PersonConnection',
|
||||||
@ -492,7 +512,12 @@ export const SIGN_IN_BACKGROUND_MOCK_COMPANIES = [
|
|||||||
__typename: 'FavoriteConnection',
|
__typename: 'FavoriteConnection',
|
||||||
edges: [],
|
edges: [],
|
||||||
},
|
},
|
||||||
address: '1 Microsoft Way, Redmond, WA 98052',
|
address: {
|
||||||
|
addressStreet1: '1 Microsoft Way',
|
||||||
|
addressStreet2: 'Redmond',
|
||||||
|
addressState: 'WA',
|
||||||
|
addressPostcode: '98052',
|
||||||
|
},
|
||||||
accountOwner: null,
|
accountOwner: null,
|
||||||
people: {
|
people: {
|
||||||
__typename: 'PersonConnection',
|
__typename: 'PersonConnection',
|
||||||
@ -672,7 +697,11 @@ export const SIGN_IN_BACKGROUND_MOCK_COMPANIES = [
|
|||||||
__typename: 'FavoriteConnection',
|
__typename: 'FavoriteConnection',
|
||||||
edges: [],
|
edges: [],
|
||||||
},
|
},
|
||||||
address: '42 Rue de Paradis, 75010 Paris',
|
address: {
|
||||||
|
addressStreet1: '42 rue de paradis',
|
||||||
|
addressCity: 'Paris',
|
||||||
|
addressPostcode: '75010',
|
||||||
|
},
|
||||||
accountOwner: null,
|
accountOwner: null,
|
||||||
people: {
|
people: {
|
||||||
__typename: 'PersonConnection',
|
__typename: 'PersonConnection',
|
||||||
@ -720,7 +749,12 @@ export const SIGN_IN_BACKGROUND_MOCK_COMPANIES = [
|
|||||||
__typename: 'FavoriteConnection',
|
__typename: 'FavoriteConnection',
|
||||||
edges: [],
|
edges: [],
|
||||||
},
|
},
|
||||||
address: '888 Brannan Street San Francisco, CA 94103',
|
address: {
|
||||||
|
addressStreet1: '888 Brannan Street',
|
||||||
|
addressCity: 'San Francisco',
|
||||||
|
addressState: 'CA',
|
||||||
|
addressPostcode: '75010',
|
||||||
|
},
|
||||||
accountOwner: null,
|
accountOwner: null,
|
||||||
people: {
|
people: {
|
||||||
__typename: 'PersonConnection',
|
__typename: 'PersonConnection',
|
||||||
@ -768,7 +802,13 @@ export const SIGN_IN_BACKGROUND_MOCK_COMPANIES = [
|
|||||||
__typename: 'FavoriteConnection',
|
__typename: 'FavoriteConnection',
|
||||||
edges: [],
|
edges: [],
|
||||||
},
|
},
|
||||||
address: '901 Fifth Avenue; Suite 1200; Seattle, WA 98164',
|
address: {
|
||||||
|
addressStreet1: '901 Fifth Avenue',
|
||||||
|
addressStreet2: 'Suite 1200',
|
||||||
|
addressCity: 'Seattle',
|
||||||
|
addressState: 'WA',
|
||||||
|
addressPostcode: '98164',
|
||||||
|
},
|
||||||
accountOwner: null,
|
accountOwner: null,
|
||||||
people: {
|
people: {
|
||||||
__typename: 'PersonConnection',
|
__typename: 'PersonConnection',
|
||||||
@ -816,7 +856,13 @@ export const SIGN_IN_BACKGROUND_MOCK_COMPANIES = [
|
|||||||
__typename: 'FavoriteConnection',
|
__typename: 'FavoriteConnection',
|
||||||
edges: [],
|
edges: [],
|
||||||
},
|
},
|
||||||
address: '3790 El Camino Real, Unit 518, Palo Alto, CA 94306',
|
address: {
|
||||||
|
addressStreet1: '3790 El Camino Real',
|
||||||
|
addressStreet2: 'Unit 518',
|
||||||
|
addressCity: 'Palo Alto',
|
||||||
|
addressState: 'CA',
|
||||||
|
addressPostcode: '94306',
|
||||||
|
},
|
||||||
accountOwner: null,
|
accountOwner: null,
|
||||||
people: {
|
people: {
|
||||||
__typename: 'PersonConnection',
|
__typename: 'PersonConnection',
|
||||||
@ -895,7 +941,11 @@ export const SIGN_IN_BACKGROUND_MOCK_COMPANIES = [
|
|||||||
__typename: 'FavoriteConnection',
|
__typename: 'FavoriteConnection',
|
||||||
edges: [],
|
edges: [],
|
||||||
},
|
},
|
||||||
address: '129, Samsung-ro, Yeongtong-gu, Suwon-si, Gyeonggi-do',
|
address: {
|
||||||
|
addressStreet1: '129, Samsung-ro',
|
||||||
|
addressStreet2: 'Yeongtong-gu, Suwon-si',
|
||||||
|
addressCity: 'Gyeonggi-do',
|
||||||
|
},
|
||||||
accountOwner: null,
|
accountOwner: null,
|
||||||
people: {
|
people: {
|
||||||
__typename: 'PersonConnection',
|
__typename: 'PersonConnection',
|
||||||
@ -974,7 +1024,13 @@ export const SIGN_IN_BACKGROUND_MOCK_COMPANIES = [
|
|||||||
__typename: 'FavoriteConnection',
|
__typename: 'FavoriteConnection',
|
||||||
edges: [],
|
edges: [],
|
||||||
},
|
},
|
||||||
address: '576 Folsom St., Floor 3, San Francisco, CA 94105',
|
address: {
|
||||||
|
addressStreet1: '576 Folsom St.',
|
||||||
|
addressStreet2: 'Floor 3',
|
||||||
|
addressCity: 'San Francisco',
|
||||||
|
addressState: 'CA',
|
||||||
|
addressPostcode: '94105',
|
||||||
|
},
|
||||||
accountOwner: null,
|
accountOwner: null,
|
||||||
people: {
|
people: {
|
||||||
__typename: 'PersonConnection',
|
__typename: 'PersonConnection',
|
||||||
@ -1022,7 +1078,10 @@ export const SIGN_IN_BACKGROUND_MOCK_COMPANIES = [
|
|||||||
__typename: 'FavoriteConnection',
|
__typename: 'FavoriteConnection',
|
||||||
edges: [],
|
edges: [],
|
||||||
},
|
},
|
||||||
address: '575 Lexington Ave 16th Floor, New York',
|
address: {
|
||||||
|
addressStreet1: '575 Lexington Ave 16th Floor',
|
||||||
|
addressCity: 'New York',
|
||||||
|
},
|
||||||
accountOwner: null,
|
accountOwner: null,
|
||||||
people: {
|
people: {
|
||||||
__typename: 'PersonConnection',
|
__typename: 'PersonConnection',
|
||||||
@ -1070,7 +1129,13 @@ export const SIGN_IN_BACKGROUND_MOCK_COMPANIES = [
|
|||||||
__typename: 'FavoriteConnection',
|
__typename: 'FavoriteConnection',
|
||||||
edges: [],
|
edges: [],
|
||||||
},
|
},
|
||||||
address: '315 Montgomery St, 13th Fl. San Francisco, CA 94104',
|
address: {
|
||||||
|
addressStreet1: '315 Montgomery St',
|
||||||
|
addressStreet2: '13th Fl.',
|
||||||
|
addressCity: 'San Francisco',
|
||||||
|
addressState: 'CA',
|
||||||
|
addressPostcode: '94104',
|
||||||
|
},
|
||||||
accountOwner: null,
|
accountOwner: null,
|
||||||
people: {
|
people: {
|
||||||
__typename: 'PersonConnection',
|
__typename: 'PersonConnection',
|
||||||
|
|||||||
@ -23,7 +23,7 @@ export const SIGN_IN_BACKGROUND_MOCK_FILTER_DEFINITIONS = [
|
|||||||
fieldMetadataId: '20202020-ad10-4117-a039-3f04b7a5f939',
|
fieldMetadataId: '20202020-ad10-4117-a039-3f04b7a5f939',
|
||||||
label: 'Address',
|
label: 'Address',
|
||||||
iconName: 'IconMap',
|
iconName: 'IconMap',
|
||||||
type: 'TEXT',
|
type: 'ADDRESS',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldMetadataId: '20202020-0739-495d-8e70-c0807f6b2268',
|
fieldMetadataId: '20202020-0739-495d-8e70-c0807f6b2268',
|
||||||
|
|||||||
@ -1,15 +1,15 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { OnEvent } from '@nestjs/event-emitter';
|
import { OnEvent } from '@nestjs/event-emitter';
|
||||||
|
|
||||||
import { MessageQueue } from 'src/engine/integrations/message-queue/message-queue.constants';
|
|
||||||
import { MessageQueueService } from 'src/engine/integrations/message-queue/services/message-queue.service';
|
|
||||||
import { ObjectRecordCreateEvent } from 'src/engine/integrations/event-emitter/types/object-record-create.event';
|
import { ObjectRecordCreateEvent } from 'src/engine/integrations/event-emitter/types/object-record-create.event';
|
||||||
import { objectRecordChangedValues } from 'src/engine/integrations/event-emitter/utils/object-record-changed-values';
|
|
||||||
import { ObjectRecordUpdateEvent } from 'src/engine/integrations/event-emitter/types/object-record-update.event';
|
import { ObjectRecordUpdateEvent } from 'src/engine/integrations/event-emitter/types/object-record-update.event';
|
||||||
import { ObjectRecordBaseEvent } from 'src/engine/integrations/event-emitter/types/object-record.base.event';
|
import { ObjectRecordBaseEvent } from 'src/engine/integrations/event-emitter/types/object-record.base.event';
|
||||||
import { UpsertTimelineActivityFromInternalEvent } from 'src/modules/timeline/jobs/upsert-timeline-activity-from-internal-event.job';
|
import { objectRecordChangedValues } from 'src/engine/integrations/event-emitter/utils/object-record-changed-values';
|
||||||
import { InjectMessageQueue } from 'src/engine/integrations/message-queue/decorators/message-queue.decorator';
|
import { InjectMessageQueue } from 'src/engine/integrations/message-queue/decorators/message-queue.decorator';
|
||||||
|
import { MessageQueue } from 'src/engine/integrations/message-queue/message-queue.constants';
|
||||||
|
import { MessageQueueService } from 'src/engine/integrations/message-queue/services/message-queue.service';
|
||||||
import { CreateAuditLogFromInternalEvent } from 'src/modules/timeline/jobs/create-audit-log-from-internal-event';
|
import { CreateAuditLogFromInternalEvent } from 'src/modules/timeline/jobs/create-audit-log-from-internal-event';
|
||||||
|
import { UpsertTimelineActivityFromInternalEvent } from 'src/modules/timeline/jobs/upsert-timeline-activity-from-internal-event.job';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class EntityEventsToDbListener {
|
export class EntityEventsToDbListener {
|
||||||
|
|||||||
@ -46,6 +46,13 @@ export function WorkspaceField<T extends FieldMetadataType>(
|
|||||||
object,
|
object,
|
||||||
propertyKey.toString(),
|
propertyKey.toString(),
|
||||||
);
|
);
|
||||||
|
const isDeprecated =
|
||||||
|
TypedReflect.getMetadata(
|
||||||
|
'workspace:is-deprecated-field-metadata-args',
|
||||||
|
object,
|
||||||
|
propertyKey.toString(),
|
||||||
|
) ?? false;
|
||||||
|
|
||||||
const defaultValue = (options.defaultValue ??
|
const defaultValue = (options.defaultValue ??
|
||||||
generateDefaultValue(
|
generateDefaultValue(
|
||||||
options.type,
|
options.type,
|
||||||
@ -65,6 +72,7 @@ export function WorkspaceField<T extends FieldMetadataType>(
|
|||||||
isNullable,
|
isNullable,
|
||||||
isSystem,
|
isSystem,
|
||||||
gate,
|
gate,
|
||||||
|
isDeprecated,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,12 @@
|
|||||||
|
import { TypedReflect } from 'src/utils/typed-reflect';
|
||||||
|
|
||||||
|
export function WorkspaceIsDeprecated(): PropertyDecorator {
|
||||||
|
return (object, propertyKey) => {
|
||||||
|
TypedReflect.defineMetadata(
|
||||||
|
'workspace:is-deprecated-field-metadata-args',
|
||||||
|
true,
|
||||||
|
object,
|
||||||
|
propertyKey.toString(),
|
||||||
|
);
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -73,4 +73,9 @@ export interface WorkspaceFieldMetadataArgs {
|
|||||||
* Field gate.
|
* Field gate.
|
||||||
*/
|
*/
|
||||||
readonly gate?: Gate;
|
readonly gate?: Gate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is deprecated field.
|
||||||
|
*/
|
||||||
|
readonly isDeprecated?: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,12 @@ export const companyPrefillData = async (
|
|||||||
.into(`${schemaName}.company`, [
|
.into(`${schemaName}.company`, [
|
||||||
'name',
|
'name',
|
||||||
'domainName',
|
'domainName',
|
||||||
'address',
|
'addressAddressStreet1',
|
||||||
|
'addressAddressStreet2',
|
||||||
|
'addressAddressCity',
|
||||||
|
'addressAddressState',
|
||||||
|
'addressAddressPostcode',
|
||||||
|
'addressAddressCountry',
|
||||||
'employees',
|
'employees',
|
||||||
'position',
|
'position',
|
||||||
])
|
])
|
||||||
@ -19,35 +24,60 @@ export const companyPrefillData = async (
|
|||||||
{
|
{
|
||||||
name: 'Airbnb',
|
name: 'Airbnb',
|
||||||
domainName: 'airbnb.com',
|
domainName: 'airbnb.com',
|
||||||
address: 'San Francisco',
|
addressAddressStreet1: '888 Brannan St',
|
||||||
|
addressAddressStreet2: null,
|
||||||
|
addressAddressCity: 'San Francisco',
|
||||||
|
addressAddressState: 'CA',
|
||||||
|
addressAddressPostcode: '94103',
|
||||||
|
addressAddressCountry: 'United States',
|
||||||
employees: 5000,
|
employees: 5000,
|
||||||
position: 1,
|
position: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Qonto',
|
name: 'Qonto',
|
||||||
domainName: 'qonto.com',
|
domainName: 'qonto.com',
|
||||||
address: 'San Francisco',
|
addressAddressStreet1: '18 rue de navarrin',
|
||||||
|
addressAddressStreet2: null,
|
||||||
|
addressAddressCity: 'Paris',
|
||||||
|
addressAddressState: null,
|
||||||
|
addressAddressPostcode: '75009',
|
||||||
|
addressAddressCountry: 'France',
|
||||||
employees: 800,
|
employees: 800,
|
||||||
position: 2,
|
position: 2,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Stripe',
|
name: 'Stripe',
|
||||||
domainName: 'stripe.com',
|
domainName: 'stripe.com',
|
||||||
address: 'San Francisco',
|
addressAddressStreet1: 'Eutaw Street',
|
||||||
|
addressAddressStreet2: null,
|
||||||
|
addressAddressCity: 'Dublin',
|
||||||
|
addressAddressState: null,
|
||||||
|
addressAddressPostcode: null,
|
||||||
|
addressAddressCountry: 'Ireland',
|
||||||
employees: 8000,
|
employees: 8000,
|
||||||
position: 3,
|
position: 3,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Figma',
|
name: 'Figma',
|
||||||
domainName: 'figma.com',
|
domainName: 'figma.com',
|
||||||
address: 'San Francisco',
|
addressAddressStreet1: '760 Market St',
|
||||||
|
addressAddressStreet2: 'Floor 10',
|
||||||
|
addressAddressCity: 'San Francisco',
|
||||||
|
addressAddressState: null,
|
||||||
|
addressAddressPostcode: '94102',
|
||||||
|
addressAddressCountry: 'United States',
|
||||||
employees: 800,
|
employees: 800,
|
||||||
position: 4,
|
position: 4,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Notion',
|
name: 'Notion',
|
||||||
domainName: 'notion.com',
|
domainName: 'notion.com',
|
||||||
address: 'San Francisco',
|
addressAddressStreet1: '2300 Harrison St',
|
||||||
|
addressAddressStreet2: null,
|
||||||
|
addressAddressCity: 'San Francisco',
|
||||||
|
addressAddressState: 'CA',
|
||||||
|
addressAddressPostcode: '94110',
|
||||||
|
addressAddressCountry: 'United States',
|
||||||
employees: 400,
|
employees: 400,
|
||||||
position: 5,
|
position: 5,
|
||||||
},
|
},
|
||||||
|
|||||||
@ -8,11 +8,11 @@ import {
|
|||||||
} from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/comparator.interface';
|
} from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/comparator.interface';
|
||||||
import { ComputedPartialFieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/partial-field-metadata.interface';
|
import { ComputedPartialFieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/partial-field-metadata.interface';
|
||||||
|
|
||||||
import { transformMetadataForComparison } from 'src/engine/workspace-manager/workspace-sync-metadata/comparators/utils/transform-metadata-for-comparison.util';
|
|
||||||
import {
|
import {
|
||||||
FieldMetadataEntity,
|
FieldMetadataEntity,
|
||||||
FieldMetadataType,
|
FieldMetadataType,
|
||||||
} from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
|
} from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
|
||||||
|
import { transformMetadataForComparison } from 'src/engine/workspace-manager/workspace-sync-metadata/comparators/utils/transform-metadata-for-comparison.util';
|
||||||
|
|
||||||
const commonFieldPropertiesToIgnore = [
|
const commonFieldPropertiesToIgnore = [
|
||||||
'id',
|
'id',
|
||||||
@ -28,6 +28,12 @@ const commonFieldPropertiesToIgnore = [
|
|||||||
|
|
||||||
const fieldPropertiesToStringify = ['defaultValue'] as const;
|
const fieldPropertiesToStringify = ['defaultValue'] as const;
|
||||||
|
|
||||||
|
const shouldSkipFieldCreation = (
|
||||||
|
standardFieldMetadata: ComputedPartialFieldMetadata | undefined,
|
||||||
|
) => {
|
||||||
|
return standardFieldMetadata?.isCustom;
|
||||||
|
};
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class WorkspaceFieldComparator {
|
export class WorkspaceFieldComparator {
|
||||||
constructor() {}
|
constructor() {}
|
||||||
@ -108,10 +114,6 @@ export class WorkspaceFieldComparator {
|
|||||||
const findField = (
|
const findField = (
|
||||||
field: ComputedPartialFieldMetadata | FieldMetadataEntity,
|
field: ComputedPartialFieldMetadata | FieldMetadataEntity,
|
||||||
) => {
|
) => {
|
||||||
if (field.isCustom) {
|
|
||||||
return field.name === fieldName;
|
|
||||||
}
|
|
||||||
|
|
||||||
return field.standardId === fieldName;
|
return field.standardId === fieldName;
|
||||||
};
|
};
|
||||||
// Object shouldn't have thousands of fields, so we can use find here
|
// Object shouldn't have thousands of fields, so we can use find here
|
||||||
@ -122,6 +124,9 @@ export class WorkspaceFieldComparator {
|
|||||||
|
|
||||||
switch (difference.type) {
|
switch (difference.type) {
|
||||||
case 'CREATE': {
|
case 'CREATE': {
|
||||||
|
if (shouldSkipFieldCreation(standardFieldMetadata)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (!standardFieldMetadata) {
|
if (!standardFieldMetadata) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Field ${fieldName} not found in standardObjectMetadata`,
|
`Field ${fieldName} not found in standardObjectMetadata`,
|
||||||
|
|||||||
@ -114,7 +114,8 @@ export const COMMENT_STANDARD_FIELD_IDS = {
|
|||||||
export const COMPANY_STANDARD_FIELD_IDS = {
|
export const COMPANY_STANDARD_FIELD_IDS = {
|
||||||
name: '20202020-4d99-4e2e-a84c-4a27837b1ece',
|
name: '20202020-4d99-4e2e-a84c-4a27837b1ece',
|
||||||
domainName: '20202020-0c28-43d8-8ba5-3659924d3489',
|
domainName: '20202020-0c28-43d8-8ba5-3659924d3489',
|
||||||
address: '20202020-a82a-4ee2-96cc-a18a3259d953',
|
address_deprecated: '20202020-a82a-4ee2-96cc-a18a3259d953',
|
||||||
|
address: '20202020-c5ce-4adc-b7b6-9c0979fc55e7',
|
||||||
employees: '20202020-8965-464a-8a75-74bafc152a0b',
|
employees: '20202020-8965-464a-8a75-74bafc152a0b',
|
||||||
linkedinLink: '20202020-ebeb-4beb-b9ad-6848036fb451',
|
linkedinLink: '20202020-ebeb-4beb-b9ad-6848036fb451',
|
||||||
xLink: '20202020-6f64-4fd9-9580-9c1991c7d8c3',
|
xLink: '20202020-6f64-4fd9-9580-9c1991c7d8c3',
|
||||||
|
|||||||
@ -162,7 +162,7 @@ export class StandardFieldFactory {
|
|||||||
options: workspaceFieldMetadataArgs.options,
|
options: workspaceFieldMetadataArgs.options,
|
||||||
workspaceId: context.workspaceId,
|
workspaceId: context.workspaceId,
|
||||||
isNullable: workspaceFieldMetadataArgs.isNullable,
|
isNullable: workspaceFieldMetadataArgs.isNullable,
|
||||||
isCustom: false,
|
isCustom: workspaceFieldMetadataArgs.isDeprecated ? true : false,
|
||||||
isSystem:
|
isSystem:
|
||||||
workspaceEntityMetadataArgs?.isSystem ||
|
workspaceEntityMetadataArgs?.isSystem ||
|
||||||
workspaceFieldMetadataArgs.isSystem,
|
workspaceFieldMetadataArgs.isSystem,
|
||||||
|
|||||||
@ -125,16 +125,6 @@ export class WorkspaceMetadataUpdaterService {
|
|||||||
updatedFieldMetadataCollection: FieldMetadataUpdate[];
|
updatedFieldMetadataCollection: FieldMetadataUpdate[];
|
||||||
}> {
|
}> {
|
||||||
const fieldMetadataRepository = manager.getRepository(FieldMetadataEntity);
|
const fieldMetadataRepository = manager.getRepository(FieldMetadataEntity);
|
||||||
|
|
||||||
/**
|
|
||||||
* Create field metadata
|
|
||||||
*/
|
|
||||||
const createdFieldMetadataCollection = await fieldMetadataRepository.save(
|
|
||||||
storage.fieldMetadataCreateCollection.map((field) =>
|
|
||||||
this.prepareFieldMetadataForCreation(field),
|
|
||||||
) as DeepPartial<FieldMetadataEntity>[],
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update field metadata
|
* Update field metadata
|
||||||
*/
|
*/
|
||||||
@ -145,6 +135,15 @@ export class WorkspaceMetadataUpdaterService {
|
|||||||
'workspaceId',
|
'workspaceId',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create field metadata
|
||||||
|
*/
|
||||||
|
const createdFieldMetadataCollection = await fieldMetadataRepository.save(
|
||||||
|
storage.fieldMetadataCreateCollection.map((field) =>
|
||||||
|
this.prepareFieldMetadataForCreation(field),
|
||||||
|
) as DeepPartial<FieldMetadataEntity>[],
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete field metadata
|
* Delete field metadata
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
import { Address } from 'nodemailer/lib/mailer';
|
||||||
|
|
||||||
import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/relation.interface';
|
import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/relation.interface';
|
||||||
|
|
||||||
import { CurrencyMetadata } from 'src/engine/metadata-modules/field-metadata/composite-types/currency.composite-type';
|
import { CurrencyMetadata } from 'src/engine/metadata-modules/field-metadata/composite-types/currency.composite-type';
|
||||||
@ -22,6 +24,7 @@ import { WorkspaceField } from 'src/engine/twenty-orm/decorators/workspace-field
|
|||||||
import { WorkspaceIsNullable } from 'src/engine/twenty-orm/decorators/workspace-is-nullable.decorator';
|
import { WorkspaceIsNullable } from 'src/engine/twenty-orm/decorators/workspace-is-nullable.decorator';
|
||||||
import { WorkspaceIsSystem } from 'src/engine/twenty-orm/decorators/workspace-is-system.decorator';
|
import { WorkspaceIsSystem } from 'src/engine/twenty-orm/decorators/workspace-is-system.decorator';
|
||||||
import { WorkspaceRelation } from 'src/engine/twenty-orm/decorators/workspace-relation.decorator';
|
import { WorkspaceRelation } from 'src/engine/twenty-orm/decorators/workspace-relation.decorator';
|
||||||
|
import { WorkspaceIsDeprecated } from 'src/engine/twenty-orm/decorators/workspace-is-deprecated.decorator';
|
||||||
import { WorkspaceJoinColumn } from 'src/engine/twenty-orm/decorators/workspace-join-column.decorator';
|
import { WorkspaceJoinColumn } from 'src/engine/twenty-orm/decorators/workspace-join-column.decorator';
|
||||||
|
|
||||||
@WorkspaceEntity({
|
@WorkspaceEntity({
|
||||||
@ -52,15 +55,6 @@ export class CompanyWorkspaceEntity extends BaseWorkspaceEntity {
|
|||||||
})
|
})
|
||||||
domainName?: string;
|
domainName?: string;
|
||||||
|
|
||||||
@WorkspaceField({
|
|
||||||
standardId: COMPANY_STANDARD_FIELD_IDS.address,
|
|
||||||
type: FieldMetadataType.TEXT,
|
|
||||||
label: 'Address',
|
|
||||||
description: 'The company address',
|
|
||||||
icon: 'IconMap',
|
|
||||||
})
|
|
||||||
address: string;
|
|
||||||
|
|
||||||
@WorkspaceField({
|
@WorkspaceField({
|
||||||
standardId: COMPANY_STANDARD_FIELD_IDS.employees,
|
standardId: COMPANY_STANDARD_FIELD_IDS.employees,
|
||||||
type: FieldMetadataType.NUMBER,
|
type: FieldMetadataType.NUMBER,
|
||||||
@ -102,6 +96,28 @@ export class CompanyWorkspaceEntity extends BaseWorkspaceEntity {
|
|||||||
@WorkspaceIsNullable()
|
@WorkspaceIsNullable()
|
||||||
annualRecurringRevenue: CurrencyMetadata | null;
|
annualRecurringRevenue: CurrencyMetadata | null;
|
||||||
|
|
||||||
|
@WorkspaceField({
|
||||||
|
standardId: COMPANY_STANDARD_FIELD_IDS.address_deprecated,
|
||||||
|
type: FieldMetadataType.TEXT,
|
||||||
|
label: 'Address (deprecated) ',
|
||||||
|
description:
|
||||||
|
'Address of the company - deprecated in favor of new address field',
|
||||||
|
icon: 'IconMap',
|
||||||
|
})
|
||||||
|
@WorkspaceIsDeprecated()
|
||||||
|
@WorkspaceIsNullable()
|
||||||
|
address_old: string;
|
||||||
|
|
||||||
|
@WorkspaceField({
|
||||||
|
standardId: COMPANY_STANDARD_FIELD_IDS.address,
|
||||||
|
type: FieldMetadataType.ADDRESS,
|
||||||
|
label: 'Address',
|
||||||
|
description: 'Address of the company',
|
||||||
|
icon: 'IconMap',
|
||||||
|
})
|
||||||
|
@WorkspaceIsNullable()
|
||||||
|
address: Address;
|
||||||
|
|
||||||
@WorkspaceField({
|
@WorkspaceField({
|
||||||
standardId: COMPANY_STANDARD_FIELD_IDS.idealCustomerProfile,
|
standardId: COMPANY_STANDARD_FIELD_IDS.idealCustomerProfile,
|
||||||
type: FieldMetadataType.BOOLEAN,
|
type: FieldMetadataType.BOOLEAN,
|
||||||
|
|||||||
@ -8,6 +8,7 @@ export interface ReflectMetadataTypeMap {
|
|||||||
['workspace:is-system-metadata-args']: true;
|
['workspace:is-system-metadata-args']: true;
|
||||||
['workspace:is-audit-logged-metadata-args']: false;
|
['workspace:is-audit-logged-metadata-args']: false;
|
||||||
['workspace:is-primary-field-metadata-args']: true;
|
['workspace:is-primary-field-metadata-args']: true;
|
||||||
|
['workspace:is-deprecated-field-metadata-args']: true;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class TypedReflect {
|
export class TypedReflect {
|
||||||
|
|||||||
@ -31,7 +31,9 @@ describe('CompanyResolver (e2e)', () => {
|
|||||||
id
|
id
|
||||||
name
|
name
|
||||||
domainName
|
domainName
|
||||||
address
|
address {
|
||||||
|
addressCity
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
@ -39,7 +41,7 @@ describe('CompanyResolver (e2e)', () => {
|
|||||||
data: {
|
data: {
|
||||||
name: 'New Company',
|
name: 'New Company',
|
||||||
domainName: 'new-company.com',
|
domainName: 'new-company.com',
|
||||||
address: 'New Address',
|
address: { addressCity: 'Paris' },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -57,7 +59,7 @@ describe('CompanyResolver (e2e)', () => {
|
|||||||
expect(data).toHaveProperty('id');
|
expect(data).toHaveProperty('id');
|
||||||
expect(data).toHaveProperty('name', 'New Company');
|
expect(data).toHaveProperty('name', 'New Company');
|
||||||
expect(data).toHaveProperty('domainName', 'new-company.com');
|
expect(data).toHaveProperty('domainName', 'new-company.com');
|
||||||
expect(data).toHaveProperty('address', 'New Address');
|
expect(data).toHaveProperty('address', { addressCity: 'Paris' });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -69,7 +71,9 @@ describe('CompanyResolver (e2e)', () => {
|
|||||||
id
|
id
|
||||||
name
|
name
|
||||||
domainName
|
domainName
|
||||||
address
|
address {
|
||||||
|
addressCity
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
@ -92,7 +96,7 @@ describe('CompanyResolver (e2e)', () => {
|
|||||||
expect(company).toHaveProperty('id');
|
expect(company).toHaveProperty('id');
|
||||||
expect(company).toHaveProperty('name', 'New Company');
|
expect(company).toHaveProperty('name', 'New Company');
|
||||||
expect(company).toHaveProperty('domainName', 'new-company.com');
|
expect(company).toHaveProperty('domainName', 'new-company.com');
|
||||||
expect(company).toHaveProperty('address', 'New Address');
|
expect(company).toHaveProperty('address', { addressCity: 'Paris' });
|
||||||
|
|
||||||
// Check if we have access to ressources outside of our workspace
|
// Check if we have access to ressources outside of our workspace
|
||||||
const instagramCompany = data.find((c) => c.name === 'Instagram');
|
const instagramCompany = data.find((c) => c.name === 'Instagram');
|
||||||
@ -109,7 +113,9 @@ describe('CompanyResolver (e2e)', () => {
|
|||||||
id
|
id
|
||||||
name
|
name
|
||||||
domainName
|
domainName
|
||||||
address
|
address {
|
||||||
|
addressCity
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
@ -131,7 +137,7 @@ describe('CompanyResolver (e2e)', () => {
|
|||||||
expect(data).toHaveProperty('id');
|
expect(data).toHaveProperty('id');
|
||||||
expect(data).toHaveProperty('name', 'New Company');
|
expect(data).toHaveProperty('name', 'New Company');
|
||||||
expect(data).toHaveProperty('domainName', 'new-company.com');
|
expect(data).toHaveProperty('domainName', 'new-company.com');
|
||||||
expect(data).toHaveProperty('address', 'New Address');
|
expect(data).toHaveProperty('address', { addressCity: 'Paris' });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -143,7 +149,9 @@ describe('CompanyResolver (e2e)', () => {
|
|||||||
id
|
id
|
||||||
name
|
name
|
||||||
domainName
|
domainName
|
||||||
address
|
address {
|
||||||
|
addressCity
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
@ -175,7 +183,9 @@ describe('CompanyResolver (e2e)', () => {
|
|||||||
id
|
id
|
||||||
name
|
name
|
||||||
domainName
|
domainName
|
||||||
address
|
address {
|
||||||
|
addressCity
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
@ -186,7 +196,7 @@ describe('CompanyResolver (e2e)', () => {
|
|||||||
data: {
|
data: {
|
||||||
name: 'Updated Company',
|
name: 'Updated Company',
|
||||||
domainName: 'updated-company.com',
|
domainName: 'updated-company.com',
|
||||||
address: 'Updated Address',
|
address: { addressCity: 'Updated City' },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -202,7 +212,7 @@ describe('CompanyResolver (e2e)', () => {
|
|||||||
expect(data).toHaveProperty('id');
|
expect(data).toHaveProperty('id');
|
||||||
expect(data).toHaveProperty('name', 'Updated Company');
|
expect(data).toHaveProperty('name', 'Updated Company');
|
||||||
expect(data).toHaveProperty('domainName', 'updated-company.com');
|
expect(data).toHaveProperty('domainName', 'updated-company.com');
|
||||||
expect(data).toHaveProperty('address', 'Updated Address');
|
expect(data).toHaveProperty('address', { addressCity: 'Updated City' });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -214,7 +224,9 @@ describe('CompanyResolver (e2e)', () => {
|
|||||||
id
|
id
|
||||||
name
|
name
|
||||||
domainName
|
domainName
|
||||||
address
|
address {
|
||||||
|
addressCity
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
|
|||||||
@ -14,7 +14,7 @@ describe('creates.create_company', () => {
|
|||||||
nameSingular: 'Company',
|
nameSingular: 'Company',
|
||||||
crudZapierOperation: Operation.create,
|
crudZapierOperation: Operation.create,
|
||||||
name: 'Company Name',
|
name: 'Company Name',
|
||||||
address: 'Company Address',
|
address: { addressCity: 'Paris' },
|
||||||
domainName: 'Company Domain Name',
|
domainName: 'Company Domain Name',
|
||||||
linkedinLink: { url: '/linkedin_url', label: 'Test linkedinUrl' },
|
linkedinLink: { url: '/linkedin_url', label: 'Test linkedinUrl' },
|
||||||
xLink: { url: '/x_url', label: 'Test xUrl' },
|
xLink: { url: '/x_url', label: 'Test xUrl' },
|
||||||
|
|||||||
@ -67,7 +67,7 @@ describe('triggers.trigger_record.created', () => {
|
|||||||
name: '',
|
name: '',
|
||||||
domainName: '',
|
domainName: '',
|
||||||
createdAt: '2023-10-19 10:10:12.490',
|
createdAt: '2023-10-19 10:10:12.490',
|
||||||
address: '',
|
address: { addressCity: null },
|
||||||
employees: null,
|
employees: null,
|
||||||
linkedinUrl: null,
|
linkedinUrl: null,
|
||||||
xUrl: null,
|
xUrl: null,
|
||||||
|
|||||||
@ -10,7 +10,7 @@ describe('utils.handleQueryParams', () => {
|
|||||||
test('should format', () => {
|
test('should format', () => {
|
||||||
const inputData = {
|
const inputData = {
|
||||||
name: 'Company Name',
|
name: 'Company Name',
|
||||||
address: 'Company Address',
|
address: { addressCity: 'Paris' },
|
||||||
domainName: 'Company Domain Name',
|
domainName: 'Company Domain Name',
|
||||||
linkedinUrl__url: '/linkedin_url',
|
linkedinUrl__url: '/linkedin_url',
|
||||||
linkedinUrl__label: 'Test linkedinUrl',
|
linkedinUrl__label: 'Test linkedinUrl',
|
||||||
@ -23,7 +23,7 @@ describe('utils.handleQueryParams', () => {
|
|||||||
const result = handleQueryParams(inputData);
|
const result = handleQueryParams(inputData);
|
||||||
const expectedResult =
|
const expectedResult =
|
||||||
'name: "Company Name", ' +
|
'name: "Company Name", ' +
|
||||||
'address: "Company Address", ' +
|
'address: { addressCity: "Paris" }, ' +
|
||||||
'domainName: "Company Domain Name", ' +
|
'domainName: "Company Domain Name", ' +
|
||||||
'linkedinUrl: {url: "/linkedin_url", label: "Test linkedinUrl"}, ' +
|
'linkedinUrl: {url: "/linkedin_url", label: "Test linkedinUrl"}, ' +
|
||||||
'xUrl: {url: "/x_url", label: "Test xUrl"}, ' +
|
'xUrl: {url: "/x_url", label: "Test xUrl"}, ' +
|
||||||
|
|||||||
Reference in New Issue
Block a user