Project

General

Profile

« Previous | Next » 

Revision 60992

[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).

View differences:

searchOrganizations.component.ts
46 46
  private errorCodes: ErrorCodes;
47 47
  private errorMessages: ErrorMessagesComponent;
48 48
  properties:EnvProperties;
49
@Input() piwikSiteId = null;
49
  @Input() piwikSiteId = null;
50 50
  public results =[];
51 51
  public filters =[];
52 52
  public searchUtils:SearchUtilsClass = new SearchUtilsClass();
......
111 111
        this.oldTotalResults = this.searchUtils.totalResults;
112 112
      }
113 113
      var refine = true;
114
      if (params['page'] != undefined && this.filters && !firstLoad && this.searchUtils.page != +params['page']) {
115
        refine = false;
116
      }
114
      if(this.searchPage.searchUtils.refineStatus == this.errorCodes.DONE) {
115
        if (params['page'] != undefined && this.filters && !firstLoad && this.searchUtils.page != +params['page']) {
116
          refine = false;
117
        }
117 118

  
118
      if (params['size'] != undefined && this.filters && !firstLoad && this.searchUtils.size != params['size']) {
119
        refine = false;
119
        if (params['size'] != undefined && this.filters && !firstLoad && this.searchUtils.size != params['size']) {
120
          refine = false;
121
        }
120 122
      }
121 123

  
122 124
      let page = (params['page']=== undefined)?1:+params['page'];
......
169 171
            this.filtersReturned(refine, filters, totalResults, page);
170 172
          },
171 173
          err => {
172
            this.handleError("Error getting organizations: ", err);
174
            this.filters = this.searchPage.prepareFiltersToShow([], 0);
175

  
176
            this.handleError("Error getting refine filters for organizations: ", err);
173 177
            this.searchUtils.refineStatus = this.errorMessages.getErrorCode(err.status);
174 178

  
175 179
            this.disableRefineForms = false;

Also available in: Unified diff