Deprecate ObjectMetadataInterface and improve entity typing (#13310)
# Introduction Following `FieldMetadataInterface` deprecation in https://github.com/twentyhq/twenty/pull/13264 As for the previous PR will rename and remove all the file in a secondary PR to avoid conflicts and over loading this one ## Improvements Removed optional properties from the `objectMetadataEntity` model and added utils to retrieve test data ## Notes By touching to `ObjectMetadataDTO` I would have expected a twenty-front codegenerated types mutation, but it does not seem to be granular enough to null/undefined coercion
This commit is contained in:
@ -44,8 +44,12 @@ export class StandardObjectFactory {
|
||||
}
|
||||
|
||||
return {
|
||||
...workspaceEntityMetadataArgs,
|
||||
// TODO: Remove targetTableName when we remove the old metadata
|
||||
labelIdentifierFieldMetadataId: null,
|
||||
imageIdentifierFieldMetadataId: null,
|
||||
duplicateCriteria: [],
|
||||
...workspaceEntityMetadataArgs,
|
||||
description: workspaceEntityMetadataArgs.description ?? null,
|
||||
targetTableName: 'DEPRECATED',
|
||||
workspaceId: context.workspaceId,
|
||||
dataSourceId: context.dataSourceId,
|
||||
|
||||
@ -5,17 +5,29 @@ import {
|
||||
PartialFieldMetadata,
|
||||
} from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/partial-field-metadata.interface';
|
||||
|
||||
export type PartialWorkspaceEntity = Omit<
|
||||
export type PartialWorkspaceEntity = Pick<
|
||||
ObjectMetadataInterface,
|
||||
'id' | 'standardId' | 'fields' | 'isActive'
|
||||
| 'workspaceId'
|
||||
| 'nameSingular'
|
||||
| 'namePlural'
|
||||
| 'labelSingular'
|
||||
| 'labelPlural'
|
||||
| 'description'
|
||||
| 'icon'
|
||||
| 'targetTableName'
|
||||
| 'indexMetadatas'
|
||||
| 'isSystem'
|
||||
| 'isCustom'
|
||||
| 'isRemote'
|
||||
| 'isAuditLogged'
|
||||
| 'isSearchable'
|
||||
| 'duplicateCriteria'
|
||||
| 'labelIdentifierFieldMetadataId'
|
||||
| 'imageIdentifierFieldMetadataId'
|
||||
> & {
|
||||
standardId: string;
|
||||
icon?: string;
|
||||
workspaceId: string;
|
||||
dataSourceId: string;
|
||||
fields: (PartialFieldMetadata | PartialComputedFieldMetadata)[];
|
||||
labelIdentifierStandardId?: string | null;
|
||||
imageIdentifierStandardId?: string | null;
|
||||
};
|
||||
|
||||
export type ComputedPartialWorkspaceEntity = Omit<
|
||||
|
||||
Reference in New Issue
Block a user