[Library|Trunk]
New search: fix issue with quick selections add Page URL resolver component: to properly redirect old routes to new research outcomes search page git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58156 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
1c7412cd63
commit
c88ec8c54f
|
@ -130,7 +130,6 @@ export class SearchResearchResultsComponent {
|
|||
if (this.searchUtils.sortBy && this.searchUtils.sortBy != "resultdateofacceptance,descending" && this.searchUtils.sortBy != "resultdateofacceptance,ascending") {
|
||||
this.searchUtils.sortBy = "";
|
||||
}
|
||||
console.log(params);
|
||||
this.selectedFields = [];
|
||||
this.searchPage.prepareSearchPage(this.fieldIds, this.selectedFields, this.refineFields, this.rangeFields, this.fieldIdsMap,this.customFilter,params, this.resultType, this.quickFilter);
|
||||
this._getResults(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy, refine, this.searchPage.getSearchAPIQueryForRangeFields(params)+this.searchPage.getSearchAPIQueryForRefineFields(params, firstLoad));
|
||||
|
|
|
@ -176,19 +176,14 @@ export class NewSearchPageComponent {
|
|||
}
|
||||
}
|
||||
this.selectedFilters = 0;
|
||||
//<<<<<<< .mine
|
||||
|
||||
for(let i = 0; i < this.rangeFilters.length; i++) {
|
||||
this.rangeFilters[i].selectedFromValue = null;
|
||||
this.rangeFilters[i].selectedToValue = null;
|
||||
}
|
||||
this.selectedRangeFilters = 0;
|
||||
//||||||| .r58066
|
||||
//=======
|
||||
if (this.quickFilter) {
|
||||
this.removeValueFromQuickFilter();
|
||||
}
|
||||
//>>>>>>> .r58095
|
||||
this.goTo(1);
|
||||
// this.clearKeywords();
|
||||
}
|
||||
|
@ -731,14 +726,15 @@ export class NewSearchPageComponent {
|
|||
allFqs += "&fq=" + StringUtils.URIEncode(this.customFilter.queryFieldName + " exact " + StringUtils.quote((this.customFilter.valueId)));
|
||||
}
|
||||
|
||||
if (this.quickFilter) {
|
||||
if ((this.entityType == "result" && firstLoad && URLparams[this.quickFilter.filterId] == undefined && (URLparams["qf"] == undefined || URLparams["qf"] == "true"))
|
||||
|| ((this.entityType == "result" && URLparams[this.quickFilter.filterId] != undefined && StringUtils.URIDecode(URLparams[this.quickFilter.filterId]).split(/,(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/, -1).indexOf(StringUtils.quote(this.quickFilter.value)) != -1))) {
|
||||
if (this.quickFilter && this.entityType == "result") {
|
||||
if((firstLoad && URLparams[this.quickFilter.filterId] == undefined && URLparams["qf"] == undefined) || URLparams["qf"] == "true"
|
||||
|| ((URLparams[this.quickFilter.filterId] != undefined && StringUtils.URIDecode(URLparams[this.quickFilter.filterId]).split(/,(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/, -1).indexOf(StringUtils.quote(this.quickFilter.value)) != -1))) {
|
||||
this.quickFilter.selected = true;
|
||||
} else {
|
||||
this.quickFilter.selected = false;
|
||||
}
|
||||
if (this.entityType == "result" && firstLoad && URLparams[this.quickFilter.filterId] == undefined && (URLparams["qf"] == undefined || URLparams["qf"] == "true")) {
|
||||
if ((firstLoad && URLparams[this.quickFilter.filterId] == undefined && URLparams["qf"] == undefined)
|
||||
||( URLparams[this.quickFilter.filterId] == undefined && URLparams["qf"] == "true")) {
|
||||
allFqs += "&fq=resultbestaccessright exact " + StringUtils.quote(this.quickFilter.value);
|
||||
}
|
||||
}
|
||||
|
@ -1028,7 +1024,8 @@ export class NewSearchPageComponent {
|
|||
// this.parameterNames.push("sortBy");
|
||||
// this.parameterValues.push(this.searchUtils.sortBy);
|
||||
// }
|
||||
|
||||
// console.log(this.parameterNames)
|
||||
// console.log(this.parameterValues)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -78,17 +78,21 @@ export class QuickSelectionsComponent implements OnChanges {
|
|||
quickFilterChanged() {
|
||||
let value = this.control.getRawValue();
|
||||
this.quickFilter.selected = value.QFselected;
|
||||
this.quickFilter.filter.countSelectedValues = 0;
|
||||
if(this.quickFilter.filter) {
|
||||
if (value.QFselected) {
|
||||
for (let filterValue of this.quickFilter.filter.values) {
|
||||
filterValue.selected = (filterValue.name == this.quickFilter.value)
|
||||
}
|
||||
if((filterValue.name == this.quickFilter.value)) {
|
||||
filterValue.selected = true
|
||||
this.quickFilter.filter.countSelectedValues = 1;
|
||||
}else{
|
||||
filterValue.selected = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (let filterValue of this.quickFilter.filter.values) {
|
||||
filterValue.selected = false;
|
||||
}
|
||||
this.quickFilter.filter.countSelectedValues = 0;
|
||||
}
|
||||
}
|
||||
this.typeChange.emit({});
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
import {Component} from '@angular/core';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'page-URL-resolver',
|
||||
template: `
|
||||
`
|
||||
})
|
||||
|
||||
export class PageURLResolverComponent {
|
||||
parameters= {};
|
||||
constructor(private route: ActivatedRoute, private router : Router) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.queryParams.subscribe(params => {
|
||||
console.log(params);
|
||||
this.parameters = Object.assign({}, params);
|
||||
this.navigateTO(this.router.url.split("?")[0])
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
navigateTO(url:string){
|
||||
if( url == "/search/find/publications" ){
|
||||
this.parameters["type"]="publications";
|
||||
this.router.navigate(["/search/find/research-results"],{queryParams:this.parameters})
|
||||
}else if( url == "/search/find/datasets" ){
|
||||
this.parameters["type"]="datasets";
|
||||
this.router.navigate(["/search/find/research-results"],{queryParams:this.parameters})
|
||||
}else if( url == "/search/find/software" ){
|
||||
this.parameters["type"]="software";
|
||||
this.router.navigate(["/search/find/research-results"],{queryParams:this.parameters})
|
||||
}else if( url == "/search/find/other" ){
|
||||
this.parameters["type"]="other";
|
||||
this.router.navigate(["/search/find/research-results"],{queryParams:this.parameters})
|
||||
}else if( url == "/search/advanced/publications" ){
|
||||
this.parameters["type"]="publications";
|
||||
this.router.navigate(["/search/advanced/research-results"],{queryParams:this.parameters})
|
||||
}else if( url == "/search/advanced/datasets" ){
|
||||
this.parameters["type"]="datasets";
|
||||
this.router.navigate(["/search/advanced/research-results"],{queryParams:this.parameters})
|
||||
}else if( url == "/search/advanced/software" ){
|
||||
this.parameters["type"]="software";
|
||||
this.router.navigate(["/search/advanced/research-results"],{queryParams:this.parameters})
|
||||
}else if( url == "/search/advanced/other" ){
|
||||
this.parameters["type"]="other";
|
||||
this.router.navigate(["/search/advanced/research-results"],{queryParams:this.parameters})
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue