Skip to content

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

Emit click-step event to BBStepBar and let caller decide how to respond

天舟fea83a4b1883
diff --git a/frontend/src/bbkit/BBStepBar.vue b/frontend/src/bbkit/BBStepBar.vue
index c183c0d250..a635677a6e 100644
--- a/frontend/src/bbkit/BBStepBar.vue
+++ b/frontend/src/bbkit/BBStepBar.vue
@@ -9,10 +9,10 @@
>
<div class="h-0.5 w-full bg-gray-300"></div>
</div>
- <router-link
- :to="step.link()"
+ <div
class="relative w-6 h-6 flex items-center justify-center rounded-full"
:class="stepClass(step.status)"
+ @click.stop.prevent="$emit('click-step', step)"
>
<template v-if="step.status == `PENDING`">
<span
@@ -119,7 +119,7 @@
</svg>
</template>
<span class="sr-only">{{ step.title }}</span>
- </router-link>
+ </div>
</li>
</ol>
</nav>
@@ -131,6 +131,7 @@ import { BBStep, BBStepStatus } from "./types";
export default {
name: "BBStepBar",
+ emits: ["click-step"],
props: {
stepList: {
required: true,
@@ -141,23 +142,23 @@ export default {
const stepClass = (status: BBStepStatus) => {
switch (status) {
case "PENDING":
- return "bg-white border-2 border-control";
+ return "bg-white border-2 border-control hover:border-control-hover";
case "PENDING_ACTIVE":
- return "bg-white border-2 border-blue-600 text-blue-600";
+ return "bg-white border-2 border-blue-600 text-blue-600 hover:text-blue-700 hover:border-blue-700";
case "PENDING_APPROVAL":
- return "bg-white border-2 border-control";
+ return "bg-white border-2 border-control hover:border-control-hover";
case "PENDING_APPROVAL_ACTIVE":
- return "bg-white border-2 border-blue-600 text-blue-600";
+ return "bg-white border-2 border-blue-600 text-blue-600 hover:text-blue-700 hover:border-blue-700";
case "RUNNING":
- return "bg-white border-2 border-blue-600 text-blue-600";
+ return "bg-white border-2 border-blue-600 text-blue-600 hover:text-blue-700 hover:border-blue-700";
case "DONE":
- return "bg-success text-white";
+ return "bg-success hover:bg-success-hover text-white";
case "FAILED":
- return "bg-error text-white hover:text-white";
+ return "bg-error hover:bg-error-hover text-white";
case "CANCELED":
- return "bg-white border-2 text-gray-400 border-gray-400";
+ return "bg-white border-2 text-gray-400 border-gray-400 hover:text-gray-500 hover:border-gray-500";
case "SKIPPED":
- return "bg-white border-2 text-gray-300 border-gray-300";
+ return "bg-white border-2 text-gray-300 border-gray-300 hover:text-gray-400 hover:border-gray-400";
}
};
diff --git a/frontend/src/bbkit/types.ts b/frontend/src/bbkit/types.ts
index 83e0c8a4e0..94ebcc98c2 100644
--- a/frontend/src/bbkit/types.ts
+++ b/frontend/src/bbkit/types.ts
@@ -30,7 +30,7 @@ export type BBStepStatus =
export type BBStep = {
title: string;
status: BBStepStatus;
- link(): string;
+ payload: any;
};
export type BBStepTabItem = {
diff --git a/frontend/src/components/IssueTable.vue b/frontend/src/components/IssueTable.vue
index 0529f55780..b284d468fb 100644
--- a/frontend/src/components/IssueTable.vue
+++ b/frontend/src/components/IssueTable.vue
@@ -88,7 +88,14 @@
{{ activeDatabaseName(issue) }}
</BBTableCell>
<BBTableCell class="hidden sm:table-cell">
- <BBStepBar :stepList="taskList(issue)" />
+ <BBStepBar
+ :stepList="taskStepList(issue)"
+ @click-step="
+ (step) => {
+ clickIssueStep(issue, step);
+ }
+ "
+ />
</BBTableCell>
<BBTableCell class="hidden md:table-cell">
{{ humanizeTs(issue.updatedTs) }}
@@ -125,6 +132,7 @@ import {
activeDatabase,
activeTask,
allTaskList,
+ stageSlug,
} from "../utils";
import { Issue, EMPTY_ID, Task } from "../types";
@@ -238,7 +246,7 @@ export default {
const router = useRouter();
- const taskList = function (issue: Issue): BBStep[] {
+ const taskStepList = function (issue: Issue): BBStep[] {
const list: Task[] = allTaskList(issue.pipeline);
return list.map((task) => {
let status: BBStepStatus = task.status;
@@ -253,26 +261,40 @@ export default {
return {
title: task.name,
status,
- link: (): string => {
- return `/issue/${issue.id}`;
- },
+ payload: task,
};
});
};
- const clickIssue = function (section: number, row: number) {
+ const clickIssue = (section: number, row: number) => {
const issue = props.issueSectionList[section].list[row];
router.push(`/issue/${issueSlug(issue.name, issue.id)}`);
};
+ const clickIssueStep = (issue: Issue, step: BBStep) => {
+ const task = step.payload as Task;
+ const stageIndex = issue.pipeline.stageList.findIndex((item, index) => {
+ return item.id == task.stage.id;
+ });
+
+ router.push({
+ name: "workspace.issue.detail",
+ params: {
+ issueSlug: issueSlug(issue.name, issue.id),
+ },
+ query: { stage: stageSlug(task.stage.name, stageIndex) },
+ });
+ };
+
return {
state,
columnList: columnListMap.get(props.mode),
activeEnvironmentName,
activeDatabaseName,
- taskList,
+ taskStepList,
activeTask,
clickIssue,
+ clickIssueStep,
};
},
};