mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-02 13:01:23 +01:00
fix issue about back to public project #1918
This commit is contained in:
parent
613dfc597d
commit
04929c98f7
@ -16,4 +16,6 @@
|
||||
font-size: 14px;
|
||||
font-style: italic;
|
||||
letter-spacing: 0.01em;
|
||||
}
|
||||
}
|
||||
.cursor{
|
||||
cursor: pointer;}
|
@ -1,4 +1,4 @@
|
||||
<a *ngIf="hasSignedIn" [routerLink]="['/harbor', 'projects']">< {{'PROJECT_DETAIL.PROJECTS' | translate}}</a>
|
||||
<a *ngIf="hasSignedIn" (click)="backToProject()" class="cursor">< {{'PROJECT_DETAIL.PROJECTS' | translate}}</a>
|
||||
<a *ngIf="!hasSignedIn" [routerLink]="['/harbor', 'sign-in']">< {{'SEARCH.BACK' | translate}}</a>
|
||||
|
||||
<h1 class="sub-header-title">{{currentProject.name}} <span class="role-label" *ngIf="isMember">{{roleName | translate}}</span></h1>
|
||||
|
@ -57,4 +57,11 @@ export class ProjectDetailComponent {
|
||||
return this.sessionService.getCurrentUser() != null;
|
||||
}
|
||||
|
||||
}
|
||||
backToProject(): void {
|
||||
if (window.sessionStorage) {
|
||||
window.sessionStorage.setItem('fromDetails', 'true');
|
||||
}
|
||||
this.router.navigate(['/harbor', 'projects']);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
</div>
|
||||
<div class="option-right">
|
||||
<div class="select" style="float: left; left:-6px; top:8px;">
|
||||
<select (change)="doFilterProjects($event)">
|
||||
<select (change)="doFilterProjects($event)" [(ngModel)]="selecteType">
|
||||
<option value="0" [selected]="currentFilteredType === 0">{{projectTypes[0] | translate}}</option>
|
||||
<option value="1">{{projectTypes[1] | translate}}</option>
|
||||
<option value="2">{{projectTypes[2] | translate}}</option>
|
||||
|
@ -47,6 +47,7 @@ import { StatisticHandler } from '../shared/statictics/statistic-handler.service
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
export class ProjectComponent implements OnInit, OnDestroy {
|
||||
selecteType:number = 0;
|
||||
|
||||
changedProjects: Project[];
|
||||
projectTypes = ProjectTypes;
|
||||
@ -121,6 +122,16 @@ export class ProjectComponent implements OnInit, OnDestroy {
|
||||
|
||||
retrieve(state?: State): void {
|
||||
this.projectName = "";
|
||||
|
||||
if (window.sessionStorage && window.sessionStorage['projectTypeValue'] && window.sessionStorage['fromDetails']) {
|
||||
this.currentFilteredType = +window.sessionStorage['projectTypeValue'];
|
||||
this.selecteType = this.currentFilteredType;
|
||||
window.sessionStorage.removeItem('fromDetails');
|
||||
}
|
||||
if (this.currentFilteredType !== 0) {
|
||||
this.getProjects('', this.currentFilteredType - 1);
|
||||
return;
|
||||
}
|
||||
this.getProjects();
|
||||
}
|
||||
|
||||
@ -175,6 +186,9 @@ export class ProjectComponent implements OnInit, OnDestroy {
|
||||
} else {
|
||||
this.getProjects("", this.currentFilteredType - 1);
|
||||
}
|
||||
if (window.sessionStorage) {
|
||||
window.sessionStorage['projectTypeValue'] = this.currentFilteredType;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -192,6 +206,11 @@ export class ProjectComponent implements OnInit, OnDestroy {
|
||||
} else {
|
||||
this.getProjects("", this.currentFilteredType - 1);
|
||||
}
|
||||
|
||||
this.selecteType = this.currentFilteredType;
|
||||
if (window.sessionStorage) {
|
||||
window.sessionStorage['projectTypeValue'] = this.currentFilteredType;
|
||||
}
|
||||
},
|
||||
error => this.messageHandlerService.handleError(error)
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user