Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: fix typescript compiler complaints (#11506)

Liu Ji33c0b2fd6400
diff --git a/frontend/src/store/modules/sqlEditor/tree.ts b/frontend/src/store/modules/sqlEditor/tree.ts
index 9ff9b4ee46..0a451cbb05 100644
--- a/frontend/src/store/modules/sqlEditor/tree.ts
+++ b/frontend/src/store/modules/sqlEditor/tree.ts
@@ -176,10 +176,8 @@ export const useSQLEditorTreeStore = defineStore("sqlEditorTree", () => {
);
return {
- databaseList,
factorList,
filteredFactorList,
- currentProject,
state,
tree,
collectNode,
diff --git a/frontend/src/types/sqlEditor/tree.ts b/frontend/src/types/sqlEditor/tree.ts
index eb52bd1ec4..38f04746f3 100644
--- a/frontend/src/types/sqlEditor/tree.ts
+++ b/frontend/src/types/sqlEditor/tree.ts
@@ -1,6 +1,6 @@
import type { TreeOption } from "naive-ui";
import { t } from "@/plugins/i18n";
-import { useSQLEditorTreeStore } from "@/store";
+import { useSQLEditorStore } from "@/store";
import type { Environment } from "../proto/v1/environment_service";
import type {
ComposedDatabase,
@@ -94,9 +94,9 @@ export const readableSQLEditorTreeFactor = (
factor: SQLEditorTreeFactor,
labelPrefix: string | undefined = ""
) => {
- const treeStore = useSQLEditorTreeStore();
+ const editorStore = useSQLEditorStore();
if (factor === "project") {
- if (treeStore.currentProject) {
+ if (editorStore.currentProject) {
return t("common.database");
} else {
return t("common.project");
diff --git a/frontend/src/views/sql-editor/AsidePanel/AsidePanel.vue b/frontend/src/views/sql-editor/AsidePanel/AsidePanel.vue
index 56564985bb..bab63eea36 100644
--- a/frontend/src/views/sql-editor/AsidePanel/AsidePanel.vue
+++ b/frontend/src/views/sql-editor/AsidePanel/AsidePanel.vue
@@ -51,7 +51,7 @@ const { project, projectContextReady, strictProject } =
storeToRefs(editorStore);
const projectUID = computed(() => {
- return treeStore.currentProject?.uid ?? null;
+ return editorStore.currentProject?.uid ?? null;
});
watch([project, projectContextReady], ([project, ready]) => {
diff --git a/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/DatabaseHoverPanel/DatabaseHoverPanel.vue b/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/DatabaseHoverPanel/DatabaseHoverPanel.vue
index 946e5227b9..ccfa6f6182 100644
--- a/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/DatabaseHoverPanel/DatabaseHoverPanel.vue
+++ b/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/DatabaseHoverPanel/DatabaseHoverPanel.vue
@@ -72,7 +72,7 @@ import {
InstanceV1Name,
ProjectV1Name,
} from "@/components/v2";
-import { useSQLEditorTreeStore } from "@/store";
+import { useSQLEditorStore } from "@/store";
import type { Position, SQLEditorTreeNodeTarget } from "@/types";
import { minmax } from "@/utils";
import { useHoverStateContext } from "./hover-state";
@@ -87,7 +87,7 @@ const emit = defineEmits<{
(event: "click-outside", e: MouseEvent): void;
}>();
-const treeStore = useSQLEditorTreeStore();
+const editorStore = useSQLEditorStore();
const { state, position, update } = useHoverStateContext();
const popoverRef = ref<HTMLDivElement>();
@@ -112,7 +112,7 @@ const database = computed(() => {
});
const hasProjectContext = computed(() => {
- return !!treeStore.currentProject;
+ return !!editorStore.currentProject;
});
const displayPosition = computed(() => {
diff --git a/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/GroupingBar/FactorPanel.vue b/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/GroupingBar/FactorPanel.vue
index a11b662340..2d29e078e5 100644
--- a/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/GroupingBar/FactorPanel.vue
+++ b/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/GroupingBar/FactorPanel.vue
@@ -25,14 +25,15 @@
import { cloneDeep, orderBy, uniq } from "lodash-es";
import { storeToRefs } from "pinia";
import { computed } from "vue";
-import { useSQLEditorTreeStore } from "@/store";
+import { useSQLEditorStore, useSQLEditorTreeStore } from "@/store";
import type { SQLEditorTreeFactor as Factor } from "@/types";
import { useSQLEditorContext } from "@/views/sql-editor/context";
import FactorItem from "./FactorItem.vue";
import FactorTags from "./FactorTags.vue";
const treeStore = useSQLEditorTreeStore();
-const { databaseList, factorList } = storeToRefs(treeStore);
+const { factorList } = storeToRefs(treeStore);
+const { databaseList } = storeToRefs(useSQLEditorStore());
const { events } = useSQLEditorContext();
const PRESET_FACTORS: Factor[] = ["project", "instance", "environment"];
diff --git a/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/TreeNode/DatabaseNode.vue b/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/TreeNode/DatabaseNode.vue
index 4d45ef49e4..f241b9ee40 100644
--- a/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/TreeNode/DatabaseNode.vue
+++ b/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/TreeNode/DatabaseNode.vue
@@ -34,7 +34,7 @@
import { computed } from "vue";
import DatabaseIcon from "~icons/heroicons-outline/circle-stack";
import { EnvironmentV1Name, InstanceV1EngineIcon } from "@/components/v2";
-import { useSQLEditorTreeStore } from "@/store";
+import { useSQLEditorStore } from "@/store";
import type {
SQLEditorTreeNode as TreeNode,
SQLEditorTreeFactor as Factor,
@@ -47,7 +47,7 @@ const props = defineProps<{
keyword: string;
}>();
-const treeStore = useSQLEditorTreeStore();
+const editorStore = useSQLEditorStore();
const database = computed(
() => (props.node as TreeNode<"database">).meta.target
@@ -62,6 +62,6 @@ const hasEnvironmentContext = computed(() => {
});
const hasProjectContext = computed(() => {
- return props.factors.includes("project") || !!treeStore.currentProject;
+ return props.factors.includes("project") || !!editorStore.currentProject;
});
</script>