Skip to content

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

chore: tweak plan check runs in issue context (#14972)

boojack8f000adc67ad
diff --git a/frontend/src/components/AnomalyCenter/AnomalyCenterDashboard.vue b/frontend/src/components/AnomalyCenter/AnomalyCenterDashboard.vue
index 7d18db39cb..624a2897d1 100644
--- a/frontend/src/components/AnomalyCenter/AnomalyCenterDashboard.vue
+++ b/frontend/src/components/AnomalyCenter/AnomalyCenterDashboard.vue
@@ -27,52 +27,37 @@
class="grid grid-cols-1 gap-4 sm:grid-cols-2"
:class="`lg:grid-cols-${databaseAnomalySummaryList.length}`"
>
- <template
+ <div
v-for="(summary, index) in databaseAnomalySummaryList"
:key="index"
+ class="px-4 py-2 border"
>
- <NTooltip>
- <template #trigger>
- <div class="px-4 py-2 border">
- <div class="flex justify-between items-center">
- <dt class="textlabel">
- {{ summary.environmentName }}
- </dt>
- <dd class="flex flex-row text-main space-x-2">
- <span class="flex flex-row items-center">
- <heroicons-outline:exclamation-circle
- class="w-4 h-4 mr-1 text-error"
- />
- {{ summary.criticalCount }}
- </span>
- <span class="flex flex-row items-center">
- <heroicons-outline:exclamation
- class="w-4 h-4 mr-1 text-warning"
- />
- {{ summary.highCount }}
- </span>
- <span class="flex flex-row items-center">
- <heroicons-outline:information-circle
- class="w-4 h-4 mr-1 text-info"
- />
- {{ summary.mediumCount }}
- </span>
- </dd>
- </div>
- </div>
- </template>
- <span class="text-sm">
- {{
- $t("anomaly.tooltip", {
- env: summary.environmentName,
- criticalCount: summary.criticalCount,
- highCount: summary.highCount,
- mediumCount: summary.mediumCount,
- })
- }}
- </span>
- </NTooltip>
- </template>
+ <div class="flex justify-between items-center">
+ <dt class="textlabel">
+ {{ summary.environmentName }}
+ </dt>
+ <dd class="flex flex-row text-main space-x-2">
+ <span class="flex flex-row items-center">
+ <heroicons-outline:exclamation-circle
+ class="w-4 h-4 mr-1 text-error"
+ />
+ {{ summary.criticalCount }}
+ </span>
+ <span class="flex flex-row items-center">
+ <heroicons-outline:exclamation
+ class="w-4 h-4 mr-1 text-warning"
+ />
+ {{ summary.highCount }}
+ </span>
+ <span class="flex flex-row items-center">
+ <heroicons-outline:information-circle
+ class="w-4 h-4 mr-1 text-info"
+ />
+ {{ summary.mediumCount }}
+ </span>
+ </dd>
+ </div>
+ </div>
</dl>
</div>
</div>
@@ -93,7 +78,6 @@
</template>
<script lang="ts" setup>
-import { NTooltip } from "naive-ui";
import { computed, onMounted, ref } from "vue";
import type { BBTableSectionDataSource } from "@/bbkit/types";
import {
diff --git a/frontend/src/components/IssueV1/components/Sidebar/ReleaseInfo.vue b/frontend/src/components/IssueV1/components/Sidebar/ReleaseInfo.vue
index 2198e9232d..06d70d2486 100644
--- a/frontend/src/components/IssueV1/components/Sidebar/ReleaseInfo.vue
+++ b/frontend/src/components/IssueV1/components/Sidebar/ReleaseInfo.vue
@@ -4,25 +4,21 @@
class="w-full text-sm text-control-light flex space-x-1 items-center"
>
<PackageIcon class="w-5 h-auto shrink-0" />
- <a :href="`/${release.name}`" target="_blank" class="normal-link truncate">
+ <a
+ :href="`/${release.name}`"
+ target="_blank"
+ class="normal-link truncate"
+ :class="{
+ 'line-through opacity-60': release.state === State.DELETED,
+ }"
+ >
{{ release.title }}
</a>
- <NTag
- v-if="release.state === State.DELETED"
- class="shrink-0"
- type="warning"
- size="small"
- round
- >
- {{ $t("common.archived") }}
- </NTag>
</div>
</template>
<script setup lang="ts">
import { PackageIcon } from "lucide-vue-next";
-import { NTag } from "naive-ui";
-import { computed } from "vue";
import { useIssueContext } from "@/components/IssueV1";
import { useReleaseByName } from "@/store";
import { isValidReleaseName } from "@/types";
@@ -33,8 +29,4 @@ const { issue } = useIssueContext();
const { release, ready } = useReleaseByName(
issue.value.planEntity?.releaseSource?.release || ""
);
-
-defineExpose({
- shown: computed(() => isValidReleaseName(release.value.name)),
-});
</script>
diff --git a/frontend/src/components/IssueV1/components/Sidebar/ReviewSection/ReviewSection.vue b/frontend/src/components/IssueV1/components/Sidebar/ReviewSection/ReviewSection.vue
index 4d02bb2551..d9a33fc3c3 100644
--- a/frontend/src/components/IssueV1/components/Sidebar/ReviewSection/ReviewSection.vue
+++ b/frontend/src/components/IssueV1/components/Sidebar/ReviewSection/ReviewSection.vue
@@ -109,10 +109,4 @@ const retryFindingApprovalFlow = async () => {
retrying.value = false;
}
};
-
-defineExpose({
- shown: computed(() => {
- return true; // Always shown
- }),
-});
</script>
diff --git a/frontend/src/components/IssueV1/components/Sidebar/Sidebar.vue b/frontend/src/components/IssueV1/components/Sidebar/Sidebar.vue
index fb56ab1806..e70faa167e 100644
--- a/frontend/src/components/IssueV1/components/Sidebar/Sidebar.vue
+++ b/frontend/src/components/IssueV1/components/Sidebar/Sidebar.vue
@@ -1,11 +1,11 @@
<template>
<div class="flex flex-col gap-y-3 py-2 px-3">
- <VCSInfo ref="vcsInfoRef" />
- <ReleaseInfo ref="releaseInfoRef" />
- <ReviewSection ref="reviewSectionRef" />
+ <VCSInfo />
+ <ReleaseInfo />
+ <ReviewSection />
<IssueLabels />
- <div v-if="isFirstSectionShown" class="border-t -mx-3" />
+ <div class="border-t -mx-3" />
<EarliestAllowedTime />
<PreBackupSection />
@@ -14,7 +14,6 @@
</template>
<script lang="ts" setup>
-import { computed, ref } from "vue";
import EarliestAllowedTime from "./EarliestAllowedTime.vue";
import GhostSection from "./GhostSection";
import IssueLabels from "./IssueLabels.vue";
@@ -22,14 +21,4 @@ import PreBackupSection from "./PreBackupSection";
import ReleaseInfo from "./ReleaseInfo.vue";
import ReviewSection from "./ReviewSection";
import VCSInfo from "./VCSInfo.vue";
-
-const vcsInfoRef = ref<InstanceType<typeof VCSInfo>>();
-const releaseInfoRef = ref<InstanceType<typeof ReleaseInfo>>();
-const reviewSectionRef = ref<InstanceType<typeof ReviewSection>>();
-
-const isFirstSectionShown = computed(() => {
- return [vcsInfoRef, releaseInfoRef, reviewSectionRef].some(
- (elemRef) => elemRef.value?.shown
- );
-});
</script>
diff --git a/frontend/src/components/IssueV1/components/Sidebar/VCSInfo.vue b/frontend/src/components/IssueV1/components/Sidebar/VCSInfo.vue
index 94bc32f0fc..5a97cf881f 100644
--- a/frontend/src/components/IssueV1/components/Sidebar/VCSInfo.vue
+++ b/frontend/src/components/IssueV1/components/Sidebar/VCSInfo.vue
@@ -80,10 +80,4 @@ const beautifyPullRequestUrl = (vcs: Plan_VCSSource | undefined) => {
}
return "";
};
-
-defineExpose({
- shown: computed(() => {
- return false;
- }),
-});
</script>
diff --git a/frontend/src/components/IssueV1/logic/plan-check.ts b/frontend/src/components/IssueV1/logic/plan-check.ts
index b7d71b955d..35fbdd56bc 100644
--- a/frontend/src/components/IssueV1/logic/plan-check.ts
+++ b/frontend/src/components/IssueV1/logic/plan-check.ts
@@ -31,13 +31,7 @@ export const planCheckRunListForTask = (issue: ComposedIssue, task: Task) => {
const spec = specForTask(issue.planEntity, task);
const sheet = spec ? sheetNameForSpec(spec) : "";
return issue.planCheckRunList.filter((check) => {
- if (sheet && check.sheet) {
- // If both the task spec and the planCheckRun have `sheet`
- // filter by sheet and target combination
- return check.sheet === sheet && check.target === target;
- }
- // Otherwise filter by target only
- return check.target === target;
+ return check.sheet === sheet && check.target === target;
});
};
diff --git a/frontend/src/components/PlanCheckRun/PlanCheckRunBadge.vue b/frontend/src/components/PlanCheckRun/PlanCheckRunBadge.vue
index 9be7671e67..f41abba13d 100644
--- a/frontend/src/components/PlanCheckRun/PlanCheckRunBadge.vue
+++ b/frontend/src/components/PlanCheckRun/PlanCheckRunBadge.vue
@@ -63,6 +63,7 @@ defineEmits<{
const { t } = useI18n();
const latestPlanCheckRun = computed(() => {
+ // Get the latest PlanCheckRun by UID.
return maxBy(props.planCheckRunList, (check) =>
Number(extractPlanCheckRunUID(check.name))
)!;
diff --git a/frontend/src/components/PlanCheckRun/PlanCheckRunBadgeBar.vue b/frontend/src/components/PlanCheckRun/PlanCheckRunBadgeBar.vue
index d0789aa01e..11c24cf805 100644
--- a/frontend/src/components/PlanCheckRun/PlanCheckRunBadgeBar.vue
+++ b/frontend/src/components/PlanCheckRun/PlanCheckRunBadgeBar.vue
@@ -1,5 +1,5 @@
<template>
- <div class="flex items-center flex-wrap gap-2 flex-1">
+ <div class="flex items-center flex-wrap sm:gap-2 gap-1 flex-1">
<PlanCheckRunBadge
v-for="group in planCheckRunsGroupByType"
:key="group.type"
diff --git a/frontend/src/store/modules/v1/experimental-issue.ts b/frontend/src/store/modules/v1/experimental-issue.ts
index 69d9847aa4..f18e11a5a3 100644
--- a/frontend/src/store/modules/v1/experimental-issue.ts
+++ b/frontend/src/store/modules/v1/experimental-issue.ts
@@ -1,3 +1,4 @@
+import { orderBy } from "lodash-es";
import { ref, watch, type WatchCallback } from "vue";
import {
issueServiceClient,
@@ -63,12 +64,11 @@ export const composeIssue = async (
}
if (hasProjectPermissionV2(projectEntity, "bb.planCheckRuns.list")) {
// Only show the latest plan check runs.
- // TODO(steven): maybe we need to show all plan check runs on a separate page later.
const { planCheckRuns } = await planServiceClient.listPlanCheckRuns({
parent: issue.plan,
latestOnly: true,
});
- issue.planCheckRunList = planCheckRuns;
+ issue.planCheckRunList = orderBy(planCheckRuns, "name", "desc");
}
}
if (config.withRollout && issue.rollout) {
diff --git a/frontend/src/store/modules/v1/plan.ts b/frontend/src/store/modules/v1/plan.ts
index f96d90b543..cff28b2aac 100644
--- a/frontend/src/store/modules/v1/plan.ts
+++ b/frontend/src/store/modules/v1/plan.ts
@@ -1,4 +1,5 @@
import dayjs from "dayjs";
+import { orderBy } from "lodash-es";
import { defineStore } from "pinia";
import { planServiceClient } from "@/grpcweb";
import { useUserStore } from "@/store";
@@ -97,7 +98,7 @@ export const composePlan = async (rawPlan: Plan): Promise<ComposedPlan> => {
parent: rawPlan.name,
latestOnly: true,
});
- plan.planCheckRunList = planCheckRuns;
+ plan.planCheckRunList = orderBy(planCheckRuns, "name", "desc");
}
return plan;