Skip to content

The open alternative to Salesforce, designed for AI.

feat(twenty-server): allow shouldHideEmptyGroups in app view manifest (#21370)

Félix Malfaitcf705659769b
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-view-manifest-to-universal-flat-view.util.spec.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-view-manifest-to-universal-flat-view.util.spec.ts
index 9f9951bb0f1..be2f9c8f190 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-view-manifest-to-universal-flat-view.util.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-view-manifest-to-universal-flat-view.util.spec.ts
@@ -35,6 +35,7 @@ describe('fromViewManifestToUniversalFlatView', () => {
expect(result.icon).toBe('IconList');
expect(result.position).toBe(0);
expect(result.isCompact).toBe(false);
+ expect(result.shouldHideEmptyGroups).toBe(false);
expect(result.isCustom).toBe(true);
expect(result.visibility).toBe(ViewVisibility.WORKSPACE);
expect(result.openRecordIn).toBe(ViewOpenRecordIn.SIDE_PANEL);
@@ -53,6 +54,7 @@ describe('fromViewManifestToUniversalFlatView', () => {
icon: 'IconLayoutKanban',
position: 3,
isCompact: true,
+ shouldHideEmptyGroups: true,
visibility: ViewVisibility.UNLISTED,
openRecordIn: ViewOpenRecordIn.RECORD_PAGE,
},
@@ -64,6 +66,7 @@ describe('fromViewManifestToUniversalFlatView', () => {
expect(result.icon).toBe('IconLayoutKanban');
expect(result.position).toBe(3);
expect(result.isCompact).toBe(true);
+ expect(result.shouldHideEmptyGroups).toBe(true);
expect(result.visibility).toBe(ViewVisibility.UNLISTED);
expect(result.openRecordIn).toBe(ViewOpenRecordIn.RECORD_PAGE);
});
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-view-manifest-to-universal-flat-view.util.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-view-manifest-to-universal-flat-view.util.ts
index 0c50b797cec..e503ccc8288 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-view-manifest-to-universal-flat-view.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-view-manifest-to-universal-flat-view.util.ts
@@ -38,7 +38,7 @@ export const fromViewManifestToUniversalFlatView = ({
viewManifest.calendarFieldMetadataUniversalIdentifier ?? null,
mainGroupByFieldMetadataUniversalIdentifier:
viewManifest.mainGroupByFieldMetadataUniversalIdentifier ?? null,
- shouldHideEmptyGroups: false,
+ shouldHideEmptyGroups: viewManifest.shouldHideEmptyGroups ?? false,
anyFieldFilterValue: null,
createdByUserWorkspaceId: null,
viewFieldUniversalIdentifiers: [],
diff --git a/packages/twenty-shared/src/application/viewManifestType.ts b/packages/twenty-shared/src/application/viewManifestType.ts
index 103c07dab39..0e3db1cd658 100644
--- a/packages/twenty-shared/src/application/viewManifestType.ts
+++ b/packages/twenty-shared/src/application/viewManifestType.ts
@@ -74,6 +74,7 @@ export type ViewManifest = SyncableEntityOptions & {
visibility?: ViewVisibility;
openRecordIn?: ViewOpenRecordIn;
mainGroupByFieldMetadataUniversalIdentifier?: string;
+ shouldHideEmptyGroups?: boolean;
kanbanAggregateOperation?: AggregateOperations;
kanbanAggregateOperationFieldMetadataUniversalIdentifier?: string;
calendarLayout?: ViewCalendarLayout;