diff --git a/.gitignore b/.gitignore index d79e11032..d7da3b8cb 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,5 @@ src/ui_ng/aot/**/*.json **/aot **/dist **/.bin +package-lock.json +src/ui_ng/package-lock.json diff --git a/src/ui_ng/lib/package.json b/src/ui_ng/lib/package.json index 7d2f94fd1..3017d468e 100644 --- a/src/ui_ng/lib/package.json +++ b/src/ui_ng/lib/package.json @@ -1,6 +1,6 @@ { "name": "harbor-ui", - "version": "0.7.19-dev.3", + "version": "0.7.19-dev.8", "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.ts b/src/ui_ng/lib/src/repository-gridview/repository-gridview.component.ts index 5b476e05f..eebaab31c 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 @@ -346,11 +346,32 @@ export class RepositoryGridviewComponent implements OnChanges, OnInit { }); } + containsLatestTag(repo: RepositoryItem): Promise { + return toPromise(this.tagService.getTags(repo.name)) + .then(items => { + if (items.some((t: Tag) => { return t.name === 'latest'; })) { + return true; + } else { + return false; + }; + }) + .catch(error => Promise.reject(false)); + } + provisionItemEvent(evt: any, repo: RepositoryItem): void { evt.stopPropagation(); let repoCopy = clone(repo); repoCopy.name = this.registryUrl + ":443/" + repoCopy.name; - this.repoProvisionEvent.emit(repoCopy); + this.containsLatestTag(repo) + .then(containsLatest => { + if (containsLatest) { + this.repoProvisionEvent.emit(repoCopy); + } else { + this.addInfoEvent.emit(repoCopy); + } + }) + .catch( error => this.errorHandler.error(error)); + } itemAddInfoEvent(evt: any, repo: RepositoryItem): void { diff --git a/src/ui_ng/package.json b/src/ui_ng/package.json index a33a7de9b..45ba52ae7 100644 --- a/src/ui_ng/package.json +++ b/src/ui_ng/package.json @@ -32,7 +32,7 @@ "clarity-icons": "^0.10.27", "clarity-ui": "^0.10.27", "core-js": "^2.4.1", - "harbor-ui": "0.7.19-dev.3", + "harbor-ui": "0.7.19-dev.8", "intl": "^1.2.5", "mutationobserver-shim": "^0.3.2", "ngx-cookie": "^1.0.0",