Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
fix: pass computed ref to useSpecSheet hook (#17011)
boojack833cfb50abf6
diff --git a/frontend/src/components/Plan/components/SQLCheckSection/SQLCheckButton.vue b/frontend/src/components/Plan/components/SQLCheckSection/SQLCheckButton.vueindex 73bd9bfa4a..66fca0774c 100644--- a/frontend/src/components/Plan/components/SQLCheckSection/SQLCheckButton.vue+++ b/frontend/src/components/Plan/components/SQLCheckSection/SQLCheckButton.vue@@ -89,7 +89,7 @@ withDefaults(const { t } = useI18n();const { database, project, selectedSpec, upsertResult } =usePlanSQLCheckContext();-const { sheetStatement } = useSpecSheet(selectedSpec.value);+const { sheetStatement } = useSpecSheet(computed(() => selectedSpec.value));const isRunning = ref(false);const showDetailPanel = ref(false);diff --git a/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue b/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vueindex 1a53bdc09b..550c560850 100644--- a/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue+++ b/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue@@ -271,9 +271,8 @@ const isEditorReadonly = computed(() => {return !state.isEditing || isSheetOversize.value || false;});-const { sheet, sheetName, sheetReady, sheetStatement } = useSpecSheet(- selectedSpec.value-);+const { sheet, sheetName, sheetReady, sheetStatement } =+ useSpecSheet(selectedSpec);const isSheetOversize = computed(() => {if (isCreating.value) return false;diff --git a/frontend/src/components/Plan/components/StatementSection/useSpecSheet.ts b/frontend/src/components/Plan/components/StatementSection/useSpecSheet.tsindex 0f610b150c..56cfbbe281 100644--- a/frontend/src/components/Plan/components/StatementSection/useSpecSheet.ts+++ b/frontend/src/components/Plan/components/StatementSection/useSpecSheet.ts@@ -1,5 +1,5 @@import { computedAsync } from "@vueuse/core";-import { computed, ref } from "vue";+import { computed, ref, type ComputedRef } from "vue";import { getLocalSheetByName } from "@/components/Plan";import { useSheetV1Store } from "@/store";import type { Plan_Spec } from "@/types/proto-es/v1/plan_service_pb";@@ -10,13 +10,11 @@ import {sheetNameOfSpec,} from "@/utils";-export const useSpecSheet = (spec: Plan_Spec) => {+export const useSpecSheet = (spec: ComputedRef<Plan_Spec>) => {const sheetStore = useSheetV1Store();- const sheetName = computed(() => {- return sheetNameOfSpec(spec);- });const isFetchingSheet = ref(false);+ const sheetName = computed(() => sheetNameOfSpec(spec.value));const sheetReady = computed(() => {return !isFetchingSheet.value;});diff --git a/frontend/src/components/Plan/components/common/DatabaseDisplay.vue b/frontend/src/components/Plan/components/common/DatabaseDisplay.vueindex 96fbd0865c..d555e74c53 100644--- a/frontend/src/components/Plan/components/common/DatabaseDisplay.vue+++ b/frontend/src/components/Plan/components/common/DatabaseDisplay.vue@@ -18,7 +18,7 @@</span><template v-if="project"><router-link- class="pl-2"+ class="pl-2 opacity-60 hover:opacity-100":to="databaseV1UrlWithProject(project, database)"target="_blank"@click.stop