diff --git a/src/ui_ng/lib/src/vulnerability-scanning/result-tip.component.ts b/src/ui_ng/lib/src/vulnerability-scanning/result-tip.component.ts index f729bc1c3..41e6d97d3 100644 --- a/src/ui_ng/lib/src/vulnerability-scanning/result-tip.component.ts +++ b/src/ui_ng/lib/src/vulnerability-scanning/result-tip.component.ts @@ -62,7 +62,6 @@ export class ResultTipComponent implements OnInit { if (item.severity != VulnerabilitySeverity.NONE) { this.packagesWithVul += item.count } - switch (item.severity) { case VulnerabilitySeverity.UNKNOWN: this._unknownCount += item.count; @@ -86,18 +85,22 @@ export class ResultTipComponent implements OnInit { } this.translate.get(this.packageText(this.totalPackages)).subscribe((p1: string) => { this.translate.get(this.unitText(this.packagesWithVul)).subscribe((vul: string) => { - let messageKey: string = "VULNERABILITY.CHART.TOOLTIPS_TITLE_SINGULAR"; - if (this.packagesWithVul > 1) { - messageKey = "VULNERABILITY.CHART.TOOLTIPS_TITLE"; - } - this.translate.get(messageKey, - { + if (this.totalPackages === 0) { + this.translate.get('VULNERABILITY.CHART.TOOLTIPS_TITLE_ZERO').subscribe( (res: string) => { + this._tipTitle = res; + }); + } else { + let messageKey = 'VULNERABILITY.CHART.TOOLTIPS_TITLE_SINGULAR'; + if (this.packagesWithVul > 1) { + messageKey = 'VULNERABILITY.CHART.TOOLTIPS_TITLE'; + } + this.translate.get(messageKey, { totalVulnerability: this.packagesWithVul, totalPackages: this.totalPackages, package: p1, vulnerability: vul - }) - .subscribe((res: string) => this._tipTitle = res); + }).subscribe((res: string) => this._tipTitle = res); + } }); }); } diff --git a/src/ui_ng/package.json b/src/ui_ng/package.json index f8f2b596a..971f2c857 100644 --- a/src/ui_ng/package.json +++ b/src/ui_ng/package.json @@ -31,7 +31,7 @@ "clarity-icons": "^0.9.8", "clarity-ui": "^0.9.8", "core-js": "^2.4.1", - "harbor-ui": "0.4.91", + "harbor-ui": "0.4.92", "intl": "^1.2.5", "mutationobserver-shim": "^0.3.2", "ngx-cookie": "^1.0.0", diff --git a/src/ui_ng/src/i18n/lang/en-us-lang.json b/src/ui_ng/src/i18n/lang/en-us-lang.json index 9089c6c01..6d4ec1d8f 100644 --- a/src/ui_ng/src/i18n/lang/en-us-lang.json +++ b/src/ui_ng/src/i18n/lang/en-us-lang.json @@ -510,7 +510,8 @@ "CHART": { "SCANNING_TIME": "Scan completed time:", "TOOLTIPS_TITLE": "{{totalVulnerability}} of {{totalPackages}} {{package}} have known {{vulnerability}}.", - "TOOLTIPS_TITLE_SINGULAR": "{{totalVulnerability}} of {{totalPackages}} {{package}} has known {{vulnerability}}." + "TOOLTIPS_TITLE_SINGULAR": "{{totalVulnerability}} of {{totalPackages}} {{package}} has known {{vulnerability}}.", + "TOOLTIPS_TITLE_ZERO": "No recognizable vulnerability package found" }, "SEVERITY": { "HIGH": "high", diff --git a/src/ui_ng/src/i18n/lang/es-es-lang.json b/src/ui_ng/src/i18n/lang/es-es-lang.json index 8b1b40078..66ca37098 100644 --- a/src/ui_ng/src/i18n/lang/es-es-lang.json +++ b/src/ui_ng/src/i18n/lang/es-es-lang.json @@ -509,7 +509,8 @@ "CHART": { "SCANNING_TIME": "Scan completed time:", "TOOLTIPS_TITLE": "{{totalVulnerability}} of {{totalPackages}} {{package}} have known {{vulnerability}}.", - "TOOLTIPS_TITLE_SINGULAR": "{{totalVulnerability}} of {{totalPackages}} {{package}} has known {{vulnerability}}." + "TOOLTIPS_TITLE_SINGULAR": "{{totalVulnerability}} of {{totalPackages}} {{package}} has known {{vulnerability}}.", + "TOOLTIPS_TITLE_ZERO": "No se encontró ningún paquete de vulnerabilidad reconocible" }, "SEVERITY": { "HIGH": "high", diff --git a/src/ui_ng/src/i18n/lang/zh-cn-lang.json b/src/ui_ng/src/i18n/lang/zh-cn-lang.json index af643351b..fc6c0c178 100644 --- a/src/ui_ng/src/i18n/lang/zh-cn-lang.json +++ b/src/ui_ng/src/i18n/lang/zh-cn-lang.json @@ -510,7 +510,8 @@ "CHART": { "SCANNING_TIME": "扫描完成时间:", "TOOLTIPS_TITLE": "{{totalPackages}}个{{package}}中的{{totalVulnerability}}个含有{{vulnerability}}.", - "TOOLTIPS_TITLE_SINGULAR": "{{totalPackages}}个{{package}}中的{{totalVulnerability}}个含有{{vulnerability}}." + "TOOLTIPS_TITLE_SINGULAR": "{{totalPackages}}个{{package}}中的{{totalVulnerability}}个含有{{vulnerability}}.", + "TOOLTIPS_TITLE_ZERO": "没有发现可识别的漏洞包" }, "SEVERITY": { "HIGH": "严重",