[Trunk | Library]: searchResearchResults.component.ts & searchProjects.component.ts:

[Bug fix - caused on r58351] Initialize range filters only on when refine is true (do not flicker range filtes on page change - BUT update on range value/ query change)


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58360 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2020-03-31 10:14:13 +00:00
parent 84cf96efa7
commit 1e5964aecc
2 changed files with 6 additions and 10 deletions

View File

@ -122,7 +122,7 @@ export class SearchProjectsComponent {
this.searchPage.fieldIds = this.fieldIds;
this.selectedFields = [];
this.searchPage.prepareSearchPage(this.fieldIds, this.selectedFields, this.refineFields, this.rangeFields, this.fieldIdsMap,this.customFilter,params, "project");
this.getResults(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), this.searchUtils.page, this.searchUtils.size, refine, this.searchPage.getSearchAPIQueryForRangeFields(params)+this.searchPage.getSearchAPIQueryForRefineFields(params, firstLoad), firstLoad);
this.getResults(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), this.searchUtils.page, this.searchUtils.size, refine, this.searchPage.getSearchAPIQueryForRangeFields(params)+this.searchPage.getSearchAPIQueryForRefineFields(params, firstLoad));
firstLoad = false;
});
}
@ -130,7 +130,7 @@ export class SearchProjectsComponent {
this.sub.unsubscribe();
}
sub: any;
public getResults(parameters:string, page: number, size: number, refine: boolean, refineFieldsFilterQuery = null, firstLoad: boolean = true){
public getResults(parameters:string, page: number, size: number, refine: boolean, refineFieldsFilterQuery = null){
if(page > this.pagingLimit) {
size=0;
}
@ -162,12 +162,10 @@ export class SearchProjectsComponent {
// this.searchPage.updateBaseUrlWithParameters();
if (refine) {
this.filters = this.searchPage.prepareFiltersToShow(data[2], this.searchUtils.totalResults);
this.rangeFilters = this.searchPage.prepareRangeFiltersToShow();
}else{
this.searchPage.buildPageURLParameters(this.filters, this.rangeFilters, false);
}
if(firstLoad) {
this.rangeFilters = this.searchPage.prepareRangeFiltersToShow();
}
//var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = this.errorCodes.DONE;

View File

@ -132,7 +132,7 @@ export class SearchResearchResultsComponent {
}
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), firstLoad);
this._getResults(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy, refine, this.searchPage.getSearchAPIQueryForRangeFields(params)+this.searchPage.getSearchAPIQueryForRefineFields(params, firstLoad));
firstLoad = false;
}));
}
@ -143,7 +143,7 @@ export class SearchResearchResultsComponent {
}
}
public _getResults(parameters: string, page: number, size: number, sortBy: string, refine: boolean, refineFieldsFilterQuery = null, firstLoad: boolean = true) {
public _getResults(parameters: string, page: number, size: number, sortBy: string, refine: boolean, refineFieldsFilterQuery = null) {
if (page > this.pagingLimit) {
size = 0;
}
@ -168,12 +168,10 @@ export class SearchResearchResultsComponent {
this.results = data[1];
if (refine) {
this.filters = this.searchPage.prepareFiltersToShow(data[2],this.searchUtils.totalResults);
this.rangeFilters = this.searchPage.prepareRangeFiltersToShow();
} else {
this.searchPage.buildPageURLParameters(this.filters, this.rangeFilters, false);
}
if(firstLoad) {
this.rangeFilters = this.searchPage.prepareRangeFiltersToShow();
}
this.searchUtils.status = this.errorCodes.DONE;
if (this.searchUtils.totalResults == 0) {