Skip to content

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

chore: only show error line for latest plan check run (#11961)

boojack8d60910bee39
diff --git a/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckBar/PlanCheckDetail.vue b/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckBar/PlanCheckDetail.vue
index bdd21f268a..334b76954a 100644
--- a/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckBar/PlanCheckDetail.vue
+++ b/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckBar/PlanCheckDetail.vue
@@ -42,7 +42,7 @@
class="ml-1 normal-link"
@click="
state.activeResultDefinition =
- row.checkResult.sqlReviewReport.detail
+ row.checkResult.sqlReviewReport!.detail
"
>{{ $t("sql-review.view-definition") }}</span
>
@@ -76,13 +76,14 @@
</a>
</HideInStandaloneMode>
- <template v-if="row.checkResult.sqlReviewReport?.line">
+ <!-- Only show the error line for latest plan check run -->
+ <template v-if="isLatest && row.checkResult.sqlReviewReport?.line">
<span class="border-r border-control-border ml-1"></span>
<span
class="ml-1 normal-link"
@click="
handleClickPlanCheckDetailLine(
- row.checkResult.sqlReviewReport.line
+ row.checkResult.sqlReviewReport!.line
)
"
>
@@ -161,6 +162,7 @@ type LocalState = {
const props = defineProps<{
planCheckRun: PlanCheckRun;
environment?: string;
+ isLatest?: boolean;
}>();
const { t } = useI18n();
diff --git a/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckBar/PlanCheckPanel.vue b/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckBar/PlanCheckPanel.vue
index f4c513de4c..6eebd8ff53 100644
--- a/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckBar/PlanCheckPanel.vue
+++ b/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckBar/PlanCheckPanel.vue
@@ -25,6 +25,7 @@
v-if="selectedPlanCheckRun"
:plan-check-run="selectedPlanCheckRun"
:environment="environment"
+ :is-latest="isLatestPlanCheckRun"
@close="$emit('close')"
/>
</div>
@@ -81,6 +82,10 @@ const selectedPlanCheckRun = computed(() => {
);
});
+const isLatestPlanCheckRun = computed(() => {
+ return selectedPlanCheckRunUID.value === first(selectedPlanCheckRunList.value)?.uid;
+});
+
const tabItemList = computed(() => {
return selectedPlanCheckRunList.value.map<TabFilterItem<string>>(
(checkRun, i) => {
diff --git a/frontend/src/components/SQLCheck/SQLCheckPanel.vue b/frontend/src/components/SQLCheck/SQLCheckPanel.vue
index 0c29f70e29..7e492e243f 100644
--- a/frontend/src/components/SQLCheck/SQLCheckPanel.vue
+++ b/frontend/src/components/SQLCheck/SQLCheckPanel.vue
@@ -8,7 +8,11 @@
container-class="!pt-0 -mt-px"
@close="$emit('close')"
>
- <PlanCheckDetail :plan-check-run="planCheckRun" :environment="environment">
+ <PlanCheckDetail
+ :plan-check-run="planCheckRun"
+ :environment="environment"
+ :is-latest="true"
+ >
<template #row-extra="{ row }">
<slot name="row-extra" :row="row" />
</template>