fix(sidebar): load visible schema filters on mount
This commit is contained in:
1 parent
1e7a33bd99
commit
86a6846b10
7 files changed
+47
-12
No files matched your search
@@ -85,6 +85,7 @@ import { usesSyntheticRowIdKey } from "@/lib/table/tableEditing";
|
||||
import { tableOpenPageLimit } from "@/lib/table/tableOpenPageLimit";
|
||||
import { getCachedTableMetadata, loadTableMetadata, TABLE_METADATA_CACHE_TTL_MS, tableMetadataToDataTabMeta } from "@/lib/metadata/tableMetadataCache";
|
||||
import {
|
||||
canConfigureVisibleSchemasForTreeNode,
|
||||
canCreateConnectionNamespace,
|
||||
canCreateDatabaseNodeNamespace,
|
||||
canEditDatabaseProperties as canEditDatabasePropertiesForNode,
|
||||
@@ -161,7 +162,6 @@ import { isSqlServerLinkedNode } from "@/lib/database/sqlServerLinkedServers";
|
||||
import DatabaseIcon from "@/components/icons/DatabaseIcon.vue";
|
||||
import ConnectionErrorIndicator from "@/components/connection/ConnectionErrorIndicator.vue";
|
||||
import ProductionContextBadge from "@/components/common/ProductionContextBadge.vue";
|
||||
import { isSchemaAware } from "@/lib/database/databaseFeatureSupport";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import LightTooltip from "@/components/ui/LightTooltip.vue";
|
||||
@@ -4251,15 +4251,9 @@ const canConfigureVisibleDatabases = computed(() => {
|
||||
});
|
||||
|
||||
const canConfigureVisibleSchemas = computed(() => {
|
||||
if (props.node.type === "database" && props.node.connectionId && props.node.database != null) {
|
||||
const dbType = connectionStore.getConfig(props.node.connectionId)?.db_type;
|
||||
return isSchemaAware(dbType);
|
||||
}
|
||||
if (props.node.type === "connection" && props.node.connectionId) {
|
||||
const dbType = connectionStore.getConfig(props.node.connectionId)?.db_type;
|
||||
return isSchemaAware(dbType) && !usesTreeSchemaMode(dbType);
|
||||
}
|
||||
return false;
|
||||
if (!props.node.connectionId) return false;
|
||||
const dbType = connectionStore.getConfig(props.node.connectionId)?.db_type;
|
||||
return canConfigureVisibleSchemasForTreeNode(dbType, props.node.type, props.node.database);
|
||||
});
|
||||
|
||||
const canCopyFinalProxyPort = computed(() => {
|
||||
|
||||
@@ -67,6 +67,8 @@ watch(
|
||||
if (!open) return;
|
||||
loadDatabases().catch(() => {});
|
||||
},
|
||||
// Tree-level async hosts mount the dialog with `open` already true.
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
watch(showSystemDatabases, (show) => {
|
||||
|
||||
@@ -64,6 +64,8 @@ watch(
|
||||
loadSchemas().catch(() => {});
|
||||
}
|
||||
},
|
||||
// Tree-level async hosts mount the dialog with `open` already true.
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
function initDraftMode() {
|
||||
|
||||
@@ -40,6 +40,12 @@ export function usesTreeSchemaMode(dbType?: DatabaseType): boolean {
|
||||
return !!dbType && TREE_SCHEMA_TYPES.has(dbType);
|
||||
}
|
||||
|
||||
export function canConfigureVisibleSchemasForTreeNode(dbType: DatabaseType | undefined, nodeType: TreeNodeType, database?: string | null): boolean {
|
||||
if (!isSchemaAware(dbType)) return false;
|
||||
if (nodeType === "database") return database != null;
|
||||
return nodeType === "connection" && !usesTreeSchemaMode(dbType);
|
||||
}
|
||||
|
||||
export function usesDatabaseObjectTreeMode(dbType?: DatabaseType): boolean {
|
||||
return !!dbType && DATABASE_OBJECT_TREE_TYPES.has(dbType);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user