Migrate Company and Person standard fields in preparation for the enrichment app (#21171)
# Migrate Company and Person standard fields in preparation for the
enrichment app
## Why
Our standard `Person`/`Company` objects accumulated fields that aren't
generic to every
business, while missing a more universal revenue field that essentially
every CRM ships.
This PR makes the **Standard application** hold a tighter, more
universal set of fields,
and sets the stage for a follow-up PR that introduces a **People Data
Labs enrichment app**
to populate them.
## What changes
### Standard fields
**Demoted (Standard → Workspace Custom application)** — not generic
enough to ship as standard:
| Object | Field | Type |
| ------- | ------------------------------ | -------- |
| Company | annualRecurringRevenue (ARR) | CURRENCY |
| Company | employees | NUMBER |
| Company | idealCustomerProfile (ICP) | BOOLEAN |
| Company | xLink (X/Twitter) | LINKS |
| Person | xLink (X/Twitter) | LINKS |
| Person | city | TEXT |
**Added (new generic Standard field)** — present in
Salesforce/HubSpot/Zoho, PDL-populatable:
| Object | Field | Type |
| ------- | ------------- |
-------------------------------------------------------- |
| Company | annualRevenue | CURRENCY (generic total revenue; replaces
the niche ARR) |
### Behavior by workspace
* **New workspaces:** demoted fields are gone; `annualRevenue` is
**active**.
* **Existing workspaces:** demoted fields are **preserved as active
custom fields, data intact**;
`annualRevenue` is created **inactive (opt-in)** with its column ready,
so a later activation
is a metadata-only toggle.
### Upgrade commands (v2.9)
Three idempotent, per-workspace commands, run in timestamp order:
1. **`upgrade:2-9:move-demoted-standard-fields-to-custom-application`**
(1799000040000) —
re-owns the 6 demoted fields to the workspace custom application
(`isCustom = true`,
new `applicationId` + fresh `universalIdentifier`), keeping their data
and active state.
2. **`upgrade:2-9:rename-conflicting-custom-fields`** (1799000045000) —
if a workspace already
has a *custom* field named `annualRevenue`, renames it to
`annualRevenueCustom`
(data preserved via column rename) so the standard field can be added.
Skips non-custom matches.
3. **`upgrade:2-9:add-inactive-generic-standard-fields`**
(1799000050000) — creates
`Company.annualRevenue` on existing workspaces as inactive, guarded to
skip workspaces
missing the target object or where the name is still taken.
**Failure model:** the workspace iterator isolates failures per
workspace (one workspace failing
never affects others); within a workspace the runner records per-command
status and resumes on the
next run, and every command is idempotent, so partial runs self-heal.
### Supporting changes
* **Field-option color palette:** widened the `TagColor` union
(`twenty-shared` `FieldMetadataOptions`
+ the field-metadata `options.input` DTO) from 10 colors to the full
theme palette, benefiting any
future SELECT/MULTI_SELECT field.
* **Dev seeder:**
* The default "Annual Recurring Revenue" dashboard widget now points at
the generic
`annualRevenue` field (renamed to "Annual Revenue").
* Removed the "Companies by Size (Stacked by City)" widget (relied on
the demoted `employees`).
* `employees` is dropped from company data seeds and re-added as a
**custom** field seed, so dev
workspaces still get an `employees` column matching the demoted
behavior.
### Cleanup
Front-end record types (`Company.ts`/`Person.ts`), the
`getDisplayNameFromParticipant` test mock,
metadata integration specs, the Zapier `crud_record` test, and the
regenerated
`get-standard-object-metadata-related-entity-ids` snapshot.
## ⚠️ Breaking change (intentional)
Removes standard fields `Company.annualRecurringRevenue`,
`Company.employees`,
`Company.idealCustomerProfile`, `Company.xLink`, `Person.xLink`, and
`Person.city` from the core
GraphQL schema (replaced by `Company.annualRevenue`).
This is why the breaking-changes check reports a large number of
removals — `graphql-inspector`
flags any removed object field plus its derived
aggregate/order-by/filter/update types.
**Mitigation:** the
`upgrade:2-9:move-demoted-standard-fields-to-custom-application` command
re-owns these fields as custom fields per workspace, preserving their
name and data, so existing
tenants keep working. New workspaces won't have them.
This commit is contained in:
+7
-7
@@ -270,12 +270,12 @@ export class DevSeederPermissionsService {
|
||||
},
|
||||
});
|
||||
|
||||
const personCityFieldMetadata = personObjectMetadata.fields.find(
|
||||
(field) => field.name === 'city',
|
||||
const personJobTitleFieldMetadata = personObjectMetadata.fields.find(
|
||||
(field) => field.name === 'jobTitle',
|
||||
);
|
||||
|
||||
if (!personCityFieldMetadata) {
|
||||
throw new Error('Person city field metadata not found');
|
||||
if (!personJobTitleFieldMetadata) {
|
||||
throw new Error('Person jobTitle field metadata not found');
|
||||
}
|
||||
|
||||
const companyLinkedinLinkFieldMetadata = companyObjectMetadata.fields.find(
|
||||
@@ -286,9 +286,9 @@ export class DevSeederPermissionsService {
|
||||
throw new Error('Company linkedin link field metadata not found');
|
||||
}
|
||||
|
||||
const readOnlyOnPersonCityFieldPermission = {
|
||||
const readOnlyOnPersonJobTitleFieldPermission = {
|
||||
objectMetadataId: personObjectMetadata.id,
|
||||
fieldMetadataId: personCityFieldMetadata.id,
|
||||
fieldMetadataId: personJobTitleFieldMetadata.id,
|
||||
canReadFieldValue: null,
|
||||
canUpdateFieldValue: false,
|
||||
};
|
||||
@@ -305,7 +305,7 @@ export class DevSeederPermissionsService {
|
||||
input: {
|
||||
roleId: customRole.id,
|
||||
fieldPermissions: [
|
||||
readOnlyOnPersonCityFieldPermission,
|
||||
readOnlyOnPersonJobTitleFieldPermission,
|
||||
noReadOnCompanyLinkedinLinkFieldPermission,
|
||||
],
|
||||
},
|
||||
|
||||
+6
-3
@@ -49,7 +49,10 @@ export const getPageLayoutWidgetDataSeedsV2 = (
|
||||
|
||||
const companyIdFieldId = getFieldId(companyObject, 'id');
|
||||
const companyCreatedAtFieldId = getFieldId(companyObject, 'createdAt');
|
||||
const companyArrFieldId = getFieldId(companyObject, 'annualRecurringRevenue');
|
||||
const companyAnnualRevenueFieldId = getFieldId(
|
||||
companyObject,
|
||||
'annualRevenue',
|
||||
);
|
||||
const companyNameFieldId = getFieldId(companyObject, 'name');
|
||||
const companyLinkedinLinkFieldId = getFieldId(companyObject, 'linkedinLink');
|
||||
|
||||
@@ -133,7 +136,7 @@ export const getPageLayoutWidgetDataSeedsV2 = (
|
||||
: null,
|
||||
|
||||
// PIE chart: Revenue Distribution (Customer Analytics)
|
||||
isDefined(companyArrFieldId) && isDefined(companyNameFieldId)
|
||||
isDefined(companyAnnualRevenueFieldId) && isDefined(companyNameFieldId)
|
||||
? ({
|
||||
id: generateSeedId(
|
||||
workspaceId,
|
||||
@@ -155,7 +158,7 @@ export const getPageLayoutWidgetDataSeedsV2 = (
|
||||
},
|
||||
configuration: {
|
||||
configurationType: WidgetConfigurationType.PIE_CHART,
|
||||
aggregateFieldMetadataId: companyArrFieldId,
|
||||
aggregateFieldMetadataId: companyAnnualRevenueFieldId,
|
||||
aggregateOperation: AggregateOperations.SUM,
|
||||
groupByFieldMetadataId: companyNameFieldId,
|
||||
orderBy: GraphOrderBy.VALUE_DESC,
|
||||
|
||||
+7
-90
@@ -12,7 +12,6 @@ import { fromPageLayoutWidgetConfigurationToUniversalConfiguration } from 'src/e
|
||||
import { type ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
||||
import { AxisNameDisplay } from 'src/engine/metadata-modules/page-layout-widget/enums/axis-name-display.enum';
|
||||
import { BarChartLayout } from 'src/engine/metadata-modules/page-layout-widget/enums/bar-chart-layout.enum';
|
||||
import { ObjectRecordGroupByDateGranularity } from 'src/engine/metadata-modules/page-layout-widget/enums/date-granularity.enum';
|
||||
import { GraphOrderBy } from 'src/engine/metadata-modules/page-layout-widget/enums/graph-order-by.enum';
|
||||
import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';
|
||||
import { WidgetType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-type.enum';
|
||||
@@ -133,13 +132,13 @@ export const getPageLayoutWidgetDataSeeds = (
|
||||
const opportunityStageFieldId = getFieldId(opportunityObject, 'stage');
|
||||
|
||||
const companyIdFieldId = getFieldId(companyObject, 'id');
|
||||
const companyEmployeesFieldId = getFieldId(companyObject, 'employees');
|
||||
const companyArrFieldId = getFieldId(companyObject, 'annualRecurringRevenue');
|
||||
const companyAnnualRevenueFieldId = getFieldId(
|
||||
companyObject,
|
||||
'annualRevenue',
|
||||
);
|
||||
const companyLinkedinLinkFieldId = getFieldId(companyObject, 'linkedinLink');
|
||||
const companyAddressFieldId = getFieldId(companyObject, 'address');
|
||||
|
||||
const personIdFieldId = getFieldId(personObject, 'id');
|
||||
const personCityFieldId = getFieldId(personObject, 'city');
|
||||
|
||||
const opportunityIdFieldId = getFieldId(opportunityObject, 'id');
|
||||
|
||||
@@ -359,52 +358,8 @@ export const getPageLayoutWidgetDataSeeds = (
|
||||
overrides: null,
|
||||
} satisfies SeederFlatPageLayoutWidget)
|
||||
: null,
|
||||
isDefined(companyIdFieldId) &&
|
||||
isDefined(companyEmployeesFieldId) &&
|
||||
isDefined(companyAddressFieldId)
|
||||
? ({
|
||||
id: generateSeedId(
|
||||
workspaceId,
|
||||
PAGE_LAYOUT_WIDGET_SEEDS.CUSTOMER_COMPANIES_BY_SIZE,
|
||||
),
|
||||
pageLayoutTabId: generateSeedId(
|
||||
workspaceId,
|
||||
PAGE_LAYOUT_TAB_SEEDS.CUSTOMER_OVERVIEW,
|
||||
),
|
||||
title: 'Companies by Size (Stacked by City)',
|
||||
type: WidgetType.GRAPH,
|
||||
gridPosition: { row: 0, column: 6, rowSpan: 10, columnSpan: 6 },
|
||||
position: {
|
||||
layoutMode: PageLayoutTabLayoutMode.GRID,
|
||||
row: 0,
|
||||
column: 6,
|
||||
rowSpan: 10,
|
||||
columnSpan: 6,
|
||||
},
|
||||
configuration: {
|
||||
configurationType: WidgetConfigurationType.BAR_CHART,
|
||||
aggregateFieldMetadataId: companyIdFieldId,
|
||||
aggregateOperation: AggregateOperations.COUNT,
|
||||
primaryAxisGroupByFieldMetadataId: companyEmployeesFieldId,
|
||||
secondaryAxisGroupByFieldMetadataId: companyAddressFieldId,
|
||||
secondaryAxisGroupBySubFieldName: 'addressCity',
|
||||
secondaryAxisGroupByDateGranularity:
|
||||
ObjectRecordGroupByDateGranularity.DAY,
|
||||
primaryAxisOrderBy: GraphOrderBy.FIELD_ASC,
|
||||
axisNameDisplay: AxisNameDisplay.NONE,
|
||||
displayDataLabel: false,
|
||||
color: 'auto',
|
||||
layout: BarChartLayout.VERTICAL,
|
||||
timezone: 'UTC',
|
||||
firstDayOfTheWeek: CalendarStartDay.MONDAY,
|
||||
},
|
||||
objectMetadataId: companyObject?.id ?? null,
|
||||
overrides: null,
|
||||
} satisfies SeederFlatPageLayoutWidget)
|
||||
: null,
|
||||
|
||||
// Customer Analytics Tab Widgets
|
||||
isDefined(companyArrFieldId)
|
||||
isDefined(companyAnnualRevenueFieldId)
|
||||
? ({
|
||||
id: generateSeedId(
|
||||
workspaceId,
|
||||
@@ -414,7 +369,7 @@ export const getPageLayoutWidgetDataSeeds = (
|
||||
workspaceId,
|
||||
PAGE_LAYOUT_TAB_SEEDS.CUSTOMER_ANALYTICS,
|
||||
),
|
||||
title: 'Annual Recurring Revenue',
|
||||
title: 'Annual Revenue',
|
||||
type: WidgetType.GRAPH,
|
||||
gridPosition: { row: 0, column: 0, rowSpan: 4, columnSpan: 4 },
|
||||
position: {
|
||||
@@ -426,7 +381,7 @@ export const getPageLayoutWidgetDataSeeds = (
|
||||
},
|
||||
configuration: {
|
||||
configurationType: WidgetConfigurationType.AGGREGATE_CHART,
|
||||
aggregateFieldMetadataId: companyArrFieldId,
|
||||
aggregateFieldMetadataId: companyAnnualRevenueFieldId,
|
||||
aggregateOperation: AggregateOperations.SUM,
|
||||
displayDataLabel: true,
|
||||
timezone: 'UTC',
|
||||
@@ -499,44 +454,6 @@ export const getPageLayoutWidgetDataSeeds = (
|
||||
overrides: null,
|
||||
} satisfies SeederFlatPageLayoutWidget)
|
||||
: null,
|
||||
isDefined(personIdFieldId) && isDefined(personCityFieldId)
|
||||
? ({
|
||||
id: generateSeedId(
|
||||
workspaceId,
|
||||
PAGE_LAYOUT_WIDGET_SEEDS.TEAM_GEOGRAPHIC_DISTRIBUTION,
|
||||
),
|
||||
pageLayoutTabId: generateSeedId(
|
||||
workspaceId,
|
||||
PAGE_LAYOUT_TAB_SEEDS.TEAM_OVERVIEW,
|
||||
),
|
||||
title: 'Geographic Distribution',
|
||||
type: WidgetType.GRAPH,
|
||||
gridPosition: { row: 0, column: 6, rowSpan: 5, columnSpan: 6 },
|
||||
position: {
|
||||
layoutMode: PageLayoutTabLayoutMode.GRID,
|
||||
row: 0,
|
||||
column: 6,
|
||||
rowSpan: 5,
|
||||
columnSpan: 6,
|
||||
},
|
||||
configuration: {
|
||||
configurationType: WidgetConfigurationType.BAR_CHART,
|
||||
aggregateFieldMetadataId: personIdFieldId,
|
||||
aggregateOperation: AggregateOperations.COUNT,
|
||||
primaryAxisGroupByFieldMetadataId: personCityFieldId,
|
||||
primaryAxisOrderBy: GraphOrderBy.VALUE_DESC,
|
||||
axisNameDisplay: AxisNameDisplay.NONE,
|
||||
displayDataLabel: false,
|
||||
color: 'auto',
|
||||
layout: BarChartLayout.VERTICAL,
|
||||
timezone: 'UTC',
|
||||
firstDayOfTheWeek: CalendarStartDay.MONDAY,
|
||||
},
|
||||
objectMetadataId: personObject?.id ?? null,
|
||||
overrides: null,
|
||||
} satisfies SeederFlatPageLayoutWidget)
|
||||
: null,
|
||||
|
||||
// Team Metrics Tab Widgets
|
||||
isDefined(taskIdFieldId)
|
||||
? ({
|
||||
|
||||
-602
File diff suppressed because it is too large
Load Diff
-1202
File diff suppressed because it is too large
Load Diff
-1
@@ -341,7 +341,6 @@ export class TimelineActivitySeederService {
|
||||
...commonProperties,
|
||||
name: recordSeed.name,
|
||||
domainName: recordSeed.domainNamePrimaryLinkUrl,
|
||||
employees: recordSeed.employees,
|
||||
city: recordSeed.addressAddressCity,
|
||||
}),
|
||||
person: () => ({
|
||||
|
||||
+10
@@ -3,6 +3,16 @@ import { FieldMetadataType } from 'twenty-shared/types';
|
||||
import { type FieldMetadataSeed } from 'src/engine/workspace-manager/dev-seeder/metadata/types/field-metadata-seed.type';
|
||||
|
||||
export const COMPANY_CUSTOM_FIELD_SEEDS: FieldMetadataSeed[] = [
|
||||
{
|
||||
type: FieldMetadataType.NUMBER,
|
||||
name: 'employees',
|
||||
label: 'Employees',
|
||||
description: 'Number of employees in the company',
|
||||
icon: 'IconUsers',
|
||||
isActive: true,
|
||||
isNullable: true,
|
||||
isUnique: false,
|
||||
},
|
||||
{
|
||||
type: FieldMetadataType.TEXT,
|
||||
name: 'tagline',
|
||||
|
||||
-6
@@ -24,7 +24,6 @@ export const prefillCompanies = async (
|
||||
'addressAddressState',
|
||||
'addressAddressPostcode',
|
||||
'addressAddressCountry',
|
||||
'employees',
|
||||
'position',
|
||||
'createdBySource',
|
||||
'createdByWorkspaceMemberId',
|
||||
@@ -45,7 +44,6 @@ export const prefillCompanies = async (
|
||||
addressAddressState: 'CA',
|
||||
addressAddressPostcode: '94103',
|
||||
addressAddressCountry: 'United States',
|
||||
employees: 5000,
|
||||
position: 1,
|
||||
createdBySource: FieldActorSource.SYSTEM,
|
||||
createdByWorkspaceMemberId: null,
|
||||
@@ -64,7 +62,6 @@ export const prefillCompanies = async (
|
||||
addressAddressState: 'CA',
|
||||
addressAddressPostcode: '94104',
|
||||
addressAddressCountry: 'United States',
|
||||
employees: 1100,
|
||||
position: 2,
|
||||
createdBySource: FieldActorSource.SYSTEM,
|
||||
createdByWorkspaceMemberId: null,
|
||||
@@ -83,7 +80,6 @@ export const prefillCompanies = async (
|
||||
addressAddressState: null,
|
||||
addressAddressPostcode: null,
|
||||
addressAddressCountry: 'Ireland',
|
||||
employees: 8000,
|
||||
position: 3,
|
||||
createdBySource: FieldActorSource.SYSTEM,
|
||||
createdByWorkspaceMemberId: null,
|
||||
@@ -102,7 +98,6 @@ export const prefillCompanies = async (
|
||||
addressAddressState: null,
|
||||
addressAddressPostcode: '94102',
|
||||
addressAddressCountry: 'United States',
|
||||
employees: 800,
|
||||
position: 4,
|
||||
createdBySource: FieldActorSource.SYSTEM,
|
||||
createdByWorkspaceMemberId: null,
|
||||
@@ -121,7 +116,6 @@ export const prefillCompanies = async (
|
||||
addressAddressState: 'CA',
|
||||
addressAddressPostcode: '94110',
|
||||
addressAddressCountry: 'United States',
|
||||
employees: 400,
|
||||
position: 5,
|
||||
createdBySource: FieldActorSource.SYSTEM,
|
||||
createdByWorkspaceMemberId: null,
|
||||
|
||||
-6
@@ -26,7 +26,6 @@ export const prefillPeople = async (
|
||||
'id',
|
||||
'nameFirstName',
|
||||
'nameLastName',
|
||||
'city',
|
||||
'emailsPrimaryEmail',
|
||||
'avatarUrl',
|
||||
'position',
|
||||
@@ -46,7 +45,6 @@ export const prefillPeople = async (
|
||||
id: BRIAN_CHESKY_ID,
|
||||
nameFirstName: 'Brian',
|
||||
nameLastName: 'Chesky',
|
||||
city: 'San Francisco',
|
||||
emailsPrimaryEmail: 'chesky@airbnb.com',
|
||||
avatarUrl:
|
||||
'https://twentyhq.github.io/placeholder-images/founders/brian-chesky.jpg',
|
||||
@@ -65,7 +63,6 @@ export const prefillPeople = async (
|
||||
id: DARIO_AMODEI_ID,
|
||||
nameFirstName: 'Dario',
|
||||
nameLastName: 'Amodei',
|
||||
city: 'San Francisco',
|
||||
emailsPrimaryEmail: 'amodei@anthropic.com',
|
||||
avatarUrl:
|
||||
'https://twentyhq.github.io/placeholder-images/founders/dario-amodei.jpg',
|
||||
@@ -84,7 +81,6 @@ export const prefillPeople = async (
|
||||
id: PATRICK_COLLISON_ID,
|
||||
nameFirstName: 'Patrick',
|
||||
nameLastName: 'Collison',
|
||||
city: 'San Francisco',
|
||||
emailsPrimaryEmail: 'collison@stripe.com',
|
||||
avatarUrl:
|
||||
'https://twentyhq.github.io/placeholder-images/founders/patrick-collison.jpg',
|
||||
@@ -103,7 +99,6 @@ export const prefillPeople = async (
|
||||
id: DYLAN_FIELD_ID,
|
||||
nameFirstName: 'Dylan',
|
||||
nameLastName: 'Field',
|
||||
city: 'San Francisco',
|
||||
emailsPrimaryEmail: 'field@figma.com',
|
||||
avatarUrl:
|
||||
'https://twentyhq.github.io/placeholder-images/founders/dylan-field.jpg',
|
||||
@@ -122,7 +117,6 @@ export const prefillPeople = async (
|
||||
id: IVAN_ZHAO_ID,
|
||||
nameFirstName: 'Ivan',
|
||||
nameLastName: 'Zhao',
|
||||
city: 'San Francisco',
|
||||
emailsPrimaryEmail: 'zhao@notion.com',
|
||||
avatarUrl:
|
||||
'https://twentyhq.github.io/placeholder-images/founders/ivan-zhao.jpg',
|
||||
|
||||
+938
-977
File diff suppressed because it is too large
Load Diff
+4
-57
@@ -169,22 +169,6 @@ export const buildCompanyStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
employees: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'employees',
|
||||
type: FieldMetadataType.NUMBER,
|
||||
label: i18nLabel(msg`Employees`),
|
||||
description: i18nLabel(msg`Number of employees in the company`),
|
||||
icon: 'IconUsers',
|
||||
isNullable: true,
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
linkedinLink: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
@@ -201,32 +185,14 @@ export const buildCompanyStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
xLink: createStandardFieldFlatMetadata({
|
||||
annualRevenue: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'xLink',
|
||||
type: FieldMetadataType.LINKS,
|
||||
label: i18nLabel(msg`X`),
|
||||
description: i18nLabel(msg`The company Twitter/X account`),
|
||||
icon: 'IconBrandX',
|
||||
isNullable: true,
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
annualRecurringRevenue: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'annualRecurringRevenue',
|
||||
fieldName: 'annualRevenue',
|
||||
type: FieldMetadataType.CURRENCY,
|
||||
label: i18nLabel(msg`ARR`),
|
||||
description: i18nLabel(
|
||||
msg`Annual Recurring Revenue: The actual or estimated annual revenue of the company`,
|
||||
),
|
||||
label: i18nLabel(msg`Annual Revenue`),
|
||||
description: i18nLabel(msg`The company's total annual revenue`),
|
||||
icon: 'IconMoneybag',
|
||||
isNullable: true,
|
||||
},
|
||||
@@ -235,25 +201,6 @@ export const buildCompanyStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
idealCustomerProfile: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'idealCustomerProfile',
|
||||
type: FieldMetadataType.BOOLEAN,
|
||||
label: i18nLabel(msg`ICP`),
|
||||
description: i18nLabel(
|
||||
msg`Ideal Customer Profile: Indicates whether the company is the most suitable and valuable customer for you`,
|
||||
),
|
||||
icon: 'IconTarget',
|
||||
isNullable: false,
|
||||
defaultValue: false,
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
position: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
|
||||
-32
@@ -167,22 +167,6 @@ export const buildPersonStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
xLink: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'xLink',
|
||||
type: FieldMetadataType.LINKS,
|
||||
label: i18nLabel(msg`X`),
|
||||
description: "Contact's X/Twitter account",
|
||||
icon: 'IconBrandX',
|
||||
isNullable: true,
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
jobTitle: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
@@ -218,22 +202,6 @@ export const buildPersonStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
city: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'city',
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: i18nLabel(msg`City`),
|
||||
description: "Contact's city",
|
||||
icon: 'IconMap',
|
||||
isNullable: true,
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
//deprecated
|
||||
avatarUrl: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
|
||||
+6
-60
@@ -72,19 +72,6 @@ export const computeStandardCompanyViewFields = (
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allCompaniesEmployees: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'company',
|
||||
context: {
|
||||
viewName: 'allCompanies',
|
||||
viewFieldName: 'employees',
|
||||
fieldName: 'employees',
|
||||
position: 5,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
aggregateOperation: AggregateOperations.MAX,
|
||||
},
|
||||
}),
|
||||
allCompaniesLinkedinLink: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'company',
|
||||
@@ -92,7 +79,7 @@ export const computeStandardCompanyViewFields = (
|
||||
viewName: 'allCompanies',
|
||||
viewFieldName: 'linkedinLink',
|
||||
fieldName: 'linkedinLink',
|
||||
position: 6,
|
||||
position: 5,
|
||||
isVisible: true,
|
||||
size: 170,
|
||||
aggregateOperation: AggregateOperations.PERCENTAGE_EMPTY,
|
||||
@@ -105,7 +92,7 @@ export const computeStandardCompanyViewFields = (
|
||||
viewName: 'allCompanies',
|
||||
viewFieldName: 'address',
|
||||
fieldName: 'address',
|
||||
position: 7,
|
||||
position: 6,
|
||||
isVisible: true,
|
||||
size: 170,
|
||||
aggregateOperation: AggregateOperations.COUNT_NOT_EMPTY,
|
||||
@@ -219,47 +206,19 @@ export const computeStandardCompanyViewFields = (
|
||||
},
|
||||
}),
|
||||
// Business group
|
||||
companyRecordPageFieldsAnnualRecurringRevenue:
|
||||
createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'company',
|
||||
context: {
|
||||
viewName: 'companyRecordPageFields',
|
||||
viewFieldName: 'annualRecurringRevenue',
|
||||
fieldName: 'annualRecurringRevenue',
|
||||
position: 0,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
viewFieldGroupName: 'business',
|
||||
},
|
||||
}),
|
||||
companyRecordPageFieldsEmployees: createStandardViewFieldFlatMetadata({
|
||||
companyRecordPageFieldsAnnualRevenue: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'company',
|
||||
context: {
|
||||
viewName: 'companyRecordPageFields',
|
||||
viewFieldName: 'employees',
|
||||
fieldName: 'employees',
|
||||
position: 1,
|
||||
viewFieldName: 'annualRevenue',
|
||||
fieldName: 'annualRevenue',
|
||||
position: 0,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
viewFieldGroupName: 'business',
|
||||
},
|
||||
}),
|
||||
companyRecordPageFieldsIdealCustomerProfile:
|
||||
createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'company',
|
||||
context: {
|
||||
viewName: 'companyRecordPageFields',
|
||||
viewFieldName: 'idealCustomerProfile',
|
||||
fieldName: 'idealCustomerProfile',
|
||||
position: 2,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
viewFieldGroupName: 'business',
|
||||
},
|
||||
}),
|
||||
// Contact group
|
||||
companyRecordPageFieldsAddress: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
@@ -287,19 +246,6 @@ export const computeStandardCompanyViewFields = (
|
||||
viewFieldGroupName: 'contact',
|
||||
},
|
||||
}),
|
||||
companyRecordPageFieldsXLink: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'company',
|
||||
context: {
|
||||
viewName: 'companyRecordPageFields',
|
||||
viewFieldName: 'xLink',
|
||||
fieldName: 'xLink',
|
||||
position: 2,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
viewFieldGroupName: 'contact',
|
||||
},
|
||||
}),
|
||||
// System group
|
||||
companyRecordPageFieldsCreatedAt: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
|
||||
+2
-52
@@ -86,18 +86,6 @@ export const computeStandardPersonViewFields = (
|
||||
aggregateOperation: AggregateOperations.MIN,
|
||||
},
|
||||
}),
|
||||
allPeopleCity: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'person',
|
||||
context: {
|
||||
viewName: 'allPeople',
|
||||
viewFieldName: 'city',
|
||||
fieldName: 'city',
|
||||
position: 6,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allPeopleJobTitle: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'person',
|
||||
@@ -105,7 +93,7 @@ export const computeStandardPersonViewFields = (
|
||||
viewName: 'allPeople',
|
||||
viewFieldName: 'jobTitle',
|
||||
fieldName: 'jobTitle',
|
||||
position: 7,
|
||||
position: 6,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
@@ -117,19 +105,7 @@ export const computeStandardPersonViewFields = (
|
||||
viewName: 'allPeople',
|
||||
viewFieldName: 'linkedinLink',
|
||||
fieldName: 'linkedinLink',
|
||||
position: 8,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allPeopleXLink: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'person',
|
||||
context: {
|
||||
viewName: 'allPeople',
|
||||
viewFieldName: 'xLink',
|
||||
fieldName: 'xLink',
|
||||
position: 9,
|
||||
position: 7,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
@@ -163,19 +139,6 @@ export const computeStandardPersonViewFields = (
|
||||
viewFieldGroupName: 'general',
|
||||
},
|
||||
}),
|
||||
personRecordPageFieldsCity: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'person',
|
||||
context: {
|
||||
viewName: 'personRecordPageFields',
|
||||
viewFieldName: 'city',
|
||||
fieldName: 'city',
|
||||
position: 2,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
viewFieldGroupName: 'general',
|
||||
},
|
||||
}),
|
||||
personRecordPageFieldsPointOfContactForOpportunities:
|
||||
createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
@@ -338,19 +301,6 @@ export const computeStandardPersonViewFields = (
|
||||
viewFieldGroupName: 'social',
|
||||
},
|
||||
}),
|
||||
personRecordPageFieldsXLink: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'person',
|
||||
context: {
|
||||
viewName: 'personRecordPageFields',
|
||||
viewFieldName: 'xLink',
|
||||
fieldName: 'xLink',
|
||||
position: 1,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
viewFieldGroupName: 'social',
|
||||
},
|
||||
}),
|
||||
// System group
|
||||
personRecordPageFieldsCreatedAt: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
|
||||
Reference in New Issue
Block a user