Skip to content

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

chore: task actions (#16696)

boojack2f7b0cfbe5ef
diff --git a/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/IssueCommentAction.vue b/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/IssueCommentAction.vue
index c78bce77b8..2edc3d4328 100644
--- a/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/IssueCommentAction.vue
+++ b/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/IssueCommentAction.vue
@@ -25,7 +25,7 @@
issueComment.type === IssueCommentType.USER_COMMENT
"
>
- <span>({{ $t("common.edited") }}</span>
+ <span class="opacity-80">({{ $t("common.edited") }}</span>
<HumanizeTs
:ts="getTimeForPbTimestamp(issueComment.updateTime, 0) / 1000"
class="ml-1"
diff --git a/frontend/src/components/Plan/components/IssueReviewView/Sidebar/Sidebar.vue b/frontend/src/components/Plan/components/IssueReviewView/Sidebar/Sidebar.vue
index 0816211dbe..b9b2cc0cb7 100644
--- a/frontend/src/components/Plan/components/IssueReviewView/Sidebar/Sidebar.vue
+++ b/frontend/src/components/Plan/components/IssueReviewView/Sidebar/Sidebar.vue
@@ -1,6 +1,9 @@
<template>
<div class="w-full flex flex-col p-4 gap-4">
- <IssueStatusSection :issue="issue" />
+ <IssueStatusSection
+ v-if="issue.approvalTemplates.length > 0"
+ :issue="issue"
+ />
<ApprovalFlowSection :issue="issue" />
@@ -19,7 +22,7 @@
<NInput
v-model:value="issue.description"
type="textarea"
- placeholder="Add description..."
+ :placeholder="$t('issue.add-some-description')"
:disabled="!allowChange"
:autosize="false"
:resizable="false"
diff --git a/frontend/src/components/Plan/components/PlanCheckSection/PlanCheckSection.vue b/frontend/src/components/Plan/components/PlanCheckSection/PlanCheckSection.vue
index f7bce4cb2a..b329f36819 100644
--- a/frontend/src/components/Plan/components/PlanCheckSection/PlanCheckSection.vue
+++ b/frontend/src/components/Plan/components/PlanCheckSection/PlanCheckSection.vue
@@ -49,68 +49,6 @@
</div>
</div>
- <div class="flex-1 overflow-y-auto">
- <!-- Check Results -->
- <div v-if="checkRunsForSpec.length > 0" class="flex flex-wrap gap-4">
- <!-- Group by Check Type -->
- <div
- v-for="(typeGroup, checkType) in groupedByType"
- :key="checkType"
- class="inline-flex items-center gap-1"
- >
- <component
- :is="getCheckTypeIcon(checkType)"
- class="w-4 h-4 opacity-80"
- />
- <span class="text-sm">{{ getCheckTypeLabel(checkType) }}</span>
-
- <!-- Status indicators -->
- <div class="flex items-center gap-2">
- <div
- v-if="typeGroup.summary.error > 0"
- class="flex items-center gap-1"
- >
- <XCircleIcon class="w-3.5 h-3.5 text-error" />
- <span class="text-sm text-error">{{
- typeGroup.summary.error
- }}</span>
- </div>
- <div
- v-if="typeGroup.summary.warning > 0"
- class="flex items-center gap-1"
- >
- <AlertCircleIcon class="w-3.5 h-3.5 text-warning" />
- <span class="text-sm text-warning">{{
- typeGroup.summary.warning
- }}</span>
- </div>
- <div
- v-if="typeGroup.summary.success > 0"
- class="flex items-center gap-1"
- >
- <CheckCircleIcon class="w-3.5 h-3.5 text-success" />
- <span class="text-sm text-success">{{
- typeGroup.summary.success
- }}</span>
- </div>
- </div>
- </div>
- </div>
-
- <!-- Empty State -->
- <div v-else class="flex flex-col">
- <div class="text-control-light">
- <div class="flex flex-row justify-start items-center gap-2">
- <CheckCircleIcon class="w-5 h-5 opacity-40" />
- <span>{{ $t("plan.checks.no-checks") }}</span>
- </div>
- <p v-if="allowRunChecks" class="text-sm mt-1">
- {{ $t("plan.checks.click-to-run-checks") }}
- </p>
- </div>
- </div>
- </div>
-
<!-- Status Drawer -->
<Drawer v-model:show="drawerVisible">
<DrawerContent
@@ -207,6 +145,7 @@
</template>
<script setup lang="ts">
+import { create } from "@bufbuild/protobuf";
import {
CheckCircleIcon,
AlertCircleIcon,
@@ -222,15 +161,14 @@ import { computed, ref } from "vue";
import { useI18n } from "vue-i18n";
import Drawer from "@/components/v2/Container/Drawer.vue";
import DrawerContent from "@/components/v2/Container/DrawerContent.vue";
-import { create } from "@bufbuild/protobuf";
import { planServiceClientConnect } from "@/grpcweb";
-import { RunPlanChecksRequestSchema } from "@/types/proto-es/v1/plan_service_pb";
import {
useCurrentUserV1,
useCurrentProjectV1,
pushNotification,
extractUserId,
} from "@/store";
+import { RunPlanChecksRequestSchema } from "@/types/proto-es/v1/plan_service_pb";
import {
PlanCheckRun_Result_Status,
type PlanCheckRun,
@@ -275,39 +213,6 @@ const summary = computed(() => {
return result;
});
-const groupedByType = computed(() => {
- const groups: Record<
- string,
- {
- summary: { success: number; warning: number; error: number };
- checkRuns: PlanCheckRun[];
- }
- > = {};
-
- for (const checkRun of checkRunsForSpec.value) {
- const type = checkRun.type;
- if (!groups[type]) {
- groups[type] = {
- summary: { success: 0, warning: 0, error: 0 },
- checkRuns: [],
- };
- }
-
- groups[type].checkRuns.push(checkRun);
-
- const status = getCheckRunStatus(checkRun);
- if (status === PlanCheckRun_Result_Status.ERROR) {
- groups[type].summary.error++;
- } else if (status === PlanCheckRun_Result_Status.WARNING) {
- groups[type].summary.warning++;
- } else {
- groups[type].summary.success++;
- }
- }
-
- return groups;
-});
-
const drawerTitle = computed(() => {
if (selectedStatus.value === "ERROR") return "Error Details";
if (selectedStatus.value === "WARNING") return "Warning Details";
diff --git a/frontend/src/components/Plan/components/RolloutView/RolloutView.vue b/frontend/src/components/Plan/components/RolloutView/RolloutView.vue
index e66f733868..9fcf8b9fb0 100644
--- a/frontend/src/components/Plan/components/RolloutView/RolloutView.vue
+++ b/frontend/src/components/Plan/components/RolloutView/RolloutView.vue
@@ -29,7 +29,7 @@
<!-- Content area -->
<div class="flex-1 overflow-hidden">
- <StageView
+ <StagesView
v-if="!isTableView"
:merged-stages="mergedStages"
:task-status-filter="taskStatusFilter"
@@ -48,10 +48,10 @@ import { ListIcon, Columns3Icon } from "lucide-vue-next";
import { NButton, NButtonGroup } from "naive-ui";
import { ref } from "vue";
import { Task_Status } from "@/types/proto/v1/rollout_service";
-import { provideRolloutViewContext } from "./context";
-import StageView from "./StageView.vue";
+import StagesView from "./StagesView.vue";
import TaskFilter from "./TaskFilter.vue";
import TaskTable from "./TaskTable.vue";
+import { provideRolloutViewContext } from "./context";
// Provide the context and get its values directly
const { rollout, mergedStages } = provideRolloutViewContext();
diff --git a/frontend/src/components/Plan/components/RolloutView/RunTasksButton.vue b/frontend/src/components/Plan/components/RolloutView/RunTasksButton.vue
index b4cfc7e196..af95377341 100644
--- a/frontend/src/components/Plan/components/RolloutView/RunTasksButton.vue
+++ b/frontend/src/components/Plan/components/RolloutView/RunTasksButton.vue
@@ -1,5 +1,5 @@
<template>
- <NButton v-if="hasRunnableTasks" size="small" @click="handleRunTasks">
+ <NButton v-if="hasRunnableTasks" size="tiny" @click="handleRunTasks">
<template #icon>
<PlayIcon class="w-4 h-4" />
</template>
diff --git a/frontend/src/components/Plan/components/RolloutView/StageCard.vue b/frontend/src/components/Plan/components/RolloutView/StageCard.vue
index 9c80468724..f91badcf03 100644
--- a/frontend/src/components/Plan/components/RolloutView/StageCard.vue
+++ b/frontend/src/components/Plan/components/RolloutView/StageCard.vue
@@ -10,9 +10,11 @@
<div
class="w-full flex flex-row justify-between items-center gap-2 px-2 pt-2 pb-1"
>
- <p class="text-base font-medium">
- {{ environmentStore.getEnvironmentByName(stage.environment).title }}
- <NTag v-if="!isCreated" round size="tiny">Preview</NTag>
+ <p>
+ <span class="text-base font-medium">
+ {{ environmentStore.getEnvironmentByName(stage.environment).title }}
+ </span>
+ <NTag class="ml-2" v-if="!isCreated" round size="tiny">Preview</NTag>
</p>
<div v-if="isCreated">
<RunTasksButton :stage="stage" @run-tasks="showRunTasksPanel = true" />
@@ -21,22 +23,19 @@
<NVirtualList
style="max-height: 80vh"
:items="filteredTasks"
- :item-size="56"
+ :item-size="40"
+ item-resizable
>
<template #default="{ item: task }: { item: Task }">
<div
:key="task.name"
- class="w-full border-t border-zinc-50 flex items-center justify-start truncate px-2 py-3 min-h-[56px]"
+ class="w-full border-t border-zinc-50 flex items-center justify-start truncate px-2 py-2 h-10 cursor-pointer hover:bg-zinc-50 transition-colors"
+ @click="handleTaskClick(task)"
>
<TaskStatus :status="task.status" size="small" class="shrink-0" />
<TaskDatabaseName :task="task" class="ml-2 flex-1" />
<div class="ml-auto flex items-center space-x-1 shrink-0">
- <NTooltip>
- <template #trigger>
- <NTag round size="tiny">{{ semanticTaskType(task.type) }}</NTag>
- </template>
- {{ $t("common.type") }}
- </NTooltip>
+ <NTag round size="tiny">{{ semanticTaskType(task.type) }}</NTag>
<NTooltip v-if="extractSchemaVersionFromTask(task)">
<template #trigger>
@@ -65,9 +64,12 @@ import { NTag, NTooltip, NVirtualList } from "naive-ui";
import { twMerge } from "tailwind-merge";
import { computed, ref } from "vue";
import { useI18n } from "vue-i18n";
+import { useRouter } from "vue-router";
import { semanticTaskType } from "@/components/IssueV1";
import TaskStatus from "@/components/Rollout/RolloutDetail/Panels/kits/TaskStatus.vue";
-import { useEnvironmentV1Store } from "@/store";
+import { PROJECT_V1_ROUTE_ROLLOUT_DETAIL_TASK_DETAIL } from "@/router/dashboard/projectV1";
+import { useCurrentProjectV1, useEnvironmentV1Store } from "@/store";
+import { extractProjectResourceName } from "@/utils";
import {
Stage,
type Task,
@@ -85,6 +87,8 @@ const props = defineProps<{
}>();
const { t: $t } = useI18n();
+const router = useRouter();
+const { project } = useCurrentProjectV1();
const environmentStore = useEnvironmentV1Store();
const { rollout } = useRolloutViewContext();
@@ -107,4 +111,29 @@ const filteredTasks = computed(() => {
props.taskStatusFilter.includes(task.status)
);
});
+
+// Helper function to extract IDs from task and stage names
+const getTaskRouteParams = (task: Task) => {
+ const rolloutId = rollout.value?.name.split('/').pop();
+ const stageId = props.stage.name.split('/').pop();
+ const taskId = task.name.split('/').pop();
+
+ return { rolloutId, stageId, taskId };
+};
+
+// Task click handler
+const handleTaskClick = (task: Task) => {
+ const params = getTaskRouteParams(task);
+ if (params.rolloutId && params.stageId && params.taskId) {
+ router.push({
+ name: PROJECT_V1_ROUTE_ROLLOUT_DETAIL_TASK_DETAIL,
+ params: {
+ projectId: extractProjectResourceName(project.value.name),
+ rolloutId: params.rolloutId,
+ stageId: params.stageId,
+ taskId: params.taskId,
+ },
+ });
+ }
+};
</script>
diff --git a/frontend/src/components/Plan/components/RolloutView/StageView.vue b/frontend/src/components/Plan/components/RolloutView/StagesView.vue
similarity index 78%
rename from frontend/src/components/Plan/components/RolloutView/StageView.vue
rename to frontend/src/components/Plan/components/RolloutView/StagesView.vue
index f6caf769ae..2e4da7bd02 100644
--- a/frontend/src/components/Plan/components/RolloutView/StageView.vue
+++ b/frontend/src/components/Plan/components/RolloutView/StagesView.vue
@@ -7,9 +7,12 @@
<!-- Connecting line -->
<div class="absolute top-5 border-t-2 border-gray-200 w-full z-0"></div>
- <template v-for="stage in mergedStages" :key="stage.name">
- <StageCard :stage="stage" :task-status-filter="taskStatusFilter" />
- </template>
+ <StageCard
+ v-for="stage in mergedStages"
+ :key="stage.name"
+ :stage="stage"
+ :task-status-filter="taskStatusFilter"
+ />
</div>
</div>
</div>
diff --git a/frontend/src/components/Plan/components/RolloutView/TaskFilter.vue b/frontend/src/components/Plan/components/RolloutView/TaskFilter.vue
index 83931ec389..4071a9bd54 100644
--- a/frontend/src/components/Plan/components/RolloutView/TaskFilter.vue
+++ b/frontend/src/components/Plan/components/RolloutView/TaskFilter.vue
@@ -3,7 +3,6 @@
<div class="flex items-center justify-between">
<h3 class="text-base font-medium">
{{ $t("common.tasks") }}
- <span>({{ totalTaskCount }})</span>
</h3>
</div>
<div class="flex flex-row gap-1 items-center">
@@ -27,7 +26,14 @@
<template #avatar>
<TaskStatus :status="status" size="small" />
</template>
- <span class="select-none text-base">{{ getTaskCount(status) }}</span>
+ <div class="flex flex-row items-center gap-2">
+ <span class="select-none text-base">{{
+ stringifyTaskStatus(status)
+ }}</span>
+ <span class="select-none text-base font-medium">{{
+ getTaskCount(status)
+ }}</span>
+ </div>
</NTag>
</template>
</div>
@@ -41,6 +47,7 @@ import { computed } from "vue";
import TaskStatus from "@/components/Rollout/RolloutDetail/Panels/kits/TaskStatus.vue";
import type { Rollout, Task_Status } from "@/types/proto/v1/rollout_service";
import { Task_Status as TaskStatusEnum } from "@/types/proto/v1/rollout_service";
+import { stringifyTaskStatus } from "@/utils";
import { useRolloutViewContext } from "./context";
defineProps<{
@@ -55,12 +62,12 @@ const emit = defineEmits<{
const { mergedStages } = useRolloutViewContext();
const TASK_STATUS_FILTERS: Task_Status[] = [
- TaskStatusEnum.NOT_STARTED,
- TaskStatusEnum.PENDING,
- TaskStatusEnum.RUNNING,
TaskStatusEnum.DONE,
+ TaskStatusEnum.RUNNING,
+ TaskStatusEnum.PENDING,
TaskStatusEnum.FAILED,
TaskStatusEnum.CANCELED,
+ TaskStatusEnum.NOT_STARTED,
TaskStatusEnum.SKIPPED,
];
@@ -68,8 +75,6 @@ const allTasks = computed(() => {
return flatten(mergedStages.value.map((stage) => stage.tasks));
});
-const totalTaskCount = computed(() => allTasks.value.length);
-
const getTaskCount = (status: Task_Status) => {
return allTasks.value.filter((task) => task.status === status).length;
};
diff --git a/frontend/src/components/Plan/components/RolloutView/TaskRolloutActionPanel.vue b/frontend/src/components/Plan/components/RolloutView/TaskRolloutActionPanel.vue
index e34181deae..c565293708 100644
--- a/frontend/src/components/Plan/components/RolloutView/TaskRolloutActionPanel.vue
+++ b/frontend/src/components/Plan/components/RolloutView/TaskRolloutActionPanel.vue
@@ -30,49 +30,63 @@
{{ $t("common.task") }}
</template>
<template v-else>{{ $t("common.tasks") }}</template>
- <span class="font-mono opacity-80" v-if="runnableTasks.length > 1"
+ <span class="opacity-80" v-if="runnableTasks.length > 1"
>({{ runnableTasks.length }})</span
>
</label>
<div class="flex-1 overflow-y-auto">
- <NScrollbar class="max-h-64">
- <ul class="text-sm space-y-2">
- <li
- v-for="task in runnableTasks"
- :key="task.name"
- class="flex items-center"
- >
- <NTag
- v-if="semanticTaskType(task.type)"
- class="mr-2"
- size="small"
+ <template v-if="useVirtualScroll">
+ <NVirtualList
+ :items="runnableTasks"
+ :item-size="itemHeight"
+ class="max-h-64"
+ item-resizable
+ >
+ <template #default="{ item: task }">
+ <div
+ :key="task.name"
+ class="flex items-center text-sm"
+ :style="{ height: `${itemHeight}px` }"
+ >
+ <NTag
+ v-if="semanticTaskType(task.type)"
+ class="mr-2"
+ size="small"
+ >
+ <span class="inline-block text-center">
+ {{ semanticTaskType(task.type) }}
+ </span>
+ </NTag>
+ <TaskDatabaseName :task="task" />
+ </div>
+ </template>
+ </NVirtualList>
+ </template>
+ <template v-else>
+ <NScrollbar class="max-h-64">
+ <ul class="text-sm space-y-2">
+ <li
+ v-for="task in runnableTasks"
+ :key="task.name"
+ class="flex items-center"
>
- <span class="inline-block text-center">
- {{ semanticTaskType(task.type) }}
- </span>
- </NTag>
- <TaskDatabaseName :task="task" />
- </li>
- </ul>
- </NScrollbar>
+ <NTag
+ v-if="semanticTaskType(task.type)"
+ class="mr-2"
+ size="small"
+ >
+ <span class="inline-block text-center">
+ {{ semanticTaskType(task.type) }}
+ </span>
+ </NTag>
+ <TaskDatabaseName :task="task" />
+ </li>
+ </ul>
+ </NScrollbar>
+ </template>
</div>
</div>
- <div class="flex flex-col gap-y-1 shrink-0">
- <p class="font-medium text-control">
- {{ $t("common.comment") }}
- </p>
- <NInput
- v-model:value="comment"
- type="textarea"
- :placeholder="$t('issue.leave-a-comment')"
- :autosize="{
- minRows: 3,
- maxRows: 10,
- }"
- />
- </div>
-
<div
v-if="showScheduledTimePicker"
class="flex flex-col gap-y-3 shrink-0"
@@ -106,6 +120,21 @@
/>
</div>
</div>
+
+ <div class="flex flex-col gap-y-1 shrink-0">
+ <p class="font-medium text-control">
+ {{ $t("common.comment") }}
+ </p>
+ <NInput
+ v-model:value="comment"
+ type="textarea"
+ :placeholder="$t('issue.leave-a-comment')"
+ :autosize="{
+ minRows: 3,
+ maxRows: 10,
+ }"
+ />
+ </div>
</div>
</template>
<template #footer>
@@ -150,6 +179,7 @@ import {
NScrollbar,
NTag,
NTooltip,
+ NVirtualList,
} from "naive-ui";
import { computed, reactive, ref } from "vue";
import { useI18n } from "vue-i18n";
@@ -201,6 +231,10 @@ const runnableTasks = computed(() => {
);
});
+// Virtual scroll configuration
+const useVirtualScroll = computed(() => runnableTasks.value.length > 50);
+const itemHeight = 32; // Height of each task item in pixels
+
const showScheduledTimePicker = computed(() => {
return props.action === "RUN_TASKS";
});
diff --git a/frontend/src/components/Plan/components/RolloutView/TaskRunTable.vue b/frontend/src/components/Plan/components/RolloutView/TaskRunTable.vue
new file mode 100644
index 0000000000..801258cc2f
--- /dev/null
+++ b/frontend/src/components/Plan/components/RolloutView/TaskRunTable.vue
@@ -0,0 +1,161 @@
+<template>
+ <NDataTable
+ size="small"
+ :row-key="rowKey"
+ :columns="columnList"
+ :data="taskRuns"
+ :striped="true"
+ :bordered="true"
+ />
+</template>
+
+<script lang="tsx" setup>
+import type { DataTableColumn } from "naive-ui";
+import { NDataTable, NTag } from "naive-ui";
+import { computed } from "vue";
+import { useI18n } from "vue-i18n";
+import HumanizeDate from "@/components/misc/HumanizeDate.vue";
+import { getDateForPbTimestamp, getTimeForPbTimestamp } from "@/types";
+import { Duration } from "@/types/proto/google/protobuf/duration";
+import type { TaskRun } from "@/types/proto/v1/rollout_service";
+import { TaskRun_Status } from "@/types/proto/v1/rollout_service";
+import { humanizeDurationV1 } from "@/utils";
+
+defineProps<{
+ taskRuns: TaskRun[];
+}>();
+
+const { t } = useI18n();
+
+const rowKey = (taskRun: TaskRun) => {
+ return taskRun.name;
+};
+
+const columnList = computed((): DataTableColumn<TaskRun>[] => {
+ return [
+ {
+ key: "status",
+ title: t("common.status"),
+ width: 100,
+ render: (taskRun: TaskRun) => {
+ const statusType = getStatusType(taskRun.status);
+ const statusText = getStatusText(taskRun.status);
+ return (
+ <NTag type={statusType} size="small">
+ {statusText}
+ </NTag>
+ );
+ },
+ },
+ {
+ key: "createTime",
+ title: t("task.created"),
+ width: 140,
+ render: (taskRun: TaskRun) => (
+ <HumanizeDate date={getDateForPbTimestamp(taskRun.createTime)} />
+ ),
+ },
+ {
+ key: "startTime",
+ title: t("task.started"),
+ width: 140,
+ render: (taskRun: TaskRun) =>
+ taskRun.startTime ? (
+ <HumanizeDate date={getDateForPbTimestamp(taskRun.startTime)} />
+ ) : (
+ "-"
+ ),
+ },
+ {
+ key: "updateTime",
+ title: "Update Time",
+ width: 140,
+ render: (taskRun: TaskRun) =>
+ taskRun.updateTime ? (
+ <HumanizeDate date={getDateForPbTimestamp(taskRun.updateTime)} />
+ ) : (
+ "-"
+ ),
+ },
+ {
+ key: "executionDuration",
+ title: t("task.execution-time"),
+ width: 120,
+ render: (taskRun: TaskRun) => {
+ const duration = executionDurationOfTaskRun(taskRun);
+ return duration ? humanizeDurationV1(duration) : "-";
+ },
+ },
+ {
+ key: "executionSummary",
+ title: "Summary",
+ render: (taskRun: TaskRun) => {
+ return getExecutionSummary(taskRun);
+ },
+ },
+ ];
+});
+
+const getStatusType = (status: TaskRun_Status) => {
+ switch (status) {
+ case TaskRun_Status.DONE:
+ return "success";
+ case TaskRun_Status.FAILED:
+ case TaskRun_Status.CANCELED:
+ return "error";
+ case TaskRun_Status.RUNNING:
+ return "info";
+ case TaskRun_Status.PENDING:
+ return "warning";
+ default:
+ return "default";
+ }
+};
+
+const getStatusText = (status: TaskRun_Status) => {
+ return status.replace("_", " ");
+};
+
+const executionDurationOfTaskRun = (taskRun: TaskRun): Duration | undefined => {
+ const { startTime, updateTime } = taskRun;
+ if (!startTime || !updateTime) {
+ return undefined;
+ }
+ if (startTime.seconds.toString() === "0") {
+ return undefined;
+ }
+ if (taskRun.status === TaskRun_Status.RUNNING) {
+ const elapsedMS = Date.now() - getTimeForPbTimestamp(startTime);
+ return Duration.fromPartial({
+ seconds: Math.floor(elapsedMS / 1000),
+ nanos: (elapsedMS % 1000) * 1e6,
+ });
+ }
+ const startMS = getTimeForPbTimestamp(startTime);
+ const updateMS = getTimeForPbTimestamp(updateTime);
+ const elapsedMS = updateMS - startMS;
+ return Duration.fromPartial({
+ seconds: Math.floor(elapsedMS / 1000),
+ nanos: (elapsedMS % 1000) * 1e6,
+ });
+};
+
+const getExecutionSummary = (taskRun: TaskRun) => {
+ if (taskRun.status === TaskRun_Status.DONE) {
+ return "Completed successfully";
+ }
+ if (taskRun.status === TaskRun_Status.FAILED) {
+ return "Failed";
+ }
+ if (taskRun.status === TaskRun_Status.CANCELED) {
+ return "Canceled";
+ }
+ if (taskRun.status === TaskRun_Status.RUNNING) {
+ return "Running...";
+ }
+ if (taskRun.status === TaskRun_Status.PENDING) {
+ return "Pending";
+ }
+ return "Unknown";
+};
+</script>
diff --git a/frontend/src/components/Plan/components/RolloutView/TaskStatusActions.vue b/frontend/src/components/Plan/components/RolloutView/TaskStatusActions.vue
new file mode 100644
index 0000000000..b45e8496e4
--- /dev/null
+++ b/frontend/src/components/Plan/components/RolloutView/TaskStatusActions.vue
@@ -0,0 +1,161 @@
+<template>
+ <div
+ v-if="primaryAction || dropdownOptions.length > 0"
+ class="flex flex-row justify-end items-center gap-x-2"
+ >
+ <NButton
+ v-if="primaryAction"
+ type="primary"
+ size="small"
+ @click="handleTaskStatusAction(primaryAction)"
+ >
+ {{ actionDisplayTitle(primaryAction) }}
+ </NButton>
+ <NDropdown
+ v-if="dropdownOptions.length > 0"
+ trigger="hover"
+ :options="dropdownOptions"
+ @select="(action) => handleTaskStatusAction(action)"
+ >
+ <NButton size="small">
+ <template #icon>
+ <EllipsisVerticalIcon class="w-4 h-4" />
+ </template>
+ </NButton>
+ </NDropdown>
+ </div>
+</template>
+
+<script setup lang="ts">
+import { EllipsisVerticalIcon } from "lucide-vue-next";
+import { NButton, NDropdown } from "naive-ui";
+import { computed } from "vue";
+import { useI18n } from "vue-i18n";
+import { create } from "@bufbuild/protobuf";
+import {
+ BatchRunTasksRequestSchema,
+ BatchSkipTasksRequestSchema,
+ BatchCancelTaskRunsRequestSchema,
+} from "@/types/proto-es/v1/rollout_service_pb";
+import { rolloutServiceClientConnect } from "@/grpcweb";
+import { Task_Status } from "@/types/proto/v1/rollout_service";
+import type { Task, TaskRun, Rollout, Stage } from "@/types/proto/v1/rollout_service";
+
+type TaskStatusAction =
+ // NOT_STARTED -> PENDING
+ | "RUN"
+ // FAILED -> PENDING
+ | "RETRY"
+ // * -> CANCELLED
+ | "CANCEL"
+ // * -> SKIPPED
+ | "SKIP";
+
+const props = defineProps<{
+ task: Task;
+ taskRuns: TaskRun[];
+ rollout?: Rollout;
+}>();
+
+const emit = defineEmits<{
+ "task-action-completed": [];
+}>();
+
+const { t } = useI18n();
+
+// Helper function to find the stage for a task
+const findStageForTask = (rollout: Rollout | undefined, task: Task): Stage | undefined => {
+ if (!rollout) return undefined;
+
+ for (const stage of rollout.stages) {
+ for (const stageTask of stage.tasks) {
+ if (stageTask.name === task.name) {
+ return stage;
+ }
+ }
+ }
+ return undefined;
+};
+
+const primaryAction = computed((): TaskStatusAction | null => {
+ if (props.task.status === Task_Status.NOT_STARTED) {
+ return "RUN";
+ } else if (props.task.status === Task_Status.FAILED) {
+ return "RETRY";
+ } else {
+ return null;
+ }
+});
+
+const dropdownActions = computed((): TaskStatusAction[] => {
+ if (
+ [
+ Task_Status.NOT_STARTED,
+ Task_Status.FAILED,
+ Task_Status.CANCELED,
+ ].includes(props.task.status)
+ ) {
+ return ["SKIP"];
+ } else if (
+ [Task_Status.PENDING, Task_Status.RUNNING].includes(props.task.status)
+ ) {
+ return ["CANCEL"];
+ } else {
+ return [];
+ }
+});
+
+const dropdownOptions = computed(() => {
+ return dropdownActions.value.map((action) => {
+ return {
+ key: action,
+ label: actionDisplayTitle(action),
+ };
+ });
+});
+
+const actionDisplayTitle = (action: TaskStatusAction) => {
+ if (action === "RUN") {
+ return t("common.run");
+ } else if (action === "RETRY") {
+ return t("common.retry");
+ } else if (action === "CANCEL") {
+ return t("common.cancel");
+ } else if (action === "SKIP") {
+ return t("common.skip");
+ }
+};
+
+const handleTaskStatusAction = async (action: TaskStatusAction) => {
+ const stage = findStageForTask(props.rollout, props.task);
+ if (!stage) return;
+
+ try {
+ if (action === "RUN" || action === "RETRY") {
+ const request = create(BatchRunTasksRequestSchema, {
+ parent: stage.name,
+ tasks: [props.task.name],
+ });
+ await rolloutServiceClientConnect.batchRunTasks(request);
+ } else if (action === "SKIP") {
+ const request = create(BatchSkipTasksRequestSchema, {
+ parent: stage.name,
+ tasks: [props.task.name],
+ });
+ await rolloutServiceClientConnect.batchSkipTasks(request);
+ } else if (action === "CANCEL") {
+ const request = create(BatchCancelTaskRunsRequestSchema, {
+ parent: `${stage.name}/tasks/-`,
+ taskRuns: props.taskRuns.map((taskRun) => taskRun.name),
+ // TODO: Let user input reason.
+ reason: "",
+ });
+ await rolloutServiceClientConnect.batchCancelTaskRuns(request);
+ }
+
+ emit("task-action-completed");
+ } catch (error) {
+ console.error("Failed to execute task action:", error);
+ }
+};
+</script>
\ No newline at end of file
diff --git a/frontend/src/components/Plan/components/RolloutView/TaskTable.vue b/frontend/src/components/Plan/components/RolloutView/TaskTable.vue
index 5fba471b9d..eb58e6a980 100644
--- a/frontend/src/components/Plan/components/RolloutView/TaskTable.vue
+++ b/frontend/src/components/Plan/components/RolloutView/TaskTable.vue
@@ -7,6 +7,10 @@
:striped="true"
:bordered="true"
:row-key="(task: Task) => task.name"
+ :virtual-scroll="virtualScrollEnabled"
+ :max-height="'80vh'"
+ :row-height="virtualScrollEnabled ? 40 : undefined"
+ :row-props="rowProps"
/>
</div>
</template>
@@ -18,13 +22,22 @@ import type { DataTableColumn } from "naive-ui";
import { NDataTable } from "naive-ui";
import { computed } from "vue";
import { useI18n } from "vue-i18n";
+import { useRouter } from "vue-router";
import { semanticTaskType } from "@/components/IssueV1";
import TaskStatus from "@/components/Rollout/RolloutDetail/Panels/kits/TaskStatus.vue";
import { databaseForTask } from "@/components/Rollout/RolloutDetail/utils";
import { InstanceV1EngineIcon } from "@/components/v2";
+import { PROJECT_V1_ROUTE_ROLLOUT_DETAIL_TASK_DETAIL } from "@/router/dashboard/projectV1";
import { useCurrentProjectV1, useEnvironmentV1Store } from "@/store";
-import type { Task, Rollout, Task_Status } from "@/types/proto/v1/rollout_service";
-import { extractSchemaVersionFromTask } from "@/utils";
+import type {
+ Task,
+ Rollout,
+ Task_Status,
+} from "@/types/proto/v1/rollout_service";
+import {
+ extractProjectResourceName,
+ extractSchemaVersionFromTask,
+} from "@/utils";
import { useRolloutViewContext } from "./context";
const props = defineProps<{
@@ -33,6 +46,7 @@ const props = defineProps<{
}>();
const { t } = useI18n();
+const router = useRouter();
const { project } = useCurrentProjectV1();
const environmentStore = useEnvironmentV1Store();
const { mergedStages } = useRolloutViewContext();
@@ -49,6 +63,56 @@ const taskList = computed(() => {
const stages = computed(() => mergedStages.value);
+// Virtual scroll configuration
+const virtualScrollEnabled = computed(() => taskList.value.length > 100);
+
+// Memoized stage lookup for better performance
+const stageMap = computed(() => {
+ const map = new Map<string, (typeof stages.value)[0]>();
+ stages.value.forEach((stage) => {
+ stage.tasks.forEach((task) => {
+ map.set(task.name, stage);
+ });
+ });
+ return map;
+});
+
+// Helper function to extract IDs from task and stage names
+const getTaskRouteParams = (task: Task) => {
+ const stage = stageMap.value.get(task.name);
+ if (!stage) return null;
+
+ const rolloutId = props.rollout.name.split("/").pop();
+ const stageId = stage.name.split("/").pop();
+ const taskId = task.name.split("/").pop();
+
+ return { rolloutId, stageId, taskId };
+};
+
+// Row click handler
+const handleRowClick = (task: Task) => {
+ const params = getTaskRouteParams(task);
+ if (params) {
+ router.push({
+ name: PROJECT_V1_ROUTE_ROLLOUT_DETAIL_TASK_DETAIL,
+ params: {
+ projectId: extractProjectResourceName(project.value.name),
+ rolloutId: params.rolloutId,
+ stageId: params.stageId,
+ taskId: params.taskId,
+ },
+ });
+ }
+};
+
+// Row props for click handling
+const rowProps = (task: Task) => {
+ return {
+ style: "cursor: pointer;",
+ onClick: () => handleRowClick(task),
+ };
+};
+
const columnList = computed((): DataTableColumn<Task>[] => {
return [
{
@@ -64,9 +128,7 @@ const columnList = computed((): DataTableColumn<Task>[] => {
title: t("common.stage"),
width: 120,
render: (task) => {
- const stage = stages.value.find((stage) =>
- stage.tasks.find((t) => t.name === task.name)
- );
+ const stage = stageMap.value.get(task.name);
if (stage) {
const environment = environmentStore.getEnvironmentByName(
stage.environment
diff --git a/frontend/src/components/Plan/components/RolloutView/TaskView.vue b/frontend/src/components/Plan/components/RolloutView/TaskView.vue
new file mode 100644
index 0000000000..b533301b11
--- /dev/null
+++ b/frontend/src/components/Plan/components/RolloutView/TaskView.vue
@@ -0,0 +1,256 @@
+<template>
+ <div v-if="task" class="w-full h-full flex flex-col gap-y-4 p-4">
+ <!-- Task Basic Info -->
+ <div class="w-full flex flex-col gap-y-3">
+ <div class="flex flex-row items-center justify-between">
+ <div class="flex flex-row items-center gap-x-3">
+ <TaskStatus :size="'large'" :status="task.status" />
+ <div class="flex flex-row items-center text-xl">
+ <InstanceV1EngineIcon
+ class="mr-2"
+ :size="'large'"
+ :instance="database.instanceResource"
+ />
+ <span class="font-medium">{{ database.instanceResource.title }}</span>
+ <ChevronRightIcon class="inline opacity-60 mx-2 w-5" />
+ <span>{{ database.databaseName }}</span>
+ </div>
+ </div>
+
+ <!-- Task Status Actions -->
+ <TaskStatusActions
+ :task="task"
+ :task-runs="taskRuns"
+ :rollout="rollout"
+ @task-action-completed="handleTaskActionCompleted"
+ />
+ </div>
+
+ <div class="flex flex-row gap-x-2">
+ <NTag round>{{ semanticTaskType(task.type) }}</NTag>
+ <NTag v-if="schemaVersion" round>{{ schemaVersion }}</NTag>
+ </div>
+ </div>
+
+ <!-- Task Runs Table -->
+ <TaskRunTable v-if="taskRuns.length > 0" :task-runs="taskRuns" />
+
+ <!-- Sheet Statement -->
+ <div class="w-full flex-1 min-h-0">
+ <div class="flex items-center justify-between mb-2">
+ <span class="text-base font-medium">{{ $t("common.statement") }}</span>
+ <CopyButton v-if="statement" :size="'medium'" :content="statement" />
+ </div>
+ <MonacoEditor
+ v-if="statement"
+ class="h-full min-h-[200px] border rounded-[3px] text-sm overflow-clip"
+ :content="statement"
+ :readonly="true"
+ :auto-height="{ min: 200, max: 480 }"
+ />
+ <div
+ v-else
+ class="h-32 border rounded-[3px] flex items-center justify-center text-control"
+ >
+ {{ $t("common.no-data") }}
+ </div>
+ </div>
+ </div>
+</template>
+
+<script setup lang="ts">
+import { create } from "@bufbuild/protobuf";
+import { isEqual, sortBy } from "lodash-es";
+import { ChevronRightIcon } from "lucide-vue-next";
+import { NTag } from "naive-ui";
+import { computed, ref, watchEffect } from "vue";
+import { useI18n } from "vue-i18n";
+import { useRoute } from "vue-router";
+import { semanticTaskType } from "@/components/IssueV1";
+import { MonacoEditor } from "@/components/MonacoEditor";
+import TaskStatus from "@/components/Rollout/RolloutDetail/Panels/kits/TaskStatus.vue";
+import { databaseForTask } from "@/components/Rollout/RolloutDetail/utils";
+import { InstanceV1EngineIcon, CopyButton } from "@/components/v2";
+import { rolloutServiceClientConnect } from "@/grpcweb";
+import { useCurrentProjectV1, useSheetV1Store } from "@/store";
+import { getDateForPbTimestamp, unknownTask } from "@/types";
+import {
+ ListTaskRunsRequestSchema,
+ GetRolloutRequestSchema,
+} from "@/types/proto-es/v1/rollout_service_pb";
+import type { Task, TaskRun, Rollout } from "@/types/proto/v1/rollout_service";
+import {
+ extractSchemaVersionFromTask,
+ getSheetStatement,
+ sheetNameOfTaskV1,
+ isValidTaskName,
+} from "@/utils";
+import {
+ convertNewTaskRunToOld,
+ convertNewRolloutToOld,
+} from "@/utils/v1/rollout-conversions";
+import TaskRunTable from "./TaskRunTable.vue";
+import TaskStatusActions from "./TaskStatusActions.vue";
+
+const props = defineProps<{
+ task?: Task;
+ // Route parameters for when used in router
+ stageId?: string;
+ taskId?: string;
+ rolloutId?: string;
+}>();
+
+const { t: _t } = useI18n();
+const route = useRoute();
+const { project } = useCurrentProjectV1();
+const sheetStore = useSheetV1Store();
+const taskRunsRef = ref<TaskRun[]>([]);
+const rolloutRef = ref<Rollout>();
+const routeTaskRef = ref<Task>();
+
+// Determine if we're in route mode or prop mode
+const isRouteMode = computed(
+ () => !props.task && (props.stageId || props.taskId)
+);
+
+// Get the task - either from props or from fetched rollout
+const task = computed(() => {
+ if (props.task) return props.task;
+ if (routeTaskRef.value) return routeTaskRef.value;
+ return unknownTask();
+});
+
+// Fetch rollout and task when in route mode
+watchEffect(async () => {
+ if (!isRouteMode.value) return;
+
+ const rolloutId = props.rolloutId || (route.params.rolloutId as string);
+ const stageId = props.stageId || (route.params.stageId as string);
+ const taskId = props.taskId || (route.params.taskId as string);
+
+ if (!rolloutId || !stageId || !taskId) return;
+
+ try {
+ const rolloutName = `projects/${project.value.name.split("/")[1]}/rollouts/${rolloutId}`;
+ const request = create(GetRolloutRequestSchema, { name: rolloutName });
+ const response = await rolloutServiceClientConnect.getRollout(request);
+ const rollout = convertNewRolloutToOld(response);
+ rolloutRef.value = rollout;
+
+ // Find the specific task
+ for (const stage of rollout.stages) {
+ if (stage.name.endsWith(`/${stageId}`)) {
+ for (const stageTask of stage.tasks) {
+ if (stageTask.name.endsWith(`/${taskId}`)) {
+ routeTaskRef.value = stageTask;
+ return;
+ }
+ }
+ }
+ }
+ } catch (error) {
+ console.error("Failed to fetch rollout:", error);
+ }
+});
+
+// Task basic info
+const database = computed(() => databaseForTask(project.value, task.value));
+const schemaVersion = computed(() => extractSchemaVersionFromTask(task.value));
+
+// Sheet statement
+const statement = computed(() => {
+ const sheet = sheetStore.getSheetByName(sheetNameOfTaskV1(task.value));
+ if (sheet) {
+ return getSheetStatement(sheet);
+ }
+ return "";
+});
+
+// Fetch task runs
+watchEffect(async () => {
+ if (!isValidTaskName(task.value.name)) {
+ return;
+ }
+
+ try {
+ const request = create(ListTaskRunsRequestSchema, {
+ parent: task.value.name,
+ });
+ const response = await rolloutServiceClientConnect.listTaskRuns(request);
+ const taskRuns = response.taskRuns.map(convertNewTaskRunToOld);
+ const sorted = sortBy(taskRuns, (t) =>
+ getDateForPbTimestamp(t.createTime)
+ ).reverse();
+ if (!isEqual(sorted, taskRunsRef.value)) {
+ taskRunsRef.value = sorted;
+ }
+ } catch (error) {
+ console.error("Failed to fetch task runs:", error);
+ }
+});
+
+// Fetch sheet when task changes
+watchEffect(async () => {
+ const sheetName = sheetNameOfTaskV1(task.value);
+ if (sheetName) {
+ await sheetStore.getOrFetchSheetByName(sheetName);
+ }
+});
+
+// Task run info
+const taskRuns = computed(() => taskRunsRef.value);
+
+// Get the rollout for task status actions
+const rollout = computed(() => rolloutRef.value);
+
+// Handle task action completion to refresh data
+const handleTaskActionCompleted = async () => {
+ // Refresh task runs after action
+ if (isValidTaskName(task.value.name)) {
+ try {
+ const request = create(ListTaskRunsRequestSchema, {
+ parent: task.value.name,
+ });
+ const response = await rolloutServiceClientConnect.listTaskRuns(request);
+ const taskRuns = response.taskRuns.map(convertNewTaskRunToOld);
+ const sorted = sortBy(taskRuns, (t) =>
+ getDateForPbTimestamp(t.createTime)
+ ).reverse();
+ taskRunsRef.value = sorted;
+ } catch (error) {
+ console.error("Failed to refresh task runs:", error);
+ }
+ }
+
+ // Refresh rollout data in route mode
+ if (isRouteMode.value) {
+ const rolloutId = props.rolloutId || (route.params.rolloutId as string);
+ const stageId = props.stageId || (route.params.stageId as string);
+ const taskId = props.taskId || (route.params.taskId as string);
+
+ if (rolloutId && stageId && taskId) {
+ try {
+ const rolloutName = `projects/${project.value.name.split("/")[1]}/rollouts/${rolloutId}`;
+ const request = create(GetRolloutRequestSchema, { name: rolloutName });
+ const response = await rolloutServiceClientConnect.getRollout(request);
+ const rollout = convertNewRolloutToOld(response);
+ rolloutRef.value = rollout;
+
+ // Update the task reference
+ for (const stage of rollout.stages) {
+ if (stage.name.endsWith(`/${stageId}`)) {
+ for (const stageTask of stage.tasks) {
+ if (stageTask.name.endsWith(`/${taskId}`)) {
+ routeTaskRef.value = stageTask;
+ return;
+ }
+ }
+ }
+ }
+ } catch (error) {
+ console.error("Failed to refresh rollout:", error);
+ }
+ }
+ }
+};
+</script>
diff --git a/frontend/src/components/Plan/components/RolloutView/index.ts b/frontend/src/components/Plan/components/RolloutView/index.ts
index 9034811da7..a5a840433f 100644
--- a/frontend/src/components/Plan/components/RolloutView/index.ts
+++ b/frontend/src/components/Plan/components/RolloutView/index.ts
@@ -1 +1,4 @@
export { default as RolloutView } from "./RolloutView.vue";
+export { default as TaskView } from "./TaskView.vue";
+export { default as TaskRunTable } from "./TaskRunTable.vue";
+export { default as TaskStatusActions } from "./TaskStatusActions.vue";
diff --git a/frontend/src/components/Rollout/RolloutDataTable.vue b/frontend/src/components/Rollout/RolloutDataTable.vue
index 36a1d048f0..c6627edae9 100644
--- a/frontend/src/components/Rollout/RolloutDataTable.vue
+++ b/frontend/src/components/Rollout/RolloutDataTable.vue
@@ -48,13 +48,13 @@ const { t } = useI18n();
const router = useRouter();
const TASK_STATUS_FILTERS: Task_Status[] = [
- TaskStatusEnum.NOT_STARTED,
- TaskStatusEnum.PENDING,
- TaskStatusEnum.RUNNING,
TaskStatusEnum.DONE,
+ TaskStatusEnum.RUNNING,
TaskStatusEnum.FAILED,
TaskStatusEnum.CANCELED,
TaskStatusEnum.SKIPPED,
+ TaskStatusEnum.PENDING,
+ TaskStatusEnum.NOT_STARTED,
];
const getTaskCount = (rollout: ComposedRollout, status: Task_Status) => {
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 6c166ab9b2..c3c4dc009d 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -1097,9 +1097,7 @@
"configuration-has-issues": "Configuration has {count} issue | Configuration has {count} issues"
},
"checks": {
- "self": "Checks",
- "no-checks": "No check results available",
- "click-to-run-checks": "Click \"Run Checks\" to validate this specification"
+ "self": "Checks"
}
},
"rollout": {
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index 0c068c9480..694722b8d4 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -1097,9 +1097,7 @@
"configuration-has-issues": "La configuración tiene {count} problemas | La configuración tiene {count} problemas"
},
"checks": {
- "self": "Cheques",
- "no-checks": "No hay resultados de verificación disponibles",
- "click-to-run-checks": "Haga clic en \"Ejecutar comprobaciones\" para validar esta especificación"
+ "self": "Cheques"
}
},
"rollout": {
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index 1a86ff0a2c..d8cdde6c16 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -1097,9 +1097,7 @@
"configuration-has-issues": "構成に {count} 個の問題があります | 構成に {count} 個の問題があります"
},
"checks": {
- "self": "小切手",
- "no-checks": "チェック結果はありません",
- "click-to-run-checks": "この仕様を検証するには、「チェックを実行」をクリックしてください"
+ "self": "小切手"
}
},
"rollout": {
diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.json
index 43816ab2af..a28fb2ff3d 100644
--- a/frontend/src/locales/vi-VN.json
+++ b/frontend/src/locales/vi-VN.json
@@ -1097,9 +1097,7 @@
"configuration-has-issues": "Cấu hình có vấn đề {count} | Cấu hình có vấn đề {count}"
},
"checks": {
- "self": "Kiểm tra",
- "no-checks": "Không có kết quả kiểm tra nào có sẵn",
- "click-to-run-checks": "Nhấp vào \"Chạy kiểm tra\" để xác thực thông số kỹ thuật này"
+ "self": "Kiểm tra"
}
},
"rollout": {
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index a978e3ed12..32b2e97edf 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -1097,9 +1097,7 @@
"configuration-has-issues": "配置存在 {count} 个问题 | 配置存在 {count} 个问题"
},
"checks": {
- "self": "检查",
- "no-checks": "没有可用的检查结果",
- "click-to-run-checks": "单击“运行检查”以验证此规范"
+ "self": "检查"
}
},
"rollout": {
diff --git a/frontend/src/router/dashboard/projectV1.ts b/frontend/src/router/dashboard/projectV1.ts
index a05bf5a093..125e0864db 100644
--- a/frontend/src/router/dashboard/projectV1.ts
+++ b/frontend/src/router/dashboard/projectV1.ts
@@ -97,14 +97,13 @@ const cicdRoutes: RouteRecordRaw[] = [
requiredPermissionList: () => ["bb.rollouts.get"],
},
},
- // TODO(steven): Add more children routes for rollout detail.
- // {
- // path: "stages/:stageId/tasks/:taskId",
- // name: PROJECT_V1_ROUTE_ROLLOUT_DETAIL_TASK_DETAIL,
- // component: () =>
- // import("@/components/Rollout/RolloutDetail/TaskDetail/"),
- // props: true,
- // },
+ {
+ path: "stages/:stageId/tasks/:taskId",
+ name: PROJECT_V1_ROUTE_ROLLOUT_DETAIL_TASK_DETAIL,
+ component: () =>
+ import("@/components/Plan/components/RolloutView/TaskView.vue"),
+ props: true,
+ },
],
},
],
diff --git a/frontend/src/views/project/CICDLayout.vue b/frontend/src/views/project/CICDLayout.vue
index bcb2a54a5d..907a4eaed2 100644
--- a/frontend/src/views/project/CICDLayout.vue
+++ b/frontend/src/views/project/CICDLayout.vue
@@ -14,6 +14,7 @@
:key="tab"
:name="tab"
:tab="tabRender(tab)"
+ @click="handleTabChange(tab)"
/>
<!-- Suffix slot for Specifications tab -->
@@ -60,6 +61,7 @@ import {
PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL,
PROJECT_V1_ROUTE_PLAN_DETAIL_SPECS,
PROJECT_V1_ROUTE_ROLLOUT_DETAIL,
+ PROJECT_V1_ROUTE_ROLLOUT_DETAIL_TASK_DETAIL,
} from "@/router/dashboard/projectV1";
import {
extractIssueUID,
@@ -139,7 +141,12 @@ const tabKey = computed(() => {
return TabKey.Checks;
} else if (routeName === PROJECT_V1_ROUTE_ISSUE_DETAIL_V1) {
return TabKey.Review;
- } else if (routeName === PROJECT_V1_ROUTE_ROLLOUT_DETAIL) {
+ } else if (
+ [
+ PROJECT_V1_ROUTE_ROLLOUT_DETAIL,
+ PROJECT_V1_ROUTE_ROLLOUT_DETAIL_TASK_DETAIL,
+ ].includes(routeName)
+ ) {
return TabKey.Rollout;
}
// Fallback to Overview if no specific tab is matched.