Skip to content

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

feat: add GitHub-style status indicators to plan list (#17655)

Danny Xu3ef1de91f934
diff --git a/frontend/src/components/Plan/components/PlanCheckRunStatusIcon.vue b/frontend/src/components/Plan/components/PlanCheckRunStatusIcon.vue
index 137255df04..e9eeb78040 100644
--- a/frontend/src/components/Plan/components/PlanCheckRunStatusIcon.vue
+++ b/frontend/src/components/Plan/components/PlanCheckRunStatusIcon.vue
@@ -1,31 +1,27 @@
<template>
<span
- class="flex items-center justify-center rounded-full select-none overflow-hidden"
+ v-if="hasAnyChecks"
+ class="flex items-center justify-center select-none flex-shrink-0"
:class="iconClass()"
>
<template v-if="planCheckRunStatus === PlanCheckRun_Result_Status.ERROR">
- <span
- class="h-2 w-2 rounded-full text-center pb-6 font-normal text-base"
- aria-hidden="true"
- >!</span
- >
+ <XIcon />
</template>
<template
v-else-if="planCheckRunStatus === PlanCheckRun_Result_Status.WARNING"
>
- <span
- class="h-2 w-2 rounded-full text-center pb-6 font-normal text-base"
- aria-hidden="true"
- >!</span
- >
+ <span class="text-xs font-bold" aria-hidden="true">!</span>
</template>
<template
v-else-if="planCheckRunStatus === PlanCheckRun_Result_Status.SUCCESS"
>
- <heroicons-solid:check class="w-4 h-4" />
+ <CheckIcon />
</template>
- <template v-else>
- <span class="h-3 w-3 bg-white rounded-full" aria-hidden="true"></span>
+ <template v-else-if="hasRunningChecks">
+ <span
+ class="w-2.5 h-2.5 rounded-full border-2 border-control"
+ aria-hidden="true"
+ ></span>
</template>
</span>
</template>
@@ -33,6 +29,8 @@
<script lang="ts" setup>
import type { PropType } from "vue";
import { computed } from "vue";
+import CheckIcon from "~icons/heroicons-solid/check";
+import XIcon from "~icons/heroicons-solid/x";
import {
PlanCheckRun_Result_Status,
type Plan,
@@ -52,21 +50,23 @@ const props = defineProps({
},
});
-const { getOverallStatus: planCheckRunStatus } = usePlanCheckStatus(
- computed(() => props.plan)
-);
+const {
+ getOverallStatus: planCheckRunStatus,
+ hasAnyStatus: hasAnyChecks,
+ hasRunning: hasRunningChecks,
+} = usePlanCheckStatus(computed(() => props.plan));
const iconClass = () => {
- const iconClass = props.size === "normal" ? "w-5 h-5" : "w-4 h-4";
+ const sizeClass = props.size === "normal" ? "w-4 h-4" : "w-3.5 h-3.5";
switch (planCheckRunStatus.value) {
case PlanCheckRun_Result_Status.ERROR:
- return iconClass + " bg-error text-white";
+ return `${sizeClass} text-error`;
case PlanCheckRun_Result_Status.WARNING:
- return iconClass + " bg-warning text-white";
+ return `${sizeClass} text-warning`;
case PlanCheckRun_Result_Status.SUCCESS:
- return iconClass + " bg-success text-white";
+ return `${sizeClass} text-success`;
default:
- return iconClass + " bg-control text-white";
+ return `${sizeClass} text-warning`;
}
};
</script>
diff --git a/frontend/src/components/Plan/components/PlanDataTable/PlanDataTable.vue b/frontend/src/components/Plan/components/PlanDataTable/PlanDataTable.vue
index 407ab3a152..23d90cce9a 100644
--- a/frontend/src/components/Plan/components/PlanDataTable/PlanDataTable.vue
+++ b/frontend/src/components/Plan/components/PlanDataTable/PlanDataTable.vue
@@ -18,6 +18,7 @@ import { NPerformantEllipsis, NDataTable, NTag } from "naive-ui";
import { computed } from "vue";
import { useI18n } from "vue-i18n";
import { useRouter } from "vue-router";
+import PencilIcon from "~icons/heroicons-outline/pencil";
import { BBAvatar } from "@/bbkit";
import Timestamp from "@/components/misc/Timestamp.vue";
import { useIssueLayoutVersion } from "@/composables/useIssueLayoutVersion";
@@ -45,10 +46,24 @@ const { enabledNewLayout } = useIssueLayoutVersion();
const columnList = computed((): DataTableColumn<Plan>[] => {
const columns: (DataTableColumn<Plan> & { hide?: boolean })[] = [
{
- key: "status",
+ key: "state-icon",
title: "",
- width: "36px",
- render: (plan) => <PlanCheckRunStatusIcon plan={plan} />,
+ width: "24px",
+ render: (plan) => {
+ const showDraftIcon =
+ enabledNewLayout.value && plan.issue === "" && plan.rollout === "";
+ if (!showDraftIcon || plan.state === State.DELETED) {
+ return null;
+ }
+ return (
+ <span
+ class="flex items-center justify-center w-4 h-4 rounded-full border border-control-border text-control opacity-60"
+ title={t("common.draft")}
+ >
+ <PencilIcon class="w-3 h-3" />
+ </span>
+ );
+ },
},
{
key: "title",
@@ -79,6 +94,7 @@ const columnList = computed((): DataTableColumn<Plan>[] => {
) : (
<span class="opacity-60 italic">{t("common.untitled")}</span>
)}
+ <PlanCheckRunStatusIcon plan={plan} size="small" />
{isDeleted && (
<NTag type="warning" round size="small">
{t("common.closed")}