[Aggregator | develop]: search.component.ts: Added in <search-all> input [openAccess]="false" | searchAll.component.ts: Added @Input() openAccess: boolean = true; and add "resultbestaccessright" parameter in queries if this is true | home.module.ts: Imported SearchInputModule | home.component: In search bar, remove 2 steps, go to search all page and add advanced search link.

This commit is contained in:
Konstantina Galouni 2023-07-11 15:11:37 +03:00
parent ae68622fb6
commit 5f980c01bb
1 changed files with 6 additions and 3 deletions

View File

@ -93,7 +93,8 @@ export class SearchAllComponent {
// @Input() formPlaceholderText = "Search for "+OpenaireEntities.RESULTS+", "+OpenaireEntities.PROJECTS+", "+OpenaireEntities.DATASOURCES+" & "+OpenaireEntities.ORGANIZATIONS+" in OpenAIRE";
@Input() searchForm: SearchForm = {class: 'search-form', dark: true}
@Input() breadcrumbs: Breadcrumb[] = [];
@Input() openAccess: boolean = true;
subs: Subscription[] = [];
quickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = {
@ -421,7 +422,7 @@ export class SearchAllComponent {
this.reload["result"] = false;
this.fetchPublications.results = [];
//Add Open Access Filter
this.subs.push(this.numOfSearchResults(this.fetchPublications, (refineParams ? (refineParams + '&') : '') + "&fq=resultbestaccessright%20exact%20%22Open%20Access%22"));
this.subs.push(this.numOfSearchResults(this.fetchPublications, (refineParams ? (refineParams + '&') : '') + (this.openAccess ? "&fq=resultbestaccessright%20exact%20%22Open%20Access%22" : "")));
}
if (this.activeEntity != "projects" && this.reload["projects"] && this.showProjects) {
@ -607,7 +608,9 @@ export class SearchAllComponent {
}
if (entity == "result") {
entity = "research-outcomes";
this.parameters["resultbestaccessright"] = '"' + encodeURIComponent("Open Access") + '"';
if(!!this.openAccess) {
this.parameters["resultbestaccessright"] = '"' + encodeURIComponent("Open Access") + '"';
}
}
this.router.navigate(["/search/find", entity], {queryParams: this.parameters});
}