Merge pull request #8738 from jwangyangls/fix-error

Fix error in Harbor
This commit is contained in:
jwangyangls 2019-08-21 11:02:00 +08:00 committed by GitHub
commit 8701007714
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;
this.scanningResults = this.dataCache.filter((item: VulnerabilityItem) => item.id !== '');
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>