Modify bread crumb for vic

This commit is contained in:
Fuhui Peng (c) 2018-04-18 18:29:06 +08:00
parent 2f1989d211
commit 8a41bcab93
12 changed files with 73 additions and 46 deletions

View File

@ -3,13 +3,21 @@ export const REPOSITORY_STYLE = `.option-right {
margin-bottom: 12px; margin-bottom: 12px;
} }
.arrow-block a{ .arrow-back {
text-decoration: none; cursor: pointer;
cursor: pointer;
color: #007cbb;
font-size: 12px;
} }
.arrow-block {
border-right: 2px solid #cccccc;
margin-right: 6px;
display: inline-flex;
padding: 6px 6px 6px 12px;
}
.title-block {
display: inline-block;
}
.tag-name { .tag-name {
font-weight: 300; font-weight: 300;
font-size: 32px; font-size: 32px;

View File

@ -1,14 +1,18 @@
export const REPOSITORY_TEMPLATE = ` export const REPOSITORY_TEMPLATE = `
<section class="overview-section"> <section class="overview-section">
<div class="title-wrapper"> <div class="title-wrapper" *ngIf="withAdmiral">
<div class="arrow-block"> <div class="title-block arrow-block">
<a (click)="goProBack()">< {{'SIDE_NAV.PROJECTS'| translate}}</a> <clr-icon class="rotate-90 arrow-back" shape="arrow" size="36" (click)="goBack()"></clr-icon>
<a (click)="goRepBack()">< {{'REPOSITORY.REPOSITORIES'| translate}}</a>
</div> </div>
<div> <div class="title-block">
<h2 sub-header-title class="custom-h2">{{repoName}}</h2> <h2 sub-header-title class="custom-h2">{{repoName}}</h2>
</div> </div>
</div> </div>
<div class="title-wrapper" *ngIf="!withAdmiral">
<div class="title-block">
<h2 class="custom-h2">{{repoName}}</h2>
</div>
</div>
</section> </section>
<section class="detail-section"> <section class="detail-section">

View File

@ -52,8 +52,7 @@ export class RepositoryComponent implements OnInit {
@Input() hasProjectAdminRole: boolean; @Input() hasProjectAdminRole: boolean;
@Input() isGuest: boolean; @Input() isGuest: boolean;
@Output() tagClickEvent = new EventEmitter<TagClickEvent>(); @Output() tagClickEvent = new EventEmitter<TagClickEvent>();
@Output() backRepEvt: EventEmitter<any> = new EventEmitter<any>(); @Output() backEvt: EventEmitter<any> = new EventEmitter<any>();
@Output() backProEvt: EventEmitter<any> = new EventEmitter<any>();
onGoing = false; onGoing = false;
editing = false; editing = false;
@ -156,11 +155,8 @@ export class RepositoryComponent implements OnInit {
.catch(error => this.errorHandler.error(error)); .catch(error => this.errorHandler.error(error));
} }
goRepBack(): void { goBack(): void {
this.backRepEvt.emit(this.projectId); this.backEvt.emit(this.projectId);
}
goProBack(): void {
this.backProEvt.emit();
} }
hasChanges() { hasChanges() {

View File

@ -10,10 +10,15 @@ export const TAG_DETAIL_STYLES: string = `
padding-right: 24px; padding-right: 24px;
} }
.title-block {
display: inline-block;
}
.tag-name { .tag-name {
font-weight: 300; font-weight: 300;
font-size: 32px; font-size: 32px;
} }
.tag-name h2{margin-top:0;}
.tag-timestamp { .tag-timestamp {
font-weight: 400; font-weight: 400;
@ -33,11 +38,19 @@ export const TAG_DETAIL_STYLES: string = `
transform: rotate(-90deg); transform: rotate(-90deg);
} }
.arrow-block a{ .arrow-back {
text-decoration: none;
cursor: pointer; cursor: pointer;
color: #007cbb; }
font-size: 12px;
.arrow-block {
border-right: 2px solid #cccccc;
margin-right: 6px;
display: inline-flex;
padding: 6px 6px 6px 12px;
}
.title-block {
display: inline-block;
} }

View File

@ -1,14 +1,17 @@
export const TAG_DETAIL_HTML: string = ` export const TAG_DETAIL_HTML: string = `
<div> <div>
<section class="overview-section"> <section class="overview-section">
<div class="title-wrapper"> <div class="title-wrapper" *ngIf="withAdmiral">
<div class="arrow-block"> <div class="title-block arrow-block">
<a (click)="onBackPro()">< {{'SIDE_NAV.PROJECTS'| translate}}</a> <clr-icon class="rotate-90 arrow-back" shape="arrow" size="36" (click)="onBack()"></clr-icon>
<a (click)="onBackRep()">< {{'REPOSITORY.REPOSITORIES'| translate}}</a>
<a (click)="onBackTag()">< {{repositoryId}}</a>
</div> </div>
<div class=""> <div class="title-block">
<h2 class="custom-h2" sub-header-title>{{repositoryId}}:{{tagDetails.name}}</h2> <h2 class="custom-h2">{{repositoryId}}:{{tagDetails.name}}</h2>
</div>
</div>
<div class="title-wrapper" *ngIf="!withAdmiral">
<div class="title-block">
<h2 class="custom-h2">{{repositoryId}}:{{tagDetails.name}}</h2>
</div> </div>
</div> </div>
<div class="summary-block"> <div class="summary-block">

View File

@ -38,9 +38,7 @@ export class TagDetailComponent implements OnInit {
labels: [], labels: [],
}; };
@Output() backTagEvt: EventEmitter<any> = new EventEmitter<any>(); @Output() backEvt: EventEmitter<any> = new EventEmitter<any>();
@Output() backRepEvt: EventEmitter<any> = new EventEmitter<any>();
@Output() backProEvt: EventEmitter<any> = new EventEmitter<any>();
constructor( constructor(
private tagService: TagService, private tagService: TagService,
@ -79,14 +77,8 @@ export class TagDetailComponent implements OnInit {
} }
} }
onBackTag(): void { onBack(): void {
this.backTagEvt.emit(this.repositoryId); this.backEvt.emit(this.repositoryId);
}
onBackRep(): void {
this.backRepEvt.emit();
}
onBackPro(): void {
this.backProEvt.emit();
} }
getPackageText(count: number): string { getPackageText(count: number): string {

View File

@ -30,7 +30,7 @@
"clarity-icons": "0.10.24", "clarity-icons": "0.10.24",
"clarity-ui": "0.10.24", "clarity-ui": "0.10.24",
"core-js": "^2.4.1", "core-js": "^2.4.1",
"harbor-ui": "0.7.1", "harbor-ui": "0.6.81",
"intl": "^1.2.5", "intl": "^1.2.5",
"mutationobserver-shim": "^0.3.2", "mutationobserver-shim": "^0.3.2",
"ngx-cookie": "^1.0.0", "ngx-cookie": "^1.0.0",

View File

@ -1,3 +1,8 @@
<div> <div>
<hbr-tag-detail (backTagEvt)="goBackTag($event)" (backRepEvt)="goBackRep()" (backProEvt)="goBackPro()" [tagId]="tagId" [withClair]="withClair" [withAdmiral]="withAdmiral" [repositoryId]="repositoryId"></hbr-tag-detail> <div class="arrow-block" *ngIf="!withAdmiral">
<a (click)="goBackPro()">< {{'SIDE_NAV.PROJECTS'| translate}}</a>
<a (click)="goBackRep()">< {{'REPOSITORY.REPOSITORIES'| translate}}</a>
<a (click)="goBack(repositoryId)">< {{repositoryId}}</a>
</div>
<hbr-tag-detail (backEvt)="goBack($event)" [tagId]="tagId" [withClair]="withClair" [withAdmiral]="withAdmiral" [repositoryId]="repositoryId"></hbr-tag-detail>
</div> </div>

View File

@ -17,7 +17,8 @@ import {AppConfigService} from "../../app-config.service";
@Component({ @Component({
selector: 'repository', selector: 'repository',
templateUrl: 'tag-detail-page.component.html' templateUrl: 'tag-detail-page.component.html',
styles: ['.arrow-block a{text-decoration: none; cursor: pointer; cursor: pointer; color: #007cbb; font-size: 12px;}']
}) })
export class TagDetailPageComponent implements OnInit { export class TagDetailPageComponent implements OnInit {
tagId: string; tagId: string;
@ -45,7 +46,7 @@ export class TagDetailPageComponent implements OnInit {
return this.appConfigService.getConfig().with_clair; return this.appConfigService.getConfig().with_clair;
} }
goBackTag(tag: string): void { goBack(tag: string): void {
this.router.navigate(["harbor", "projects", this.projectId, "repositories", tag]); this.router.navigate(["harbor", "projects", this.projectId, "repositories", tag]);
} }
goBackRep(): void { goBackRep(): void {

View File

@ -1,3 +1,4 @@
.sub-header-title { .sub-header-title {
margin-top: 12px; margin-top: 12px;
} }
.arrow-block a{text-decoration: none; cursor: pointer; cursor: pointer; color: #007cbb; font-size: 12px;}

View File

@ -1,4 +1,8 @@
<div> <div>
<div class="arrow-block" *ngIf="!withAdmiral">
<a (click)="goProBack()">< {{'SIDE_NAV.PROJECTS'| translate}}</a>
<a (click)="watchGoBackEvt(projectId)">< {{'REPOSITORY.REPOSITORIES'| translate}}</a>
</div>
<hbr-repository [repoName]="repoName" [hasSignedIn]="hasSignedIn" [hasProjectAdminRole]="hasProjectAdminRole" [projectId]="projectId" [isGuest]="isGuest" <hbr-repository [repoName]="repoName" [hasSignedIn]="hasSignedIn" [hasProjectAdminRole]="hasProjectAdminRole" [projectId]="projectId" [isGuest]="isGuest"
(tagClickEvent)="watchTagClickEvt($event)" (backRepEvt)="goRepBack($event)" (backProEvt)="goProBack()"></hbr-repository> (tagClickEvent)="watchTagClickEvt($event)" (backEvt)="watchGoBackEvt($event)"></hbr-repository>
</div> </div>

View File

@ -85,7 +85,7 @@ export class TagRepositoryComponent implements OnInit {
this.router.navigate(linkUrl); this.router.navigate(linkUrl);
} }
goRepBack(projectId: string): void { watchGoBackEvt(projectId: string| number): void {
this.router.navigate(["harbor", "projects", projectId, "repositories"]); this.router.navigate(["harbor", "projects", projectId, "repositories"]);
} }
goProBack(): void { goProBack(): void {