Skip to content

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

r/pipeline/task

Tianzhou Chenf25224b0a871
diff --git a/frontend/src/components/ProjectSidePanel.vue b/frontend/src/components/ProjectSidePanel.vue
index c5e16bd663..3a6d18ff96 100644
--- a/frontend/src/components/ProjectSidePanel.vue
+++ b/frontend/src/components/ProjectSidePanel.vue
@@ -23,10 +23,10 @@
<!-- Expandable link section, show/hide based on state. -->
<div v-if="expandState" class="mt-1 space-y-1">
<router-link
- :to="`/${project.attributes.namespace}/${project.attributes.slug}/pipeline`"
+ :to="`/${project.attributes.namespace}/${project.attributes.slug}/task`"
class="sidebar-link group w-full flex items-center pl-10 pr-2 py-1"
>
- Pipeline
+ Task
</router-link>
<router-link
:to="`/${project.attributes.namespace}/${project.attributes.slug}/environment`"
diff --git a/frontend/src/components/PipelineTable.vue b/frontend/src/components/TaskTable.vue
similarity index 78%
rename from frontend/src/components/PipelineTable.vue
rename to frontend/src/components/TaskTable.vue
index 5258765ae0..b0aed35996 100644
--- a/frontend/src/components/PipelineTable.vue
+++ b/frontend/src/components/TaskTable.vue
@@ -1,23 +1,23 @@
<template>
<BBTable
:columnList="state.columnList"
- :sectionDataSource="pipelineSectionList"
+ :sectionDataSource="taskSectionList"
:showHeader="false"
- @click-row="clickPipeline"
+ @click-row="clickTask"
>
- <template v-slot:body="{ rowData: pipeline }">
+ <template v-slot:body="{ rowData: task }">
<BBTableCell :leftPadding="4" class="w-4 table-cell">
<span
class="w-5 h-5 flex items-center justify-center rounded-full"
- :class="iconStatusMap[pipeline.attributes.status].class"
+ :class="iconStatusMap[task.attributes.status].class"
>
- <template v-if="pipeline.attributes.status == `PENDING`">
+ <template v-if="task.attributes.status == `PENDING`">
<span
class="h-1.5 w-1.5 bg-blue-600 hover:bg-blue-700 rounded-full"
aria-hidden="true"
></span>
</template>
- <template v-else-if="pipeline.attributes.status == `RUNNING`">
+ <template v-else-if="task.attributes.status == `RUNNING`">
<span
class="h-2 w-2 bg-blue-600 hover:bg-blue-700 rounded-full"
style="
@@ -26,7 +26,7 @@
aria-hidden="true"
></span>
</template>
- <template v-else-if="pipeline.attributes.status == `DONE`">
+ <template v-else-if="task.attributes.status == `DONE`">
<svg
class="w-4 h-4"
xmlns="http://www.w3.org/2000/svg"
@@ -41,14 +41,14 @@
/>
</svg>
</template>
- <template v-else-if="pipeline.attributes.status == `FAILED`">
+ <template v-else-if="task.attributes.status == `FAILED`">
<span
class="h-2 w-2 rounded-full text-center pb-6 font-normal text-base"
aria-hidden="true"
>!</span
>
</template>
- <template v-else-if="pipeline.attributes.status == `CANCELED`">
+ <template v-else-if="task.attributes.status == `CANCELED`">
<svg
class="w-5 h-5"
fill="currentColor"
@@ -68,29 +68,29 @@
</BBTableCell>
<BBTableCell class="w-4 table-cell text-gray-500">
- <span class="">#{{ pipeline.id }}</span>
+ <span class="">#{{ task.id }}</span>
</BBTableCell>
<BBTableCell :rightPadding="1" class="w-4">
<span
class="flex items-center justify-center px-1.5 py-0.5 rounded-full text-xs font-mono bg-gray-500 text-white"
>
- {{ pipeline.attributes.type }}
+ {{ task.attributes.type }}
</span>
</BBTableCell>
<BBTableCell class="w-24 table-cell">
- {{ environmentName(pipeline.attributes.currentStageId) }}
+ {{ environmentName(task.attributes.currentStageId) }}
</BBTableCell>
<BBTableCell :leftPadding="1" class="w-auto">
- {{ pipeline.attributes.name }}
+ {{ task.attributes.name }}
</BBTableCell>
<BBTableCell class="w-12 hidden sm:table-cell">
- <BBStepBar :stepList="stageList(pipeline)" />
+ <BBStepBar :stepList="stageList(task)" />
</BBTableCell>
<BBTableCell class="w-56 hidden sm:table-cell">
- {{ pipeline.attributes.assignee.name }}
+ {{ task.attributes.assignee.name }}
</BBTableCell>
<BBTableCell :rightPadding="4" class="w-24 hidden md:table-cell">
- {{ humanize(pipeline.attributes.lastUpdatedTs) }}
+ {{ humanize(task.attributes.lastUpdatedTs) }}
</BBTableCell>
</template>
</BBTable>
@@ -107,7 +107,7 @@ import {
BBStepStatus,
} from "../bbkit/types";
import { humanize } from "../utils";
-import { EnvironmentId, Pipeline } from "../types";
+import { EnvironmentId, Task } from "../types";
interface LocalState {
columnList: BBTableColumn[];
@@ -141,12 +141,12 @@ const iconStatusMap = {
};
export default {
- name: "PipelineTable",
+ name: "TaskTable",
components: {},
props: {
- pipelineSectionList: {
+ taskSectionList: {
required: true,
- type: Object as PropType<BBTableSectionDataSource<Pipeline>[]>,
+ type: Object as PropType<BBTableSectionDataSource<Task>[]>,
},
},
setup(props, ctx) {
@@ -188,8 +188,8 @@ export default {
const router = useRouter();
- const stageList = function (pipeline: Pipeline): BBStep[] {
- return pipeline.attributes.stageProgressList.map((stageProgress) => {
+ const stageList = function (task: Task): BBStep[] {
+ return task.attributes.stageProgressList.map((stageProgress) => {
let stepStatus: BBStepStatus = "CREATED";
switch (stageProgress.status) {
case "CREATED":
@@ -218,16 +218,14 @@ export default {
title: stageProgress.stageName,
status: stepStatus,
link: (): string => {
- return `/pipeline/${pipeline.id}#${stageProgress.stageId}`;
+ return `/task/${task.id}#${stageProgress.stageId}`;
},
};
});
};
- const clickPipeline = function (section: number, row: number) {
- router.push(
- `/pipeline/${props.pipelineSectionList[section].list[row].id}`
- );
+ const clickTask = function (section: number, row: number) {
+ router.push(`/task/${props.taskSectionList[section].list[row].id}`);
};
return {
@@ -236,7 +234,7 @@ export default {
iconStatusMap,
stageList,
humanize,
- clickPipeline,
+ clickTask,
};
},
};
diff --git a/frontend/src/miragejs/factories/index.js b/frontend/src/miragejs/factories/index.js
index 376e896fbf..e7c95b3f89 100644
--- a/frontend/src/miragejs/factories/index.js
+++ b/frontend/src/miragejs/factories/index.js
@@ -12,7 +12,7 @@ import dataSource from "./dataSource";
import repository from "./repository";
import job from "./job";
import step from "./step";
-import pipeline from "./pipeline";
+import task from "./task";
import group from "./group";
import workspace from "./workspace";
import workspaceRole from "./workspaceRole";
@@ -36,7 +36,7 @@ export default {
...repository,
...job,
...step,
- ...pipeline,
+ ...task,
...group,
...workspace,
...workspaceRole,
diff --git a/frontend/src/miragejs/factories/job.js b/frontend/src/miragejs/factories/job.js
index 8fce584d28..fbf9046342 100644
--- a/frontend/src/miragejs/factories/job.js
+++ b/frontend/src/miragejs/factories/job.js
@@ -4,7 +4,7 @@ import faker from "faker";
export default {
job: Factory.extend({
name() {
- return "pipeline job " + faker.fake("{{lorem.word}}");
+ return "task job " + faker.fake("{{lorem.word}}");
},
slug(i) {
return 1000 + i;
diff --git a/frontend/src/miragejs/factories/pipeline.js b/frontend/src/miragejs/factories/task.js
similarity index 97%
rename from frontend/src/miragejs/factories/pipeline.js
rename to frontend/src/miragejs/factories/task.js
index 5c5022d941..b2c062d9a1 100644
--- a/frontend/src/miragejs/factories/pipeline.js
+++ b/frontend/src/miragejs/factories/task.js
@@ -2,7 +2,7 @@ import { Factory } from "miragejs";
import faker from "faker";
export default {
- pipeline: Factory.extend({
+ task: Factory.extend({
name(i) {
return faker.fake("{{lorem.sentence}}");
},
diff --git a/frontend/src/miragejs/models/index.js b/frontend/src/miragejs/models/index.js
index 23667711ad..993f164032 100644
--- a/frontend/src/miragejs/models/index.js
+++ b/frontend/src/miragejs/models/index.js
@@ -20,7 +20,7 @@ export default {
group: hasMany(),
project: hasMany(),
workspaceRole: hasMany(),
- pipeline: hasMany(),
+ task: hasMany(),
environment: hasMany(),
instance: hasMany(),
}),
@@ -49,7 +49,7 @@ export default {
user: belongsTo(),
}),
- pipeline: Model.extend({
+ task: Model.extend({
workspace: belongsTo(),
}),
diff --git a/frontend/src/miragejs/routes/index.js b/frontend/src/miragejs/routes/index.js
index 3a21dd8e2a..9e1093be16 100644
--- a/frontend/src/miragejs/routes/index.js
+++ b/frontend/src/miragejs/routes/index.js
@@ -46,34 +46,34 @@ export default function routes() {
return schema.users.create(signupInfo);
});
- // Pipeline
- this.get("/pipeline", function (schema, request) {
+ // Task
+ this.get("/task", function (schema, request) {
const {
queryParams: { userid: userId },
} = request;
if (userId) {
- return schema.pipelines.where((pipeline) => {
+ return schema.tasks.where((task) => {
return (
- pipeline.workspaceId == WORKSPACE_ID &&
- (pipeline.creator.id == userId ||
- pipeline.assignee.id == userId ||
- pipeline.subscriberIdList.includes(userId))
+ task.workspaceId == WORKSPACE_ID &&
+ (task.creator.id == userId ||
+ task.assignee.id == userId ||
+ task.subscriberIdList.includes(userId))
);
});
}
- return schema.pipelines.none();
+ return schema.tasks.none();
});
- this.get("/pipeline/:id", function (schema, request) {
- const pipeline = schema.pipelines.find(request.params.id);
- if (pipeline) {
- return pipeline;
+ this.get("/task/:id", function (schema, request) {
+ const task = schema.tasks.find(request.params.id);
+ if (task) {
+ return task;
}
return new Response(
404,
{},
- { errors: "Pipeline " + request.params.id + " not found" }
+ { errors: "Task " + request.params.id + " not found" }
);
});
@@ -337,21 +337,21 @@ export default function routes() {
return schema.environments.none();
});
- this.get("/project/:id/pipeline", function (schema, request) {
+ this.get("/project/:id/task", function (schema, request) {
const project = schema.projects.find(request.params.id);
if (project) {
- return schema.pipelines.where({
+ return schema.tasks.where({
projectId: project.id,
});
}
return schema.environments.none();
});
- this.get("/project/:id/pipeline/:pipelineId", function (schema, request) {
+ this.get("/project/:id/task/:taskId", function (schema, request) {
const project = schema.projects.find(request.params.id);
if (project) {
- return schema.pipelines.findBy({
- slug: request.params.pipelineId,
+ return schema.tasks.findBy({
+ slug: request.params.taskId,
});
}
return null;
diff --git a/frontend/src/miragejs/seeds/index.js b/frontend/src/miragejs/seeds/index.js
index 55adb1479b..c6cee650e7 100644
--- a/frontend/src/miragejs/seeds/index.js
+++ b/frontend/src/miragejs/seeds/index.js
@@ -49,7 +49,7 @@ const workspacesSeeder = (server) => {
});
}
- // Pipeline
+ // Task
const ws1Owner = server.schema.users.find(1);
const ws1DBA = server.schema.users.find(2);
const ws1Dev1 = server.schema.users.find(3);
@@ -59,7 +59,7 @@ const workspacesSeeder = (server) => {
const ws2Dev = server.schema.users.find(1);
for (let i = 0; i < 15; i++) {
- server.create("pipeline", {
+ server.create("task", {
creator: {
id: ws1Dev1.id,
name: ws1Dev1.name,
@@ -75,7 +75,7 @@ const workspacesSeeder = (server) => {
}
for (let i = 0; i < 15; i++) {
- server.create("pipeline", {
+ server.create("task", {
creator: {
id: ws1Owner.id,
name: ws1Owner.name,
@@ -91,7 +91,7 @@ const workspacesSeeder = (server) => {
}
for (let i = 0; i < 15; i++) {
- server.create("pipeline", {
+ server.create("task", {
creator: {
id: ws1Dev2.id,
name: ws1Dev2.name,
@@ -106,7 +106,7 @@ const workspacesSeeder = (server) => {
});
}
- server.create("pipeline", {
+ server.create("task", {
creator: {
id: ws2Dev.id,
name: ws2Dev.name,
@@ -217,30 +217,30 @@ const workspacesSeeder = (server) => {
});
// Bookmarks
- // Pipeline 1
- const pipeline1 = server.schema.pipelines.find(1);
+ // Task 1
+ const task1 = server.schema.tasks.find(1);
server.create("bookmark", {
workspace: workspace1,
- name: "Pipeline #" + pipeline1.id,
- link: `/pipeline/${pipeline1.id}`,
+ name: "Task #" + task1.id,
+ link: `/task/${task1.id}`,
});
- // Pipeline 2
- const pipeline2 = server.schema.pipelines.find(2);
+ // Task 2
+ const task2 = server.schema.tasks.find(2);
server.create("bookmark", {
workspace: workspace1,
- name: "Pipeline #" + pipeline2.id,
- link: `/pipeline/${pipeline2.id}`,
+ name: "Task #" + task2.id,
+ link: `/task/${task2.id}`,
});
- // Pipeline 3
- const pipeline3 = server.schema.pipelines.findBy({
+ // Task 3
+ const task3 = server.schema.tasks.findBy({
workspaceId: workspace2.id,
});
server.create("bookmark", {
workspace: workspace2,
- name: "Pipeline #" + pipeline3.id,
- link: `/pipeline/${pipeline3.id}`,
+ name: "Task #" + task3.id,
+ link: `/task/${task3.id}`,
});
};
diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts
index 6d3de904ca..35ac88f784 100644
--- a/frontend/src/router/index.ts
+++ b/frontend/src/router/index.ts
@@ -253,25 +253,24 @@ const routes: Array<RouteRecordRaw> = [
},
components: {
content: defineAsyncComponent(
- () => import("../views/PipelineDetail.vue")
+ () => import("../views/TaskDetail.vue")
),
leftSidebar: DashboardSidebar,
},
props: { content: true, leftSidebar: true },
},
{
- path: "pipeline/:pipelineId",
- name: "workspace.pipeline.detail",
+ path: "task/:taskId",
+ name: "workspace.task.detail",
meta: {
title: (route: RouteLocationNormalized) => {
- return store.getters["pipeline/pipelineById"](
- route.params.pipelineId
- ).attributes.name;
+ return store.getters["task/taskById"](route.params.taskId)
+ .attributes.name;
},
},
components: {
content: defineAsyncComponent(
- () => import("../views/PipelineDetail.vue")
+ () => import("../views/TaskDetail.vue")
),
leftSidebar: DashboardSidebar,
},
@@ -337,15 +336,15 @@ router.beforeEach((to, from, next) => {
}
const routerSlug = store.getters["router/routeSlug"](to);
- const pipelineId = routerSlug.pipelineId;
+ const taskId = routerSlug.taskId;
const instanceSlug = routerSlug.instanceSlug;
console.log("RouterSlug:", routerSlug);
- if (pipelineId) {
+ if (taskId) {
store
- .dispatch("pipeline/fetchPipelineById", pipelineId)
- .then((pipeline) => {
+ .dispatch("task/fetchTaskById", taskId)
+ .then((task) => {
next();
})
.catch((error) => {
diff --git a/frontend/src/store/index.ts b/frontend/src/store/index.ts
index aa0d80c2c8..67dc1ad2c5 100644
--- a/frontend/src/store/index.ts
+++ b/frontend/src/store/index.ts
@@ -10,7 +10,7 @@ import dataSource from "./modules/dataSource";
import repository from "./modules/repository";
import auth from "./modules/auth";
import group from "./modules/group";
-import pipeline from "./modules/pipeline";
+import task from "./modules/task";
// Following states are persisted in local storage
import uistate from "./modules/uistate";
@@ -33,7 +33,7 @@ export const store: Store<any> = createStore({
repository,
auth,
group,
- pipeline,
+ task,
uistate,
router,
command,
diff --git a/frontend/src/store/modules/pipeline.ts b/frontend/src/store/modules/pipeline.ts
deleted file mode 100644
index f19a71ccb9..0000000000
--- a/frontend/src/store/modules/pipeline.ts
+++ /dev/null
@@ -1,71 +0,0 @@
-import axios from "axios";
-import { UserId, PipelineId, Pipeline, PipelineState } from "../../types";
-
-const state: () => PipelineState = () => ({
- pipelineListByUser: new Map(),
- pipelineById: new Map(),
-});
-
-const getters = {
- pipelineListByUser: (state: PipelineState) => (userId: UserId) => {
- return state.pipelineListByUser.get(userId);
- },
-
- pipelineById: (state: PipelineState) => (pipelineId: PipelineId) => {
- return state.pipelineById.get(pipelineId);
- },
-};
-
-const actions = {
- async fetchPipelineListForUser({ commit }: any, userId: UserId) {
- const pipelineList = (await axios.get(`/api/pipeline?userid=${userId}`))
- .data.data;
- commit("setPipelineListForUser", { userId, pipelineList });
- return pipelineList;
- },
-
- async fetchPipelineById({ commit }: any, pipelineId: PipelineId) {
- const pipeline = (await axios.get(`/api/pipeline/${pipelineId}`)).data.data;
- commit("setPipelineById", {
- pipelineId,
- pipeline,
- });
- return pipeline;
- },
-};
-
-const mutations = {
- setPipelineListForUser(
- state: PipelineState,
- {
- userId,
- pipelineList,
- }: {
- userId: UserId;
- pipelineList: Pipeline[];
- }
- ) {
- state.pipelineListByUser.set(userId, pipelineList);
- },
-
- setPipelineById(
- state: PipelineState,
- {
- pipelineId,
- pipeline,
- }: {
- pipelineId: PipelineId;
- pipeline: Pipeline;
- }
- ) {
- state.pipelineById.set(pipelineId, pipeline);
- },
-};
-
-export default {
- namespaced: true,
- state,
- getters,
- actions,
- mutations,
-};
diff --git a/frontend/src/store/modules/router.ts b/frontend/src/store/modules/router.ts
index bf8af77da0..90d35f9890 100644
--- a/frontend/src/store/modules/router.ts
+++ b/frontend/src/store/modules/router.ts
@@ -11,19 +11,19 @@ const getters = {
routeSlug: (state: RouterState) => (
currentRoute: RouteLocationNormalized
): RouterSlug => {
- // /pipeline/<<pipeline-id>>
- // Total 2 elements, 2nd element is the pipeline id
- const pipelineComponents = currentRoute.path.match(
- "/pipeline/([0-9a-zA-Z_-]+)"
+ // /task/<<task-id>>
+ // Total 2 elements, 2nd element is the task id
+ const taskComponents = currentRoute.path.match(
+ "/task/([0-9a-zA-Z_-]+)"
) || ["/", undefined];
- if (pipelineComponents[1]) {
+ if (taskComponents[1]) {
return {
- pipelineId: pipelineComponents[1],
+ taskId: taskComponents[1],
};
}
// /instance/<<instance-id>>
- // Total 2 elements, 2nd element is the pipeline id
+ // Total 2 elements, 2nd element is the task id
const instanceComponents = currentRoute.path.match(
"/instance/([0-9a-zA-Z_-]+)"
) || ["/", undefined];
diff --git a/frontend/src/store/modules/task.ts b/frontend/src/store/modules/task.ts
new file mode 100644
index 0000000000..d59e82d244
--- /dev/null
+++ b/frontend/src/store/modules/task.ts
@@ -0,0 +1,70 @@
+import axios from "axios";
+import { UserId, TaskId, Task, TaskState } from "../../types";
+
+const state: () => TaskState = () => ({
+ taskListByUser: new Map(),
+ taskById: new Map(),
+});
+
+const getters = {
+ taskListByUser: (state: TaskState) => (userId: UserId) => {
+ return state.taskListByUser.get(userId);
+ },
+
+ taskById: (state: TaskState) => (taskId: TaskId) => {
+ return state.taskById.get(taskId);
+ },
+};
+
+const actions = {
+ async fetchTaskListForUser({ commit }: any, userId: UserId) {
+ const taskList = (await axios.get(`/api/task?userid=${userId}`)).data.data;
+ commit("setTaskListForUser", { userId, taskList });
+ return taskList;
+ },
+
+ async fetchTaskById({ commit }: any, taskId: TaskId) {
+ const task = (await axios.get(`/api/task/${taskId}`)).data.data;
+ commit("setTaskById", {
+ taskId,
+ task,
+ });
+ return task;
+ },
+};
+
+const mutations = {
+ setTaskListForUser(
+ state: TaskState,
+ {
+ userId,
+ taskList,
+ }: {
+ userId: UserId;
+ taskList: Task[];
+ }
+ ) {
+ state.taskListByUser.set(userId, taskList);
+ },
+
+ setTaskById(
+ state: TaskState,
+ {
+ taskId,
+ task,
+ }: {
+ taskId: TaskId;
+ task: Task;
+ }
+ ) {
+ state.taskById.set(taskId, task);
+ },
+};
+
+export default {
+ namespaced: true,
+ state,
+ getters,
+ actions,
+ mutations,
+};
diff --git a/frontend/src/types/bytebase.ts b/frontend/src/types/bytebase.ts
index 204f355359..390c068880 100644
--- a/frontend/src/types/bytebase.ts
+++ b/frontend/src/types/bytebase.ts
@@ -5,7 +5,7 @@ import { BBNotificationStyle } from "../bbkit/types";
// Also good for readability.
export type UserId = string;
-export type PipelineId = string;
+export type TaskId = string;
export type GroupId = string;
@@ -33,7 +33,7 @@ export type NewBookmark = Omit<Bookmark, "id">;
export type Activity = ResourceObject & {};
export type ActivityNew = Omit<Activity, "id">;
-export type Pipeline = ResourceObject & {
+export type Task = ResourceObject & {
attributes: {
title: string;
createdTs: number;
@@ -65,7 +65,7 @@ export type Pipeline = ResourceObject & {
subscriberIdList: Array<string>;
};
};
-export type PipelineNew = Omit<Pipeline, "id">;
+export type TaskNew = Omit<Task, "id">;
export type Environment = ResourceObject & {
attributes: {
@@ -128,7 +128,7 @@ export type SignupInfo = Omit<
// UI State Models
export type RouterSlug = {
- pipelineId?: PipelineId;
+ taskId?: TaskId;
instanceSlug?: string;
};
@@ -168,9 +168,9 @@ export interface ActivityState {
activityListByUser: Map<UserId, Activity[]>;
}
-export interface PipelineState {
- pipelineListByUser: Map<UserId, Pipeline[]>;
- pipelineById: Map<PipelineId, Pipeline>;
+export interface TaskState {
+ taskListByUser: Map<UserId, Task[]>;
+ taskById: Map<TaskId, Task>;
}
export interface GroupState {
diff --git a/frontend/src/views/Home.vue b/frontend/src/views/Home.vue
index e4e97c6b7a..e0975994ca 100644
--- a/frontend/src/views/Home.vue
+++ b/frontend/src/views/Home.vue
@@ -3,8 +3,8 @@
<div class="px-2 py-1">
<EnvironmentTabFilter @select-environment="selectEnvironment" />
</div>
- <PipelineTable
- :pipelineSectionList="[
+ <TaskTable
+ :taskSectionList="[
{
title: 'Attention',
list: filteredList(state.attentionList).sort((a, b) => {
@@ -31,16 +31,16 @@
<script lang="ts">
import { watchEffect, inject, reactive } from "vue";
import EnvironmentTabFilter from "../components/EnvironmentTabFilter.vue";
-import PipelineTable from "../components/PipelineTable.vue";
+import TaskTable from "../components/TaskTable.vue";
import { useStore } from "vuex";
import { useRouter } from "vue-router";
import { UserStateSymbol } from "../components/ProvideUser.vue";
-import { User, Environment, Pipeline } from "../types";
+import { User, Environment, Task } from "../types";
interface LocalState {
- attentionList: Pipeline[];
- subscribeList: Pipeline[];
- closeList: Pipeline[];
+ attentionList: Task[];
+ subscribeList: Task[];
+ closeList: Task[];
selectedEnvironment?: Environment;
}
@@ -48,7 +48,7 @@ export default {
name: "Home",
components: {
EnvironmentTabFilter,
- PipelineTable,
+ TaskTable,
},
props: {},
setup(props, ctx) {
@@ -61,34 +61,34 @@ export default {
const router = useRouter();
const currentUser = inject<User>(UserStateSymbol);
- const preparePipelineList = () => {
+ const prepareTaskList = () => {
store
- .dispatch("pipeline/fetchPipelineListForUser", currentUser!.id)
- .then((pipelineList: Pipeline[]) => {
+ .dispatch("task/fetchTaskListForUser", currentUser!.id)
+ .then((taskList: Task[]) => {
state.attentionList = [];
state.subscribeList = [];
state.closeList = [];
- for (const pipeline of pipelineList) {
+ for (const task of taskList) {
if (
- pipeline.attributes.assignee.id === currentUser!.id &&
- (pipeline.attributes.status === "PENDING" ||
- pipeline.attributes.status === "RUNNING" ||
- pipeline.attributes.status === "FAILED")
+ task.attributes.assignee.id === currentUser!.id &&
+ (task.attributes.status === "PENDING" ||
+ task.attributes.status === "RUNNING" ||
+ task.attributes.status === "FAILED")
) {
- state.attentionList.push(pipeline);
+ state.attentionList.push(task);
} else if (
- pipeline.attributes.subscriberIdList.includes(currentUser!.id) &&
- (pipeline.attributes.status === "PENDING" ||
- pipeline.attributes.status === "RUNNING" ||
- pipeline.attributes.status === "FAILED")
+ task.attributes.subscriberIdList.includes(currentUser!.id) &&
+ (task.attributes.status === "PENDING" ||
+ task.attributes.status === "RUNNING" ||
+ task.attributes.status === "FAILED")
) {
- state.subscribeList.push(pipeline);
+ state.subscribeList.push(task);
} else if (
- pipeline.attributes.creator.id === currentUser!.id &&
- (pipeline.attributes.status === "DONE" ||
- pipeline.attributes.status === "CANCELED")
+ task.attributes.creator.id === currentUser!.id &&
+ (task.attributes.status === "DONE" ||
+ task.attributes.status === "CANCELED")
) {
- state.closeList.push(pipeline);
+ state.closeList.push(task);
}
}
})
@@ -101,19 +101,17 @@ export default {
state.selectedEnvironment = environment;
};
- const filteredList = (list: Pipeline[]) => {
+ const filteredList = (list: Task[]) => {
if (!state.selectedEnvironment) {
// Select "All"
return list;
}
- return list.filter((pipeline) => {
- return (
- pipeline.attributes.currentStageId == state.selectedEnvironment!.id
- );
+ return list.filter((task) => {
+ return task.attributes.currentStageId == state.selectedEnvironment!.id;
});
};
- watchEffect(preparePipelineList);
+ watchEffect(prepareTaskList);
return {
state,
diff --git a/frontend/src/views/PipelineActivityPanel.vue b/frontend/src/views/TaskActivityPanel.vue
similarity index 99%
rename from frontend/src/views/PipelineActivityPanel.vue
rename to frontend/src/views/TaskActivityPanel.vue
index fa01f22ab4..258fa4706c 100644
--- a/frontend/src/views/PipelineActivityPanel.vue
+++ b/frontend/src/views/TaskActivityPanel.vue
@@ -327,14 +327,14 @@
<script lang="ts">
import { PropType } from "vue";
-import { Pipeline } from "../types";
+import { Task } from "../types";
export default {
- name: "PipelineActivityPanel",
+ name: "TaskActivityPanel",
props: {
- pipeline: {
+ task: {
required: true,
- type: Object as PropType<Pipeline>,
+ type: Object as PropType<Task>,
},
},
components: {},
diff --git a/frontend/src/views/PipelineContent.vue b/frontend/src/views/TaskContent.vue
similarity index 64%
rename from frontend/src/views/PipelineContent.vue
rename to frontend/src/views/TaskContent.vue
index b51bb4b3df..08a5b8c14a 100644
--- a/frontend/src/views/PipelineContent.vue
+++ b/frontend/src/views/TaskContent.vue
@@ -1,20 +1,20 @@
<template>
<h2 class="sr-only">Description</h2>
<div class="prose max-w-none whitespace-pre-line">
- {{ pipeline.attributes.content }}
+ {{ task.attributes.content }}
</div>
</template>
<script lang="ts">
import { PropType } from "vue";
-import { Pipeline } from "../types";
+import { Task } from "../types";
export default {
- name: "PipelineContent",
+ name: "TaskContent",
props: {
- pipeline: {
+ task: {
required: true,
- type: Object as PropType<Pipeline>,
+ type: Object as PropType<Task>,
},
},
components: {},
diff --git a/frontend/src/views/PipelineContentBar.vue b/frontend/src/views/TaskContentBar.vue
similarity index 93%
rename from frontend/src/views/PipelineContentBar.vue
rename to frontend/src/views/TaskContentBar.vue
index 3953e3dd8e..8cbcfe1ecc 100644
--- a/frontend/src/views/PipelineContentBar.vue
+++ b/frontend/src/views/TaskContentBar.vue
@@ -46,14 +46,14 @@
<script lang="ts">
import { PropType } from "vue";
-import { Pipeline } from "../types";
+import { Task } from "../types";
export default {
- name: "PipelineToolbar",
+ name: "TaskToolbar",
props: {
- pipeline: {
+ task: {
required: true,
- type: Object as PropType<Pipeline>,
+ type: Object as PropType<Task>,
},
},
components: {},
diff --git a/frontend/src/views/PipelineDetail.vue b/frontend/src/views/TaskDetail.vue
similarity index 50%
rename from frontend/src/views/PipelineDetail.vue
rename to frontend/src/views/TaskDetail.vue
index 9a2dc60733..038da902b6 100644
--- a/frontend/src/views/PipelineDetail.vue
+++ b/frontend/src/views/TaskDetail.vue
@@ -1,16 +1,16 @@
<template>
<div
- id="pipeline-detail-top"
+ id="task-detail-top"
class="flex-1 overflow-auto focus:outline-none"
tabindex="0"
>
<!-- Page header -->
<div class="bg-white">
- <PipelineHighlightPanel :pipeline="pipeline" />
+ <TaskHighlightPanel :task="task" />
</div>
<!-- Flow -->
- <PipelineFlow :pipeline="pipeline" />
+ <TaskFlow :task="task" />
<!-- Main Content -->
<main
@@ -23,18 +23,15 @@
>
<div class="lg:col-span-2 lg:pr-8 lg:border-r lg:border-gray-200">
<div>
- <PipelineContentBar v-if="false" :pipeline="pipeline" />
- <PipelineSidebar class="lg:hidden" :pipeline="pipeline" />
- <PipelineContent :pipeline="pipeline" />
+ <TaskContentBar v-if="false" :task="task" />
+ <TaskSidebar class="lg:hidden" :task="task" />
+ <TaskContent :task="task" />
</div>
<section aria-labelledby="activity-title" class="mt-8 lg:mt-10">
- <PipelineActivityPanel :pipeline="pipeline" />
+ <TaskActivityPanel :task="task" />
</section>
</div>
- <PipelineSidebar
- class="hidden lg:block lg:pl-8"
- :pipeline="pipeline"
- />
+ <TaskSidebar class="hidden lg:block lg:pl-8" :task="task" />
</div>
</div>
</main>
@@ -45,28 +42,28 @@
import { computed, onMounted } from "vue";
import { useStore } from "vuex";
import { humanize } from "../utils";
-import PipelineActivityPanel from "../views/PipelineActivityPanel.vue";
-import PipelineFlow from "../views/PipelineFlow.vue";
-import PipelineHighlightPanel from "../views/PipelineHighlightPanel.vue";
-import PipelineContent from "../views/PipelineContent.vue";
-import PipelineContentBar from "../views/PipelineContentBar.vue";
-import PipelineSidebar from "../views/PipelineSidebar.vue";
+import TaskActivityPanel from "../views/TaskActivityPanel.vue";
+import TaskFlow from "../views/TaskFlow.vue";
+import TaskHighlightPanel from "../views/TaskHighlightPanel.vue";
+import TaskContent from "../views/TaskContent.vue";
+import TaskContentBar from "../views/TaskContentBar.vue";
+import TaskSidebar from "../views/TaskSidebar.vue";
export default {
- name: "PipelineDetail",
+ name: "TaskDetail",
props: {
- pipelineId: {
+ taskId: {
required: true,
type: String,
},
},
components: {
- PipelineActivityPanel,
- PipelineContent,
- PipelineContentBar,
- PipelineFlow,
- PipelineHighlightPanel,
- PipelineSidebar,
+ TaskActivityPanel,
+ TaskContent,
+ TaskContentBar,
+ TaskFlow,
+ TaskHighlightPanel,
+ TaskSidebar,
},
setup(props, ctx) {
@@ -77,14 +74,12 @@ export default {
// The hypothesis is that because the scroll bar is in the nested
// route, thus setting the scrollBehavior in the global router
// won't work.
- document.getElementById("pipeline-detail-top")!.scrollIntoView();
+ document.getElementById("task-detail-top")!.scrollIntoView();
});
- const pipeline = computed(() =>
- store.getters["pipeline/pipelineById"](props.pipelineId)
- );
+ const task = computed(() => store.getters["task/taskById"](props.taskId));
- return { pipeline, humanize };
+ return { task, humanize };
},
};
</script>
diff --git a/frontend/src/views/PipelineFlow.vue b/frontend/src/views/TaskFlow.vue
similarity index 95%
rename from frontend/src/views/PipelineFlow.vue
rename to frontend/src/views/TaskFlow.vue
index 4a080f00d5..61e0b532f1 100644
--- a/frontend/src/views/PipelineFlow.vue
+++ b/frontend/src/views/TaskFlow.vue
@@ -98,7 +98,7 @@
class="ml-4 text-sm"
:class="
stepTextClass(
- pipeline.currentStageId == stage.stageId,
+ task.currentStageId == stage.stageId,
stage.status
)
"
@@ -133,7 +133,7 @@
<script lang="ts">
import { PropType } from "vue";
-import { Pipeline } from "../types";
+import { Task } from "../types";
interface FlowItem {
title: string;
@@ -142,22 +142,22 @@ interface FlowItem {
}
export default {
- name: "PipelineFlow",
+ name: "TaskFlow",
props: {
- pipeline: {
+ task: {
required: true,
- type: Object as PropType<Pipeline>,
+ type: Object as PropType<Task>,
},
},
components: {},
setup(props, ctx) {
- const stageList: FlowItem[] = props.pipeline.attributes.stageProgressList.map(
+ const stageList: FlowItem[] = props.task.attributes.stageProgressList.map(
(stageProgress) => {
return {
title: stageProgress.stageName,
status: stageProgress.status,
link: (): string => {
- return `/pipeline/${props.pipeline.id}#${stageProgress.stageId}`;
+ return `/task/${props.task.id}#${stageProgress.stageId}`;
},
};
}
diff --git a/frontend/src/views/PipelineHighlightPanel.vue b/frontend/src/views/TaskHighlightPanel.vue
similarity index 79%
rename from frontend/src/views/PipelineHighlightPanel.vue
rename to frontend/src/views/TaskHighlightPanel.vue
index 6bb4fd19c8..a735f86e91 100644
--- a/frontend/src/views/PipelineHighlightPanel.vue
+++ b/frontend/src/views/TaskHighlightPanel.vue
@@ -12,18 +12,18 @@
<p
class="text-2xl font-bold leading-7 text-gray-900 sm:leading-9 whitespace-nowrap"
>
- {{ pipeline.attributes.name }}
+ {{ task.attributes.name }}
</p>
</div>
<div>
<p class="mt-2 text-sm text-gray-500">
- #{{ pipeline.id }} opened by
+ #{{ task.id }} opened by
<span href="#" class="font-medium text-control">{{
- pipeline.attributes.creator.name
+ task.attributes.creator.name
}}</span>
at
<span href="#" class="font-medium text-control">{{
- moment(pipeline.attributes.lastUpdatedTs).format("LLL")
+ moment(task.attributes.lastUpdatedTs).format("LLL")
}}</span>
</p>
</div>
@@ -40,14 +40,14 @@
<script lang="ts">
import { PropType } from "vue";
-import { Pipeline } from "../types";
+import { Task } from "../types";
export default {
- name: "PipelineHighlightPanel",
+ name: "TaskHighlightPanel",
props: {
- pipeline: {
+ task: {
required: true,
- type: Object as PropType<Pipeline>,
+ type: Object as PropType<Task>,
},
},
components: {},
diff --git a/frontend/src/views/PipelineSidebar.vue b/frontend/src/views/TaskSidebar.vue
similarity index 86%
rename from frontend/src/views/PipelineSidebar.vue
rename to frontend/src/views/TaskSidebar.vue
index 5689eaa648..3f6fcd5ee0 100644
--- a/frontend/src/views/PipelineSidebar.vue
+++ b/frontend/src/views/TaskSidebar.vue
@@ -9,11 +9,11 @@
<div class="flex-shrink-0">
<BBAvatar
:size="'small'"
- :username="pipeline.attributes.assignee.name"
+ :username="task.attributes.assignee.name"
/>
</div>
<div class="text-sm font-medium text-gray-900">
- {{ pipeline.attributes.assignee.name }}
+ {{ task.attributes.assignee.name }}
</div>
</li>
</ul>
@@ -67,13 +67,13 @@
<div>
<h2 class="textlabel">Update Time</h2>
<span class="textfield">
- {{ moment(pipeline.attributes.lastUpdatedTs).format("LLL") }}</span
+ {{ moment(task.attributes.lastUpdatedTs).format("LLL") }}</span
>
</div>
<div>
<h2 class="textlabel">Creation Time</h2>
<span class="textfield">
- {{ moment(pipeline.attributes.createdTs).format("LLL") }}</span
+ {{ moment(task.attributes.createdTs).format("LLL") }}</span
>
</div>
</div>
@@ -82,14 +82,14 @@
<script lang="ts">
import { PropType } from "vue";
-import { Pipeline } from "../types";
+import { Task } from "../types";
export default {
- name: "PipelineSidebar",
+ name: "TaskSidebar",
props: {
- pipeline: {
+ task: {
required: true,
- type: Object as PropType<Pipeline>,
+ type: Object as PropType<Task>,
},
},
components: {},