Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workflow and version as standard object #6412

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

thomtrp
Copy link
Contributor

@thomtrp thomtrp commented Jul 25, 2024

As title

Hidden behind a feature flag.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This pull request introduces workflow and version as standard objects, controlled by a feature flag.

  • Added workflowPrefillData function in packages/twenty-server/src/database/commands/data-seed-dev-workspace.command.ts for seeding workflow data.
  • Introduced IsWorkflowEnabled feature flag in packages/twenty-server/src/database/typeorm-seeds/core/feature-flags.ts.
  • Updated FeatureFlagKeys enum in packages/twenty-server/src/engine/core-modules/feature-flag/feature-flag.entity.ts to include IsWorkflowEnabled.
  • Added new entities WorkflowWorkspaceEntity and WorkflowVersionWorkspaceEntity in packages/twenty-server/src/modules/workflow/standard-objects/.
  • Modified multiple files to include new relations to WorkflowWorkspaceEntity, ensuring integration with existing entities like ActivityTargetWorkspaceEntity and AttachmentWorkspaceEntity.

19 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link
Contributor

@martmull martmull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thomtrp thomtrp force-pushed the tt-workflow-and-version-as-standard-objects branch from 0bebb4f to b87e720 Compare July 25, 2024 16:20
@thomtrp thomtrp merged commit ce68f8a into main Jul 25, 2024
6 checks passed
@thomtrp thomtrp deleted the tt-workflow-and-version-as-standard-objects branch July 25, 2024 16:33
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this file be empty ?

Comment on lines +18 to +29
@WorkspaceGate({
featureFlag: FeatureFlagKeys.IsWorkflowEnabled,
})
@WorkspaceEntity({
standardId: STANDARD_OBJECT_IDS.workflowVersion,
namePlural: 'workflowVersions',
labelSingular: 'WorkflowVersion',
labelPlural: 'WorkflowVersions',
description: 'A workflow version',
icon: 'IconVersions',
labelIdentifierStandardId: WORKFLOW_VERSION_STANDARD_FIELD_IDS.name,
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the gate should be placed below the @WorkspaceEntity

Suggested change
@WorkspaceGate({
featureFlag: FeatureFlagKeys.IsWorkflowEnabled,
})
@WorkspaceEntity({
standardId: STANDARD_OBJECT_IDS.workflowVersion,
namePlural: 'workflowVersions',
labelSingular: 'WorkflowVersion',
labelPlural: 'WorkflowVersions',
description: 'A workflow version',
icon: 'IconVersions',
labelIdentifierStandardId: WORKFLOW_VERSION_STANDARD_FIELD_IDS.name,
})
@WorkspaceEntity({
standardId: STANDARD_OBJECT_IDS.workflowVersion,
namePlural: 'workflowVersions',
labelSingular: 'WorkflowVersion',
labelPlural: 'WorkflowVersions',
description: 'A workflow version',
icon: 'IconVersions',
labelIdentifierStandardId: WORKFLOW_VERSION_STANDARD_FIELD_IDS.name,
})
@WorkspaceGate({
featureFlag: FeatureFlagKeys.IsWorkflowEnabled,
})

Comment on lines +24 to +35
@WorkspaceGate({
featureFlag: FeatureFlagKeys.IsWorkflowEnabled,
})
@WorkspaceEntity({
standardId: STANDARD_OBJECT_IDS.workflow,
namePlural: 'workflows',
labelSingular: 'Workflow',
labelPlural: 'Workflows',
description: 'A workflow',
icon: 'IconSettingsAutomation',
labelIdentifierStandardId: WORKFLOW_STANDARD_FIELD_IDS.name,
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Suggested change
@WorkspaceGate({
featureFlag: FeatureFlagKeys.IsWorkflowEnabled,
})
@WorkspaceEntity({
standardId: STANDARD_OBJECT_IDS.workflow,
namePlural: 'workflows',
labelSingular: 'Workflow',
labelPlural: 'Workflows',
description: 'A workflow',
icon: 'IconSettingsAutomation',
labelIdentifierStandardId: WORKFLOW_STANDARD_FIELD_IDS.name,
})
@WorkspaceEntity({
standardId: STANDARD_OBJECT_IDS.workflow,
namePlural: 'workflows',
labelSingular: 'Workflow',
labelPlural: 'Workflows',
description: 'A workflow',
icon: 'IconSettingsAutomation',
labelIdentifierStandardId: WORKFLOW_STANDARD_FIELD_IDS.name,
})
@WorkspaceGate({
featureFlag: FeatureFlagKeys.IsWorkflowEnabled,
})

inverseSideFieldKey: 'favorites',
})
@WorkspaceIsNullable()
workflow: Relation<WorkflowWorkspaceEntity> | null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

inverseSideFieldKey: 'attachments',
})
@WorkspaceIsNullable()
workflow: Relation<WorkflowWorkspaceEntity> | null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

inverseSideFieldKey: 'activityTargets',
})
@WorkspaceIsNullable()
workflow: Relation<WorkflowWorkspaceEntity> | null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also have to gate the relations

inverseSideFieldKey: 'timelineActivities',
})
@WorkspaceIsNullable()
workflow: Relation<WorkflowWorkspaceEntity> | null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

charlesBochet added a commit that referenced this pull request Jul 25, 2024
We have recently merged
[#workflow](#6412) but we should
put the workflow standard object behind a feature flag for now

---------

Co-authored-by: bosiraphael <raphael.bosi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants