[REQUIRES_CACHE_FLUSH][GQL_VIEW_GROUP_API_BREAKING_CHANGE] ViewGroup in v2 (#15052)
# 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
This commit is contained in:
+8
-4
@@ -58,10 +58,14 @@ export const useSetViewTypeFromLayoutOptionsMenu = () => {
|
||||
fieldMetadataId: randomFieldForKanban,
|
||||
} satisfies ViewGroup);
|
||||
|
||||
await createViewGroupRecords({
|
||||
viewGroupsToCreate,
|
||||
viewId: currentViewId,
|
||||
});
|
||||
await createViewGroupRecords(
|
||||
viewGroupsToCreate.map((viewGroup) => ({
|
||||
input: {
|
||||
...viewGroup,
|
||||
viewId: currentViewId,
|
||||
},
|
||||
})),
|
||||
);
|
||||
|
||||
return viewGroupsToCreate;
|
||||
},
|
||||
|
||||
+14
-5
@@ -106,14 +106,22 @@ export const useHandleRecordGroupField = () => {
|
||||
);
|
||||
|
||||
if (viewGroupsToCreate.length > 0) {
|
||||
await createViewGroupRecords({ viewGroupsToCreate, viewId: view.id });
|
||||
await createViewGroupRecords(
|
||||
viewGroupsToCreate.map((viewGroup) => ({
|
||||
input: {
|
||||
...viewGroup,
|
||||
viewId: view.id,
|
||||
},
|
||||
})),
|
||||
);
|
||||
}
|
||||
|
||||
if (viewGroupsToDelete.length > 0) {
|
||||
await deleteViewGroupRecords(
|
||||
viewGroupsToDelete.map((group) => ({
|
||||
id: group.id,
|
||||
viewId: view.id,
|
||||
input: {
|
||||
id: group.id,
|
||||
},
|
||||
})),
|
||||
);
|
||||
}
|
||||
@@ -151,8 +159,9 @@ export const useHandleRecordGroupField = () => {
|
||||
|
||||
await deleteViewGroupRecords(
|
||||
view.viewGroups.map((group) => ({
|
||||
id: group.id,
|
||||
viewId: view.id,
|
||||
input: {
|
||||
id: group.id,
|
||||
},
|
||||
})),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user