From 296e9059400919260f3e9ca54b74a912f361e55f Mon Sep 17 00:00:00 2001 From: Shijun Sun <30999793+AllForNothing@users.noreply.github.com> Date: Tue, 15 Aug 2023 11:41:50 +0800 Subject: [PATCH] ignore spaces for vulnerability filters (#19180) 1.Fixes #19168 Signed-off-by: AllForNothing --- .../vulnerability-filter/vulnerability-filter.component.ts | 6 +++--- .../vulnerability-summary.component.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/portal/src/app/base/left-side-nav/interrogation-services/vulnerability-database/vulnerability-filter/vulnerability-filter.component.ts b/src/portal/src/app/base/left-side-nav/interrogation-services/vulnerability-database/vulnerability-filter/vulnerability-filter.component.ts index 7b16febecbf..cecf895225e 100644 --- a/src/portal/src/app/base/left-side-nav/interrogation-services/vulnerability-database/vulnerability-filter/vulnerability-filter.component.ts +++ b/src/portal/src/app/base/left-side-nav/interrogation-services/vulnerability-database/vulnerability-filter/vulnerability-filter.component.ts @@ -97,7 +97,7 @@ export class VulnerabilityFilterComponent { return; } else if ( item === OptionType.PROJECT_ID && - this.valueMap[OptionType.PROJECT_ID] + this.valueMap[OptionType.PROJECT_ID]?.trim() ) { result.projectId = this.valueMap[OptionType.PROJECT_ID]?.trim(); } else if (item === OptionType.SEVERITY) { @@ -107,14 +107,14 @@ export class VulnerabilityFilterComponent { ); } } else if (item === OptionType.CVSS3) { - if (this.startScore || this.endScore) { + if (this.startScore?.trim() || this.endScore?.trim()) { result.normal.push( `${OptionType.CVSS3}=[${ this.startScore ? this.startScore?.trim() : '0.0' }~${this.endScore ? this.endScore?.trim() : '10.0'}]` ); } - } else if (this.valueMap[item]) { + } else if (this.valueMap[item]?.trim()) { result.normal.push(`${item}=${this.valueMap[item]?.trim()}`); } }); diff --git a/src/portal/src/app/base/left-side-nav/interrogation-services/vulnerability-database/vulnerability-summary/vulnerability-summary.component.html b/src/portal/src/app/base/left-side-nav/interrogation-services/vulnerability-database/vulnerability-summary/vulnerability-summary.component.html index e0e3bec0e0c..967538b93c8 100644 --- a/src/portal/src/app/base/left-side-nav/interrogation-services/vulnerability-database/vulnerability-summary/vulnerability-summary.component.html +++ b/src/portal/src/app/base/left-side-nav/interrogation-services/vulnerability-database/vulnerability-summary/vulnerability-summary.component.html @@ -88,7 +88,7 @@

{{ securitySummary?.none_cnt || 0 }} -
+