feat(sidebar): support hierarchical batch connection moves
This commit is contained in:
10 files changed
+105
-38
No files matched your search
+4
-1
@@ -135,7 +135,10 @@ const mountedApps: Array<{ unmount: () => void; host: HTMLElement }> = [];
|
||||
function createStore() {
|
||||
return reactive({
|
||||
connections: [{ id: "conn-visible" }, { id: "conn-hidden" }, { id: "conn-next" }],
|
||||
sidebarLayout: { groups: [{ id: "group-a", name: "Group A" }] },
|
||||
sidebarLayout: {
|
||||
groups: [{ id: "group-a", name: "Group A" }],
|
||||
order: [{ type: "group", id: "group-a", children: [] }],
|
||||
},
|
||||
selectedTreeNodeIds: [] as string[],
|
||||
selectedTreeNodeId: null as string | null,
|
||||
treeSelectionAnchorId: null as string | null,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { computed, ref } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { translateBackendError } from "@/i18n/backend-errors";
|
||||
import { Upload, Download, FolderPlus, RefreshCw, ChevronsLeft, ChevronsUp, Trash2, FolderInput, Check, Minus, Square, X } from "@lucide/vue";
|
||||
import { Upload, Download, FolderPlus, FolderOpen, RefreshCw, ChevronsLeft, ChevronsUp, Trash2, FolderInput, Check, Minus, Square, X } from "@lucide/vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from "@/components/ui/dialog";
|
||||
import { Input } from "@/components/ui/input";
|
||||
@@ -10,6 +10,7 @@ import LightDropdown from "@/components/ui/LightDropdown.vue";
|
||||
import LightTooltip from "@/components/ui/LightTooltip.vue";
|
||||
import ConnectionTree from "@/components/sidebar/ConnectionTree.vue";
|
||||
import { applyConnectionMultiSelection, emptyConnectionMultiSelection, isExitConnectionMultiSelectionShortcut } from "@/lib/sidebar/sidebarConnectionMultiSelect";
|
||||
import { connectionGroupDestinationRows } from "@/lib/sidebar/sidebarLayout";
|
||||
import { useConnectionStore } from "@/stores/connectionStore";
|
||||
import { useToast } from "@/composables/useToast";
|
||||
import type { QueryTab, TreeNode } from "@/types/database";
|
||||
@@ -53,9 +54,12 @@ const allConnectionsSelected = computed(() => allConnectionIds.value.length > 0
|
||||
const selectAllIcon = computed(() => (allConnectionsSelected.value ? Check : selectedConnectionCount.value > 0 ? Minus : Square));
|
||||
const selectAllLabel = computed(() => (allConnectionsSelected.value ? t("connectionGroup.deselectAllConnections") : t("connectionGroup.selectAllConnections")));
|
||||
const moveGroupItems = computed(() => [
|
||||
...connectionStore.sidebarLayout.groups.map((group) => ({
|
||||
...connectionGroupDestinationRows(connectionStore.sidebarLayout).map((group) => ({
|
||||
value: group.id,
|
||||
label: group.name,
|
||||
title: group.path.join(" / "),
|
||||
icon: FolderOpen,
|
||||
indentLevel: group.depth,
|
||||
})),
|
||||
{
|
||||
value: UNGROUPED_GROUP_VALUE,
|
||||
|
||||
Reference in new issue
Block a user