mirror of
https://github.com/lingble/twenty.git
synced 2025-11-01 05:07:56 +00:00
Remove objectMetadata isSoftDeletable
This commit is contained in:
@@ -0,0 +1,19 @@
|
|||||||
|
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||||
|
|
||||||
|
export class RemoveObjectMetadataIsSoftDeletable1726486735275
|
||||||
|
implements MigrationInterface
|
||||||
|
{
|
||||||
|
name = 'RemoveObjectMetadataIsSoftDeletable1726486735275';
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(
|
||||||
|
`ALTER TABLE "metadata"."objectMetadata" DROP COLUMN "isSoftDeletable"`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(
|
||||||
|
`ALTER TABLE "metadata"."objectMetadata" ADD "isSoftDeletable" boolean`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -33,7 +33,6 @@ export class GraphqlQueryParser {
|
|||||||
|
|
||||||
parseFilter(
|
parseFilter(
|
||||||
recordFilter: RecordFilter,
|
recordFilter: RecordFilter,
|
||||||
shouldAddDefaultSoftDeleteCondition = false,
|
|
||||||
): FindOptionsWhere<ObjectLiteral> | FindOptionsWhere<ObjectLiteral>[] {
|
): FindOptionsWhere<ObjectLiteral> | FindOptionsWhere<ObjectLiteral>[] {
|
||||||
const graphqlQueryFilterParser = new GraphqlQueryFilterParser(
|
const graphqlQueryFilterParser = new GraphqlQueryFilterParser(
|
||||||
this.fieldMetadataMap,
|
this.fieldMetadataMap,
|
||||||
@@ -41,10 +40,7 @@ export class GraphqlQueryParser {
|
|||||||
|
|
||||||
const parsedFilter = graphqlQueryFilterParser.parse(recordFilter);
|
const parsedFilter = graphqlQueryFilterParser.parse(recordFilter);
|
||||||
|
|
||||||
if (
|
if (!('deletedAt' in this.fieldMetadataMap)) {
|
||||||
!shouldAddDefaultSoftDeleteCondition ||
|
|
||||||
!('deletedAt' in this.fieldMetadataMap)
|
|
||||||
) {
|
|
||||||
return parsedFilter;
|
return parsedFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -70,10 +70,7 @@ export class GraphqlQueryFindManyResolverService {
|
|||||||
args.orderBy ?? [],
|
args.orderBy ?? [],
|
||||||
isForwardPagination,
|
isForwardPagination,
|
||||||
);
|
);
|
||||||
const where = graphqlQueryParser.parseFilter(
|
const where = graphqlQueryParser.parseFilter(args.filter ?? ({} as Filter));
|
||||||
args.filter ?? ({} as Filter),
|
|
||||||
objectMetadataItem.isSoftDeletable ?? false,
|
|
||||||
);
|
|
||||||
|
|
||||||
const cursor = this.getCursor(args);
|
const cursor = this.getCursor(args);
|
||||||
const limit = args.first ?? args.last ?? QUERY_MAX_RECORDS;
|
const limit = args.first ?? args.last ?? QUERY_MAX_RECORDS;
|
||||||
|
|||||||
@@ -55,10 +55,7 @@ export class GraphqlQueryFindOneResolverService {
|
|||||||
objectMetadataItem,
|
objectMetadataItem,
|
||||||
graphqlFields(info),
|
graphqlFields(info),
|
||||||
);
|
);
|
||||||
const where = graphqlQueryParser.parseFilter(
|
const where = graphqlQueryParser.parseFilter(args.filter ?? ({} as Filter));
|
||||||
args.filter ?? ({} as Filter),
|
|
||||||
objectMetadataItem.isSoftDeletable ?? false,
|
|
||||||
);
|
|
||||||
|
|
||||||
const objectRecord = await repository.findOne({ where, select, relations });
|
const objectRecord = await repository.findOne({ where, select, relations });
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export class FindManyQueryFactory {
|
|||||||
const argsString = this.argsStringFactory.create(
|
const argsString = this.argsStringFactory.create(
|
||||||
args,
|
args,
|
||||||
options.fieldMetadataCollection,
|
options.fieldMetadataCollection,
|
||||||
!options.withSoftDeleted && !!options.objectMetadataItem.isSoftDeletable,
|
!options.withSoftDeleted,
|
||||||
);
|
);
|
||||||
|
|
||||||
return `
|
return `
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
|
|
||||||
import { WorkspaceQueryBuilderOptions } from 'src/engine/api/graphql/workspace-query-builder/interfaces/workspace-query-builder-options.interface';
|
|
||||||
import { RecordFilter } from 'src/engine/api/graphql/workspace-query-builder/interfaces/record.interface';
|
import { RecordFilter } from 'src/engine/api/graphql/workspace-query-builder/interfaces/record.interface';
|
||||||
|
import { WorkspaceQueryBuilderOptions } from 'src/engine/api/graphql/workspace-query-builder/interfaces/workspace-query-builder-options.interface';
|
||||||
import { FindOneResolverArgs } from 'src/engine/api/graphql/workspace-resolver-builder/interfaces/workspace-resolvers-builder.interface';
|
import { FindOneResolverArgs } from 'src/engine/api/graphql/workspace-resolver-builder/interfaces/workspace-resolvers-builder.interface';
|
||||||
|
|
||||||
import { computeObjectTargetTable } from 'src/engine/utils/compute-object-target-table.util';
|
import { computeObjectTargetTable } from 'src/engine/utils/compute-object-target-table.util';
|
||||||
@@ -29,7 +29,7 @@ export class FindOneQueryFactory {
|
|||||||
const argsString = this.argsStringFactory.create(
|
const argsString = this.argsStringFactory.create(
|
||||||
args,
|
args,
|
||||||
options.fieldMetadataCollection,
|
options.fieldMetadataCollection,
|
||||||
!options.withSoftDeleted && !!options.objectMetadataItem.isSoftDeletable,
|
!options.withSoftDeleted,
|
||||||
);
|
);
|
||||||
|
|
||||||
return `
|
return `
|
||||||
|
|||||||
@@ -5,18 +5,18 @@ import { GraphQLResolveInfo } from 'graphql';
|
|||||||
import { FieldMetadataInterface } from 'src/engine/metadata-modules/field-metadata/interfaces/field-metadata.interface';
|
import { FieldMetadataInterface } from 'src/engine/metadata-modules/field-metadata/interfaces/field-metadata.interface';
|
||||||
import { ObjectMetadataInterface } from 'src/engine/metadata-modules/field-metadata/interfaces/object-metadata.interface';
|
import { ObjectMetadataInterface } from 'src/engine/metadata-modules/field-metadata/interfaces/object-metadata.interface';
|
||||||
|
|
||||||
import { isRelationFieldMetadataType } from 'src/engine/utils/is-relation-field-metadata-type.util';
|
import { getFieldArgumentsByKey } from 'src/engine/api/graphql/workspace-query-builder/utils/get-field-arguments-by-key.util';
|
||||||
|
import { computeColumnName } from 'src/engine/metadata-modules/field-metadata/utils/compute-column-name.util';
|
||||||
import { RelationMetadataType } from 'src/engine/metadata-modules/relation-metadata/relation-metadata.entity';
|
import { RelationMetadataType } from 'src/engine/metadata-modules/relation-metadata/relation-metadata.entity';
|
||||||
|
import { computeObjectTargetTable } from 'src/engine/utils/compute-object-target-table.util';
|
||||||
import {
|
import {
|
||||||
deduceRelationDirection,
|
deduceRelationDirection,
|
||||||
RelationDirection,
|
RelationDirection,
|
||||||
} from 'src/engine/utils/deduce-relation-direction.util';
|
} from 'src/engine/utils/deduce-relation-direction.util';
|
||||||
import { getFieldArgumentsByKey } from 'src/engine/api/graphql/workspace-query-builder/utils/get-field-arguments-by-key.util';
|
import { isRelationFieldMetadataType } from 'src/engine/utils/is-relation-field-metadata-type.util';
|
||||||
import { computeObjectTargetTable } from 'src/engine/utils/compute-object-target-table.util';
|
|
||||||
import { computeColumnName } from 'src/engine/metadata-modules/field-metadata/utils/compute-column-name.util';
|
|
||||||
|
|
||||||
import { FieldsStringFactory } from './fields-string.factory';
|
|
||||||
import { ArgsStringFactory } from './args-string.factory';
|
import { ArgsStringFactory } from './args-string.factory';
|
||||||
|
import { FieldsStringFactory } from './fields-string.factory';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class RelationFieldAliasFactory {
|
export class RelationFieldAliasFactory {
|
||||||
@@ -101,7 +101,7 @@ export class RelationFieldAliasFactory {
|
|||||||
const argsString = this.argsStringFactory.create(
|
const argsString = this.argsStringFactory.create(
|
||||||
args,
|
args,
|
||||||
referencedObjectMetadata.fields ?? [],
|
referencedObjectMetadata.fields ?? [],
|
||||||
!withSoftDeleted && !!referencedObjectMetadata.isSoftDeletable,
|
!withSoftDeleted,
|
||||||
);
|
);
|
||||||
const fieldsString =
|
const fieldsString =
|
||||||
await this.fieldsStringFactory.createFieldsStringRecursive(
|
await this.fieldsStringFactory.createFieldsStringRecursive(
|
||||||
|
|||||||
@@ -548,7 +548,6 @@ export class WorkspaceQueryRunnerService {
|
|||||||
options: WorkspaceQueryRunnerOptions,
|
options: WorkspaceQueryRunnerOptions,
|
||||||
): Promise<Record[] | undefined> {
|
): Promise<Record[] | undefined> {
|
||||||
const { authContext, objectMetadataItem } = options;
|
const { authContext, objectMetadataItem } = options;
|
||||||
let query: string;
|
|
||||||
|
|
||||||
assertMutationNotOnRemoteObject(objectMetadataItem);
|
assertMutationNotOnRemoteObject(objectMetadataItem);
|
||||||
|
|
||||||
@@ -564,8 +563,7 @@ export class WorkspaceQueryRunnerService {
|
|||||||
args,
|
args,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (objectMetadataItem.isSoftDeletable) {
|
const query = await this.workspaceQueryBuilderFactory.updateMany(
|
||||||
query = await this.workspaceQueryBuilderFactory.updateMany(
|
|
||||||
{
|
{
|
||||||
filter: hookedArgs.filter,
|
filter: hookedArgs.filter,
|
||||||
data: {
|
data: {
|
||||||
@@ -577,12 +575,6 @@ export class WorkspaceQueryRunnerService {
|
|||||||
atMost: maximumRecordAffected,
|
atMost: maximumRecordAffected,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
query = await this.workspaceQueryBuilderFactory.deleteMany(hookedArgs, {
|
|
||||||
...options,
|
|
||||||
atMost: maximumRecordAffected,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const repository =
|
const repository =
|
||||||
await this.twentyORMGlobalManager.getRepositoryForWorkspace(
|
await this.twentyORMGlobalManager.getRepositoryForWorkspace(
|
||||||
@@ -603,7 +595,7 @@ export class WorkspaceQueryRunnerService {
|
|||||||
await this.parseResult<PGGraphQLMutation<Record>>(
|
await this.parseResult<PGGraphQLMutation<Record>>(
|
||||||
result,
|
result,
|
||||||
objectMetadataItem,
|
objectMetadataItem,
|
||||||
objectMetadataItem.isSoftDeletable ? 'update' : 'deleteFrom',
|
'update',
|
||||||
authContext.workspace.id,
|
authContext.workspace.id,
|
||||||
)
|
)
|
||||||
)?.records;
|
)?.records;
|
||||||
@@ -648,13 +640,6 @@ export class WorkspaceQueryRunnerService {
|
|||||||
|
|
||||||
assertMutationNotOnRemoteObject(objectMetadataItem);
|
assertMutationNotOnRemoteObject(objectMetadataItem);
|
||||||
|
|
||||||
if (!objectMetadataItem.isSoftDeletable) {
|
|
||||||
throw new WorkspaceQueryRunnerException(
|
|
||||||
'This method is reserved to objects that can be soft-deleted, use delete instead',
|
|
||||||
WorkspaceQueryRunnerExceptionCode.DATA_NOT_FOUND,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const maximumRecordAffected = this.environmentService.get(
|
const maximumRecordAffected = this.environmentService.get(
|
||||||
'MUTATION_MAXIMUM_AFFECTED_RECORDS',
|
'MUTATION_MAXIMUM_AFFECTED_RECORDS',
|
||||||
);
|
);
|
||||||
@@ -711,13 +696,6 @@ export class WorkspaceQueryRunnerService {
|
|||||||
|
|
||||||
assertMutationNotOnRemoteObject(objectMetadataItem);
|
assertMutationNotOnRemoteObject(objectMetadataItem);
|
||||||
|
|
||||||
if (!objectMetadataItem.isSoftDeletable) {
|
|
||||||
throw new WorkspaceQueryRunnerException(
|
|
||||||
'This method is reserved to objects that can be soft-deleted',
|
|
||||||
WorkspaceQueryRunnerExceptionCode.DATA_NOT_FOUND,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const maximumRecordAffected = this.environmentService.get(
|
const maximumRecordAffected = this.environmentService.get(
|
||||||
'MUTATION_MAXIMUM_AFFECTED_RECORDS',
|
'MUTATION_MAXIMUM_AFFECTED_RECORDS',
|
||||||
);
|
);
|
||||||
@@ -792,7 +770,6 @@ export class WorkspaceQueryRunnerService {
|
|||||||
authContext.workspace.id,
|
authContext.workspace.id,
|
||||||
objectMetadataItem.nameSingular,
|
objectMetadataItem.nameSingular,
|
||||||
);
|
);
|
||||||
let query: string;
|
|
||||||
|
|
||||||
assertMutationNotOnRemoteObject(objectMetadataItem);
|
assertMutationNotOnRemoteObject(objectMetadataItem);
|
||||||
assertIsValidUuid(args.id);
|
assertIsValidUuid(args.id);
|
||||||
@@ -805,8 +782,7 @@ export class WorkspaceQueryRunnerService {
|
|||||||
args,
|
args,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (objectMetadataItem.isSoftDeletable) {
|
const query = await this.workspaceQueryBuilderFactory.updateOne(
|
||||||
query = await this.workspaceQueryBuilderFactory.updateOne(
|
|
||||||
{
|
{
|
||||||
id: hookedArgs.id,
|
id: hookedArgs.id,
|
||||||
data: {
|
data: {
|
||||||
@@ -815,12 +791,6 @@ export class WorkspaceQueryRunnerService {
|
|||||||
},
|
},
|
||||||
options,
|
options,
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
query = await this.workspaceQueryBuilderFactory.deleteOne(
|
|
||||||
hookedArgs,
|
|
||||||
options,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const existingRecord = await repository.findOne({
|
const existingRecord = await repository.findOne({
|
||||||
where: { id: args.id },
|
where: { id: args.id },
|
||||||
@@ -832,7 +802,7 @@ export class WorkspaceQueryRunnerService {
|
|||||||
await this.parseResult<PGGraphQLMutation<Record>>(
|
await this.parseResult<PGGraphQLMutation<Record>>(
|
||||||
result,
|
result,
|
||||||
objectMetadataItem,
|
objectMetadataItem,
|
||||||
objectMetadataItem.isSoftDeletable ? 'update' : 'deleteFrom',
|
'update',
|
||||||
authContext.workspace.id,
|
authContext.workspace.id,
|
||||||
)
|
)
|
||||||
)?.records;
|
)?.records;
|
||||||
|
|||||||
@@ -20,5 +20,4 @@ export interface ObjectMetadataInterface {
|
|||||||
isAuditLogged: boolean;
|
isAuditLogged: boolean;
|
||||||
labelIdentifierFieldMetadataId?: string | null;
|
labelIdentifierFieldMetadataId?: string | null;
|
||||||
imageIdentifierFieldMetadataId?: string | null;
|
imageIdentifierFieldMetadataId?: string | null;
|
||||||
isSoftDeletable?: boolean | null;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,9 +69,6 @@ export class ObjectMetadataEntity implements ObjectMetadataInterface {
|
|||||||
@Column({ default: true })
|
@Column({ default: true })
|
||||||
isAuditLogged: boolean;
|
isAuditLogged: boolean;
|
||||||
|
|
||||||
@Column({ nullable: true, type: 'boolean' })
|
|
||||||
isSoftDeletable?: boolean | null;
|
|
||||||
|
|
||||||
@Column({ nullable: true, type: 'uuid' })
|
@Column({ nullable: true, type: 'uuid' })
|
||||||
labelIdentifierFieldMetadataId?: string | null;
|
labelIdentifierFieldMetadataId?: string | null;
|
||||||
|
|
||||||
|
|||||||
@@ -215,7 +215,6 @@ export class ObjectMetadataService extends TypeOrmQueryService<ObjectMetadataEnt
|
|||||||
isCustom: isCustom,
|
isCustom: isCustom,
|
||||||
isSystem: false,
|
isSystem: false,
|
||||||
isRemote: objectMetadataInput.isRemote,
|
isRemote: objectMetadataInput.isRemote,
|
||||||
isSoftDeletable: true,
|
|
||||||
fields: isCustom
|
fields: isCustom
|
||||||
? // Creating default fields.
|
? // Creating default fields.
|
||||||
// No need to create a custom migration for this though as the default columns are already
|
// No need to create a custom migration for this though as the default columns are already
|
||||||
|
|||||||
@@ -21,9 +21,7 @@ import { NoteTargetWorkspaceEntity } from 'src/modules/note/standard-objects/not
|
|||||||
import { TaskTargetWorkspaceEntity } from 'src/modules/task/standard-objects/task-target.workspace-entity';
|
import { TaskTargetWorkspaceEntity } from 'src/modules/task/standard-objects/task-target.workspace-entity';
|
||||||
import { TimelineActivityWorkspaceEntity } from 'src/modules/timeline/standard-objects/timeline-activity.workspace-entity';
|
import { TimelineActivityWorkspaceEntity } from 'src/modules/timeline/standard-objects/timeline-activity.workspace-entity';
|
||||||
|
|
||||||
@WorkspaceCustomEntity({
|
@WorkspaceCustomEntity()
|
||||||
softDelete: true,
|
|
||||||
})
|
|
||||||
export class CustomWorkspaceEntity extends BaseWorkspaceEntity {
|
export class CustomWorkspaceEntity extends BaseWorkspaceEntity {
|
||||||
@WorkspaceField({
|
@WorkspaceField({
|
||||||
standardId: CUSTOM_OBJECT_STANDARD_FIELD_IDS.name,
|
standardId: CUSTOM_OBJECT_STANDARD_FIELD_IDS.name,
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
import { metadataArgsStorage } from 'src/engine/twenty-orm/storage/metadata-args.storage';
|
import { metadataArgsStorage } from 'src/engine/twenty-orm/storage/metadata-args.storage';
|
||||||
import { TypedReflect } from 'src/utils/typed-reflect';
|
import { TypedReflect } from 'src/utils/typed-reflect';
|
||||||
|
|
||||||
interface WorkspaceCustomEntityOptions {
|
export function WorkspaceCustomEntity(options = {}): ClassDecorator {
|
||||||
softDelete?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function WorkspaceCustomEntity(
|
|
||||||
options: WorkspaceCustomEntityOptions = {},
|
|
||||||
): ClassDecorator {
|
|
||||||
return (target) => {
|
return (target) => {
|
||||||
const gate = TypedReflect.getMetadata(
|
const gate = TypedReflect.getMetadata(
|
||||||
'workspace:gate-metadata-args',
|
'workspace:gate-metadata-args',
|
||||||
@@ -17,7 +11,6 @@ export function WorkspaceCustomEntity(
|
|||||||
metadataArgsStorage.addExtendedEntities({
|
metadataArgsStorage.addExtendedEntities({
|
||||||
target,
|
target,
|
||||||
gate,
|
gate,
|
||||||
softDelete: options.softDelete,
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ interface WorkspaceEntityOptions {
|
|||||||
icon?: string;
|
icon?: string;
|
||||||
labelIdentifierStandardId?: string;
|
labelIdentifierStandardId?: string;
|
||||||
imageIdentifierStandardId?: string;
|
imageIdentifierStandardId?: string;
|
||||||
softDelete?: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function WorkspaceEntity(
|
export function WorkspaceEntity(
|
||||||
@@ -48,7 +47,6 @@ export function WorkspaceEntity(
|
|||||||
isAuditLogged,
|
isAuditLogged,
|
||||||
isSystem,
|
isSystem,
|
||||||
gate,
|
gate,
|
||||||
softDelete: options.softDelete ?? true,
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,10 +20,7 @@ type EntitySchemaColumnMap = {
|
|||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class EntitySchemaColumnFactory {
|
export class EntitySchemaColumnFactory {
|
||||||
create(
|
create(fieldMetadataMap: FieldMetadataMap): EntitySchemaColumnMap {
|
||||||
fieldMetadataMap: FieldMetadataMap,
|
|
||||||
softDelete: boolean,
|
|
||||||
): EntitySchemaColumnMap {
|
|
||||||
let entitySchemaColumnMap: EntitySchemaColumnMap = {};
|
let entitySchemaColumnMap: EntitySchemaColumnMap = {};
|
||||||
|
|
||||||
const fieldMetadataCollection = Object.values(fieldMetadataMap);
|
const fieldMetadataCollection = Object.values(fieldMetadataMap);
|
||||||
@@ -31,11 +28,6 @@ export class EntitySchemaColumnFactory {
|
|||||||
for (const fieldMetadata of fieldMetadataCollection) {
|
for (const fieldMetadata of fieldMetadataCollection) {
|
||||||
const key = fieldMetadata.name;
|
const key = fieldMetadata.name;
|
||||||
|
|
||||||
// Skip deletedAt column if soft delete is not enabled
|
|
||||||
if (!softDelete && key === 'deletedAt') {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isRelationFieldMetadataType(fieldMetadata.type)) {
|
if (isRelationFieldMetadataType(fieldMetadata.type)) {
|
||||||
const relationMetadata =
|
const relationMetadata =
|
||||||
fieldMetadata.fromRelationMetadata ??
|
fieldMetadata.fromRelationMetadata ??
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ export class EntitySchemaFactory {
|
|||||||
): Promise<EntitySchema> {
|
): Promise<EntitySchema> {
|
||||||
const columns = this.entitySchemaColumnFactory.create(
|
const columns = this.entitySchemaColumnFactory.create(
|
||||||
objectMetadata.fields,
|
objectMetadata.fields,
|
||||||
objectMetadata.isSoftDeletable ?? false,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const relations = await this.entitySchemaRelationFactory.create(
|
const relations = await this.entitySchemaRelationFactory.create(
|
||||||
|
|||||||
@@ -60,9 +60,4 @@ export interface WorkspaceEntityMetadataArgs {
|
|||||||
* Image identifier.
|
* Image identifier.
|
||||||
*/
|
*/
|
||||||
readonly imageIdentifierStandardId: string | null;
|
readonly imageIdentifierStandardId: string | null;
|
||||||
|
|
||||||
/**
|
|
||||||
* Enable soft delete.
|
|
||||||
*/
|
|
||||||
readonly softDelete: boolean;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,9 +13,4 @@ export interface WorkspaceExtendedEntityMetadataArgs {
|
|||||||
* Entity gate.
|
* Entity gate.
|
||||||
*/
|
*/
|
||||||
readonly gate?: Gate;
|
readonly gate?: Gate;
|
||||||
|
|
||||||
/**
|
|
||||||
* Enable soft delete.
|
|
||||||
*/
|
|
||||||
readonly softDelete?: boolean;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,14 +150,6 @@ export class StandardFieldFactory {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
|
||||||
workspaceFieldMetadataArgs.name === 'deletedAt' &&
|
|
||||||
workspaceEntityMetadataArgs &&
|
|
||||||
!workspaceEntityMetadataArgs.softDelete
|
|
||||||
) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
type: workspaceFieldMetadataArgs.type,
|
type: workspaceFieldMetadataArgs.type,
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ export class StandardObjectFactory {
|
|||||||
isCustom: false,
|
isCustom: false,
|
||||||
isRemote: false,
|
isRemote: false,
|
||||||
isSystem: workspaceEntityMetadataArgs.isSystem ?? false,
|
isSystem: workspaceEntityMetadataArgs.isSystem ?? false,
|
||||||
isSoftDeletable: workspaceEntityMetadataArgs.softDelete,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user