Skip to content

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

chore: use ID and filter default project (#8105)

Danny Xucc38ce5eb250
diff --git a/frontend/src/components/CustomApproval/Settings/components/common/utils.ts b/frontend/src/components/CustomApproval/Settings/components/common/utils.ts
index 249ae8badf..fcaf02f8c1 100644
--- a/frontend/src/components/CustomApproval/Settings/components/common/utils.ts
+++ b/frontend/src/components/CustomApproval/Settings/components/common/utils.ts
@@ -3,7 +3,12 @@ import type { SelectOption } from "naive-ui";
import { type Factor, SQLTypeList } from "@/plugins/cel";
import { t, te } from "@/plugins/i18n";
import { useEnvironmentV1Store, useProjectV1ListByCurrentUser } from "@/store";
-import { engineName, PresetRiskLevelList, SupportedSourceList } from "@/types";
+import {
+ engineName,
+ PresetRiskLevelList,
+ SupportedSourceList,
+ DEFAULT_PROJECT_V1_NAME,
+} from "@/types";
import {
Risk,
Risk_Source,
@@ -132,10 +137,15 @@ const getEnvironmentIdOptions = () => {
const getProjectIdOptions = () => {
const { projectList } = useProjectV1ListByCurrentUser();
- return projectList.value.map<SelectOption>((proj) => ({
- label: proj.title,
- value: extractProjectResourceName(proj.name),
- }));
+ return projectList.value
+ .filter((proj) => proj.name != DEFAULT_PROJECT_V1_NAME)
+ .map<SelectOption>((proj) => {
+ const projectId = extractProjectResourceName(proj.name);
+ return {
+ label: projectId,
+ value: projectId,
+ };
+ });
};
const getDBEndingOptions = () => {
diff --git a/frontend/src/components/SensitiveData/components/utils.ts b/frontend/src/components/SensitiveData/components/utils.ts
index 746e52fb1f..6ac2d3cab6 100644
--- a/frontend/src/components/SensitiveData/components/utils.ts
+++ b/frontend/src/components/SensitiveData/components/utils.ts
@@ -12,6 +12,7 @@ import {
useProjectV1ListByCurrentUser,
useSettingV1Store,
} from "@/store";
+import { DEFAULT_PROJECT_V1_NAME } from "@/types";
import {
extractEnvironmentResourceName,
extractInstanceResourceName,
@@ -40,9 +41,10 @@ export const getClassificationLevelOptions = () => {
export const getEnvironmentIdOptions = () => {
const environmentList = useEnvironmentV1Store().getEnvironmentList();
return environmentList.map<SelectOption>((env) => {
+ const environmentId = extractEnvironmentResourceName(env.name);
return {
- label: env.title,
- value: extractEnvironmentResourceName(env.name),
+ label: environmentId,
+ value: environmentId,
};
});
};
@@ -50,19 +52,25 @@ export const getEnvironmentIdOptions = () => {
export const getInstanceIdOptions = () => {
const { instanceList } = useInstanceV1List(false);
return instanceList.value.map<SelectOption>((ins) => {
+ const instanceId = extractInstanceResourceName(ins.name);
return {
- label: ins.title,
- value: extractInstanceResourceName(ins.name),
+ label: instanceId,
+ value: instanceId,
};
});
};
export const getProjectIdOptions = () => {
const { projectList } = useProjectV1ListByCurrentUser();
- return projectList.value.map<SelectOption>((proj) => ({
- label: proj.title,
- value: extractProjectResourceName(proj.name),
- }));
+ return projectList.value
+ .filter((proj) => proj.name != DEFAULT_PROJECT_V1_NAME)
+ .map<SelectOption>((proj) => {
+ const projectId = extractProjectResourceName(proj.name);
+ return {
+ label: projectId,
+ value: projectId,
+ };
+ });
};
export const factorSupportDropdown: Factor[] = [