Fix error in Harbor

Signed-off-by: Yogi_Wang <yawang@vmware.com>
This commit is contained in:
Yogi_Wang 2019-08-19 18:01:31 +08:00
parent c0497c1a8d
commit 2134492587
3 changed files with 7 additions and 5 deletions

View File

@ -52,10 +52,10 @@ export class ImageNameInputComponent implements OnInit, OnDestroy {
const prolist: any = this.proService.listProjects(name, undefined);
if (prolist.subscribe) {
prolist.subscribe(response => {
if (response) {
this.selectedProjectList = response.slice(0, 10);
if (response.body) {
this.selectedProjectList = response.body.slice(0, 10);
// if input project name exist in the project list
let exist = response.find((data: any) => data.name === name);
let exist = response.body.find((data: any) => data.name === name);
if (!exist) {
this.noProjectInfo = "REPLICATION.NO_PROJECT_INFO";
} else {

View File

@ -39,7 +39,9 @@ export class ResultGridComponent implements OnInit {
this.scanningService.getVulnerabilityScanningResults(repositoryId, tagId)
.subscribe((results: VulnerabilityItem[]) => {
this.dataCache = results;
if (results) {
this.scanningResults = this.dataCache.filter((item: VulnerabilityItem) => item.id !== '');
}
}, error => { this.errorHandler.error(error); });
}

View File

@ -33,7 +33,7 @@
<clr-dg-cell>{{user.creation_time | date: 'short'}}</clr-dg-cell>
</clr-dg-row>
<clr-dg-footer>
<span *ngIf="pagination.totalItems">{{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} {{'USER.OF' | translate }}</span>
<span *ngIf="totalCount">{{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} {{'USER.OF' | translate }}</span>
{{pagination.totalItems}} {{'USER.ITEMS' | translate }}
<clr-dg-pagination #pagination [clrDgPageSize]="pageSize" [(clrDgPage)]="currentPage" [clrDgTotalItems]="totalCount">
</clr-dg-pagination>