Add applicationId to syncableEntity and fix syncApp deletion (#15170)
## Context - All flatEntity should extend SyncableEntity - SyncableEntity should now have applicationId and application relation - Fix syncApp deletion, should now properly use migration v2 to delete syncable entities
This commit is contained in:
+5
-2
@@ -1,4 +1,5 @@
|
||||
import { type Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
import { type FlatEntityFrom } from 'src/engine/metadata-modules/flat-entity/types/flat-entity.type';
|
||||
import { type ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
||||
import { type ViewFieldEntity } from 'src/engine/metadata-modules/view-field/entities/view-field.entity';
|
||||
import { type ViewFilterGroupEntity } from 'src/engine/metadata-modules/view-filter-group/entities/view-filter-group.entity';
|
||||
@@ -20,8 +21,10 @@ export type ViewEntityRelationProperties =
|
||||
| Workspace
|
||||
>;
|
||||
|
||||
export type FlatView = Omit<ViewEntity, ViewEntityRelationProperties> & {
|
||||
universalIdentifier: string;
|
||||
export type FlatView = FlatEntityFrom<
|
||||
ViewEntity,
|
||||
ViewEntityRelationProperties
|
||||
> & {
|
||||
viewFieldIds: string[];
|
||||
viewFilterIds: string[];
|
||||
viewGroupIds: string[];
|
||||
|
||||
+4
-2
@@ -20,9 +20,10 @@ export const fromCreateViewInputToFlatViewToCreate = ({
|
||||
);
|
||||
|
||||
const createdAt = new Date();
|
||||
const viewId = createViewInput.id ?? v4();
|
||||
|
||||
return {
|
||||
id: createViewInput.id ?? v4(),
|
||||
id: viewId,
|
||||
objectMetadataId,
|
||||
workspaceId,
|
||||
name: createViewInput.name,
|
||||
@@ -42,9 +43,10 @@ export const fromCreateViewInputToFlatViewToCreate = ({
|
||||
openRecordIn: createViewInput.openRecordIn ?? ViewOpenRecordIn.SIDE_PANEL,
|
||||
position: createViewInput.position ?? 0,
|
||||
type: createViewInput.type ?? ViewType.TABLE,
|
||||
universalIdentifier: v4(),
|
||||
universalIdentifier: createViewInput.universalIdentifier ?? viewId,
|
||||
viewFieldIds: [],
|
||||
viewFilterIds: [],
|
||||
viewGroupIds: [],
|
||||
applicationId: createViewInput.applicationId ?? null,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user