Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: prevent canceling issue when tasks running (#10797)
Liu Jiaa53d7c4b55b
diff --git a/frontend/src/components/IssueV1/components/Panel/IssueStatusActionPanel.vue b/frontend/src/components/IssueV1/components/Panel/IssueStatusActionPanel.vueindex f5a11b5fad..6febad4d89 100644--- a/frontend/src/components/IssueV1/components/Panel/IssueStatusActionPanel.vue+++ b/frontend/src/components/IssueV1/components/Panel/IssueStatusActionPanel.vue@@ -17,6 +17,29 @@</div></div>+ <div v-if="issueStatusActionErrors.length > 0" class="flex flex-col">+ <ErrorList+ :errors="issueStatusActionErrors"+ bullets="none"+ class="text-sm"+ >+ <template #prefix>+ <heroicons:exclamation-triangle+ class="text-warning w-4 h-4 inline-block mr-1 mb-px"+ />+ </template>+ </ErrorList>+ <div>+ <NCheckbox v-model:checked="performActionAnyway">+ {{+ $t("issue.action-anyway", {+ action: issueStatusActionDisplayName(action),+ })+ }}+ </NCheckbox>+ </div>+ </div>+<div class="flex flex-col gap-y-1"><p class="font-medium text-control">{{ $t("common.comment") }}@@ -38,18 +61,27 @@<NButton @click="$emit('close')">{{ $t("common.cancel") }}</NButton>- <NButton- v-bind="issueStatusActionButtonProps(action)"- @click="handleConfirm(action, comment)"- >- {{ issueStatusActionDisplayName(action) }}- </NButton>+ <NTooltip :disabled="confirmErrors.length === 0" placement="top">+ <template #trigger>+ <NButton+ :disabled="confirmErrors.length > 0"+ v-bind="issueStatusActionButtonProps(action)"+ @click="handleConfirm(action, comment)"+ >+ {{ issueStatusActionDisplayName(action) }}+ </NButton>+ </template>+ <template #default>+ <ErrorList :errors="confirmErrors" />+ </template>+ </NTooltip></div></template></CommonDrawer></template><script setup lang="ts">+import { NCheckbox } from "naive-ui";import { computed, reactive, ref } from "vue";import { useI18n } from "vue-i18n";import {@@ -59,8 +91,11 @@ import {issueStatusActionDisplayName,IssueStatusActionToIssueStatusMap,} from "@/components/IssueV1/logic";+import ErrorList from "@/components/misc/ErrorList.vue";import { issueServiceClient } from "@/grpcweb";import { pushNotification } from "@/store";+import { Task_Status } from "@/types/proto/v1/rollout_service";+import { flattenTaskV1List } from "@/utils";import CommonDrawer from "./CommonDrawer.vue";type LocalState = {@@ -80,6 +115,7 @@ const state = reactive<LocalState>({});const { events, issue } = useIssueContext();const comment = ref("");+const performActionAnyway = ref(false);const title = computed(() => {const { action } = props;@@ -95,6 +131,22 @@ const title = computed(() => {return "";});+const issueStatusActionErrors = computed(() => {+ const tasks = flattenTaskV1List(issue.value.rolloutEntity);+ if (tasks.some((task) => task.status === Task_Status.RUNNING)) {+ return [t("issue.status-transition.error.some-tasks-are-still-running")];+ }+ return [];+});++const confirmErrors = computed(() => {+ const errors: string[] = [];+ if (issueStatusActionErrors.value.length > 0 && !performActionAnyway.value) {+ errors.push(...issueStatusActionErrors.value);+ }+ return errors;+});+const handleConfirm = async (action: IssueStatusAction,comment: string | undefineddiff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.jsonindex b670366298..864a4187da 100644--- a/frontend/src/locales/en-US.json+++ b/frontend/src/locales/en-US.json@@ -948,6 +948,9 @@"form": {"note": "Note","placeholder": "(Optional) Add a note..."+ },+ "error": {+ "some-tasks-are-still-running": "Some tasks are still running"}},"subscribe": "Subscribe",diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.jsonindex 99d8490a48..3a02ad3ec3 100644--- a/frontend/src/locales/es-ES.json+++ b/frontend/src/locales/es-ES.json@@ -947,6 +947,9 @@"form": {"note": "Nota","placeholder": "(Opcional) Agregar una nota..."+ },+ "error": {+ "some-tasks-are-still-running": "Algunas tareas aún se están ejecutando"}},"subscribe": "Suscribirse",diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.jsonindex 18c5881f48..2e5e494f62 100644--- a/frontend/src/locales/ja-JP.json+++ b/frontend/src/locales/ja-JP.json@@ -948,6 +948,9 @@"form": {"note": "ノート","placeholder": "(任意) ノートを追加..."+ },+ "error": {+ "some-tasks-are-still-running": "一部のタスクはまだ実行中です"}},"subscribe": "購読する",diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.jsonindex c9b83406a5..ecd7d83333 100644--- a/frontend/src/locales/vi-VN.json+++ b/frontend/src/locales/vi-VN.json@@ -948,6 +948,9 @@"form": {"note": "Ghi chú","placeholder": "(Tùy chọn) Thêm ghi chú..."+ },+ "error": {+ "some-tasks-are-still-running": "Một số tác vụ vẫn đang chạy"}},"subscribe": "Đặt mua",diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.jsonindex ed70190284..ffe15fbf3b 100644--- a/frontend/src/locales/zh-CN.json+++ b/frontend/src/locales/zh-CN.json@@ -947,6 +947,9 @@"form": {"note": "笔记","placeholder": "(可选)添加一段笔记…"+ },+ "error": {+ "some-tasks-are-still-running": "部分任务仍在运行"}},"subscribe": "订阅",