Fix UI bugs found in round 2 testing (#14098)

Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
Will Sun 2021-01-27 15:38:17 +08:00 committed by GitHub
parent 50a1e85095
commit fbfc943e8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 9 deletions

View File

@ -18,7 +18,7 @@
</div>
<div class="ml-1">
<div [hidden]="!shouldShowBar()">
<hbr-vulnerability-bar [summary]="handleScanOverview(artifact?.scan_overview)" [scanner]="scanner"
<hbr-vulnerability-bar [summary]="handleScanOverview(artifact?.scan_overview)" [inputScanner]="scanner"
(submitFinish)="submitFinish($event)" [projectName]="projectName" [repoName]="repoName"
[artifactDigest]="digest">
</hbr-vulnerability-bar>

View File

@ -52,3 +52,6 @@
.report {
text-align: left;
}
.mt-5px {
margin-top: 5px;
}

View File

@ -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);
}

View File

@ -13,7 +13,7 @@
<div class="progress loop loop-height"><progress></progress></div>
</div>
<div *ngIf="completed" class="bar-state bar-state-chart">
<hbr-result-tip-histogram [scanner]="scanner" [vulnerabilitySummary]="summary"></hbr-result-tip-histogram>
<hbr-result-tip-histogram [scanner]="getScanner()" [vulnerabilitySummary]="summary"></hbr-result-tip-histogram>
</div>
<div *ngIf="otherStatus" class="bar-state">
<span class="label not-scan">{{'VULNERABILITY.STATE.OTHER_STATUS' | translate}}</span>

View File

@ -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;
}
}