Make breadcrumbs also as Input in search page

This commit is contained in:
Konstantinos Triantafyllou 2022-02-11 16:00:34 +02:00
parent 967aab00d3
commit e5a644f2ae
1 changed files with 9 additions and 11 deletions

View File

@ -94,9 +94,9 @@ export class NewSearchPageComponent {
@Input() includeOnlyResultsAndFilter: boolean = false;
@Input() showBreadcrumb: boolean = false;
@Input() showDownload: boolean = true;
@Input() breadcrumbs: Breadcrumb[] = [];
public dashboard: boolean = properties.isDashboard;
subscriptions = [];
private subscriptions = [];
public parameterNames: string[] = [];
public parameterValues: string[] = [];
@ -109,7 +109,6 @@ export class NewSearchPageComponent {
public divContents = null;
public routerHelper: RouterHelper = new RouterHelper();
public errorCodes: ErrorCodes = new ErrorCodes();
breadcrumbs: Breadcrumb[] = [];
url = null;
metaDescription = "";
@Input() basicMetaDescription = [];
@ -174,15 +173,14 @@ export class NewSearchPageComponent {
this.updateMeta(this.pageTitle);
});
this.searchUtils.baseUrl = "/" + this.searchUtils.baseUrl;
this.breadcrumbs.push({name: 'home', route: '/'});
if(this.entityType === 'community') {
this.breadcrumbs.push({name: this.pageTitle, route: null});
} else if (this.simpleView) {
this.breadcrumbs.push({name: "Search", route: null});
} else if (!this.simpleView && this.advancedSearchLink) {
this.breadcrumbs.push({name: "Advanced Search", route: null});
if(this.breadcrumbs.length === 0) {
this.breadcrumbs.push({name: 'home', route: '/'});
if (this.simpleView) {
this.breadcrumbs.push({name: "Search", route: null});
} else if (!this.simpleView && this.advancedSearchLink) {
this.breadcrumbs.push({name: "Advanced Search", route: null});
}
}
//console.log(this.filters)
if (typeof document !== 'undefined') {
this.subscriptions.push(this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => {
if (lastIndexUpdate) {