Skip to content

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

chore: show issue risk level badge (#16885)

boojack0177368f3a44
diff --git a/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/common.ts b/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/common.ts
index 282bd445de..6deebea115 100644
--- a/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/common.ts
+++ b/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/common.ts
@@ -1,3 +1,4 @@
+import { isEqual } from "lodash-es";
import { IssueCommentType, type ComposedIssueComment } from "@/store";
import { isNullOrUndefined } from "@/utils";
@@ -21,6 +22,9 @@ export const isSimilarIssueComment = (
if (!fromTaskUpdate || !toTaskUpdate) {
return false;
}
+ if (!isEqual(fromTaskUpdate.tasks, toTaskUpdate.tasks)) {
+ return false;
+ }
if (
fromTaskUpdate.toSheet &&
fromTaskUpdate.toSheet === toTaskUpdate.toSheet
diff --git a/frontend/src/components/Plan/components/IssueReviewView/Sidebar/ApprovalFlowSection/ApprovalFlowSection.vue b/frontend/src/components/Plan/components/IssueReviewView/Sidebar/ApprovalFlowSection/ApprovalFlowSection.vue
index b756e3b4eb..ef695710d5 100644
--- a/frontend/src/components/Plan/components/IssueReviewView/Sidebar/ApprovalFlowSection/ApprovalFlowSection.vue
+++ b/frontend/src/components/Plan/components/IssueReviewView/Sidebar/ApprovalFlowSection/ApprovalFlowSection.vue
@@ -3,6 +3,7 @@
<div class="w-full flex flex-row items-center gap-2">
<h3 class="textlabel">{{ $t("issue.approval-flow.self") }}</h3>
<FeatureBadge :feature="PlanFeature.FEATURE_APPROVAL_WORKFLOW" />
+ <RiskLevelIcon :risk-level="issue.riskLevel" />
</div>
<div class="mt-2">
@@ -61,6 +62,7 @@ import { useIssueV1Store } from "@/store";
import type { Issue } from "@/types/proto-es/v1/issue_service_pb";
import { PlanFeature } from "@/types/proto-es/v1/subscription_service_pb";
import ApprovalStepItem from "./ApprovalStepItem.vue";
+import RiskLevelIcon from "./RiskLevelIcon.vue";
const props = defineProps<{
issue: Issue;
diff --git a/frontend/src/components/Plan/components/IssueReviewView/Sidebar/ApprovalFlowSection/RiskLevelIcon.vue b/frontend/src/components/Plan/components/IssueReviewView/Sidebar/ApprovalFlowSection/RiskLevelIcon.vue
new file mode 100644
index 0000000000..80c0cfc811
--- /dev/null
+++ b/frontend/src/components/Plan/components/IssueReviewView/Sidebar/ApprovalFlowSection/RiskLevelIcon.vue
@@ -0,0 +1,47 @@
+<template>
+ <NTooltip v-if="riskLevel">
+ <template #trigger>
+ <ShieldCheckIcon
+ v-if="riskLevel === Issue_RiskLevel.LOW"
+ class="w-4 h-4 text-success"
+ />
+ <ShieldAlertIcon
+ v-else-if="riskLevel === Issue_RiskLevel.MODERATE"
+ class="w-4 h-4 text-warning"
+ />
+ <ShieldAlertIcon
+ v-else-if="riskLevel === Issue_RiskLevel.HIGH"
+ class="w-4 h-4 text-error"
+ />
+ </template>
+ <span>{{ riskLevelText }}</span>
+ <span class="opacity-60 ml-1">({{ $t("issue.risk-level.self") }})</span>
+ </NTooltip>
+</template>
+
+<script setup lang="ts">
+import { ShieldCheckIcon, ShieldAlertIcon } from "lucide-vue-next";
+import { NTooltip } from "naive-ui";
+import { computed } from "vue";
+import { useI18n } from "vue-i18n";
+import { Issue_RiskLevel } from "@/types/proto-es/v1/issue_service_pb";
+
+const props = defineProps<{
+ riskLevel: Issue_RiskLevel;
+}>();
+
+const { t } = useI18n();
+
+const riskLevelText = computed(() => {
+ switch (props.riskLevel) {
+ case Issue_RiskLevel.LOW:
+ return t("issue.risk-level.low");
+ case Issue_RiskLevel.MODERATE:
+ return t("issue.risk-level.moderate");
+ case Issue_RiskLevel.HIGH:
+ return t("issue.risk-level.high");
+ default:
+ return "";
+ }
+});
+</script>