7d747c9876
# Introduction Adding view-group to core engine v2 Following https://github.com/twentyhq/twenty/pull/15010 ( same pattern ) ## What's done - Created flat-view-group - flat view group runner - flat view group builder - create view group service v2 and input transpilers - refactor the existing view group resolver to fix standard ( BREAKING_CHANGE on graphql api update especially ) REST stays the same - refactored the front to consume the mutations autogenerated close https://github.com/twentyhq/core-team-issues/issues/1665
22 lines
878 B
TypeScript
22 lines
878 B
TypeScript
import { removePropertiesFromRecord } from 'twenty-shared/utils';
|
|
|
|
import { VIEW_GROUP_ENTITY_RELATION_PROPERTIES } from 'src/engine/metadata-modules/flat-view-group/constants/view-group-entity-relation-properties.constant';
|
|
import { type FlatViewGroup } from 'src/engine/metadata-modules/flat-view-group/types/flat-view-group.type';
|
|
import { type ViewGroupEntity } from 'src/engine/metadata-modules/view-group/entities/view-group.entity';
|
|
|
|
export const fromViewGroupEntityToFlatViewGroup = (
|
|
viewGroupEntity: ViewGroupEntity,
|
|
): FlatViewGroup => {
|
|
const viewGroupEntityWithoutRelations = removePropertiesFromRecord(
|
|
viewGroupEntity,
|
|
VIEW_GROUP_ENTITY_RELATION_PROPERTIES,
|
|
);
|
|
|
|
return {
|
|
...viewGroupEntityWithoutRelations,
|
|
universalIdentifier:
|
|
viewGroupEntityWithoutRelations.universalIdentifier ??
|
|
viewGroupEntityWithoutRelations.id,
|
|
};
|
|
};
|