db5338cf32
## Group records by relation (Kanban + Table)
Adds grouping by `MANY_TO_ONE` relation fields on both board and table
views, reusing the existing `ViewGroup` storage (`fieldValue = related
record id`).
- **New group** record picker to create relation-backed groups (board
column + table row)
- Relation-aware group headers (name/avatar), filtering, and drag-drop
(writes the FK join column) — all using one canonical `${name}Id` column
- Sort menu hides alphabetical options when grouping by a relation (no
comparable title)
- A group whose backing record no longer exists renders a "Deleted" chip
instead of a blank header
- **Backend:** allow `MANY_TO_ONE` relations as the Kanban
`mainGroupByField` in the flat-view validator
https://github.com/user-attachments/assets/267077a6-2667-4506-b178-eee420a16f20
<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/twentyhq/twenty/pull/22123?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
16 lines
585 B
TypeScript
16 lines
585 B
TypeScript
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
|
|
import { isManyToOneRelationField } from '@/object-metadata/utils/isManyToOneRelationField';
|
|
import { computeRelationGqlFieldJoinColumnName } from 'twenty-shared/utils';
|
|
|
|
export const getFieldMetadataItemGqlFieldName = (
|
|
fieldMetadataItem: Pick<FieldMetadataItem, 'name' | 'type' | 'relation'>,
|
|
): string => {
|
|
if (isManyToOneRelationField(fieldMetadataItem)) {
|
|
return computeRelationGqlFieldJoinColumnName({
|
|
name: fieldMetadataItem.name,
|
|
});
|
|
}
|
|
|
|
return fieldMetadataItem.name;
|
|
};
|