Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
refactor(sql-editor): move isLoadingTree field out of ConnectionContext (#2690)
Liu Ji6aad9742c17b
diff --git a/frontend/src/components/ProvideSQLEditorContext.vue b/frontend/src/components/ProvideSQLEditorContext.vueindex 36f51c3663..b7735f519f 100644--- a/frontend/src/components/ProvideSQLEditorContext.vue+++ b/frontend/src/components/ProvideSQLEditorContext.vue@@ -178,10 +178,10 @@ const setConnectionFromQuery = async () => {};onMounted(async () => {- sqlEditorStore.setConnectionContext({ isLoadingTree: true });+ sqlEditorStore.isLoadingTree = true;await prepareAccessibleConnectionByProject();await prepareSQLEditorContext();- sqlEditorStore.setConnectionContext({ isLoadingTree: false });+ sqlEditorStore.isLoadingTree = false;await setConnectionFromQuery();await sqlEditorStore.fetchQueryHistoryList();diff --git a/frontend/src/store/modules/sqlEditor.ts b/frontend/src/store/modules/sqlEditor.tsindex 6ea0b3db0d..e9a0ff7006 100644--- a/frontend/src/store/modules/sqlEditor.ts+++ b/frontend/src/store/modules/sqlEditor.ts@@ -25,7 +25,6 @@ import { useTabStore } from "./tab";import { emptyConnection } from "@/utils";export const getDefaultConnectionContext = () => ({- isLoadingTree: false,option: {} as any,});@@ -33,6 +32,7 @@ export const useSQLEditorStore = defineStore("sqlEditor", {state: (): SQLEditorState => ({connectionTree: [],connectionContext: getDefaultConnectionContext(),+ isLoadingTree: false,isExecuting: false,isShowExecutingHint: false,shouldFormatContent: false,diff --git a/frontend/src/types/sqlEditor.ts b/frontend/src/types/sqlEditor.tsindex c29f694fe3..1c1a8a37e7 100644--- a/frontend/src/types/sqlEditor.ts+++ b/frontend/src/types/sqlEditor.ts@@ -26,10 +26,8 @@ export enum SortText {KEYWORD = "3",}-// TODO(Jim): Move `isLoadingTree` to the root of sql editor state.-// refactor <TableSchema> to get rid of this structure totally.+// TODO(Jim): refactor <TableSchema> to get rid of this structure totally.export type ConnectionContext = {- isLoadingTree: boolean;option: ConnectionAtom;};diff --git a/frontend/src/types/store.ts b/frontend/src/types/store.tsindex ed630c567e..8933abcf3d 100644--- a/frontend/src/types/store.ts+++ b/frontend/src/types/store.ts@@ -197,6 +197,7 @@ export interface SQLEditorState {shouldFormatContent: boolean;queryHistoryList: QueryHistory[];isFetchingQueryHistory: boolean;+ isLoadingTree: boolean;isExecuting: boolean;isFetchingSheet: boolean;isShowExecutingHint: boolean;diff --git a/frontend/src/views/sql-editor/AsidePanel/DatabaseTree.vue b/frontend/src/views/sql-editor/AsidePanel/DatabaseTree.vueindex 05b5d48966..f8c7d38b68 100644--- a/frontend/src/views/sql-editor/AsidePanel/DatabaseTree.vue+++ b/frontend/src/views/sql-editor/AsidePanel/DatabaseTree.vue@@ -1,6 +1,6 @@<template><div- v-if="!sqlEditorStore.connectionContext.isLoadingTree"+ v-if="!sqlEditorStore.isLoadingTree"class="databases-tree p-2 space-y-2 h-full"><div class="databases-tree--input">