Update workspace entities to make all TEXT nullable (#16144)
Follow up on #15926 --------- Co-authored-by: Etienne <45695613+etiennejouan@users.noreply.github.com> Co-authored-by: guillim <guigloo@msn.com>
This commit is contained in:
+4
-3
@@ -1,19 +1,19 @@
|
||||
import { registerEnumType } from '@nestjs/graphql';
|
||||
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import { STANDARD_OBJECT_IDS } from 'twenty-shared/metadata';
|
||||
import {
|
||||
ActorMetadata,
|
||||
FieldMetadataType,
|
||||
RelationOnDeleteAction,
|
||||
} from 'twenty-shared/types';
|
||||
import { type WorkflowRunStepInfos } from 'twenty-shared/workflow';
|
||||
import { STANDARD_OBJECT_IDS } from 'twenty-shared/metadata';
|
||||
|
||||
import { RelationType } from 'src/engine/metadata-modules/field-metadata/interfaces/relation-type.interface';
|
||||
import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/relation.interface';
|
||||
|
||||
import { SEARCH_VECTOR_FIELD } from 'src/engine/metadata-modules/search-field-metadata/constants/search-vector-field.constants';
|
||||
import { IndexType } from 'src/engine/metadata-modules/index-metadata/types/indexType.types';
|
||||
import { SEARCH_VECTOR_FIELD } from 'src/engine/metadata-modules/search-field-metadata/constants/search-vector-field.constants';
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { WorkspaceEntity } from 'src/engine/twenty-orm/decorators/workspace-entity.decorator';
|
||||
import { WorkspaceFieldIndex } from 'src/engine/twenty-orm/decorators/workspace-field-index.decorator';
|
||||
@@ -103,7 +103,8 @@ export class WorkflowRunWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
description: msg`Name of the workflow run`,
|
||||
icon: 'IconSettingsAutomation',
|
||||
})
|
||||
name: string;
|
||||
@WorkspaceIsNullable()
|
||||
name: string | null;
|
||||
|
||||
@WorkspaceField({
|
||||
standardId: WORKFLOW_RUN_STANDARD_FIELD_IDS.enqueuedAt,
|
||||
|
||||
+4
-3
@@ -1,13 +1,13 @@
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import { FieldMetadataType, RelationOnDeleteAction } from 'twenty-shared/types';
|
||||
import { STANDARD_OBJECT_IDS } from 'twenty-shared/metadata';
|
||||
import { FieldMetadataType, RelationOnDeleteAction } from 'twenty-shared/types';
|
||||
|
||||
import { RelationType } from 'src/engine/metadata-modules/field-metadata/interfaces/relation-type.interface';
|
||||
import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/relation.interface';
|
||||
|
||||
import { SEARCH_VECTOR_FIELD } from 'src/engine/metadata-modules/search-field-metadata/constants/search-vector-field.constants';
|
||||
import { type FieldMetadataComplexOption } from 'src/engine/metadata-modules/field-metadata/dtos/options.input';
|
||||
import { IndexType } from 'src/engine/metadata-modules/index-metadata/types/indexType.types';
|
||||
import { SEARCH_VECTOR_FIELD } from 'src/engine/metadata-modules/search-field-metadata/constants/search-vector-field.constants';
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { WorkspaceEntity } from 'src/engine/twenty-orm/decorators/workspace-entity.decorator';
|
||||
import { WorkspaceFieldIndex } from 'src/engine/twenty-orm/decorators/workspace-field-index.decorator';
|
||||
@@ -90,7 +90,8 @@ export class WorkflowVersionWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
description: msg`The workflow version name`,
|
||||
icon: 'IconSettingsAutomation',
|
||||
})
|
||||
name: string;
|
||||
@WorkspaceIsNullable()
|
||||
name: string | null;
|
||||
|
||||
@WorkspaceField({
|
||||
standardId: WORKFLOW_VERSION_STANDARD_FIELD_IDS.trigger,
|
||||
|
||||
+2
@@ -126,6 +126,7 @@ export class WorkflowVersionWorkspaceService {
|
||||
|
||||
return {
|
||||
...draftWorkflowVersion,
|
||||
name: draftWorkflowVersion.name ?? '',
|
||||
steps: newWorkflowVersionSteps,
|
||||
trigger: newWorkflowVersionTrigger,
|
||||
};
|
||||
@@ -289,6 +290,7 @@ export class WorkflowVersionWorkspaceService {
|
||||
|
||||
return {
|
||||
...newDraftVersion,
|
||||
name: newDraftVersion.name ?? '',
|
||||
steps: remappedSteps,
|
||||
trigger: remappedTrigger ?? null,
|
||||
};
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { type ActorMetadata } from 'twenty-shared/types';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
import { StepStatus, type WorkflowRunStepInfo } from 'twenty-shared/workflow';
|
||||
import { type QueryDeepPartialEntity } from 'typeorm/query-builder/QueryPartialEntity';
|
||||
import { v4 } from 'uuid';
|
||||
import { type ActorMetadata } from 'twenty-shared/types';
|
||||
|
||||
import { WithLock } from 'src/engine/core-modules/cache-lock/with-lock.decorator';
|
||||
import { MetricsService } from 'src/engine/core-modules/metrics/metrics.service';
|
||||
@@ -109,7 +109,7 @@ export class WorkflowRunWorkspaceService {
|
||||
order: { createdAt: 'desc' },
|
||||
});
|
||||
|
||||
const workflowRunCountMatch = lastWorkflowRun?.name.match(/#(\d+)/);
|
||||
const workflowRunCountMatch = lastWorkflowRun?.name?.match(/#(\d+)/);
|
||||
|
||||
const workflowRunCount = workflowRunCountMatch
|
||||
? parseInt(workflowRunCountMatch[1], 10)
|
||||
|
||||
Reference in New Issue
Block a user