This is an automated email from the ASF dual-hosted git repository.
kgabryje pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new 2ecfb3406c3 fix(dataset-modal): show warning toast when dropping items
outside folders (#38257)
2ecfb3406c3 is described below
commit 2ecfb3406c3b7fbca29f9fae93c7092cc401832f
Author: Kamil Gabryjelski <[email protected]>
AuthorDate: Thu Feb 26 15:06:41 2026 +0100
fix(dataset-modal): show warning toast when dropping items outside folders
(#38257)
Co-authored-by: Claude Opus 4 <[email protected]>
---
.../Datasource/FoldersEditor/hooks/useDragHandlers.ts | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git
a/superset-frontend/src/components/Datasource/FoldersEditor/hooks/useDragHandlers.ts
b/superset-frontend/src/components/Datasource/FoldersEditor/hooks/useDragHandlers.ts
index f6d788b3d40..5191c03b971 100644
---
a/superset-frontend/src/components/Datasource/FoldersEditor/hooks/useDragHandlers.ts
+++
b/superset-frontend/src/components/Datasource/FoldersEditor/hooks/useDragHandlers.ts
@@ -297,6 +297,8 @@ export function useDragHandlers({
let hasNonFolderItems = false;
let hasDraggedFolder = false;
let hasDraggedDefaultFolder = false;
+ let hasDraggedColumn = false;
+ let hasDraggedMetric = false;
for (const item of draggedItems) {
if (item.type === FoldersEditorItemType.Folder) {
hasDraggedFolder = true;
@@ -305,11 +307,24 @@ export function useDragHandlers({
}
} else {
hasNonFolderItems = true;
+ if (item.type === FoldersEditorItemType.Column) {
+ hasDraggedColumn = true;
+ }
+ if (item.type === FoldersEditorItemType.Metric) {
+ hasDraggedMetric = true;
+ }
}
}
if (hasNonFolderItems) {
if (!projectedPosition || !projectedPosition.parentId) {
+ if (hasDraggedColumn && hasDraggedMetric) {
+ addWarningToast(t('Columns and metrics should be inside folders'));
+ } else if (hasDraggedColumn) {
+ addWarningToast(t('Columns should be inside folders'));
+ } else {
+ addWarningToast(t('Metrics should be inside folders'));
+ }
return;
}
}