feat: view groups (#7176)
Fix #4244 and #4356 This pull request introduces the new "view groups" capability, enabling the reordering, hiding, and showing of columns in Kanban mode. The core enhancement includes the addition of a new entity named `ViewGroup`, which manages column behaviors and interactions. #### Key Changes: 1. **ViewGroup Entity**: The newly added `ViewGroup` entity is responsible for handling the organization and state of columns. This includes: - The ability to reorder columns. - The option to hide or show specific columns based on user preferences. #### Conclusion: This PR adds a significant new feature that enhances the flexibility of Kanban views through the `ViewGroup` entity. We'll later add the view group logic to table view too. --------- Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
+27
@@ -126,6 +126,33 @@ export const viewPrefillData = async (
|
||||
)
|
||||
.execute();
|
||||
}
|
||||
|
||||
if (
|
||||
'groups' in viewDefinition &&
|
||||
viewDefinition.groups &&
|
||||
viewDefinition.groups.length > 0
|
||||
) {
|
||||
await entityManager
|
||||
.createQueryBuilder()
|
||||
.insert()
|
||||
.into(`${schemaName}.viewGroup`, [
|
||||
'fieldMetadataId',
|
||||
'isVisible',
|
||||
'fieldValue',
|
||||
'position',
|
||||
'viewId',
|
||||
])
|
||||
.values(
|
||||
viewDefinition.groups.map((group: any) => ({
|
||||
fieldMetadataId: group.fieldMetadataId,
|
||||
isVisible: group.isVisible,
|
||||
fieldValue: group.fieldValue,
|
||||
position: group.position,
|
||||
viewId: viewDefinition.id,
|
||||
})),
|
||||
)
|
||||
.execute();
|
||||
}
|
||||
}
|
||||
|
||||
return viewDefinitionsWithId;
|
||||
|
||||
Reference in New Issue
Block a user