[Extensibility] Support relation fields (#17056)
Closes https://github.com/twentyhq/core-team-issues/issues/2043
This commit is contained in:
@@ -15,6 +15,7 @@ export { DEFAULT_API_URL_NAME } from './constants/DefaultApiUrlName';
|
||||
export type { FieldManifest } from './fieldManifestType';
|
||||
export type { ObjectManifest } from './objectManifestType';
|
||||
export type { PackageJson } from './packageJsonType';
|
||||
export type { RelationFieldManifest } from './relationFieldManifestType';
|
||||
export type { RoleManifest } from './roleManifestType';
|
||||
export type {
|
||||
InputJsonSchema,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { type FieldManifest } from '@/application';
|
||||
import { type RelationFieldManifest } from '@/application/relationFieldManifestType';
|
||||
import { type SyncableEntityOptions } from '@/application/syncableEntityOptionsType';
|
||||
|
||||
export type ObjectManifest = SyncableEntityOptions & {
|
||||
@@ -8,5 +9,5 @@ export type ObjectManifest = SyncableEntityOptions & {
|
||||
labelPlural: string;
|
||||
description?: string;
|
||||
icon?: string;
|
||||
fields: FieldManifest[];
|
||||
fields: (FieldManifest | RelationFieldManifest)[];
|
||||
};
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { type SyncableEntityOptions } from '@/application/syncableEntityOptionsType';
|
||||
import { type FieldMetadataType } from '@/types';
|
||||
import { type RelationOnDeleteAction } from '@/types/RelationOnDeleteAction.type';
|
||||
import { type RelationType } from '@/types/RelationType';
|
||||
|
||||
export type RelationFieldManifest = SyncableEntityOptions & {
|
||||
name: string;
|
||||
label: string;
|
||||
description?: string;
|
||||
icon?: string;
|
||||
relationType: RelationType;
|
||||
targetObjectUniversalIdentifier: string;
|
||||
targetFieldLabel: string;
|
||||
targetFieldIcon?: string;
|
||||
onDelete?: RelationOnDeleteAction;
|
||||
type: FieldMetadataType;
|
||||
};
|
||||
Reference in New Issue
Block a user