Skip to content

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

Use assignee data from backend for rendering pipeline table

Tianzhou Chen51ac1c6eab06
diff --git a/frontend/src/components/PipelineTable.vue b/frontend/src/components/PipelineTable.vue
index cc15263554..9df16abb0e 100644
--- a/frontend/src/components/PipelineTable.vue
+++ b/frontend/src/components/PipelineTable.vue
@@ -27,7 +27,7 @@
<BBStepBar :stepList="stageList(pipeline)" />
</BBTableCell>
<BBTableCell class="w-1/12 hidden lg:table-cell">
- <BBAvatar :username="`Darth Vader`"> </BBAvatar>
+ <BBAvatar :username="pipeline.attributes.assignee.name"> </BBAvatar>
</BBTableCell>
<BBTableCell class="w-1/12 hidden lg:table-cell">
{{ humanize(pipeline.attributes.createdTs) }}
diff --git a/frontend/src/miragejs/factories/pipeline.js b/frontend/src/miragejs/factories/pipeline.js
index 63b4061a29..ba0a6061b0 100644
--- a/frontend/src/miragejs/factories/pipeline.js
+++ b/frontend/src/miragejs/factories/pipeline.js
@@ -49,11 +49,17 @@ export default {
},
];
},
- creatorId() {
- return 100;
+ creator() {
+ return {
+ id: "100",
+ name: "John Appleseed",
+ };
},
- assigneeId() {
- return 200;
+ assignee() {
+ return {
+ id: "200",
+ name: "Jim Gray",
+ };
},
subscriberIdList() {
return new Array();
diff --git a/frontend/src/miragejs/routes/index.js b/frontend/src/miragejs/routes/index.js
index afd468f0bf..cc81c20922 100644
--- a/frontend/src/miragejs/routes/index.js
+++ b/frontend/src/miragejs/routes/index.js
@@ -54,8 +54,8 @@ export default function routes() {
return schema.pipelines.where((pipeline) => {
return (
pipeline.workspaceId == WORKSPACE_ID &&
- (pipeline.creatorId == userId ||
- pipeline.assigneeId == userId ||
+ (pipeline.creator.id == userId ||
+ pipeline.assignee.id == userId ||
pipeline.subscriberIdList.includes(userId))
);
});
diff --git a/frontend/src/miragejs/seeds/index.js b/frontend/src/miragejs/seeds/index.js
index 10b1827145..ddaabef725 100644
--- a/frontend/src/miragejs/seeds/index.js
+++ b/frontend/src/miragejs/seeds/index.js
@@ -1,3 +1,5 @@
+import faker from "faker";
+
/*
* Mirage JS guide on Seeds: https://miragejs.com/docs/data-layer/factories#in-development
*/
@@ -39,8 +41,14 @@ const workspacesSeeder = (server) => {
for (let i = 0; i < 15; i++) {
server.create("pipeline", {
- creatorId: ws1Dev1.id,
- assigneeId: ws1Owner.id,
+ creator: {
+ id: ws1Dev1.id,
+ name: ws1Dev1.name,
+ },
+ assignee: {
+ id: ws1Owner.id,
+ name: ws1Owner.name,
+ },
subscriberIdList: [ws1DBA.id, ws1Dev2.id],
...fillStage(environmentList1),
workspace: workspace1,
@@ -49,8 +57,14 @@ const workspacesSeeder = (server) => {
for (let i = 0; i < 15; i++) {
server.create("pipeline", {
- creatorId: ws1Owner.id,
- assigneeId: ws1DBA.id,
+ creator: {
+ id: ws1Owner.id,
+ name: ws1Owner.name,
+ },
+ assignee: {
+ id: ws1DBA.id,
+ name: ws1DBA.name,
+ },
subscriberIdList: [ws1Dev2.id],
...fillStage(environmentList1),
workspace: workspace1,
@@ -59,8 +73,14 @@ const workspacesSeeder = (server) => {
for (let i = 0; i < 15; i++) {
server.create("pipeline", {
- creatorId: ws1Dev2.id,
- assigneeId: ws1DBA.id,
+ creator: {
+ id: ws1Dev2.id,
+ name: ws1Dev2.name,
+ },
+ assignee: {
+ id: ws1DBA.id,
+ name: ws1DBA.name,
+ },
subscriberIdList: [ws1Owner.id, ws1Dev1.id],
...fillStage(environmentList1),
workspace: workspace1,
@@ -68,8 +88,14 @@ const workspacesSeeder = (server) => {
}
server.create("pipeline", {
- creatorId: ws2Dev.id,
- assigneeId: ws2DBA.id,
+ creator: {
+ id: ws2Dev.id,
+ name: ws2Dev.name,
+ },
+ assignee: {
+ id: ws2DBA.id,
+ name: ws2DBA.name,
+ },
...fillStage(environmentList2),
workspace: workspace2,
});
diff --git a/frontend/src/types/bytebase.ts b/frontend/src/types/bytebase.ts
index 74ea1666cf..27ec4f2db9 100644
--- a/frontend/src/types/bytebase.ts
+++ b/frontend/src/types/bytebase.ts
@@ -49,8 +49,14 @@ export type Pipeline = ResourceObject & {
| "CANCELED"
| "SKIPPED";
}[];
- creatorId: string;
- assigneeId: string;
+ creator: {
+ id: string;
+ name: string;
+ };
+ assignee: {
+ id: string;
+ name: string;
+ };
subscriberIdList: Array<string>;
};
};