From 0a1599469568430a23a1fd7d86569197bf63781a Mon Sep 17 00:00:00 2001 From: Charles Bochet Date: Sat, 23 Mar 2024 20:36:14 +0100 Subject: [PATCH] Allow usage of multiple select fields on Kanban board --- .../components/RecordIndexBoardContainer.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexBoardContainer.tsx b/packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexBoardContainer.tsx index 2fd30265fc..57b8ffe4cb 100644 --- a/packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexBoardContainer.tsx +++ b/packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexBoardContainer.tsx @@ -1,3 +1,5 @@ +import { useRecoilValue } from 'recoil'; + import { useObjectMetadataItemOnly } from '@/object-metadata/hooks/useObjectMetadataItemOnly'; import { useCreateOneRecord } from '@/object-record/hooks/useCreateOneRecord'; import { useDeleteOneRecord } from '@/object-record/hooks/useDeleteOneRecord'; @@ -6,7 +8,7 @@ import { RecordBoardActionBar } from '@/object-record/record-board/action-bar/co import { RecordBoard } from '@/object-record/record-board/components/RecordBoard'; import { RecordBoardContextMenu } from '@/object-record/record-board/context-menu/components/RecordBoardContextMenu'; import { RecordBoardContext } from '@/object-record/record-board/contexts/RecordBoardContext'; -import { FieldMetadataType } from '~/generated-metadata/graphql'; +import { recordIndexKanbanFieldMetadataIdState } from '@/object-record/record-index/states/recordIndexKanbanFieldMetadataIdState'; type RecordIndexBoardContainerProps = { recordBoardId: string; @@ -23,8 +25,12 @@ export const RecordIndexBoardContainer = ({ objectNameSingular, }); + const recordIndexKanbanFieldMetadataId = useRecoilValue( + recordIndexKanbanFieldMetadataIdState, + ); + const selectFieldMetadataItem = objectMetadataItem.fields.find( - (field) => field.type === FieldMetadataType.Select, + (field) => field.id === recordIndexKanbanFieldMetadataId, ); const { deleteOneRecord } = useDeleteOneRecord({ objectNameSingular });