Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: can't properly drag and drop in empty record group #9039

Merged
merged 4 commits into from
Dec 13, 2024

Conversation

magrinj
Copy link
Member

@magrinj magrinj commented Dec 12, 2024

Fix #8968

Fix issue with drag and drop when record group are empty.
Happy to discuss the implementation, as it's limited to the @hello-pangea/dnd api.

@magrinj magrinj marked this pull request as ready for review December 12, 2024 11:50
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

Implemented drag-and-drop functionality for empty record groups by introducing new components and modifying existing ones to properly handle draggable elements and ref management.

  • Added new packages/twenty-front/src/modules/object-record/record-table/record-table-row/components/RecordTableDraggableTr.tsx to encapsulate draggable table row logic
  • Modified RecordTableRecordGroupSectionAddNew.tsx and RecordTableRecordGroupSectionLoadMore.tsx to support dragging with special index -1 for empty groups
  • Added packages/twenty-front/src/utils/mergeRefs.ts utility to handle multiple React refs for drag-and-drop functionality
  • Updated RecordTableActionRow.tsx to use RecordTableContext instead of Recoil for visible columns management
  • Refactored RecordTableRowWrapper.tsx to delegate draggable functionality to the new RecordTableDraggableTr component

6 file(s) reviewed, 6 comment(s)
Edit PR Review Bot Settings | Greptile

@magrinj magrinj force-pushed the fix/drag-drop-record-group branch from 33b8b4b to 444e9e2 Compare December 12, 2024 16:05
@magrinj magrinj merged commit 07aaf08 into main Dec 13, 2024
19 checks passed
@magrinj magrinj deleted the fix/drag-drop-record-group branch December 13, 2024 08:37
Copy link

sentry-io bot commented Dec 16, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ TypeError: Cannot read properties of undefined (reading 'size') /objects/companies View Issue

Did you find this useful? React with a 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Record group can't drag in empty group
2 participants