Skip to content

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

If rowStatusList is not specified, should only return NORMAL record

天舟6f0f5aa12961
diff --git a/frontend/src/store/modules/environment.ts b/frontend/src/store/modules/environment.ts
index 27e7b8a950..9f18e815dc 100644
--- a/frontend/src/store/modules/environment.ts
+++ b/frontend/src/store/modules/environment.ts
@@ -27,7 +27,10 @@ const getters = {
rowStatusList?: RowStatus[]
): Environment[] => {
return state.environmentList.filter((environment: Environment) => {
- return !rowStatusList || rowStatusList.includes(environment.rowStatus);
+ return (
+ (!rowStatusList && environment.rowStatus == "NORMAL") ||
+ (rowStatusList && rowStatusList.includes(environment.rowStatus))
+ );
});
},
diff --git a/frontend/src/store/modules/instance.ts b/frontend/src/store/modules/instance.ts
index 19f60d9803..898a46c2bb 100644
--- a/frontend/src/store/modules/instance.ts
+++ b/frontend/src/store/modules/instance.ts
@@ -61,7 +61,10 @@ const getters = {
): Instance[] => {
const list = [];
for (const [_, instance] of state.instanceById) {
- if (!rowStatusList || rowStatusList.includes(instance.rowStatus)) {
+ if (
+ (!rowStatusList && instance.rowStatus == "NORMAL") ||
+ (rowStatusList && rowStatusList.includes(instance.rowStatus))
+ ) {
list.push(instance);
}
}
diff --git a/frontend/src/store/modules/project.ts b/frontend/src/store/modules/project.ts
index bc99589fdd..3105ac2dfc 100644
--- a/frontend/src/store/modules/project.ts
+++ b/frontend/src/store/modules/project.ts
@@ -113,23 +113,16 @@ const getters = {
return convert(instance, includedList, rootGetters);
},
- projectList: (state: ProjectState) => (rowStatus?: RowStatus): Project[] => {
- const result: Project[] = [];
- for (const [_, project] of state.projectById) {
- if (!rowStatus || rowStatus == project.rowStatus) {
- result.push(project);
- }
- }
- return result;
- },
-
projectListByUser: (state: ProjectState) => (
userId: UserId,
rowStatusList?: RowStatus[]
): Project[] => {
const result: Project[] = [];
for (const [_, project] of state.projectById) {
- if (!rowStatusList || rowStatusList.includes(project.rowStatus)) {
+ if (
+ (!rowStatusList && project.rowStatus == "NORMAL") ||
+ (rowStatusList && rowStatusList.includes(project.rowStatus))
+ ) {
for (const member of project.memberList) {
if (member.principal.id == userId) {
result.push(project);