mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 02:05:41 +01:00
Deploy button send event based on latest tag
If latest tag exist sent provision event. Otherwise send Add additional info event.
This commit is contained in:
parent
d3930ae17c
commit
b3749bd4a4
2
.gitignore
vendored
2
.gitignore
vendored
@ -52,3 +52,5 @@ src/ui_ng/aot/**/*.json
|
||||
**/aot
|
||||
**/dist
|
||||
**/.bin
|
||||
package-lock.json
|
||||
src/ui_ng/package-lock.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",
|
||||
|
@ -346,11 +346,32 @@ export class RepositoryGridviewComponent implements OnChanges, OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
containsLatestTag(repo: RepositoryItem): Promise<boolean> {
|
||||
return toPromise<Tag[]>(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 {
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user