-
- Downloads
Add drag-n-drop to collection items tables (#16360)
* Don't wrap ItemDragSource children with <div /> react-dnd allows wrapping only native DOM elements with DND helpers. With the new table layout, we now need to drag table rows (td elements). Rendering a td with ItemDragSource results in invalid HTML as table body's direct children should only include td elements. * Rename `selected` prop to `selectedItems` * Pass ItemDragSource props to table item * Replace styled TableRow with plain <tr /> Table row is wrapped with ItemDragSource, that only accepts native DOM elements as its children So styled-components can't be used here * Make table row draggable * Add headless mode to BaseItemsTable * Add prop hiding table row's bottom border * Fix typo and split large comment * Render full table row when dragging * Add empty PinnedItemsTable drop area * Add empty ItemsTable drop area * Wrap PinnedItemsTable with drop area * Wrap ItemsTable with drop area * Extract `<tr />` style Co-authored-by:Gustavo Saiani <gustavo@poe.ma> * Fix width style Co-authored-by:
Gustavo Saiani <gustavo@poe.ma> * Run prettier * Reference issue about post-pulses work Co-authored-by:
Gustavo Saiani <gustavo@poe.ma>
Showing
- frontend/src/metabase/collections/components/BaseItemsTable.jsx 21 additions, 9 deletions...nd/src/metabase/collections/components/BaseItemsTable.jsx
- frontend/src/metabase/collections/components/BaseItemsTable.styled.jsx 0 additions, 5 deletions...metabase/collections/components/BaseItemsTable.styled.jsx
- frontend/src/metabase/collections/components/BaseTableItem.jsx 103 additions, 53 deletions...end/src/metabase/collections/components/BaseTableItem.jsx
- frontend/src/metabase/collections/components/ItemsTable.jsx 39 additions, 1 deletionfrontend/src/metabase/collections/components/ItemsTable.jsx
- frontend/src/metabase/collections/components/NormalItem.jsx 0 additions, 59 deletionsfrontend/src/metabase/collections/components/NormalItem.jsx
- frontend/src/metabase/collections/components/PinnedItemsTable.jsx 43 additions, 6 deletions.../src/metabase/collections/components/PinnedItemsTable.jsx
- frontend/src/metabase/collections/containers/CollectionContent.jsx 15 additions, 14 deletions...src/metabase/collections/containers/CollectionContent.jsx
- frontend/src/metabase/components/CollectionList.jsx 9 additions, 7 deletionsfrontend/src/metabase/components/CollectionList.jsx
- frontend/src/metabase/containers/dnd/ItemDragSource.jsx 1 addition, 1 deletionfrontend/src/metabase/containers/dnd/ItemDragSource.jsx
- frontend/src/metabase/containers/dnd/ItemsDragLayer.jsx 43 additions, 8 deletionsfrontend/src/metabase/containers/dnd/ItemsDragLayer.jsx
Loading
Please register or sign in to comment