diff --git a/renderer/components/dbComponents/inputToolsDB/groupingTaggingToolsDB.jsx b/renderer/components/dbComponents/inputToolsDB/groupingTaggingToolsDB.jsx index 118ad199..ffbbf3c7 100644 --- a/renderer/components/dbComponents/inputToolsDB/groupingTaggingToolsDB.jsx +++ b/renderer/components/dbComponents/inputToolsDB/groupingTaggingToolsDB.jsx @@ -221,6 +221,23 @@ const GroupingTaggingToolsDB = () => { ) } + const selectColumnsByString = (pastedString) => { + const namesToSelect = pastedString.split(',').map(s => s.trim().toLowerCase()) + let newSelection = { ...selectedColumnsToTag } + + const traverse = (nodes) => { + nodes.forEach(node => { + if (namesToSelect.includes(node.label.toLowerCase())) { + newSelection[node.key] = { checked: true, partialChecked: false } + } + if (node.children) traverse(node.children) + }) + } + + traverse(treeSelectData) + setSelectedColumnsToTag(newSelection) +} + // Handle the selection of a tag const handleTagSelection = (selectedTag) => { if (selectedColumnsToTag.length < 1) { @@ -271,6 +288,7 @@ const GroupingTaggingToolsDB = () => { + Hit enter to add a tag
{
-
-
-
- {/* Column Selection Title */} -
Select columns to tag
- {/* Tag Selection Title */} -
Select tags to apply
+
+ {/* The 'formgrid grid' class handles the responsive columns automatically */} +
+ + {/* Input 1: Paste Text */} +
+
+ Paste column names +
+ { + const data = e.clipboardData.getData("Text"); + selectColumnsByString(data); + }} + />
-
- {/* TreeSelect for Columns */} + {/* Input 2: TreeSelect */} +
+
+ or Select columns +
setSelectedColumnsToTag(e.value)} - placeholder="Select Collections and Columns" + placeholder="Select Collections" selectionMode="checkbox" display="chip" filter panelClassName="groupingToolTree" - style={{ width: "300px", height: "50px", marginRight: "20px" }} /> - {/* MultiSelect for Tags */} +
+ + {/* Input 3: MultiSelect */} +
+
+ Select tags to apply +
({ label: key, value: key }))} onChange={(e) => handleTagSelection(e.value)} placeholder="Select Tags" - style={{ width: "300px", height: "50px", marginRight: "20px" }} + maxSelectedLabels={2} /> - {/* Apply Button */} +
+ + {/* Input 4: Action Button */} + {/* On desktop, this aligns at the bottom. On mobile, it takes full width */} +
+ {/* We use a hidden label to keep vertical alignment consistent with other fields */} +
Action