mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
feat(folders-editor): drag entire folder block as single unit (#38122)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
5e890a8cf7
commit
63f1d9eb98
@@ -61,6 +61,7 @@ export interface VirtualizedTreeItemData {
|
||||
metricsMap: Map<string, Metric>;
|
||||
columnsMap: Map<string, ColumnMeta>;
|
||||
activeId: UniqueIdentifier | null;
|
||||
draggedFolderChildIds: Set<string>;
|
||||
forbiddenDropFolderIds: Set<string>;
|
||||
currentDropTargetId: string | null;
|
||||
onToggleCollapse: (id: string) => void;
|
||||
@@ -151,6 +152,7 @@ function VirtualizedTreeItemComponent({
|
||||
metricsMap,
|
||||
columnsMap,
|
||||
activeId,
|
||||
draggedFolderChildIds,
|
||||
forbiddenDropFolderIds,
|
||||
currentDropTargetId,
|
||||
onToggleCollapse,
|
||||
@@ -185,6 +187,12 @@ function VirtualizedTreeItemComponent({
|
||||
);
|
||||
}
|
||||
|
||||
// Hidden descendants of the dragged folder — not droppable.
|
||||
// handleDragEnd uses lastValidOverIdRef when dropping in this dead zone.
|
||||
if (draggedFolderChildIds.has(item.uuid)) {
|
||||
return <div style={{ ...style, visibility: 'hidden' }} />;
|
||||
}
|
||||
|
||||
const childCount = isFolder ? (folderChildCounts.get(item.uuid) ?? 0) : 0;
|
||||
const showEmptyState = isFolder && childCount === 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user