Revision 60992
Added by Konstantina Galouni almost 3 years ago
searchDataProviders.component.ts | ||
---|---|---|
51 | 51 |
export class SearchDataProvidersComponent { |
52 | 52 |
private errorCodes: ErrorCodes; |
53 | 53 |
private errorMessages: ErrorMessagesComponent; |
54 |
@Input() piwikSiteId = null; |
|
55 |
@Input() customFilter:SearchCustomFilter= null; |
|
56 |
@Input() tableViewLink; |
|
54 |
@Input() piwikSiteId = null;
|
|
55 |
@Input() customFilter:SearchCustomFilter= null;
|
|
56 |
@Input() tableViewLink;
|
|
57 | 57 |
public results =[]; |
58 | 58 |
public filters =[]; |
59 | 59 |
public searchUtils:SearchUtilsClass = new SearchUtilsClass(); |
... | ... | |
119 | 119 |
this.oldTotalResults = this.searchUtils.totalResults; |
120 | 120 |
} |
121 | 121 |
var refine = true; |
122 |
if (params['page'] != undefined && this.filters && !firstLoad && this.searchUtils.page != +params['page']) { |
|
123 |
refine = false; |
|
124 |
} |
|
122 |
if(this.searchPage.searchUtils.refineStatus == this.errorCodes.DONE) { |
|
125 | 123 |
|
126 |
if (params['size'] != undefined && this.filters && !firstLoad && this.searchUtils.size != params['size']) { |
|
127 |
refine = false; |
|
124 |
if (params['page'] != undefined && this.filters && !firstLoad && this.searchUtils.page != +params['page']) { |
|
125 |
refine = false; |
|
126 |
} |
|
127 |
|
|
128 |
if (params['size'] != undefined && this.filters && !firstLoad && this.searchUtils.size != params['size']) { |
|
129 |
refine = false; |
|
130 |
} |
|
128 | 131 |
} |
129 | 132 |
|
130 | 133 |
let page = (params['page']=== undefined)?0:+params['page']; |
... | ... | |
183 | 186 |
this.filtersReturned(refine, filters, totalResults, page); |
184 | 187 |
}, |
185 | 188 |
err => { |
186 |
this.handleError("Error getting organizations: ", err); |
|
189 |
this.filters = this.searchPage.prepareFiltersToShow([], 0); |
|
190 |
|
|
191 |
this.handleError("Error getting refine filters for content providers: ", err); |
|
187 | 192 |
this.searchUtils.refineStatus = this.errorMessages.getErrorCode(err.status); |
188 | 193 |
|
189 | 194 |
this.disableRefineForms = false; |
Also available in: Unified diff
[Trunk | Library]:
1. newSearchPage.component.html: In search pages show warning message when there is an error (e.g. timeout) getting refine filters.
(do not hide message for not available filters when existingFiltersWithValues > 0 - when there are filters created by url)
2. searchResearchResults.component.ts & searchProjects.component.ts & searchOrganizations.component.ts & searchDataProviders.component.ts:
a. Set refine to true when there was an error in the previous refine query (searchPage.searchUtils.refineStatus != this.errorCodes.DONE).
b. When there is an error getting refine filters, call searchPage.prepareFiltersToShow([], 0) (and prepareRangeFiltersToShow() for results and projects).