Skip to content

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

feat(frontend): ci/cd UI improvements (#7999)

Liu Jia3f08571861d
diff --git a/frontend/src/components/IssueV1/components/HeaderSection/Actions/review/ReviewActionButton.vue b/frontend/src/components/IssueV1/components/HeaderSection/Actions/review/ReviewActionButton.vue
index a962bdc690..95608a1527 100644
--- a/frontend/src/components/IssueV1/components/HeaderSection/Actions/review/ReviewActionButton.vue
+++ b/frontend/src/components/IssueV1/components/HeaderSection/Actions/review/ReviewActionButton.vue
@@ -20,7 +20,6 @@
<script setup lang="ts">
import { NButton, NTooltip } from "naive-ui";
import { computed } from "vue";
-import { useI18n } from "vue-i18n";
import { ErrorList } from "@/components/IssueV1/components/common";
import {
IssueReviewAction,
@@ -39,21 +38,9 @@ defineEmits<{
(event: "perform-action", action: IssueReviewAction): void;
}>();
-const { t } = useI18n();
const { issue, reviewContext } = useIssueContext();
const currentUser = useCurrentUserV1();
-const allTaskChecksPassed = computed(() => {
- // TODO
- return true;
- // const taskList =
- // issue.value.pipeline?.stageList.flatMap((stage) => stage.taskList) ?? [];
- // return taskList.every((task) => {
- // const summary = taskCheckRunSummary(task);
- // return summary.errorCount === 0 && summary.runningCount === 0;
- // });
-});
-
const errors = computed(() => {
const errors: string[] = [];
@@ -67,15 +54,6 @@ const errors = computed(() => {
) {
errors.push("You are not allowed to perform this action.");
}
- if (props.action === "APPROVE") {
- if (!allTaskChecksPassed.value) {
- errors.push(
- t(
- "custom-approval.issue-review.disallow-approve-reason.some-task-checks-didnt-pass"
- )
- );
- }
- }
return errors;
});
</script>
diff --git a/frontend/src/components/IssueV1/components/HeaderSection/Actions/rollout/RolloutActionButton.vue b/frontend/src/components/IssueV1/components/HeaderSection/Actions/rollout/RolloutActionButton.vue
index 7b294db67e..a7fe0679c0 100644
--- a/frontend/src/components/IssueV1/components/HeaderSection/Actions/rollout/RolloutActionButton.vue
+++ b/frontend/src/components/IssueV1/components/HeaderSection/Actions/rollout/RolloutActionButton.vue
@@ -23,7 +23,6 @@ import { ErrorList } from "@/components/IssueV1/components/common";
import {
StageRolloutAction,
TaskRolloutAction,
- allPlanChecksPassedForTask,
allowUserToApplyTaskRolloutAction,
taskRolloutActionButtonProps,
taskRolloutActionDisplayName,
@@ -48,9 +47,6 @@ const { issue, activeTask } = useIssueContext();
const errors = asyncComputed(async () => {
const errors: string[] = [];
- if (!allPlanChecksPassedForTask(issue.value, activeTask.value)) {
- errors.push("Some checks failed");
- }
if (
!(await allowUserToApplyTaskRolloutAction(
issue.value,
diff --git a/frontend/src/components/IssueV1/components/HeaderSection/HeaderSection.vue b/frontend/src/components/IssueV1/components/HeaderSection/HeaderSection.vue
index fb0b8f1ee5..e9aba13b8e 100644
--- a/frontend/src/components/IssueV1/components/HeaderSection/HeaderSection.vue
+++ b/frontend/src/components/IssueV1/components/HeaderSection/HeaderSection.vue
@@ -1,7 +1,7 @@
<template>
- <div class="flex flex-col px-4 py-2">
+ <div class="flex flex-col py-2">
<div
- class="flex flex-col md:flex-row md:items-start md:justify-between gap-2"
+ class="flex flex-col md:flex-row md:items-start md:justify-between gap-2 px-4"
>
<div class="flex-1 flex items-center gap-x-2">
<div v-if="!isCreating">
@@ -20,7 +20,7 @@
<div class="w-full border-t mt-2 mb-4" />
<div
- class="flex flex-col md:flex-row md:items-stretch md:justify-between gap-2"
+ class="flex flex-col md:flex-row md:items-stretch md:justify-between gap-2 px-4"
>
<div class="flex-1 flex flex-col gap-x-2">
<Description />
diff --git a/frontend/src/components/IssueV1/components/Panel/IssueReviewActionPanel.vue b/frontend/src/components/IssueV1/components/Panel/IssueReviewActionPanel.vue
index 4735a0048f..488451d0b3 100644
--- a/frontend/src/components/IssueV1/components/Panel/IssueReviewActionPanel.vue
+++ b/frontend/src/components/IssueV1/components/Panel/IssueReviewActionPanel.vue
@@ -3,11 +3,11 @@
:show="action !== undefined"
:title="title"
:loading="state.loading"
- @show="comment = ''"
+ @show="resetState"
@close="$emit('close')"
>
<template #default>
- <div v-if="action" class="flex flex-col gap-y-4">
+ <div v-if="action" class="flex flex-col gap-y-4 px-1">
<div class="flex flex-col gap-y-1">
<div class="font-medium text-control">
{{ $t("common.issue") }}
@@ -17,6 +17,32 @@
</div>
</div>
+ <PlanCheckBar
+ v-if="issue.planCheckRunList.length > 0"
+ :allow-run-checks="false"
+ class="shrink-0 flex-col gap-y-1"
+ label-class="!text-base"
+ />
+
+ <div v-if="planCheckErrors.length > 0" class="flex flex-col">
+ <ErrorList :errors="planCheckErrors" :bullets="false" 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: issueReviewActionDisplayName(action),
+ })
+ }}
+ </NCheckbox>
+ </div>
+ </div>
+
<div class="flex flex-col gap-y-1">
<p class="font-medium text-control">
{{ $t("common.comment") }}
@@ -39,19 +65,28 @@
<NButton @click="$emit('close')">
{{ $t("common.cancel") }}
</NButton>
- <NButton
- :disabled="!allowConfirm"
- v-bind="issueReviewActionButtonProps(action)"
- @click="handleClickConfirm"
- >
- {{ issueReviewActionDisplayName(action) }}
- </NButton>
+
+ <NTooltip :disabled="confirmErrors.length === 0" placement="top">
+ <template #trigger>
+ <NButton
+ :disabled="confirmErrors.length > 0"
+ v-bind="issueReviewActionButtonProps(action)"
+ @click="handleClickConfirm"
+ >
+ {{ issueReviewActionDisplayName(action) }}
+ </NButton>
+ </template>
+ <template #default>
+ <ErrorList :errors="confirmErrors" />
+ </template>
+ </NTooltip>
</div>
</template>
</CommonDrawer>
</template>
<script setup lang="ts">
+import { NButton, NCheckbox, NInput, NTooltip } from "naive-ui";
import { computed, reactive, ref } from "vue";
import { useI18n } from "vue-i18n";
import {
@@ -60,9 +95,13 @@ import {
targetReviewStatusForReviewAction,
issueReviewActionButtonProps,
issueReviewActionDisplayName,
+ planCheckRunSummaryForIssue,
} from "@/components/IssueV1/logic";
+import RequiredStar from "@/components/RequiredStar.vue";
import { issueServiceClient } from "@/grpcweb";
import { Issue_Approver_Status } from "@/types/proto/v1/issue_service";
+import { PlanCheckBar } from "../PlanCheckSection";
+import { ErrorList } from "../common";
import CommonDrawer from "./CommonDrawer.vue";
type LocalState = {
@@ -82,6 +121,7 @@ const state = reactive<LocalState>({
});
const { events, issue } = useIssueContext();
const comment = ref("");
+const performActionAnyway = ref(false);
const title = computed(() => {
switch (props.action) {
@@ -95,12 +135,45 @@ const title = computed(() => {
return ""; // Make linter happy
});
-const allowConfirm = computed(() => {
- if (props.action === "SEND_BACK" && comment.value === "") {
- return false;
+const planCheckErrors = computed(() => {
+ const errors: string[] = [];
+ if (props.action === "APPROVE") {
+ const summary = planCheckRunSummaryForIssue(issue.value);
+ if (summary.errorCount > 0 || summary.warnCount) {
+ errors.push(
+ t(
+ "custom-approval.issue-review.disallow-approve-reason.some-task-checks-didnt-pass"
+ )
+ );
+ }
+ if (summary.runningCount > 0) {
+ errors.push(
+ t(
+ "custom-approval.issue-review.disallow-approve-reason.some-task-checks-are-still-running"
+ )
+ );
+ }
}
- return true;
+ return errors;
+});
+
+const confirmErrors = computed(() => {
+ const errors: string[] = [];
+ if (props.action === "SEND_BACK" && comment.value === "") {
+ errors.push(
+ t(
+ "custom-approval.issue-review.disallow-approve-reason.x-field-is-required",
+ {
+ field: t("common.comment"),
+ }
+ )
+ );
+ }
+ if (planCheckErrors.value.length > 0 && !performActionAnyway.value) {
+ errors.push(...planCheckErrors.value);
+ }
+ return errors;
});
const handleClickConfirm = (e: MouseEvent) => {
@@ -159,4 +232,9 @@ const handleConfirm = async (onSuccess: () => void) => {
emit("close");
}
};
+
+const resetState = () => {
+ comment.value = "";
+ performActionAnyway.value = false;
+};
</script>
diff --git a/frontend/src/components/IssueV1/components/Panel/IssueStatusActionPanel.vue b/frontend/src/components/IssueV1/components/Panel/IssueStatusActionPanel.vue
index c0ac96f3b5..f5a11b5fad 100644
--- a/frontend/src/components/IssueV1/components/Panel/IssueStatusActionPanel.vue
+++ b/frontend/src/components/IssueV1/components/Panel/IssueStatusActionPanel.vue
@@ -7,7 +7,7 @@
@close="$emit('close')"
>
<template #default>
- <div v-if="action" class="flex flex-col gap-y-4">
+ <div v-if="action" class="flex flex-col gap-y-4 px-1">
<div class="flex flex-col gap-y-1">
<div class="font-medium text-control">
{{ $t("common.issue") }}
diff --git a/frontend/src/components/IssueV1/components/Panel/TaskRolloutActionPanel.vue b/frontend/src/components/IssueV1/components/Panel/TaskRolloutActionPanel.vue
index 36213501e3..8d3518afe3 100644
--- a/frontend/src/components/IssueV1/components/Panel/TaskRolloutActionPanel.vue
+++ b/frontend/src/components/IssueV1/components/Panel/TaskRolloutActionPanel.vue
@@ -3,11 +3,14 @@
:show="action !== undefined"
:title="title"
:loading="state.loading"
- @show="comment = ''"
+ @show="resetState"
@close="$emit('close')"
>
<template #default>
- <div v-if="action" class="flex flex-col gap-y-4 h-full overflow-y-hidden">
+ <div
+ v-if="action"
+ class="flex flex-col gap-y-4 h-full overflow-y-hidden px-1"
+ >
<div
class="flex flex-col gap-y-1 shrink overflow-y-hidden justify-start"
>
@@ -37,13 +40,34 @@
</ul>
</div>
</div>
+
<PlanCheckBar
- v-if="taskList.length === 1 && action === 'ROLLOUT'"
+ v-if="action === 'ROLLOUT' || action === 'RETRY'"
:allow-run-checks="false"
- :task="taskList[0]"
+ :plan-check-run-list="planCheckRunList"
class="shrink-0 flex-col gap-y-1"
label-class="!text-base"
/>
+
+ <div v-if="planCheckErrors.length > 0" class="flex flex-col">
+ <ErrorList :errors="planCheckErrors" :bullets="false" 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: taskRolloutActionDialogButtonName(action, taskList),
+ })
+ }}
+ </NCheckbox>
+ </div>
+ </div>
+
<div class="flex flex-col gap-y-1 shrink-0">
<p class="font-medium text-control">
{{ $t("common.comment") }}
@@ -65,24 +89,36 @@
<NButton @click="$emit('close')">
{{ $t("common.cancel") }}
</NButton>
- <NButton
- v-bind="taskRolloutActionButtonProps(action)"
- @click="handleConfirm(action, comment)"
- >
- {{ taskRolloutActionDialogButtonName(action, taskList) }}
- </NButton>
+
+ <NTooltip :disabled="confirmErrors.length === 0" placement="top">
+ <template #trigger>
+ <NButton
+ :disabled="confirmErrors.length > 0"
+ v-bind="taskRolloutActionButtonProps(action)"
+ @click="handleConfirm(action, comment)"
+ >
+ {{ taskRolloutActionDialogButtonName(action, taskList) }}
+ </NButton>
+ </template>
+ <template #default>
+ <ErrorList :errors="confirmErrors" />
+ </template>
+ </NTooltip>
</div>
</template>
</CommonDrawer>
</template>
<script setup lang="ts">
-import { groupBy } from "lodash-es";
+import { groupBy, uniqBy } from "lodash-es";
+import { NButton, NCheckbox, NInput, NTooltip } from "naive-ui";
import { computed, reactive, ref } from "vue";
import { useI18n } from "vue-i18n";
import { PlanCheckBar } from "@/components/IssueV1/components/PlanCheckSection";
import {
TaskRolloutAction,
+ planCheckRunListForTask,
+ planCheckRunSummaryForCheckRunList,
stageForTask,
taskRolloutActionButtonProps,
taskRolloutActionDialogButtonName,
@@ -97,6 +133,7 @@ import {
TaskRun,
TaskRun_Status,
} from "@/types/proto/v1/rollout_service";
+import CommonDrawer from "./CommonDrawer.vue";
type LocalState = {
loading: boolean;
@@ -116,6 +153,7 @@ const state = reactive<LocalState>({
});
const { issue, events } = useIssueContext();
const comment = ref("");
+const performActionAnyway = ref(false);
const title = computed(() => {
if (!props.action) return "";
@@ -137,6 +175,44 @@ const distinctTaskList = computed(() => {
});
});
+const planCheckRunList = computed(() => {
+ const list = props.taskList.flatMap((task) =>
+ planCheckRunListForTask(issue.value, task)
+ );
+ return uniqBy(list, (checkRun) => checkRun.uid);
+});
+
+const planCheckErrors = computed(() => {
+ const errors: string[] = [];
+ if (props.action === "ROLLOUT" || props.action === "RETRY") {
+ const summary = planCheckRunSummaryForCheckRunList(planCheckRunList.value);
+ if (summary.errorCount > 0 || summary.warnCount) {
+ errors.push(
+ t(
+ "custom-approval.issue-review.disallow-approve-reason.some-task-checks-didnt-pass"
+ )
+ );
+ }
+ if (summary.runningCount > 0) {
+ errors.push(
+ t(
+ "custom-approval.issue-review.disallow-approve-reason.some-task-checks-are-still-running"
+ )
+ );
+ }
+ }
+
+ return errors;
+});
+
+const confirmErrors = computed(() => {
+ const errors: string[] = [];
+ if (planCheckErrors.value.length > 0 && !performActionAnyway.value) {
+ errors.push(...planCheckErrors.value);
+ }
+ return errors;
+});
+
const handleConfirm = async (
action: TaskRolloutAction,
comment: string | undefined
@@ -203,4 +279,9 @@ const handleConfirm = async (
// isTransiting.value = false;
// emit("updated");
};
+
+const resetState = () => {
+ comment.value = "";
+ performActionAnyway.value = false;
+};
</script>
diff --git a/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckBar/PlanCheckBadgeBar.vue b/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckBar/PlanCheckBadgeBar.vue
index 0db03d5df7..7d214b1d5a 100644
--- a/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckBar/PlanCheckBadgeBar.vue
+++ b/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckBar/PlanCheckBadgeBar.vue
@@ -18,7 +18,6 @@ import { computed } from "vue";
import {
PlanCheckRun,
PlanCheckRun_Type,
- Task,
} from "@/types/proto/v1/rollout_service";
import { groupBy } from "@/utils/collections";
import PlanCheckBadge from "./PlanCheckBadge.vue";
@@ -26,7 +25,6 @@ import PlanCheckBadge from "./PlanCheckBadge.vue";
const props = defineProps<{
planCheckRunList: PlanCheckRun[];
selectedType?: PlanCheckRun_Type;
- task: Task;
}>();
defineEmits<{
diff --git a/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckBar/PlanCheckBar.vue b/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckBar/PlanCheckBar.vue
index c6cadd2e56..ff61c51c36 100644
--- a/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckBar/PlanCheckBar.vue
+++ b/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckBar/PlanCheckBar.vue
@@ -9,12 +9,11 @@
<PlanCheckBadgeBar
:plan-check-run-list="planCheckRunList"
- :task="task"
@select-type="selectedType = $event"
/>
<PlanCheckRunButton
- v-if="allowRunChecks"
+ v-if="allowRunChecks && task"
:task="task"
@run-checks="runChecks"
/>
@@ -38,7 +37,11 @@ import {
useIssueContext,
} from "@/components/IssueV1/logic";
import { rolloutServiceClient } from "@/grpcweb";
-import { PlanCheckRun_Type, Task } from "@/types/proto/v1/rollout_service";
+import {
+ PlanCheckRun,
+ PlanCheckRun_Type,
+ Task,
+} from "@/types/proto/v1/rollout_service";
import { VueClass } from "@/utils";
import PlanCheckBadgeBar from "./PlanCheckBadgeBar.vue";
import PlanCheckPanel from "./PlanCheckPanel.vue";
@@ -46,14 +49,18 @@ import PlanCheckRunButton from "./PlanCheckRunButton.vue";
const props = defineProps<{
allowRunChecks?: boolean;
- task: Task;
+ task?: Task;
labelClass?: VueClass;
+ planCheckRunList?: PlanCheckRun[];
}>();
const { issue, events } = useIssueContext();
const selectedType = ref<PlanCheckRun_Type>();
const planCheckRunList = computed(() => {
+ if (!props.task) {
+ return props.planCheckRunList ?? issue.value.planCheckRunList;
+ }
return planCheckRunListForTask(issue.value, props.task);
});
diff --git a/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckBar/PlanCheckDetail.vue b/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckBar/PlanCheckDetail.vue
index e44ecf6a05..ecfe6b1eb8 100644
--- a/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckBar/PlanCheckDetail.vue
+++ b/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckBar/PlanCheckDetail.vue
@@ -110,6 +110,7 @@ import {
RuleTemplate,
RuleType,
SQLReviewPolicyErrorCode,
+ UNKNOWN_ID,
findRuleTemplate,
getRuleLocalization,
ruleTemplateMap,
@@ -148,7 +149,7 @@ type LocalState = {
const props = defineProps<{
planCheckRun: PlanCheckRun;
- task: Task;
+ task?: Task;
}>();
const { t } = useI18n();
@@ -303,7 +304,11 @@ const COLUMN_LIST = computed(() => {
const reviewPolicy = useReviewPolicyByEnvironmentId(
computed(() => {
- const database = databaseForTask(issue.value, props.task);
+ const task = props.task;
+ if (!task) {
+ return String(UNKNOWN_ID);
+ }
+ const database = databaseForTask(issue.value, task);
return database.effectiveEnvironmentEntity.uid;
})
);
diff --git a/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckBar/PlanCheckPanel.vue b/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckBar/PlanCheckPanel.vue
index 20ea9ea7e5..b3d78e717b 100644
--- a/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckBar/PlanCheckPanel.vue
+++ b/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckBar/PlanCheckPanel.vue
@@ -1,6 +1,10 @@
<template>
<BBModal
- :title="$t('task.check-result.title', { name: task.title })"
+ :title="
+ task
+ ? $t('task.check-result.title', { name: task.title })
+ : $t('task.check-result.title-general')
+ "
class="!w-[56rem]"
header-class="whitespace-pre-wrap break-all gap-x-1"
@close="$emit('close')"
@@ -9,7 +13,6 @@
<PlanCheckBadgeBar
:plan-check-run-list="planCheckRunList"
:selected-type="selectedType"
- :task="task"
@select-type="$emit('select-type', $event)"
/>
<TabFilter
@@ -44,7 +47,7 @@ import PlanCheckDetail from "./PlanCheckDetail.vue";
const props = defineProps<{
planCheckRunList: PlanCheckRun[];
selectedType: PlanCheckRun_Type;
- task: Task;
+ task?: Task;
}>();
defineEmits<{
diff --git a/frontend/src/components/IssueV1/components/StageSection/StageCard.vue b/frontend/src/components/IssueV1/components/StageSection/StageCard.vue
index eeb813b802..6b143d76ac 100644
--- a/frontend/src/components/IssueV1/components/StageSection/StageCard.vue
+++ b/frontend/src/components/IssueV1/components/StageSection/StageCard.vue
@@ -33,21 +33,52 @@
</template>
<span>Missing SQL statement</span>
</NTooltip>
+ <NTooltip
+ v-if="
+ !isCreating &&
+ (planCheckStatus === PlanCheckRun_Result_Status.ERROR ||
+ planCheckStatus === PlanCheckRun_Result_Status.WARNING)
+ "
+ trigger="hover"
+ placement="top"
+ >
+ <template #trigger>
+ <heroicons:exclamation-circle-solid
+ class="w-6 h-6 ml-2"
+ :class="[
+ planCheckStatus === PlanCheckRun_Result_Status.ERROR
+ ? 'text-error hover:text-error-hover'
+ : 'text-warning hover:text-warning-hover',
+ ]"
+ />
+ </template>
+ <span>{{
+ $t(
+ "custom-approval.issue-review.disallow-approve-reason.some-task-checks-didnt-pass"
+ )
+ }}</span>
+ </NTooltip>
</div>
</template>
<script lang="ts" setup>
-import { first } from "lodash-es";
+import { first, uniqBy } from "lodash-es";
import { NTooltip } from "naive-ui";
import { computed } from "vue";
import { useI18n } from "vue-i18n";
import {
isTaskFinished,
isValidStage,
+ planCheckRunListForTask,
+ planCheckRunSummaryForCheckRunList,
useIssueContext,
} from "@/components/IssueV1/logic";
import { EMPTY_TASK_NAME, emptyTask } from "@/types";
-import { Stage, task_StatusToJSON } from "@/types/proto/v1/rollout_service";
+import {
+ PlanCheckRun_Result_Status,
+ Stage,
+ task_StatusToJSON,
+} from "@/types/proto/v1/rollout_service";
import { activeTaskInStageV1 } from "@/utils";
import TaskStatusIcon from "../TaskStatusIcon.vue";
import StageSummary from "./StageSummary.vue";
@@ -57,7 +88,8 @@ const props = defineProps<{
}>();
const { t } = useI18n();
-const { isCreating, activeTask, selectedStage, events } = useIssueContext();
+const { isCreating, issue, activeTask, selectedStage, events } =
+ useIssueContext();
const activeTaskInStage = computed(() => {
return activeTaskInStageV1(props.stage);
@@ -116,6 +148,24 @@ const taskTitle = computed(() => {
return (task ?? emptyTask()).title;
});
+const planCheckStatus = computed((): PlanCheckRun_Result_Status => {
+ if (isCreating.value) return PlanCheckRun_Result_Status.UNRECOGNIZED;
+ const planCheckList = uniqBy(
+ props.stage.tasks.flatMap((task) =>
+ planCheckRunListForTask(issue.value, task)
+ ),
+ (checkRun) => checkRun.uid
+ );
+ const summary = planCheckRunSummaryForCheckRunList(planCheckList);
+ if (summary.errorCount > 0) {
+ return PlanCheckRun_Result_Status.ERROR;
+ }
+ if (summary.warnCount > 0) {
+ return PlanCheckRun_Result_Status.WARNING;
+ }
+ return PlanCheckRun_Result_Status.SUCCESS;
+});
+
const activeOrFirstTaskInStage = (stage: Stage) => {
if (isCreating.value) {
return first(stage.tasks);
diff --git a/frontend/src/components/IssueV1/components/StageSection/StageSection.vue b/frontend/src/components/IssueV1/components/StageSection/StageSection.vue
index ffc99cb276..7fb21a70db 100644
--- a/frontend/src/components/IssueV1/components/StageSection/StageSection.vue
+++ b/frontend/src/components/IssueV1/components/StageSection/StageSection.vue
@@ -1,6 +1,6 @@
<template>
- <div class="w-full flex flex-col px-4">
- <div class="flex flex-col lg:flex-row justify-between">
+ <div class="w-full flex flex-col">
+ <div class="flex flex-col lg:flex-row justify-between px-4">
<template v-for="(stage, index) in stageList" :key="stage.uid">
<StageCard :stage="stage" :index="index" class="h-[68px]" />
<div
@@ -27,7 +27,7 @@
<div class="w-full border-t mb-4" />
- <div class="lg:flex items-start justify-between">
+ <div class="lg:flex items-start justify-between px-4">
<StageInfo />
<Actions />
diff --git a/frontend/src/components/IssueV1/components/common/ErrorList.vue b/frontend/src/components/IssueV1/components/common/ErrorList.vue
index 8e7b0aecb0..da82a653fe 100644
--- a/frontend/src/components/IssueV1/components/common/ErrorList.vue
+++ b/frontend/src/components/IssueV1/components/common/ErrorList.vue
@@ -1,16 +1,23 @@
<template>
<ul
class="flex flex-col whitespace-nowrap"
- :class="[errors.length > 1 && 'list-disc pl-4']"
+ :class="[errors.length > 1 && bullets && 'list-disc pl-4']"
>
<li v-for="(error, i) in errors" :key="i">
+ <slot name="prefix" />
{{ error }}
</li>
</ul>
</template>
<script setup lang="ts">
-defineProps<{
- errors: string[];
-}>();
+withDefaults(
+ defineProps<{
+ errors: string[];
+ bullets?: boolean;
+ }>(),
+ {
+ bullets: true,
+ }
+);
</script>
diff --git a/frontend/src/components/IssueV1/logic/plan-check.ts b/frontend/src/components/IssueV1/logic/plan-check.ts
index c1b38f6be5..73aa3f6390 100644
--- a/frontend/src/components/IssueV1/logic/plan-check.ts
+++ b/frontend/src/components/IssueV1/logic/plan-check.ts
@@ -31,18 +31,6 @@ export const planCheckRunListForTask = (issue: ComposedIssue, task: Task) => {
return issue.planCheckRunList.filter((check) => check.target === target);
};
-export const allPlanChecksPassedForTask = (
- issue: ComposedIssue,
- task: Task
-) => {
- const planCheckRunList = planCheckRunListForTask(issue, task);
- if (planCheckRunList.length === 0) {
- return true;
- }
- const summary = planCheckRunSummaryForCheckRunList(planCheckRunList);
- return summary.errorCount === 0;
-};
-
export const HiddenPlanCheckTypes = new Set<PlanCheckRun_Type>([
PlanCheckRun_Type.DATABASE_STATEMENT_SUMMARY_REPORT,
]);
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 6cf45622cf..643a68b16a 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -289,7 +289,8 @@
"checking": "Checking...",
"run-task": "Run checks",
"check-result": {
- "title": "Check result for {name}"
+ "title": "Check result for {name}",
+ "title-general": "Check result"
},
"check-type": {
"fake": "Fake",
@@ -916,7 +917,8 @@
"all-tasks": "All tasks"
}
},
- "not-editable-legacy-issue": "This issue is not editable because it was created in an old version of Bytebase"
+ "not-editable-legacy-issue": "This issue is not editable because it was created in an old version of Bytebase",
+ "action-anyway": "{action} anyway"
},
"alter-schema": {
"vcs-enabled": "This project has enabled VCS based version control and selecting database below will navigate you to the corresponding Git repository to initiate the change process.",
@@ -2745,7 +2747,9 @@
"generating-approval-flow": "Generating approval flow",
"approved-issue": "approved issue",
"disallow-approve-reason": {
- "some-task-checks-didnt-pass": "Some task checks didn't pass"
+ "some-task-checks-didnt-pass": "Some task checks didn't pass",
+ "some-task-checks-are-still-running": "Some task checks are still running",
+ "x-field-is-required": "{field} is required"
},
"send-back": "Send back",
"send-back-issue": "Send back issue?",
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index 72ba5aad04..3423e1d68a 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -289,7 +289,8 @@
"checking": "Comprobando...",
"run-task": "Ejecutar comprobaciones",
"check-result": {
- "title": "Resultado de la comprobación para {name}"
+ "title": "Resultado de la comprobación para {name}",
+ "title-general": "Comprobar resultado"
},
"check-type": {
"fake": "Falso",
@@ -915,7 +916,8 @@
"all-tasks": "Todas las tareas"
}
},
- "not-editable-legacy-issue": "Este problema no es editable porque se creó en una versión anterior de Bytebase"
+ "not-editable-legacy-issue": "Este problema no es editable porque se creó en una versión anterior de Bytebase",
+ "action-anyway": "{action} de todos modos"
},
"alter-schema": {
"vcs-enabled": "Este proyecto ha habilitado el control de versiones basado en VCS y seleccionar la base de datos a continuación lo llevará al repositorio Git correspondiente para iniciar el proceso de cambio.",
@@ -2742,7 +2744,9 @@
"generating-approval-flow": "Generando flujo de aprobación",
"approved-issue": "incidencia aprobada",
"disallow-approve-reason": {
- "some-task-checks-didnt-pass": "Algunas comprobaciones de tareas no pasaron"
+ "some-task-checks-didnt-pass": "Algunas comprobaciones de tareas no pasaron",
+ "some-task-checks-are-still-running": "Algunas comprobaciones de tareas aún se están ejecutando",
+ "x-field-is-required": "{field} se requiere"
},
"send-back": "Enviar de vuelta",
"send-back-issue": "¿Devolver el problema?",
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index f67ac658c8..bde7e287d4 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -287,7 +287,8 @@
"checking": "检查中…",
"run-task": "运行检查",
"check-result": {
- "title": "{name} 的检查结果"
+ "title": "{name} 的检查结果",
+ "title-general": "检查结果"
},
"check-type": {
"fake": "Fake",
@@ -913,7 +914,8 @@
"all-tasks": "所有任务"
}
},
- "not-editable-legacy-issue": "这个工单不可编辑,因为它是在旧版本的 Bytebase 中创建的。"
+ "not-editable-legacy-issue": "这个工单不可编辑,因为它是在旧版本的 Bytebase 中创建的。",
+ "action-anyway": "仍要{action}"
},
"alter-schema": {
"vcs-enabled": "该项目开启了基于 VCS 的版本管理,选择下面的数据库会将您导航到相应的 Git 仓库以发起变更流程。",
@@ -2739,7 +2741,9 @@
"generating-approval-flow": "正在生成审批流",
"approved-issue": "批准工单",
"disallow-approve-reason": {
- "some-task-checks-didnt-pass": "尚有未通过的任务检查项"
+ "some-task-checks-didnt-pass": "尚有未通过的任务检查项",
+ "some-task-checks-are-still-running": "尚有运行中的任务检查项",
+ "x-field-is-required": "{field}为必填项"
},
"send-back": "退回",
"send-back-issue": "退回工单?",
diff --git a/frontend/src/store/modules/sqlReview.ts b/frontend/src/store/modules/sqlReview.ts
index 652752a1ab..f6aa6a387e 100644
--- a/frontend/src/store/modules/sqlReview.ts
+++ b/frontend/src/store/modules/sqlReview.ts
@@ -12,6 +12,7 @@ import {
IdType,
MaybeRef,
RuleType,
+ UNKNOWN_ID,
} from "@/types";
import { Environment } from "@/types/proto/v1/environment_service";
import {
@@ -283,7 +284,9 @@ export const useReviewPolicyByEnvironmentId = (
) => {
const store = useSQLReviewStore();
watchEffect(() => {
- store.getOrFetchReviewPolicyByEnvironmentUID(unref(environmentId));
+ const uid = unref(environmentId);
+ if (uid === String(UNKNOWN_ID)) return;
+ store.getOrFetchReviewPolicyByEnvironmentUID(uid);
});
return computed(() =>