Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: search databases by project assigned status (#9797)
Danny Xu78066f75b165
diff --git a/frontend/src/components/IssueV1/components/IssueSearch/useSearchScopeOptions.ts b/frontend/src/components/IssueV1/components/IssueSearch/useSearchScopeOptions.tsindex 7115df3e76..efb43de829 100644--- a/frontend/src/components/IssueV1/components/IssueSearch/useSearchScopeOptions.ts+++ b/frontend/src/components/IssueV1/components/IssueSearch/useSearchScopeOptions.ts@@ -270,6 +270,31 @@ export const useSearchScopeOptions = (},],},+ {+ id: "project-assigned",+ title: t("issue.advanced-search.scope.project-assigned.title"),+ description: t(+ "issue.advanced-search.scope.project-assigned.description"+ ),+ options: [+ {+ value: "yes",+ keywords: ["yes"],+ render: () =>+ renderSpan(+ t("issue.advanced-search.scope.project-assigned.value.yes")+ ),+ },+ {+ value: "no",+ keywords: ["no"],+ render: () =>+ renderSpan(+ t("issue.advanced-search.scope.project-assigned.value.no")+ ),+ },+ ],+ },];const supportOptionIdSet = new Set(supportOptionIdList);return scopes.filter((scope) => supportOptionIdSet.has(scope.id));diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.jsonindex 1b2b06b9b2..245ac829a4 100644--- a/frontend/src/locales/en-US.json+++ b/frontend/src/locales/en-US.json@@ -1018,6 +1018,14 @@},"description": "Search by the issue approval status","title": "Approval Status"+ },+ "project-assigned": {+ "title": "Project Assigned",+ "description": "Search by databases that are assigned to a project.",+ "value": {+ "yes": "yes",+ "no": "no"+ }}},"hide": "Hide advanced search"diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.jsonindex df60fb2750..e5018fe0e6 100644--- a/frontend/src/locales/es-ES.json+++ b/frontend/src/locales/es-ES.json@@ -1017,6 +1017,14 @@},"description": "Buscar por estado de revisión del problema","title": "Estado de aprobación"+ },+ "project-assigned": {+ "title": "Proyecto asignado",+ "description": "Buscar en las bases de datos con proyecto asignado",+ "value": {+ "yes": "yes",+ "no": "no"+ }}},"hide": "Ocultar búsqueda avanzada"diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.jsonindex 932ce2e56f..944aa8b966 100644--- a/frontend/src/locales/zh-CN.json+++ b/frontend/src/locales/zh-CN.json@@ -1015,6 +1015,14 @@},"description": "按工单的审批状态搜索","title": "审批状态"+ },+ "project-assigned": {+ "title": "已分配项目",+ "description": "按数据库的项目分配状态搜索",+ "value": {+ "yes": "是",+ "no": "否"+ }}},"hide": "隐藏高级搜索"diff --git a/frontend/src/utils/v1/issue/search/common.ts b/frontend/src/utils/v1/issue/search/common.tsindex c53daf5bee..f11bbc7231 100644--- a/frontend/src/utils/v1/issue/search/common.ts+++ b/frontend/src/utils/v1/issue/search/common.ts@@ -8,6 +8,8 @@ export const UIIssueFilterScopeIdList = ["releaser",] as const;type UIIssueFilterScopeId = typeof UIIssueFilterScopeIdList[number];+export const DatabaseFilterScopeIdList = ["project-assigned"] as const;+type DatabaseFilterScopeId = typeof DatabaseFilterScopeIdList[number];export const CommonFilterScopeIdList = ["environment", "instance"] as const;type CommonFilterScopeId = typeof CommonFilterScopeIdList[number];@@ -27,6 +29,7 @@ export const SearchScopeIdList = [export type SearchScopeId =| typeof SearchScopeIdList[number]| UIIssueFilterScopeId+ | DatabaseFilterScopeId| CommonFilterScopeId;export type SearchScope = {diff --git a/frontend/src/views/DatabaseDashboard.vue b/frontend/src/views/DatabaseDashboard.vueindex 1ec838c2a4..8c98590357 100644--- a/frontend/src/views/DatabaseDashboard.vue+++ b/frontend/src/views/DatabaseDashboard.vue@@ -161,6 +161,13 @@ const selectedEnvironment = computed(() => {);});+const selectedProjectAssigned = computed(() => {+ return (+ state.params.scopes.find((scope) => scope.id === "project-assigned")+ ?.value ?? `${UNKNOWN_ID}`+ );+});+const selectedProject = computed(() => {return (state.params.scopes.find((scope) => scope.id === "project")?.value ??@@ -222,6 +229,15 @@ const filteredDatabaseList = computed(() => {selectedEnvironment.value);}+ if (selectedProjectAssigned.value !== `${UNKNOWN_ID}`) {+ list = list.filter((db) => {+ if (selectedProjectAssigned.value == "yes") {+ return db.project !== DEFAULT_PROJECT_V1_NAME;+ } else {+ return db.project === DEFAULT_PROJECT_V1_NAME;+ }+ });+ }if (selectedInstance.value !== `${UNKNOWN_ID}`) {list = list.filter((db) =>@@ -330,5 +346,6 @@ const selectedDatabases = computed((): ComposedDatabase[] => {const supportOptionIdList = computed((): SearchScopeId[] => [...CommonFilterScopeIdList,"project",+ "project-assigned",]);</script>