From fbfc943e8f5170e19b2c9697722ed2086e54a9f7 Mon Sep 17 00:00:00 2001 From: Will Sun <30999793+AllForNothing@users.noreply.github.com> Date: Wed, 27 Jan 2021 15:38:17 +0800 Subject: [PATCH] Fix UI bugs found in round 2 testing (#14098) Signed-off-by: AllForNothing --- .../artifact-vulnerabilities.component.html | 2 +- .../artifact-vulnerabilities.component.scss | 3 +++ .../artifact/artifact-tag/artifact-tag.component.ts | 9 +++------ .../result-bar-chart-component.html | 2 +- .../vulnerability-scanning/result-bar-chart.component.ts | 8 +++++++- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.html b/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.html index cee8d141e..c3cb305ee 100644 --- a/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.html +++ b/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.html @@ -18,7 +18,7 @@
- diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.scss b/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.scss index b9b4dbdd8..eac7a3b6e 100644 --- a/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.scss +++ b/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.scss @@ -52,3 +52,6 @@ .report { text-align: left; } +.mt-5px { + margin-top: 5px; +} \ No newline at end of file diff --git a/src/portal/src/app/project/repository/artifact/artifact-tag/artifact-tag.component.ts b/src/portal/src/app/project/repository/artifact/artifact-tag/artifact-tag.component.ts index 2e7ccfd04..e2d738539 100644 --- a/src/portal/src/app/project/repository/artifact/artifact-tag/artifact-tag.component.ts +++ b/src/portal/src/app/project/repository/artifact/artifact-tag/artifact-tag.component.ts @@ -182,9 +182,7 @@ export class ArtifactTagComponent implements OnInit, OnDestroy { this.artifactService.createTag(createTagParams).subscribe(res => { this.newTagformShow = false; this.newTagName = new InitTag(); - this.currentPage = 1; - let st: ClrDatagridStateInterface = { page: {from: 0, to: this.pageSize - 1, size: this.pageSize} }; - this.getCurrentArtifactTags(st); + this.refresh(); }, error => { this.loading = false; this.errorHandlerService.error(error); @@ -238,9 +236,7 @@ export class ArtifactTagComponent implements OnInit, OnDestroy { this.selectedRow = []; if (deleteSuccessList.length === deleteResult.length) { // all is success - this.currentPage = 1; - let st: ClrDatagridStateInterface = { page: {from: 0, to: this.pageSize - 1, size: this.pageSize} }; - this.getCurrentArtifactTags(st); + this.refresh(); } else if (deleteErrorList.length === deleteResult.length) { // all is error this.loading = false; @@ -322,6 +318,7 @@ export class ArtifactTagComponent implements OnInit, OnDestroy { refresh() { this.loading = true; this.currentPage = 1; + this.selectedRow = []; let st: ClrDatagridStateInterface = { page: {from: 0, to: this.pageSize - 1, size: this.pageSize} }; this.getCurrentArtifactTags(st); } diff --git a/src/portal/src/app/project/repository/vulnerability-scanning/result-bar-chart-component.html b/src/portal/src/app/project/repository/vulnerability-scanning/result-bar-chart-component.html index 1e2d4a087..4841dd85d 100644 --- a/src/portal/src/app/project/repository/vulnerability-scanning/result-bar-chart-component.html +++ b/src/portal/src/app/project/repository/vulnerability-scanning/result-bar-chart-component.html @@ -13,7 +13,7 @@
- +
{{'VULNERABILITY.STATE.OTHER_STATUS' | translate}} diff --git a/src/portal/src/app/project/repository/vulnerability-scanning/result-bar-chart.component.ts b/src/portal/src/app/project/repository/vulnerability-scanning/result-bar-chart.component.ts index 18abe3d4b..5f255cd19 100644 --- a/src/portal/src/app/project/repository/vulnerability-scanning/result-bar-chart.component.ts +++ b/src/portal/src/app/project/repository/vulnerability-scanning/result-bar-chart.component.ts @@ -30,7 +30,7 @@ const RETRY_TIMES: number = 3; styleUrls: ['./scanning.scss'] }) export class ResultBarChartComponent implements OnInit, OnDestroy { - @Input() scanner: ScannerVo; + @Input() inputScanner: ScannerVo; @Input() repoName: string = ""; @Input() projectName: string = ""; @Input() artifactDigest: string = ""; @@ -191,4 +191,10 @@ export class ResultBarChartComponent implements OnInit, OnDestroy { return `${ CURRENT_BASE_HREF }/projects/${this.projectName }/repositories/${dbEncodeURIComponent(this.repoName)}/artifacts/${this.artifactDigest}/scan/${this.summary.report_id}/log`; } + getScanner(): ScannerVo { + if (this.summary && this.summary.scanner) { + return this.summary.scanner; + } + return this.inputScanner; + } }