multiselect for onetomany relations (#6892)

Issue #4345 
used `useUpdateRelationFromManyFieldInput` hook from `FieldInput` to
`updateRelation`.
Creating a seperate hook didnt made sense when it basically does the
same thing.
However renaming the hook to something generic would make sense so that
its not tied to `FieldInput` according to naming convention

followup issue to tackle - #6890 


https://github.com/user-attachments/assets/452372ea-2699-45fd-9edf-ded36abdbca2

---------

Co-authored-by: Weiko <corentin@twenty.com>
This commit is contained in:
nitin
2024-09-06 18:26:01 +05:30
committed by GitHub
parent 85f2e58f0c
commit 7205927440
2 changed files with 31 additions and 12 deletions

View File

@ -1,7 +1,6 @@
import styled from '@emotion/styled';
import { useRecoilValue } from 'recoil';
import { Avatar } from 'twenty-ui';
import { v4 } from 'uuid';
import { useObjectRecordMultiSelectScopedStates } from '@/activities/hooks/useObjectRecordMultiSelectScopedStates';
import { MULTI_OBJECT_RECORD_SELECT_SELECTABLE_LIST_ID } from '@/object-record/relation-picker/constants/MultiObjectRecordSelectSelectableListId';
@ -69,7 +68,7 @@ export const MultipleObjectRecordSelectItem = ({
: false;
return (
<StyledSelectableItem itemId={objectRecordId} key={objectRecordId + v4()}>
<StyledSelectableItem itemId={objectRecordId} key={objectRecordId}>
<MenuItemMultiSelectAvatar
onSelectChange={(_isNewlySelectedValue) => handleSelectChange()}
isKeySelected={isSelectedByKeyboard}