From 46ec21ae8037d62af1741f16fe61781d928fff9d Mon Sep 17 00:00:00 2001 From: "Deng, Qian" Date: Tue, 3 Apr 2018 10:15:46 +0800 Subject: [PATCH 1/2] Fix bug vulnerability notification not showing --- src/ui_ng/lib/package.json | 2 +- src/ui_ng/lib/pkg/package.json | 2 +- .../repository-gridview.component.html.ts | 4 ++++ .../repository-gridview.component.ts | 14 ++++++++++++++ src/ui_ng/package.json | 2 +- 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/ui_ng/lib/package.json b/src/ui_ng/lib/package.json index dac2b4339..4899196cb 100644 --- a/src/ui_ng/lib/package.json +++ b/src/ui_ng/lib/package.json @@ -1,6 +1,6 @@ { "name": "harbor-ui", - "version": "0.6.61", + "version": "0.6.65", "description": "Harbor shared UI components based on Clarity and Angular4", "scripts": { "start": "ng serve --host 0.0.0.0 --port 4500 --proxy-config proxy.config.json", diff --git a/src/ui_ng/lib/pkg/package.json b/src/ui_ng/lib/pkg/package.json index f5ecf6cf4..c561f133c 100644 --- a/src/ui_ng/lib/pkg/package.json +++ b/src/ui_ng/lib/pkg/package.json @@ -1,6 +1,6 @@ { "name": "harbor-ui", - "version": "0.6.61", + "version": "0.6.65", "description": "Harbor shared UI components based on Clarity and Angular4", "author": "VMware", "module": "index.js", diff --git a/src/ui_ng/lib/src/repository-gridview/repository-gridview.component.html.ts b/src/ui_ng/lib/src/repository-gridview/repository-gridview.component.html.ts index 90c8820a7..c970f4153 100644 --- a/src/ui_ng/lib/src/repository-gridview/repository-gridview.component.html.ts +++ b/src/ui_ng/lib/src/repository-gridview/repository-gridview.component.html.ts @@ -33,6 +33,10 @@ export const REPOSITORY_GRIDVIEW_TEMPLATE = ` {{r.pull_count}} + + + {{'CONFIG.SCANNING.DB_NOT_READY' | translate }} + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} {{'REPOSITORY.OF' | translate}} {{pagination.totalItems}} {{'REPOSITORY.ITEMS' | translate}} diff --git a/src/ui_ng/lib/src/repository-gridview/repository-gridview.component.ts b/src/ui_ng/lib/src/repository-gridview/repository-gridview.component.ts index 5215eef0f..e9b643ff5 100644 --- a/src/ui_ng/lib/src/repository-gridview/repository-gridview.component.ts +++ b/src/ui_ng/lib/src/repository-gridview/repository-gridview.component.ts @@ -76,10 +76,24 @@ export class RepositoryGridviewComponent implements OnChanges, OnInit { return this.systemInfo ? this.systemInfo.registry_url : ''; } + public get withClair(): boolean { + return this.systemInfo ? this.systemInfo.with_clair : false; + } + + public get isClairDBReady(): boolean { + return this.systemInfo && + this.systemInfo.clair_vulnerability_status && + this.systemInfo.clair_vulnerability_status.overall_last_update > 0; + } + public get withAdmiral(): boolean { return this.systemInfo ? this.systemInfo.with_admiral : false; } + public get showDBStatusWarning(): boolean { + return this.withClair && !this.isClairDBReady; + } + ngOnChanges(changes: SimpleChanges): void { if (changes['projectId'] && changes['projectId'].currentValue) { this.refresh(); diff --git a/src/ui_ng/package.json b/src/ui_ng/package.json index 43430fa44..15d2942a5 100644 --- a/src/ui_ng/package.json +++ b/src/ui_ng/package.json @@ -31,7 +31,7 @@ "clarity-icons": "^0.10.17", "clarity-ui": "^0.10.27", "core-js": "^2.4.1", - "harbor-ui": "0.6.63", + "harbor-ui": "0.6.65", "intl": "^1.2.5", "mutationobserver-shim": "^0.3.2", "ngx-cookie": "^1.0.0", From 0e3edeb0a841e14eab8af7847c17c0fa3eabf6ff Mon Sep 17 00:00:00 2001 From: "Deng, Qian" Date: Tue, 3 Apr 2018 19:14:24 +0800 Subject: [PATCH 2/2] Reduce properties in --- src/ui_ng/lib/README.md | 4 ---- src/ui_ng/lib/package.json | 2 +- src/ui_ng/lib/pkg/package.json | 2 +- .../lib/src/repository/repository.component.ts | 16 ++++++++++++---- src/ui_ng/package.json | 2 +- .../tag-repository/tag-repository.component.html | 4 +--- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/ui_ng/lib/README.md b/src/ui_ng/lib/README.md index 36cf2cfbe..83b5c814f 100644 --- a/src/ui_ng/lib/README.md +++ b/src/ui_ng/lib/README.md @@ -181,10 +181,6 @@ watchAddInfoEvent(repo: RepositoryItem): void { **hasProjectAdminRole** is a user session related property to determined whether the current user has project administrator role. Some action menus might be disabled based on this property. -**withClair** is Clair installed - -**withNotary** is Notary installed - **tagClickEvent** is an @output event emitter for you to catch the tag click events. **goBackClickEvent** is an @output event emitter for you to catch the go back events. diff --git a/src/ui_ng/lib/package.json b/src/ui_ng/lib/package.json index 4899196cb..b49ca2d43 100644 --- a/src/ui_ng/lib/package.json +++ b/src/ui_ng/lib/package.json @@ -1,6 +1,6 @@ { "name": "harbor-ui", - "version": "0.6.65", + "version": "0.6.67", "description": "Harbor shared UI components based on Clarity and Angular4", "scripts": { "start": "ng serve --host 0.0.0.0 --port 4500 --proxy-config proxy.config.json", diff --git a/src/ui_ng/lib/pkg/package.json b/src/ui_ng/lib/pkg/package.json index c561f133c..81395e60d 100644 --- a/src/ui_ng/lib/pkg/package.json +++ b/src/ui_ng/lib/pkg/package.json @@ -1,6 +1,6 @@ { "name": "harbor-ui", - "version": "0.6.65", + "version": "0.6.67", "description": "Harbor shared UI components based on Clarity and Angular4", "author": "VMware", "module": "index.js", diff --git a/src/ui_ng/lib/src/repository/repository.component.ts b/src/ui_ng/lib/src/repository/repository.component.ts index 82c9e7096..cae155c8f 100644 --- a/src/ui_ng/lib/src/repository/repository.component.ts +++ b/src/ui_ng/lib/src/repository/repository.component.ts @@ -47,14 +47,10 @@ const TabLinkContentMap: {[index: string]: string} = { export class RepositoryComponent implements OnInit { signedCon: {[key: string]: any | string[]} = {}; @Input() projectId: number; - @Input() projectName: string; @Input() repoName: string; @Input() hasSignedIn: boolean; @Input() hasProjectAdminRole: boolean; @Input() isGuest: boolean; - @Input() withNotary: boolean; - @Input() withClair: boolean; - @Input() withAdmiral: boolean; @Output() tagClickEvent = new EventEmitter(); @Output() backEvt: EventEmitter = new EventEmitter(); @@ -85,6 +81,18 @@ export class RepositoryComponent implements OnInit { return this.systemInfo ? this.systemInfo.registry_url : ''; } + public get withNotary(): boolean { + return this.systemInfo ? this.systemInfo.with_notary : false; + } + + public get withClair(): boolean { + return this.systemInfo ? this.systemInfo.with_clair : false; + } + + public get withAdmiral(): boolean { + return this.systemInfo ? this.systemInfo.with_admiral : false; + } + ngOnInit(): void { if (!this.projectId) { this.errorHandler.error('Project ID cannot be unset.'); diff --git a/src/ui_ng/package.json b/src/ui_ng/package.json index 15d2942a5..a54b15ee0 100644 --- a/src/ui_ng/package.json +++ b/src/ui_ng/package.json @@ -31,7 +31,7 @@ "clarity-icons": "^0.10.17", "clarity-ui": "^0.10.27", "core-js": "^2.4.1", - "harbor-ui": "0.6.65", + "harbor-ui": "0.6.67", "intl": "^1.2.5", "mutationobserver-shim": "^0.3.2", "ngx-cookie": "^1.0.0", diff --git a/src/ui_ng/src/app/repository/tag-repository/tag-repository.component.html b/src/ui_ng/src/app/repository/tag-repository/tag-repository.component.html index 01f4e59b4..b9c5f60c1 100644 --- a/src/ui_ng/src/app/repository/tag-repository/tag-repository.component.html +++ b/src/ui_ng/src/app/repository/tag-repository/tag-repository.component.html @@ -1,6 +1,4 @@
-
\ No newline at end of file