make tag name clickable in repo-tag-stack view

This commit is contained in:
Steven Zou 2017-06-13 22:24:38 +08:00
parent 1d543c9212
commit f981415b5b
2 changed files with 10 additions and 2 deletions

View File

@ -27,7 +27,7 @@ export const TAG_TEMPLATE = `
<button class="action-item" (click)="showDigestId(t)">{{'REPOSITORY.COPY_DIGEST_ID' | translate}}</button>
<button class="action-item" [hidden]="!hasProjectAdminRole" (click)="deleteTag(t)">{{'REPOSITORY.DELETE' | translate}}</button>
</clr-dg-action-overflow>
<clr-dg-cell>{{t.name}}</clr-dg-cell>
<clr-dg-cell><a href="javascript:void(0)" (click)="onTagClick(t)">{{t.name}}</a></clr-dg-cell>
<clr-dg-cell>docker pull {{registryUrl}}/{{repoName}}:{{t.name}}</clr-dg-cell>
<clr-dg-cell *ngIf="withNotary" [ngSwitch]="t.signature !== null">
<clr-icon shape="check" *ngSwitchCase="true" style="color: #1D5100;"></clr-icon>

View File

@ -51,6 +51,7 @@ export class TagComponent implements OnInit {
@Input() withNotary: boolean;
@Output() refreshRepo = new EventEmitter<boolean>();
@Output() tagClickEvent = new EventEmitter<Tag>();
tags: Tag[];
@ -105,7 +106,7 @@ export class TagComponent implements OnInit {
this.errorHandler.error('Repo name cannot be unset.');
return;
}
this.retrieve();
}
@ -161,7 +162,14 @@ export class TagComponent implements OnInit {
this.showTagManifestOpened = true;
}
}
selectAndCopy($event: any) {
$event.target.select();
}
onTagClick(tag: Tag): void {
if (tag) {
this.tagClickEvent.emit(tag);
}
}
}