Skip to content

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

Cleanup the creator/updater assignment

天舟336932e61834
diff --git a/frontend/src/store/modules/activity.ts b/frontend/src/store/modules/activity.ts
index 0af7ee132e..a738c3e34c 100644
--- a/frontend/src/store/modules/activity.ts
+++ b/frontend/src/store/modules/activity.ts
@@ -18,17 +18,13 @@ function convert(
includedList: ResourceObject[],
rootGetters: any
): Activity {
- const creator = activity.attributes.creator as Principal;
- const updater = activity.attributes.updater as Principal;
const payload = activity.attributes.payload
? JSON.parse(activity.attributes.payload as string)
: undefined;
return {
- ...(activity.attributes as Omit<Activity, "id" | "creator" | "updater">),
+ ...(activity.attributes as Omit<Activity, "id">),
id: parseInt(activity.id),
- creator,
- updater,
payload,
};
}
diff --git a/frontend/src/store/modules/bookmark.ts b/frontend/src/store/modules/bookmark.ts
index 587cab56cd..46192b5fa9 100644
--- a/frontend/src/store/modules/bookmark.ts
+++ b/frontend/src/store/modules/bookmark.ts
@@ -10,14 +10,9 @@ import {
} from "../../types";
function convert(bookmark: ResourceObject, rootGetters: any): Bookmark {
- const creator = bookmark.attributes.creator as Principal;
- const updater = bookmark.attributes.updater as Principal;
-
return {
- ...(bookmark.attributes as Omit<Bookmark, "id" | "creator" | "updater">),
+ ...(bookmark.attributes as Omit<Bookmark, "id">),
id: parseInt(bookmark.id),
- creator,
- updater,
};
}
diff --git a/frontend/src/store/modules/dataSource.ts b/frontend/src/store/modules/dataSource.ts
index c21e1c5460..f6a6d0ad06 100644
--- a/frontend/src/store/modules/dataSource.ts
+++ b/frontend/src/store/modules/dataSource.ts
@@ -24,8 +24,6 @@ function convert(
includedList: ResourceObject[],
rootGetters: any
): DataSource {
- const creator = dataSource.attributes.creator as Principal;
- const updater = dataSource.attributes.updater as Principal;
const databaseId = (
dataSource.relationships!.database.data as ResourceIdentifier
).id;
@@ -61,13 +59,11 @@ function convert(
return {
...(dataSource.attributes as Omit<
DataSource,
- "id" | "creator" | "updater" | "instanceId" | "database" | "memberList"
+ "id" | "instanceId" | "database" | "memberList"
>),
id: parseInt(dataSource.id),
instance,
database,
- creator,
- updater,
memberList,
};
}
diff --git a/frontend/src/store/modules/database.ts b/frontend/src/store/modules/database.ts
index a8919610ae..3b1e6a013c 100644
--- a/frontend/src/store/modules/database.ts
+++ b/frontend/src/store/modules/database.ts
@@ -24,9 +24,6 @@ function convert(
includedList: ResourceObject[],
rootGetters: any
): Database {
- const creator = database.attributes.creator as Principal;
- const updater = database.attributes.updater as Principal;
-
// We first populate the id for instance, project and dataSourceList.
// And if we also provide the detail info for those objects in the includedList,
// then we convert them to the detailed objects.
@@ -64,11 +61,9 @@ function convert(
const databaseWithoutDataSourceList = {
...(database.attributes as Omit<
Database,
- "id" | "creator" | "updater" | "instance" | "project" | "dataSourceList"
+ "id" | "instance" | "project" | "dataSourceList"
>),
id: parseInt(database.id),
- creator,
- updater,
instance,
project,
dataSourceList: [],
diff --git a/frontend/src/store/modules/environment.ts b/frontend/src/store/modules/environment.ts
index 348f096b87..4057653f52 100644
--- a/frontend/src/store/modules/environment.ts
+++ b/frontend/src/store/modules/environment.ts
@@ -19,17 +19,9 @@ function convert(
includedList: ResourceObject[],
rootGetters: any
): Environment {
- const creator = environment.attributes.creator as Principal;
- const updater = environment.attributes.updater as Principal;
-
return {
- ...(environment.attributes as Omit<
- Environment,
- "id" | "creator" | "updater"
- >),
+ ...(environment.attributes as Omit<Environment, "id">),
id: parseInt(environment.id),
- creator,
- updater,
};
}
diff --git a/frontend/src/store/modules/instance.ts b/frontend/src/store/modules/instance.ts
index de6e93d37e..1b3d06551f 100644
--- a/frontend/src/store/modules/instance.ts
+++ b/frontend/src/store/modules/instance.ts
@@ -23,9 +23,6 @@ function convert(
includedList: ResourceObject[],
rootGetters: any
): Instance {
- const creator = instance.attributes.creator as Principal;
- const updater = instance.attributes.updater as Principal;
-
const environmentId = (
instance.relationships!.environment.data as ResourceIdentifier
).id;
@@ -43,13 +40,8 @@ function convert(
}
return {
- ...(instance.attributes as Omit<
- Instance,
- "id" | "environment" | "creator" | "updater"
- >),
+ ...(instance.attributes as Omit<Instance, "id" | "environment">),
id: parseInt(instance.id),
- creator,
- updater,
environment,
// Password is not returned by the server, we just take extra caution here to redact it.
password: "",
diff --git a/frontend/src/store/modules/issue.ts b/frontend/src/store/modules/issue.ts
index 43114ce902..03b3243396 100644
--- a/frontend/src/store/modules/issue.ts
+++ b/frontend/src/store/modules/issue.ts
@@ -23,10 +23,6 @@ function convert(
includedList: ResourceObject[],
rootGetters: any
): Issue {
- const creator = issue.attributes.creator as Principal;
- const updater = issue.attributes.updater as Principal;
- const assignee = issue.attributes.assignee as Principal;
-
const projectId = (issue.relationships!.project.data as ResourceIdentifier)
.id;
let project: Project = unknown("PROJECT") as Project;
@@ -55,15 +51,9 @@ function convert(
}
return {
- ...(issue.attributes as Omit<
- Issue,
- "id" | "project" | "creator" | "updater" | "assignee"
- >),
+ ...(issue.attributes as Omit<Issue, "id" | "project">),
id: parseInt(issue.id),
project,
- creator,
- updater,
- assignee,
pipeline,
};
}
diff --git a/frontend/src/store/modules/member.ts b/frontend/src/store/modules/member.ts
index 2b918e552c..fb5386621d 100644
--- a/frontend/src/store/modules/member.ts
+++ b/frontend/src/store/modules/member.ts
@@ -19,19 +19,12 @@ function convert(
includedList: ResourceObject[],
rootGetters: any
): Member {
- const creator = member.attributes.creator as Principal;
- const updater = member.attributes.updater as Principal;
const principal = member.attributes.principal as Principal;
principal.role = member.attributes.role as RoleType;
return {
- ...(member.attributes as Omit<
- Member,
- "id" | "creator" | "updater" | "principal"
- >),
+ ...(member.attributes as Omit<Member, "id" | "principal">),
id: parseInt(member.id),
- creator,
- updater,
principal,
};
}
diff --git a/frontend/src/store/modules/pipeline.ts b/frontend/src/store/modules/pipeline.ts
index 384da967ca..78dfab1939 100644
--- a/frontend/src/store/modules/pipeline.ts
+++ b/frontend/src/store/modules/pipeline.ts
@@ -21,9 +21,6 @@ function convert(
includedList: ResourceObject[],
rootGetters: any
): Pipeline {
- const creator = pipeline.attributes.creator as Principal;
- const updater = pipeline.attributes.updater as Principal;
-
const stageList: Stage[] = [];
const stageIdList = pipeline.relationships!.stage
.data as ResourceIdentifier[];
@@ -43,13 +40,8 @@ function convert(
}
const result: Pipeline = {
- ...(pipeline.attributes as Omit<
- Pipeline,
- "id" | "creator" | "updater" | "stageList"
- >),
+ ...(pipeline.attributes as Omit<Pipeline, "id" | "stageList">),
id: parseInt(pipeline.id),
- creator,
- updater,
stageList,
};
diff --git a/frontend/src/store/modules/project.ts b/frontend/src/store/modules/project.ts
index 16fbab023d..5acf20e6fa 100644
--- a/frontend/src/store/modules/project.ts
+++ b/frontend/src/store/modules/project.ts
@@ -24,13 +24,7 @@ function convert(
includedList: ResourceObject[],
rootGetters: any
): Project {
- const creator = project.attributes.creator as Principal;
- const updater = project.attributes.updater as Principal;
-
- const attrs = project.attributes as Omit<
- Project,
- "id" | "creator" | "updater" | "memberList"
- >;
+ const attrs = project.attributes as Omit<Project, "id" | "memberList">;
// Only able to assign an empty member list, otherwise would cause circular dependency.
// This should be fine as we shouldn't access member via member.project.memberList
const projectWithoutMemberList: Project = {
@@ -38,8 +32,8 @@ function convert(
rowStatus: attrs.rowStatus,
name: attrs.name,
key: attrs.key,
- creator,
- updater,
+ creator: attrs.creator,
+ updater: attrs.updater,
createdTs: attrs.createdTs,
updatedTs: attrs.updatedTs,
memberList: [],
diff --git a/frontend/src/store/modules/repository.ts b/frontend/src/store/modules/repository.ts
index 044fe7603f..ea31036408 100644
--- a/frontend/src/store/modules/repository.ts
+++ b/frontend/src/store/modules/repository.ts
@@ -20,9 +20,6 @@ function convert(
includedList: ResourceObject[],
rootGetters: any
): Repository {
- const creator = respository.attributes.creator as Principal;
- const updater = respository.attributes.updater as Principal;
-
const vcsId = (respository.relationships!.vcs.data as ResourceIdentifier).id;
let vcs: VCS = unknown("VCS") as VCS;
vcs.id = parseInt(vcsId);
@@ -43,13 +40,8 @@ function convert(
}
return {
- ...(respository.attributes as Omit<
- Repository,
- "id" | "creator" | "updater" | "vcs" | "project"
- >),
+ ...(respository.attributes as Omit<Repository, "id" | "vcs" | "project">),
id: parseInt(respository.id),
- creator,
- updater,
vcs,
project,
};
diff --git a/frontend/src/store/modules/stage.ts b/frontend/src/store/modules/stage.ts
index a8c373d6ce..5899546b08 100644
--- a/frontend/src/store/modules/stage.ts
+++ b/frontend/src/store/modules/stage.ts
@@ -24,9 +24,6 @@ function convertPartial(
includedList: ResourceObject[],
rootGetters: any
): Omit<Stage, "pipeline"> {
- const creator = stage.attributes.creator as Principal;
- const updater = stage.attributes.updater as Principal;
-
const environmentId = (
stage.relationships!.environment.data as ResourceIdentifier
).id;
@@ -61,13 +58,8 @@ function convertPartial(
}
const result: Omit<Stage, "pipeline"> = {
- ...(stage.attributes as Omit<
- Stage,
- "id" | "creator" | "updater" | "database" | "taskList"
- >),
+ ...(stage.attributes as Omit<Stage, "id" | "database" | "taskList">),
id: parseInt(stage.id),
- creator,
- updater,
environment,
taskList,
};
diff --git a/frontend/src/store/modules/table.ts b/frontend/src/store/modules/table.ts
index 262d732071..700bcd6c76 100644
--- a/frontend/src/store/modules/table.ts
+++ b/frontend/src/store/modules/table.ts
@@ -8,14 +8,9 @@ import {
} from "../../types";
function convert(table: ResourceObject, rootGetters: any): Table {
- const creator = table.attributes.creator as Principal;
- const updater = table.attributes.updater as Principal;
-
return {
- ...(table.attributes as Omit<Table, "id" | "creator" | "updater">),
+ ...(table.attributes as Omit<Table, "id">),
id: parseInt(table.id),
- creator,
- updater,
};
}
diff --git a/frontend/src/store/modules/task.ts b/frontend/src/store/modules/task.ts
index 222d7ac4dd..9cba9f401c 100644
--- a/frontend/src/store/modules/task.ts
+++ b/frontend/src/store/modules/task.ts
@@ -26,20 +26,13 @@ function convertTaskRun(
includedList: ResourceObject[],
rootGetters: any
): TaskRun {
- const creator = taskRun.attributes.creator as Principal;
- const updater = taskRun.attributes.updater as Principal;
const payload = taskRun.attributes.payload
? JSON.parse(taskRun.attributes.payload as string)
: undefined;
return {
- ...(taskRun.attributes as Omit<
- TaskRun,
- "id" | "creator" | "updater" | "payload"
- >),
+ ...(taskRun.attributes as Omit<TaskRun, "id" | "payload">),
id: parseInt(taskRun.id),
- creator,
- updater,
payload,
};
}
diff --git a/frontend/src/store/modules/vcs.ts b/frontend/src/store/modules/vcs.ts
index 375d58bbb5..04a249b4b9 100644
--- a/frontend/src/store/modules/vcs.ts
+++ b/frontend/src/store/modules/vcs.ts
@@ -16,13 +16,9 @@ import {
} from "../../types";
function convert(vcs: ResourceObject): VCS {
- const creator = vcs.attributes.creator as Principal;
- const updater = vcs.attributes.updater as Principal;
return {
- ...(vcs.attributes as Omit<VCS, "id" | "creator" | "updater">),
+ ...(vcs.attributes as Omit<VCS, "id">),
id: parseInt(vcs.id),
- creator,
- updater,
};
}