From 34f2bf8a4a59a2b61e1b47f1e545c6ffb20d10e8 Mon Sep 17 00:00:00 2001 From: Shashank Vishwakarma Date: Sat, 1 Jun 2024 22:13:28 +0530 Subject: [PATCH 1/3] Fixed: Fields Disappear on Drag and Drop --- .../record-board-card/components/RecordBoardCard.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCard.tsx b/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCard.tsx index 9b695a3f3c83..657937836d27 100644 --- a/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCard.tsx +++ b/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCard.tsx @@ -6,6 +6,7 @@ import { EntityChipVariant, IconEye } from 'twenty-ui'; import { RecordChip } from '@/object-record/components/RecordChip'; import { RecordBoardContext } from '@/object-record/record-board/contexts/RecordBoardContext'; +import { useDragSelect } from '@/ui/utilities/drag-select/hooks/useDragSelect'; import { useRecordBoardStates } from '@/object-record/record-board/hooks/internal/useRecordBoardStates'; import { RecordBoardCardContext } from '@/object-record/record-board/record-board-card/contexts/RecordBoardCardContext'; import { @@ -199,6 +200,7 @@ export const RecordBoardCard = () => { }; const scrollWrapperRef = useContext(ScrollWrapperContext); + const { isDragSelectionStartEnabled } = useDragSelect(); const { ref: cardRef, inView } = useInView({ root: scrollWrapperRef.current, @@ -280,8 +282,10 @@ export const RecordBoardCard = () => { > {inView ? ( - ) : ( + ) : !isDragSelectionStartEnabled() ? ( + ) : ( + )} From 4333279f445f2c22ef3e8903b216ddbbc6b9192d Mon Sep 17 00:00:00 2001 From: Shashank Vishwakarma Date: Sun, 2 Jun 2024 01:19:16 +0530 Subject: [PATCH 2/3] simplified the code by removing unnecessary nesting --- .../record-board-card/components/RecordBoardCard.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCard.tsx b/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCard.tsx index 657937836d27..186160a2506f 100644 --- a/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCard.tsx +++ b/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCard.tsx @@ -280,12 +280,10 @@ export const RecordBoardCard = () => { hotkeyScope: InlineCellHotkeyScope.InlineCell, }} > - {inView ? ( + {inView || isDragSelectionStartEnabled() ? ( - ) : !isDragSelectionStartEnabled() ? ( - ) : ( - + )} From 3dcccf56268f4524c86a46204ace4caa55f1b195 Mon Sep 17 00:00:00 2001 From: martmull Date: Mon, 3 Jun 2024 15:08:45 +0200 Subject: [PATCH 3/3] Fix ci --- .../record-board-card/components/RecordBoardCard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCard.tsx b/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCard.tsx index 186160a2506f..5f1c139d2f2e 100644 --- a/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCard.tsx +++ b/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCard.tsx @@ -6,7 +6,6 @@ import { EntityChipVariant, IconEye } from 'twenty-ui'; import { RecordChip } from '@/object-record/components/RecordChip'; import { RecordBoardContext } from '@/object-record/record-board/contexts/RecordBoardContext'; -import { useDragSelect } from '@/ui/utilities/drag-select/hooks/useDragSelect'; import { useRecordBoardStates } from '@/object-record/record-board/hooks/internal/useRecordBoardStates'; import { RecordBoardCardContext } from '@/object-record/record-board/record-board-card/contexts/RecordBoardCardContext'; import { @@ -24,6 +23,7 @@ import { Checkbox, CheckboxVariant } from '@/ui/input/components/Checkbox'; import { contextMenuIsOpenState } from '@/ui/navigation/context-menu/states/contextMenuIsOpenState'; import { contextMenuPositionState } from '@/ui/navigation/context-menu/states/contextMenuPositionState'; import { AnimatedEaseInOut } from '@/ui/utilities/animation/components/AnimatedEaseInOut'; +import { useDragSelect } from '@/ui/utilities/drag-select/hooks/useDragSelect'; import { ScrollWrapperContext } from '@/ui/utilities/scroll/components/ScrollWrapper'; const StyledBoardCard = styled.div<{ selected: boolean }>`