Add opened section (#7265)
When object is not part of the workspace favorite list, we want to show it in the "opened section" while its record page is accessed. This PR: - adds a new component `NavigationDrawerOpenedSection` - makes workflow versions and runs not system object + creates a prefilled view index for these - do not create workspace favorites for these so these do not appear in the workspace section <img width="1129" alt="Capture d’écran 2024-09-26 à 11 45 25" src="https://github.com/user-attachments/assets/c84d773c-0bef-4dce-b66a-55d7d00b0fb6">
This commit is contained in:
@ -41,15 +41,25 @@ export type WorkflowRunOutput = {
|
||||
@WorkspaceEntity({
|
||||
standardId: STANDARD_OBJECT_IDS.workflowRun,
|
||||
namePlural: 'workflowRuns',
|
||||
labelSingular: 'workflowRun',
|
||||
labelPlural: 'WorkflowRuns',
|
||||
labelSingular: 'Workflow Run',
|
||||
labelPlural: 'Workflow Runs',
|
||||
description: 'A workflow run',
|
||||
labelIdentifierStandardId: WORKFLOW_RUN_STANDARD_FIELD_IDS.name,
|
||||
icon: 'IconHistory',
|
||||
})
|
||||
@WorkspaceGate({
|
||||
featureFlag: FeatureFlagKey.IsWorkflowEnabled,
|
||||
})
|
||||
@WorkspaceIsSystem()
|
||||
export class WorkflowRunWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
@WorkspaceField({
|
||||
standardId: WORKFLOW_RUN_STANDARD_FIELD_IDS.name,
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Name',
|
||||
description: 'Name of the workflow run',
|
||||
icon: 'IconText',
|
||||
})
|
||||
name: string;
|
||||
|
||||
@WorkspaceField({
|
||||
standardId: WORKFLOW_RUN_STANDARD_FIELD_IDS.startedAt,
|
||||
type: FieldMetadataType.DATE_TIME,
|
||||
@ -75,7 +85,7 @@ export class WorkflowRunWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
type: FieldMetadataType.SELECT,
|
||||
label: 'Workflow run status',
|
||||
description: 'Workflow run status',
|
||||
icon: 'IconHistory',
|
||||
icon: 'IconStatusChange',
|
||||
options: [
|
||||
{
|
||||
value: WorkflowRunStatus.NOT_STARTED,
|
||||
@ -128,6 +138,17 @@ export class WorkflowRunWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
@WorkspaceIsNullable()
|
||||
output: WorkflowRunOutput | null;
|
||||
|
||||
@WorkspaceField({
|
||||
standardId: WORKFLOW_RUN_STANDARD_FIELD_IDS.position,
|
||||
type: FieldMetadataType.POSITION,
|
||||
label: 'Position',
|
||||
description: 'Workflow run position',
|
||||
icon: 'IconHierarchy2',
|
||||
})
|
||||
@WorkspaceIsSystem()
|
||||
@WorkspaceIsNullable()
|
||||
position: number | null;
|
||||
|
||||
// Relations
|
||||
@WorkspaceRelation({
|
||||
standardId: WORKFLOW_RUN_STANDARD_FIELD_IDS.workflowVersion,
|
||||
|
||||
@ -61,8 +61,8 @@ const WorkflowVersionStatusOptions = [
|
||||
@WorkspaceEntity({
|
||||
standardId: STANDARD_OBJECT_IDS.workflowVersion,
|
||||
namePlural: 'workflowVersions',
|
||||
labelSingular: 'WorkflowVersion',
|
||||
labelPlural: 'WorkflowVersions',
|
||||
labelSingular: 'Workflow Version',
|
||||
labelPlural: 'Workflow Versions',
|
||||
description: 'A workflow version',
|
||||
icon: 'IconVersions',
|
||||
labelIdentifierStandardId: WORKFLOW_VERSION_STANDARD_FIELD_IDS.name,
|
||||
@ -70,7 +70,6 @@ const WorkflowVersionStatusOptions = [
|
||||
@WorkspaceGate({
|
||||
featureFlag: FeatureFlagKey.IsWorkflowEnabled,
|
||||
})
|
||||
@WorkspaceIsSystem()
|
||||
export class WorkflowVersionWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
@WorkspaceField({
|
||||
standardId: WORKFLOW_VERSION_STANDARD_FIELD_IDS.name,
|
||||
@ -86,6 +85,7 @@ export class WorkflowVersionWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
type: FieldMetadataType.RAW_JSON,
|
||||
label: 'Version trigger',
|
||||
description: 'Json object to provide trigger',
|
||||
icon: 'IconSettingsAutomation',
|
||||
})
|
||||
@WorkspaceIsNullable()
|
||||
trigger: WorkflowTrigger | null;
|
||||
@ -95,6 +95,7 @@ export class WorkflowVersionWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
type: FieldMetadataType.RAW_JSON,
|
||||
label: 'Version steps',
|
||||
description: 'Json object to provide steps',
|
||||
icon: 'IconSettingsAutomation',
|
||||
})
|
||||
@WorkspaceIsNullable()
|
||||
steps: WorkflowStep[] | null;
|
||||
@ -104,11 +105,23 @@ export class WorkflowVersionWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
type: FieldMetadataType.SELECT,
|
||||
label: 'Version status',
|
||||
description: 'The workflow version status',
|
||||
icon: 'IconStatusChange',
|
||||
options: WorkflowVersionStatusOptions,
|
||||
defaultValue: "'DRAFT'",
|
||||
})
|
||||
status: WorkflowVersionStatus;
|
||||
|
||||
@WorkspaceField({
|
||||
standardId: WORKFLOW_VERSION_STANDARD_FIELD_IDS.position,
|
||||
type: FieldMetadataType.POSITION,
|
||||
label: 'Position',
|
||||
description: 'Workflow version position',
|
||||
icon: 'IconHierarchy2',
|
||||
})
|
||||
@WorkspaceIsSystem()
|
||||
@WorkspaceIsNullable()
|
||||
position: number | null;
|
||||
|
||||
// Relations
|
||||
@WorkspaceRelation({
|
||||
standardId: WORKFLOW_VERSION_STANDARD_FIELD_IDS.workflow,
|
||||
|
||||
@ -84,6 +84,7 @@ export class WorkflowWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
type: FieldMetadataType.MULTI_SELECT,
|
||||
label: 'Statuses',
|
||||
description: 'The current statuses of the workflow versions',
|
||||
icon: 'IconStatusChange',
|
||||
options: WorkflowStatusOptions,
|
||||
})
|
||||
@WorkspaceIsNullable()
|
||||
|
||||
Reference in New Issue
Block a user