Skip to content
Snippets Groups Projects
Commit f679248e authored by FORESTIER Fabien's avatar FORESTIER Fabien
Browse files

Add custom input to page-header component in order to be able to customise the...

Add custom input to page-header component in order to be able to customise the goToPreviousPage behavior
parent 0516a420
No related branches found
No related tags found
2 merge requests!16Resolve "[NavigationHistory] - Bug navigation history with dataset details tab",!19Development
<div class="page-details-background-image"></div>
<div class="page-container has-white-background" *ngIf="metadata" [ngClass]="{'blury' : isLoading}">
<div class="details-header">
<app-page-header [pageInfo]="pageHeaderInfo"></app-page-header>
<app-page-header [pageInfo]="pageHeaderInfo" [customGoToPreviousPage]="goToPreviousPage"></app-page-header>
</div>
<div class="tabulations">
......
......@@ -17,19 +17,24 @@ export class PageHeaderComponent implements OnInit {
) { }
@Input() pageInfo: IPageHeaderInfo;
@Input() customGoToPreviousPage: any;
ngOnInit() {
}
goToPreviousPage() {
const index = 1; // Start to retrieve the previous element
let url = this._navigationHistoryService.getFromLast(index);
if (this.customGoToPreviousPage) {
this.customGoToPreviousPage();
} else {
const index = 1; // Start to retrieve the previous element
let url = this._navigationHistoryService.getFromLast(index);
// If url is null then redirect to home page
if (url == null) {
url = `/${AppRoutes.home.uri}`;
// If url is null then redirect to home page
if (url == null) {
url = `/${AppRoutes.home.uri}`;
}
this._router.navigateByUrl(url);
}
this._router.navigateByUrl(url);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment