chore(*): remove unused code (#6781)
The code removed in the PR was flagged as unused by the JetBrains inspector. I did a QA on the dev environment but other checks are highly recommended. There is one commit by scope to make the review easier. --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -36,8 +36,4 @@ export class WorkspaceDataSource extends DataSource {
|
||||
): WorkspaceEntityManager {
|
||||
return new WorkspaceEntityManager(this.internalContext, this, queryRunner);
|
||||
}
|
||||
|
||||
getWorkspaceId(): string {
|
||||
return this.internalContext.workspaceId;
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,9 +57,7 @@ export function WorkspaceField<T extends FieldMetadataType>(
|
||||
) ?? false;
|
||||
|
||||
const defaultValue = (options.defaultValue ??
|
||||
generateDefaultValue(
|
||||
options.type,
|
||||
)) as FieldMetadataDefaultValue<'default'> | null;
|
||||
generateDefaultValue(options.type)) as FieldMetadataDefaultValue | null;
|
||||
|
||||
metadataArgsStorage.addFields({
|
||||
target: object.constructor,
|
||||
|
||||
@ -3,10 +3,6 @@ import { metadataArgsStorage } from 'src/engine/twenty-orm/storage/metadata-args
|
||||
import { convertClassNameToObjectMetadataName } from 'src/engine/workspace-manager/workspace-sync-metadata/utils/convert-class-to-object-metadata-name.util';
|
||||
import { TypedReflect } from 'src/utils/typed-reflect';
|
||||
|
||||
export interface WorkspaceIndexOptions {
|
||||
columns?: string[];
|
||||
}
|
||||
|
||||
export function WorkspaceIndex(): PropertyDecorator;
|
||||
export function WorkspaceIndex(columns: string[]): ClassDecorator;
|
||||
export function WorkspaceIndex(
|
||||
|
||||
@ -68,10 +68,6 @@ export class MetadataArgsStorage {
|
||||
target: Function | string,
|
||||
): WorkspaceExtendedEntityMetadataArgs | undefined;
|
||||
|
||||
filterExtendedEntities(
|
||||
target: (Function | string)[],
|
||||
): WorkspaceExtendedEntityMetadataArgs[];
|
||||
|
||||
filterExtendedEntities(
|
||||
target: (Function | string) | (Function | string)[],
|
||||
):
|
||||
@ -85,8 +81,6 @@ export class MetadataArgsStorage {
|
||||
|
||||
filterFields(target: Function | string): WorkspaceFieldMetadataArgs[];
|
||||
|
||||
filterFields(target: (Function | string)[]): WorkspaceFieldMetadataArgs[];
|
||||
|
||||
filterFields(
|
||||
target: (Function | string) | (Function | string)[],
|
||||
): WorkspaceFieldMetadataArgs[] {
|
||||
@ -107,8 +101,6 @@ export class MetadataArgsStorage {
|
||||
|
||||
filterIndexes(target: Function | string): WorkspaceIndexMetadataArgs[];
|
||||
|
||||
filterIndexes(target: (Function | string)[]): WorkspaceIndexMetadataArgs[];
|
||||
|
||||
filterIndexes(
|
||||
target: (Function | string) | (Function | string)[],
|
||||
): WorkspaceIndexMetadataArgs[] {
|
||||
@ -119,10 +111,6 @@ export class MetadataArgsStorage {
|
||||
target: Function | string,
|
||||
): WorkspaceDynamicRelationMetadataArgs[];
|
||||
|
||||
filterDynamicRelations(
|
||||
target: (Function | string)[],
|
||||
): WorkspaceDynamicRelationMetadataArgs[];
|
||||
|
||||
filterDynamicRelations(
|
||||
target: (Function | string) | (Function | string)[],
|
||||
): WorkspaceDynamicRelationMetadataArgs[] {
|
||||
@ -133,10 +121,6 @@ export class MetadataArgsStorage {
|
||||
target: Function | string,
|
||||
): WorkspaceJoinColumnsMetadataArgs[];
|
||||
|
||||
filterJoinColumns(
|
||||
target: (Function | string)[],
|
||||
): WorkspaceJoinColumnsMetadataArgs[];
|
||||
|
||||
filterJoinColumns(
|
||||
target: (Function | string) | (Function | string)[],
|
||||
): WorkspaceJoinColumnsMetadataArgs[] {
|
||||
|
||||
@ -6,15 +6,6 @@ export class WorkspaceEntitiesStorage {
|
||||
Map<string, EntitySchema>
|
||||
>();
|
||||
|
||||
static getEntitySchema(
|
||||
workspaceId: string,
|
||||
objectMetadataName: string,
|
||||
): EntitySchema | undefined {
|
||||
const workspace = this.workspaceEntities.get(workspaceId);
|
||||
|
||||
return workspace?.get(objectMetadataName);
|
||||
}
|
||||
|
||||
static setEntitySchema(
|
||||
workspaceId: string,
|
||||
objectMetadataName: string,
|
||||
@ -38,12 +29,4 @@ export class WorkspaceEntitiesStorage {
|
||||
([, schema]) => schema.options.name === target.options.name,
|
||||
)?.[0];
|
||||
}
|
||||
|
||||
static getEntities(workspaceId: string): EntitySchema[] {
|
||||
return Array.from(this.workspaceEntities.get(workspaceId)?.values() || []);
|
||||
}
|
||||
|
||||
static clearWorkspace(workspaceId: string): void {
|
||||
this.workspaceEntities.delete(workspaceId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user