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: support multiple for search issues via labels (#16008)
ecmadao64f58567dc98
diff --git a/frontend/src/components/AdvancedSearch/AdvancedSearch.vue b/frontend/src/components/AdvancedSearch/AdvancedSearch.vueindex a2c83c5e04..e517e0ecb6 100644--- a/frontend/src/components/AdvancedSearch/AdvancedSearch.vue+++ b/frontend/src/components/AdvancedSearch/AdvancedSearch.vue@@ -99,6 +99,7 @@ import {upsertScope,buildSearchTextBySearchParams,buildSearchParamsBySearchText,+ mergeSearchParams,} from "@/utils";import ScopeMenu from "./ScopeMenu.vue";import ScopeTags from "./ScopeTags.vue";@@ -620,7 +621,7 @@ onMounted(() => {...scope,readonly: existedScopes.get(scope.id),}));- emit("update:params", params);+ emit("update:params", mergeSearchParams(cloneDeep(props.params), params));}});diff --git a/frontend/src/components/IssueV1/components/IssueSearch/useIssueSearchScopeOptions.ts b/frontend/src/components/IssueV1/components/IssueSearch/useIssueSearchScopeOptions.tsindex 46fa48d6ae..c113016d53 100644--- a/frontend/src/components/IssueV1/components/IssueSearch/useIssueSearchScopeOptions.ts+++ b/frontend/src/components/IssueV1/components/IssueSearch/useIssueSearchScopeOptions.ts@@ -258,7 +258,7 @@ export const useIssueSearchScopeOptions = (],},{- id: "label",+ id: "issue-label",title: t("issue.advanced-search.scope.label.title"),description: t("issue.advanced-search.scope.label.description"),options: projectLabels.value.map((label) => {@@ -275,6 +275,7 @@ export const useIssueSearchScopeOptions = (]),};}),+ allowMultiple: true,},];const supportOptionIdSet = new Set(supportOptionIdList.value);diff --git a/frontend/src/components/Project/ProjectIssuesPanel.vue b/frontend/src/components/Project/ProjectIssuesPanel.vueindex b0c3f59d21..f51e763305 100644--- a/frontend/src/components/Project/ProjectIssuesPanel.vue+++ b/frontend/src/components/Project/ProjectIssuesPanel.vue@@ -271,14 +271,14 @@ const guessTabValueFromSearchParams = (params: SearchParams): TabValue => {if (verifyScopes(["approval"]) &&- getValueFromSearchParams(params, "status") === "OPEN" &&+ getSemanticIssueStatusFromSearchParams(params) === "OPEN" &&getValueFromSearchParams(params, "approval") === "pending") {return "WAITING_APPROVAL";}if (verifyScopes(["approval"]) &&- getValueFromSearchParams(params, "status") === "OPEN" &&+ getSemanticIssueStatusFromSearchParams(params) === "OPEN" &&getValueFromSearchParams(params, "approval") === "approved") {return "WAITING_ROLLOUT";@@ -370,7 +370,7 @@ watch(tab,() => {if (tab.value === "WAITING_APPROVAL" || tab.value === "WAITING_ROLLOUT") {- if (getValueFromSearchParams(state.params, "status") === "CLOSED") {+ if (getSemanticIssueStatusFromSearchParams(state.params) === "CLOSED") {upsertScope({params: state.params,scopes: {diff --git a/frontend/src/utils/v1/advanced-search/common.ts b/frontend/src/utils/v1/advanced-search/common.tsindex 574cdbb656..4ef2a2023e 100644--- a/frontend/src/utils/v1/advanced-search/common.ts+++ b/frontend/src/utils/v1/advanced-search/common.ts@@ -30,7 +30,7 @@ export const AllSearchScopeIdList = ["drifted",// issue related search scopes."subscriber",- "label",+ "issue-label","taskType",// auditLog related search scopes."method",@@ -90,6 +90,18 @@ export const buildSearchTextBySearchParams = (return parts.join(" ");};+export const mergeSearchParams = (base: SearchParams, patch: SearchParams) => {+ for (const scope of patch.scopes) {+ if (!base.scopes.find((s) => s.id === scope.id)) {+ base.scopes.push(scope);+ }+ }+ if (!base.query && patch.query) {+ base.query = patch.query;+ }+ return base;+};+export const buildSearchParamsBySearchText = (text: string): SearchParams => {const params = emptySearchParams();const segments = text.split(/\s+/g);diff --git a/frontend/src/utils/v1/advanced-search/issue/utils.ts b/frontend/src/utils/v1/advanced-search/issue/utils.tsindex 954fc50ba1..3f3a4e5b03 100644--- a/frontend/src/utils/v1/advanced-search/issue/utils.ts+++ b/frontend/src/utils/v1/advanced-search/issue/utils.ts@@ -4,10 +4,18 @@ import { unknownDatabase } from "@/types";import { IssueStatus } from "@/types/proto/v1/issue_service";import type { SearchParams, SemanticIssueStatus } from "../common";import {+ type SearchScopeId,getTsRangeFromSearchParams,getValueFromSearchParams,} from "../common";+const getValuesFromSearchParams = (+ params: SearchParams,+ scopeId: SearchScopeId+) => {+ return params.scopes.filter((s) => s.id === scopeId).map((s) => s.value);+};+export const buildIssueFilterBySearchParams = (params: SearchParams,defaultFilter?: Partial<IssueFilter>@@ -27,7 +35,7 @@ export const buildIssueFilterBySearchParams = (const createdTsRange = getTsRangeFromSearchParams(params, "created");const status = getSemanticIssueStatusFromSearchParams(params);- const label = getValueFromSearchParams(params, "label");+ const labels = getValuesFromSearchParams(params, "issue-label");const filter: IssueFilter = {...defaultFilter,@@ -46,7 +54,7 @@ export const buildIssueFilterBySearchParams = (: status === "CLOSED"? [IssueStatus.DONE, IssueStatus.CANCELED]: undefined,- labels: label ? [label] : [],+ labels,};return filter;};diff --git a/frontend/src/views/ExportCenter/index.vue b/frontend/src/views/ExportCenter/index.vueindex f0e1fe200d..b63f799dfc 100644--- a/frontend/src/views/ExportCenter/index.vue+++ b/frontend/src/views/ExportCenter/index.vue@@ -162,7 +162,7 @@ const overrideSearchScopeIdList = computed(() => {"status","instance","database",- "label",+ "issue-label",];return defaultScopeIdList;});diff --git a/frontend/src/views/MyIssues.vue b/frontend/src/views/MyIssues.vueindex 4673ae2561..fc7a8aed5d 100644--- a/frontend/src/views/MyIssues.vue+++ b/frontend/src/views/MyIssues.vue@@ -301,7 +301,7 @@ const guessTabValueFromSearchParams = (params: SearchParams): TabValue => {}if (verifyScopes(["approval", "approver"]) &&- getValueFromSearchParams(params, "status") === "OPEN" &&+ getSemanticIssueStatusFromSearchParams(params) === "OPEN" &&getValueFromSearchParams(params, "approval") === "pending" &&getValueFromSearchParams(params, "approver") === myEmail) {@@ -309,7 +309,7 @@ const guessTabValueFromSearchParams = (params: SearchParams): TabValue => {}if (verifyScopes(["approval", "releaser"]) &&- getValueFromSearchParams(params, "status") === "OPEN" &&+ getSemanticIssueStatusFromSearchParams(params) === "OPEN" &&getValueFromSearchParams(params, "approval") === "approved" &&getValueFromSearchParams(params, "releaser") === myEmail) {@@ -402,7 +402,7 @@ watch([tab],() => {if (tab.value === "WAITING_APPROVAL" || tab.value === "WAITING_ROLLOUT") {- if (getValueFromSearchParams(state.params, "status") === "CLOSED") {+ if (getSemanticIssueStatusFromSearchParams(state.params) === "CLOSED") {upsertScope({params: state.params,scopes: {