Skip to content

Commit

Permalink
Add KanbanFieldMetadataId on View standard object (#4604)
Browse files Browse the repository at this point in the history
* Add KanbanFieldMetadataId on View standard object

* Deprecate Pipeline step

* Fix

* Use Constants instead of raw ids

* Fix

* Fix query runner

* Fix according to review

* Fix tests

* Fix tests

* Fix tests
  • Loading branch information
charlesBochet authored Mar 21, 2024
1 parent cc0e3c8 commit 3fa8c4b
Show file tree
Hide file tree
Showing 36 changed files with 425 additions and 1,487 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Complete step three and four with :

## Production docker containers

Prebuilt images for both Postgres, frontend, and back-end can be found on [docker hub](https://hub.docker.com/r/twentycrm/). Note that the Postgres container will not persist data if your server is not configured to be stateful (e.g. Heroku). You probably want to configure a special stateful resource for the database.
Prebuilt images for both Postgres, frontend, and back-end can be found on [docker hub](https://hub.docker.com/r/twentycrm/). Note that the Postgres container will not persist data if your server is not configured to be stateful (for example Heroku). You probably want to configure a special stateful resource for the database.

## Environment Variables

Expand Down
2 changes: 1 addition & 1 deletion packages/twenty-front/nyc.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const globalCoverage = {
};

const modulesCoverage = {
statements: 75,
statements: 70,
lines: 75,
functions: 70,
include: ['src/modules/**/*'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export enum CoreObjectNameSingular {
MessageThread = 'messageThread',
Opportunity = 'opportunity',
Person = 'person',
PipelineStep = 'pipelineStep',
View = 'view',
ViewField = 'viewField',
ViewFilter = 'viewFilter',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ personId
pointOfContactId
updatedAt
companyId
pipelineStepId
probability
closeDate
amount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ personId
pointOfContactId
updatedAt
companyId
pipelineStepId
probability
closeDate
amount
Expand Down Expand Up @@ -106,7 +105,6 @@ personId
pointOfContactId
updatedAt
companyId
pipelineStepId
probability
closeDate
amount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,23 +401,6 @@ export const getObjectMetadataItemsMock = () => {
fromRelationMetadata: null,
toRelationMetadata: null,
},
{
__typename: 'field',
id: '20202020-0a2e-4676-8011-3fdb2c30d7f8',
type: 'UUID',
name: 'pipelineStepId',
label: 'Pipeline Step ID (foreign key)',
description: 'Foreign key for pipeline step',
icon: null,
isCustom: false,
isActive: true,
isSystem: true,
isNullable: true,
createdAt: '2023-11-30T11:13:15.308Z',
updatedAt: '2023-11-30T11:13:15.308Z',
fromRelationMetadata: null,
toRelationMetadata: null,
},
{
__typename: 'field',
id: '20202020-3b9c-4e58-a3d2-c617d3b596b1',
Expand All @@ -436,32 +419,63 @@ export const getObjectMetadataItemsMock = () => {
toRelationMetadata: null,
},
{
__typename: 'field',
id: '20202020-0a2e-4676-8011-3fdb2c30c258',
type: 'RELATION',
name: 'pipelineStep',
label: 'Pipeline Step',
description: 'Opportunity pipeline step',
icon: 'IconKanban',
isCustom: false,
isActive: true,
isSystem: true,
isNullable: true,
createdAt: '2023-11-30T11:13:15.308Z',
updatedAt: '2023-11-30T11:13:15.308Z',
fromRelationMetadata: null,
toRelationMetadata: {
__typename: 'relation',
id: 'dfb44970-3e09-49f2-9f1d-51c8c451b8f5',
relationType: 'ONE_TO_MANY',
fromObjectMetadata: {
__typename: 'object',
id: '20202020-1029-4661-9e91-83bad932bdcd',
dataSourceId: '20202020-7f63-47a9-b1b3-6c7290ca9fb1',
nameSingular: 'pipelineStep',
namePlural: 'pipelineSteps',
__typename: 'fieldEdge',
node: {
__typename: 'field',
id: '20202020-46cc-42bb-90d5-c724921a012d',
type: 'SELECT',
name: 'stage',
label: 'Stage',
description: 'Opportunity stage',
icon: 'IconProgressCheck',
isCustom: false,
isActive: true,
isSystem: false,
isNullable: false,
createdAt: '2024-03-21T16:48:40.384Z',
updatedAt: '2024-03-21T16:48:40.384Z',
defaultValue: {
value: 'NEW',
},
fromFieldMetadataId: '20202020-22c4-443a-b114-43c97dda5867',
options: [
{
id: '20202020-aa3b-4c0b-bd90-9d071e3b9bf2',
color: 'red',
label: 'New',
value: 'NEW',
position: 0,
},
{
id: '20202020-8f9b-4bc3-b0a0-ce6a5085c1cf',
color: 'purple',
label: 'Screening',
value: 'SCREENING',
position: 1,
},
{
id: '20202020-9797-448d-81e4-49b055a1d19b',
color: 'sky',
label: 'Meeting',
value: 'MEETING',
position: 2,
},
{
id: '20202020-d542-479c-bc88-3c6d4ee78d09',
color: 'turquoise',
label: 'Proposal',
value: 'PROPOSAL',
position: 3,
},
{
id: '20202020-b69a-4c9c-ac16-adcba0ec972d',
color: 'yellow',
label: 'Customer',
value: 'CUSTOMER',
position: 4,
},
],
fromRelationMetadata: null,
toRelationMetadata: null,
},
},
{
Expand Down Expand Up @@ -3537,155 +3551,6 @@ export const getObjectMetadataItemsMock = () => {
},
],
},
{
__typename: 'object',
id: '20202020-1029-4661-9e91-83bad932bdcd',
dataSourceId: '20202020-7f63-47a9-b1b3-6c7290ca9fb1',
nameSingular: 'pipelineStep',
namePlural: 'pipelineSteps',
labelSingular: 'Pipeline Step',
labelPlural: 'Pipeline Steps',
description: 'A pipeline step',
icon: 'IconLayoutKanban',
isCustom: false,
isActive: true,
isSystem: true,
createdAt: '2023-11-30T11:13:15.206Z',
updatedAt: '2023-11-30T11:13:15.206Z',
fields: [
{
__typename: 'field',
id: '20202020-f294-430e-b800-3a411fc05ad3',
type: 'TEXT',
name: 'name',
label: 'Name',
description: 'Pipeline Step name',
icon: 'IconCurrencyDollar',
isCustom: false,
isActive: true,
isSystem: false,
isNullable: false,
createdAt: '2023-11-30T11:13:15.337Z',
updatedAt: '2023-11-30T11:13:15.337Z',
fromRelationMetadata: null,
toRelationMetadata: null,
},
{
__typename: 'field',
id: '20202020-039a-4fbd-b4c1-66dfa9e4bd3f',
type: 'UUID',
name: 'id',
label: 'Id',
description: null,
icon: null,
isCustom: false,
isActive: true,
isSystem: true,
isNullable: false,
createdAt: '2023-11-30T11:13:15.337Z',
updatedAt: '2023-11-30T11:13:15.337Z',
fromRelationMetadata: null,
toRelationMetadata: null,
},
{
__typename: 'field',
id: '20202020-816f-4861-9b36-4a2f8ae2791c',
type: 'DATE_TIME',
name: 'createdAt',
label: 'Creation date',
description: null,
icon: 'IconCalendar',
isCustom: false,
isActive: true,
isSystem: true,
isNullable: false,
createdAt: '2023-11-30T11:13:15.337Z',
updatedAt: '2023-11-30T11:13:15.337Z',
fromRelationMetadata: null,
toRelationMetadata: null,
},
{
__typename: 'field',
id: '20202020-22c4-443a-b114-43c97dda5867',
type: 'RELATION',
name: 'opportunities',
label: 'Opportunities',
description: 'Opportunities linked to the step.',
icon: 'IconTargetArrow',
isCustom: false,
isActive: true,
isSystem: false,
isNullable: true,
createdAt: '2023-11-30T11:13:15.337Z',
updatedAt: '2023-11-30T11:13:15.337Z',
fromRelationMetadata: {
__typename: 'relation',
id: 'dfb44970-3e09-49f2-9f1d-51c8c451b8f5',
relationType: 'ONE_TO_MANY',
toObjectMetadata: {
__typename: 'object',
id: '20202020-cae9-4ff4-9579-f7d9fe44c937',
dataSourceId: '20202020-7f63-47a9-b1b3-6c7290ca9fb1',
nameSingular: 'opportunity',
namePlural: 'opportunities',
},
toFieldMetadataId: '20202020-0a2e-4676-8011-3fdb2c30c258',
},
toRelationMetadata: null,
},
{
__typename: 'field',
id: '20202020-6296-4cab-aafb-121ef5822b13',
type: 'NUMBER',
name: 'position',
label: 'Position',
description: 'Pipeline Step position',
icon: 'IconHierarchy2',
isCustom: false,
isActive: true,
isSystem: false,
isNullable: false,
createdAt: '2023-11-30T11:13:15.337Z',
updatedAt: '2023-11-30T11:13:15.337Z',
fromRelationMetadata: null,
toRelationMetadata: null,
},
{
__typename: 'field',
id: '20202020-5b93-4b28-8c45-7988ea68f91b',
type: 'TEXT',
name: 'color',
label: 'Color',
description: 'Pipeline Step color',
icon: 'IconColorSwatch',
isCustom: false,
isActive: true,
isSystem: false,
isNullable: false,
createdAt: '2023-11-30T11:13:15.337Z',
updatedAt: '2023-11-30T11:13:15.337Z',
fromRelationMetadata: null,
toRelationMetadata: null,
},
{
__typename: 'field',
id: '20202020-2d73-4829-b774-522c2f5627d7',
type: 'DATE_TIME',
name: 'updatedAt',
label: 'Update date',
description: null,
icon: 'IconCalendar',
isCustom: false,
isActive: true,
isSystem: true,
isNullable: false,
createdAt: '2023-11-30T11:13:15.337Z',
updatedAt: '2023-11-30T11:13:15.337Z',
fromRelationMetadata: null,
toRelationMetadata: null,
},
],
},
];

// Todo fix typing here (the backend is not in sync with the frontend)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const query = gql`
pointOfContactId
updatedAt
companyId
pipelineStepId
stage
probability
closeDate
amount {
Expand All @@ -52,7 +52,7 @@ export const query = gql`
pointOfContactId
updatedAt
companyId
pipelineStepId
stage
probability
closeDate
amount {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,5 @@ export const filterAvailableTableColumns = (
return false;
}

if (
isFieldRelation(columnDefinition) &&
columnDefinition.metadata?.fieldName === 'pipelineStep'
) {
return false;
}

return true;
};
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const query = gql`
pointOfContactId
updatedAt
companyId
pipelineStepId
stage
probability
closeDate
amount {
Expand All @@ -49,7 +49,7 @@ export const query = gql`
pointOfContactId
updatedAt
companyId
pipelineStepId
stage
probability
closeDate
amount {
Expand Down
Loading

0 comments on commit 3fa8c4b

Please sign in to comment.