-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Conversation
There was a problem hiding this 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 inpackages/twenty-server/src/database/commands/data-seed-dev-workspace.command.ts
for seeding workflow data. - Introduced
IsWorkflowEnabled
feature flag inpackages/twenty-server/src/database/typeorm-seeds/core/feature-flags.ts
. - Updated
FeatureFlagKeys
enum inpackages/twenty-server/src/engine/core-modules/feature-flag/feature-flag.entity.ts
to includeIsWorkflowEnabled
. - Added new entities
WorkflowWorkspaceEntity
andWorkflowVersionWorkspaceEntity
inpackages/twenty-server/src/modules/workflow/standard-objects/
. - Modified multiple files to include new relations to
WorkflowWorkspaceEntity
, ensuring integration with existing entities likeActivityTargetWorkspaceEntity
andAttachmentWorkspaceEntity
.
19 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
0bebb4f
to
b87e720
Compare
There was a problem hiding this comment.
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 ?
@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, | ||
}) |
There was a problem hiding this comment.
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
@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, | |
}) |
@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, | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
@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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
We have recently merged [#workflow](#6412) but we should put the workflow standard object behind a feature flag for now --------- Co-authored-by: bosiraphael <[email protected]>
As title
Hidden behind a feature flag.