d532f22fbb
* fix: remove old metadata seed files * feat: wip standard to core relation * fix: lint * fix: merge * fix: remove debug files * feat: add feature flag for core object metadata * fix: remove debug * feat: always disable the standard core relation * fix: missing feature flag * fix: remove debug * fix: feature flag doesn't seems to disable relation * fix: delete .vscode folder, change this in another PR * Update packages/twenty-server/src/workspace/workspace-sync-metadata/reflective-metadata.factory.ts Co-authored-by: Weiko <corentin@twenty.com> * Update packages/twenty-server/src/workspace/workspace-sync-metadata/reflective-metadata.factory.ts Co-authored-by: Weiko <corentin@twenty.com> * Update packages/twenty-server/src/workspace/workspace-sync-metadata/workspace-sync.metadata.service.ts Co-authored-by: Weiko <corentin@twenty.com> * fix: remove optional fields from metadata entities * fix: renamed variable * fix: put back CursorScalarType * fix: delete test command * fix: remove unused workspace standard migration command * fix: drop core object metadata declaration * fix: rename variable * fix: drop creation of core datasource * fix: remove feature flag * fix: drop support of standard to core relations * feat: add user email field on workspace-member standard object * fix: update seed accordingly * fix: missing remove command file * fix: datasource label should remain nullable * fix: better asserts * Remove unused code * Remove unused code --------- Co-authored-by: Weiko <corentin@twenty.com> Co-authored-by: Charles Bochet <charles@twenty.com>
84 lines
2.7 KiB
TypeScript
84 lines
2.7 KiB
TypeScript
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
|
|
import { FieldMetadata } from 'src/workspace/workspace-sync-metadata/decorators/field-metadata.decorator';
|
|
import { IsNullable } from 'src/workspace/workspace-sync-metadata/decorators/is-nullable.decorator';
|
|
import { IsSystem } from 'src/workspace/workspace-sync-metadata/decorators/is-system.decorator';
|
|
import { ObjectMetadata } from 'src/workspace/workspace-sync-metadata/decorators/object-metadata.decorator';
|
|
import { ActivityObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/activity.object-metadata';
|
|
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
|
|
import { CompanyObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/company.object-metadata';
|
|
import { PersonObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/person.object-metadata';
|
|
import { WorkspaceMemberObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/workspace-member.object-metadata';
|
|
|
|
@ObjectMetadata({
|
|
namePlural: 'attachments',
|
|
labelSingular: 'Attachment',
|
|
labelPlural: 'Attachments',
|
|
description: 'An attachment',
|
|
icon: 'IconFileImport',
|
|
})
|
|
@IsSystem()
|
|
export class AttachmentObjectMetadata extends BaseObjectMetadata {
|
|
@FieldMetadata({
|
|
type: FieldMetadataType.TEXT,
|
|
label: 'Name',
|
|
description: 'Attachment name',
|
|
icon: 'IconFileUpload',
|
|
})
|
|
name: string;
|
|
|
|
@FieldMetadata({
|
|
type: FieldMetadataType.TEXT,
|
|
label: 'Full path',
|
|
description: 'Attachment full path',
|
|
icon: 'IconLink',
|
|
})
|
|
fullPath: string;
|
|
|
|
@FieldMetadata({
|
|
type: FieldMetadataType.TEXT,
|
|
label: 'Type',
|
|
description: 'Attachment type',
|
|
icon: 'IconList',
|
|
})
|
|
type: string;
|
|
|
|
@FieldMetadata({
|
|
type: FieldMetadataType.RELATION,
|
|
label: 'Author',
|
|
description: 'Attachment author',
|
|
icon: 'IconCircleUser',
|
|
joinColumn: 'authorId',
|
|
})
|
|
author: WorkspaceMemberObjectMetadata;
|
|
|
|
@FieldMetadata({
|
|
type: FieldMetadataType.RELATION,
|
|
label: 'Activity',
|
|
description: 'Attachment activity',
|
|
icon: 'IconNotes',
|
|
joinColumn: 'activityId',
|
|
})
|
|
@IsNullable()
|
|
activity: ActivityObjectMetadata;
|
|
|
|
@FieldMetadata({
|
|
type: FieldMetadataType.RELATION,
|
|
label: 'Person',
|
|
description: 'Attachment person',
|
|
icon: 'IconUser',
|
|
joinColumn: 'personId',
|
|
})
|
|
@IsNullable()
|
|
person: PersonObjectMetadata;
|
|
|
|
@FieldMetadata({
|
|
type: FieldMetadataType.RELATION,
|
|
label: 'Company',
|
|
description: 'Attachment company',
|
|
icon: 'IconBuildingSkyscraper',
|
|
joinColumn: 'companyId',
|
|
})
|
|
@IsNullable()
|
|
company: CompanyObjectMetadata;
|
|
}
|