feat(mongodb): rename collections from sidebar
This commit is contained in:
1 parent
809500fd52
commit
9a83b46f00
26 files changed
+1105
-93
No files matched your search
@@ -45,7 +45,7 @@ import { isTauriRuntime } from "@/lib/backend/tauriRuntime";
|
||||
import { useTunnelProfileStore } from "@/stores/tunnelProfileStore";
|
||||
import { connectionIsDorisFamilyCatalogCapable, isInternalDorisCatalog, isSchemaAware, normalizeSidebarObjectKind, sidebarObjectKindsForDatabase, usesTreeSchemaMode } from "@/lib/database/databaseCapabilities";
|
||||
import { connectionObjectTreeNodeSchema, connectionObjectTreeQuerySchema, connectionUsesDatabaseObjectTreeMode, effectiveDatabaseTypeForConnection } from "@/lib/database/jdbcDialect";
|
||||
import { buildDatabaseTreeNodes, buildDuckDbConnectionTreeNodes, sortSidebarDatabases, sortSidebarNames, shouldIncludeDefaultDatabaseNode } from "@/lib/database/databaseTree";
|
||||
import { buildDatabaseTreeNodes, buildDuckDbConnectionTreeNodes, compareSidebarNames, sortSidebarDatabases, sortSidebarNames, shouldIncludeDefaultDatabaseNode } from "@/lib/database/databaseTree";
|
||||
import { buildSqlServerDatabaseTreeNodes } from "@/lib/database/sqlServerTree";
|
||||
import { collapseExpandedTreeNodes } from "@/lib/sidebar/sidebarTreeCollapse";
|
||||
import { findDatabaseTreeNode } from "@/lib/sidebar/treeRefreshTarget";
|
||||
@@ -81,6 +81,7 @@ import { getTableMetadataCapabilities } from "@/lib/table/tableMetadataCapabilit
|
||||
import { useSettingsStore } from "@/stores/settingsStore";
|
||||
import { encodeSqlServerLinkedSchema, parseSqlServerLinkedSchema } from "@/lib/database/sqlServerLinkedServers";
|
||||
import { inferMongoCompletionFields, type MongoCompletionField } from "@/lib/mongo/mongoCompletion";
|
||||
import { toMongoCollectionKind } from "@/lib/sidebar/mongoCollectionMutation";
|
||||
import { completionSchemasFromTree, completionTablesFromTree } from "@/lib/metadata/completionTreeIndex";
|
||||
import { kvRootNodeLabel } from "@/lib/kv/kvRootPresentation";
|
||||
import { REDIS_SCAN_PAGE_SIZE_DEFAULT } from "@/lib/redis/redisKeyPattern";
|
||||
@@ -2788,18 +2789,18 @@ export const useConnectionStore = defineStore("connection", () => {
|
||||
const collections = await api.mongoListCollections(connectionId, database);
|
||||
const bucketNames = new Set(collections.filter((c) => c.kind === "bucket" && c.bucketName).map((c) => c.bucketName as string));
|
||||
const hiddenCollectionNames = new Set([...bucketNames].flatMap((bucketName) => [`${bucketName}.files`, `${bucketName}.chunks`]));
|
||||
const collectionNames = collections
|
||||
.filter((c) => c.kind !== "bucket")
|
||||
.map((c) => c.name)
|
||||
.filter((name) => !hiddenCollectionNames.has(name));
|
||||
const collectionChildren = sortSidebarNames(collectionNames).map((col) => ({
|
||||
id: `${nodeId}:${col}`,
|
||||
label: col,
|
||||
type: "mongo-collection" as const,
|
||||
connectionId,
|
||||
database,
|
||||
isExpanded: false,
|
||||
}));
|
||||
const collectionEntries = collections.filter((c) => c.kind !== "bucket").filter((c) => !hiddenCollectionNames.has(c.name));
|
||||
const collectionChildren = [...collectionEntries]
|
||||
.sort((left, right) => compareSidebarNames(left.name, right.name))
|
||||
.map((col) => ({
|
||||
id: `${nodeId}:${col.name}`,
|
||||
label: col.name,
|
||||
type: "mongo-collection" as const,
|
||||
connectionId,
|
||||
database,
|
||||
meta: { collectionKind: toMongoCollectionKind(col.kind) },
|
||||
isExpanded: false,
|
||||
}));
|
||||
const children = [
|
||||
{
|
||||
id: `${nodeId}:__gridfs`,
|
||||
|
||||
Reference in new issue
Block a user