diff --git a/web/src/components/features/layouts/AppVerticalCodeSplitter/DataContainer.tsx b/web/src/components/features/layouts/AppVerticalCodeSplitter/DataContainer.tsx
index d1c89b2f3..15a2ca978 100644
--- a/web/src/components/features/layouts/AppVerticalCodeSplitter/DataContainer.tsx
+++ b/web/src/components/features/layouts/AppVerticalCodeSplitter/DataContainer.tsx
@@ -26,7 +26,7 @@ export const DataContainer: React.FC<{
/>
{hasData ? (
-
+
) : (
{fetchingData ? 'Loading data...' : 'No data returned'}
diff --git a/web/src/components/ui/table/AppDataGrid/TanStackDataGrid/DataGridHeader.tsx b/web/src/components/ui/table/AppDataGrid/TanStackDataGrid/DataGridHeader.tsx
index 0852bba2e..7147306bc 100644
--- a/web/src/components/ui/table/AppDataGrid/TanStackDataGrid/DataGridHeader.tsx
+++ b/web/src/components/ui/table/AppDataGrid/TanStackDataGrid/DataGridHeader.tsx
@@ -13,10 +13,11 @@ interface DraggableHeaderProps {
resizable: boolean;
sortable: boolean;
isOverTarget: boolean;
+ draggable: boolean;
}
const DraggableHeader: React.FC = React.memo(
- ({ header, sortable, resizable, isOverTarget }) => {
+ ({ header, sortable, resizable, isOverTarget, draggable }) => {
// Set up dnd-kit's useDraggable for this header cell
const {
attributes,
@@ -24,11 +25,8 @@ const DraggableHeader: React.FC = React.memo(
isDragging,
setNodeRef: setDragNodeRef
} = useDraggable({
- id: header.id,
- // This ensures the drag overlay matches the element's position exactly
- data: {
- type: 'header'
- }
+ disabled: !draggable,
+ id: header.id
});
// Set up droppable area to detect when a header is over this target
@@ -47,7 +45,7 @@ const DraggableHeader: React.FC = React.memo(
return (
= React.memo(
@@ -84,15 +82,6 @@ const DraggableHeader: React.FC = React.memo(
e.stopPropagation();
e.preventDefault();
}}>
- {/* */}
-
>;
sortable: boolean;
resizable: boolean;
+ draggable: boolean;
rowVirtualizer: Virtualizer;
}
@@ -121,7 +111,8 @@ export const DataGridHeader: React.FC = ({
rowVirtualizer,
table,
sortable,
- resizable
+ resizable,
+ draggable
}) => {
const overTargetId = useSortColumnContext((x) => x.overTargetId);
@@ -143,6 +134,7 @@ export const DataGridHeader: React.FC = ({
key={header.id}
header={header}
sortable={sortable}
+ draggable={draggable}
resizable={resizable}
isOverTarget={overTargetId === header.id}
/>
diff --git a/web/src/components/ui/table/AppDataGrid/TanStackDataGrid/TanStackDataGrid.stories.tsx b/web/src/components/ui/table/AppDataGrid/TanStackDataGrid/TanStackDataGrid.stories.tsx
index ec30ce023..d1004d43e 100644
--- a/web/src/components/ui/table/AppDataGrid/TanStackDataGrid/TanStackDataGrid.stories.tsx
+++ b/web/src/components/ui/table/AppDataGrid/TanStackDataGrid/TanStackDataGrid.stories.tsx
@@ -20,6 +20,9 @@ const meta: Meta = {
tags: ['autodocs'],
args: {
rows: sampleData,
+ draggable: true,
+ sortable: true,
+ resizable: true,
onReorderColumns: fn(),
onResizeColumns: fn(),
onReady: fn()
@@ -55,7 +58,16 @@ export const NonEditable: Story = {
...meta.args,
rows: sampleData,
resizable: false,
- sortable: false
+ sortable: false,
+ draggable: false
+ }
+};
+
+export const NonDraggable: Story = {
+ args: {
+ ...meta.args,
+ rows: sampleData,
+ draggable: false
}
};
diff --git a/web/src/components/ui/table/AppDataGrid/TanStackDataGrid/TanStackDataGrid.tsx b/web/src/components/ui/table/AppDataGrid/TanStackDataGrid/TanStackDataGrid.tsx
index fee60de47..599df7b48 100644
--- a/web/src/components/ui/table/AppDataGrid/TanStackDataGrid/TanStackDataGrid.tsx
+++ b/web/src/components/ui/table/AppDataGrid/TanStackDataGrid/TanStackDataGrid.tsx
@@ -22,6 +22,7 @@ export interface TanStackDataGridProps {
className?: string;
resizable?: boolean;
sortable?: boolean;
+ draggable?: boolean;
rows: Record[];
columnOrder?: string[];
columnWidths?: Record;
@@ -42,6 +43,7 @@ export const TanStackDataGrid: React.FC = React.memo(
className = '',
resizable = true,
sortable = true,
+ draggable = true,
columnWidths: columnWidthsProp,
columnOrder: serverColumnOrder,
onReorderColumns,
@@ -74,9 +76,10 @@ export const TanStackDataGrid: React.FC = React.memo(
header: () => headerFormat(field, field),
cell: (info) => cellFormat(info.getValue(), field),
enableSorting: sortable,
- enableResizing: resizable
+ enableResizing: resizable,
+ enableDragging: draggable
})),
- [fields, headerFormat, cellFormat, sortable, resizable]
+ [fields, headerFormat, cellFormat, sortable, resizable, draggable]
);
// Create the table instance.
@@ -88,6 +91,7 @@ export const TanStackDataGrid: React.FC = React.memo(
columnSizing,
columnOrder: colOrder
},
+ enableSorting: sortable,
onSortingChange: setSorting,
onColumnSizingChange: setColumnSizing,
onColumnOrderChange: setColOrder,
@@ -137,6 +141,7 @@ export const TanStackDataGrid: React.FC = React.memo(
|