diff --git a/searchPages/searchProjects.component.ts b/searchPages/searchProjects.component.ts index 4ceb951a..7b0a55bb 100644 --- a/searchPages/searchProjects.component.ts +++ b/searchPages/searchProjects.component.ts @@ -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)); + this.getResults(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), this.searchUtils.page, this.searchUtils.size, refine, this.searchPage.getSearchAPIQueryForRangeFields(params)+this.searchPage.getSearchAPIQueryForRefineFields(params, firstLoad), 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){ + public getResults(parameters:string, page: number, size: number, refine: boolean, refineFieldsFilterQuery = null, firstLoad: boolean = true){ if(page > this.pagingLimit) { size=0; } @@ -165,7 +165,9 @@ export class SearchProjectsComponent { }else{ this.searchPage.buildPageURLParameters(this.filters, this.rangeFilters, false); } - this.rangeFilters = this.searchPage.prepareRangeFiltersToShow(); + if(firstLoad) { + this.rangeFilters = this.searchPage.prepareRangeFiltersToShow(); + } //var errorCodes:ErrorCodes = new ErrorCodes(); this.searchUtils.status = this.errorCodes.DONE; diff --git a/searchPages/searchResearchResults.component.ts b/searchPages/searchResearchResults.component.ts index abeee374..6a67687b 100644 --- a/searchPages/searchResearchResults.component.ts +++ b/searchPages/searchResearchResults.component.ts @@ -109,6 +109,7 @@ export class SearchResearchResultsComponent { this.searchUtils.status = this.errorCodes.LOADING; var firstLoad = true; this.sub = this.route.queryParams.subscribe(params => { + this.loadPaging = true; if (params['page'] && this.searchUtils.page != params['page']) { this.loadPaging = false; this.oldTotalResults = this.searchUtils.totalResults; @@ -131,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)); + 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); firstLoad = false; }); } @@ -142,7 +143,7 @@ export class SearchResearchResultsComponent { sub: any; - public _getResults(parameters: string, page: number, size: number, sortBy: string, refine: boolean, refineFieldsFilterQuery = null) { + public _getResults(parameters: string, page: number, size: number, sortBy: string, refine: boolean, refineFieldsFilterQuery = null, firstLoad: boolean = true) { if (page > this.pagingLimit) { size = 0; } @@ -170,7 +171,9 @@ export class SearchResearchResultsComponent { } else { this.searchPage.buildPageURLParameters(this.filters, this.rangeFilters, false); } - this.rangeFilters = this.searchPage.prepareRangeFiltersToShow(); + if(firstLoad) { + this.rangeFilters = this.searchPage.prepareRangeFiltersToShow(); + } this.searchUtils.status = this.errorCodes.DONE; if (this.searchUtils.totalResults == 0) { diff --git a/searchPages/searchUtils/newSearchPage.component.html b/searchPages/searchUtils/newSearchPage.component.html index fb90a046..1e59a2fb 100644 --- a/searchPages/searchUtils/newSearchPage.component.html +++ b/searchPages/searchUtils/newSearchPage.component.html @@ -352,9 +352,9 @@
- 0 || !loadPaging)--> + @@ -372,7 +372,11 @@
- + +
+ + 'results'" [class]="isDisabled ? 'uk-disabled uk-link-muted' : 'uk-link-text'"> @@ -34,9 +34,7 @@ import 'rxjs'; }) export class SearchDownloadComponent { - @Input() searchUtils; - @Input() oldTotalResults:number = 0; - @Input() loadPaging: boolean = true; + @Input() isDisabled: boolean = false; @Input() totalResults:number = 0; @Input() csvParams: string; @Input() type: string; diff --git a/utils/rangeFilter/rangeFilter.component.html b/utils/rangeFilter/rangeFilter.component.html index aa959f03..3b3dd9c3 100644 --- a/utils/rangeFilter/rangeFilter.component.html +++ b/utils/rangeFilter/rangeFilter.component.html @@ -12,14 +12,14 @@
+ placeholder="e.g. 1931" [disabled]="isDisabled"/> + placeholder="e.g. 2020" [disabled]="isDisabled"/>