Project

General

Profile

« Previous | Next » 

Revision 59163

[Trunk | Library]:
1. cache-interceptor.service.ts: Added query for refine projects with hidden filters as cachable (to be removed when bug with hidden filters is solved).
2. searchResearchResults.component.ts & searchProjects.component.ts & searchDataProviders.component.ts & searchOrganizations.component.ts:
a. [Bug fix - r59155] Update checks for refine query - Do not call refine query when page, results per page, sortBy change.
b. Set refineStatus to DONE when no refine query.
c. Set new field "searchPage.hideFilters" to false when results return - used only for 1st load (do not show filters, until results return).
3. newSearchPage.component:
a. Show "Filters" label always.
b. Check if there are filters with method "get existingFiltersWithValues()" instead of "filters.length" (cases where filters > 0, but values = 0).
c. Show filters column when "!hideFilters" and there are filters (refine or selected) or when there are results.
d. Add in url parameters for "page" and "resultsPerPageChanged" even when they are set to default value (need to separate navigation via menu with no params).
4. searchFilter.component.html: Add "<ng-template #input_label>" for checkboxes and radio buttons in filters (used also in view all part).

View differences:

searchProjects.component.ts
113 113
        this.oldTotalResults = this.searchUtils.totalResults;
114 114
      }
115 115
      var refine = true;
116
      if (
117
        (
118
          this.searchUtils.page != ((params['page'] === undefined) ? 1 : +params['page'])
119
          && (this.searchUtils.page == 1 || params['page'])
120
        )
121
        && this.filters && !firstLoad
122
      ) {
116
      if (params['page'] != undefined && this.filters && !firstLoad && this.searchUtils.page != +params['page']) {
123 117
        refine = false;
124
        this.searchUtils.status = this.errorCodes.DONE;
125 118
      }
126 119

  
127
      if (
128
        (
129
          this.searchUtils.sortBy != ((params['sortBy'] === undefined) ? "" : params['sortBy'])
130
          && (this.searchUtils.sortBy == "" || params['sortBy'])
131
        )
132
        && this.filters && !firstLoad
133
      ) {
120
      if (params['size'] != undefined && this.filters && !firstLoad && this.searchUtils.size != params['size']) {
134 121
        refine = false;
135

  
136
        this.searchUtils.status = this.errorCodes.DONE;
137 122
      }
138 123

  
139
      if (
140
        (
141
          this.searchUtils.size != ((params['size'] === undefined) ? 10 : +params['size'])
142
          && (this.searchUtils.size == 10 || params['size'])
143
        )
144
        && this.filters && !firstLoad
145
      ) {
146
        refine = false;
147
        this.searchUtils.status = this.errorCodes.DONE;
148
      }
149

  
150 124
      let page = (params['page']=== undefined)?1:+params['page'];
151 125
      this.searchUtils.page = ( page <= 0 ) ? 1 : page;
152 126

  
......
160 134
      this.searchPage.prepareSearchPage(this.fieldIds, this.selectedFields, this.refineFields, this.rangeFields, this.fieldIdsMap,this.customFilter,params, "project");
161 135
      if(refine) {
162 136
        this._getFilters(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), this.searchUtils.page, 0, "", true, this.searchPage.getSearchAPIQueryForRangeFields(params)+this.searchPage.getSearchAPIQueryForRefineFields(params, firstLoad));
137
      } else {
138
        this.searchUtils.refineStatus = this.errorCodes.DONE;
163 139
      }
164 140
      this.getResults(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(),  this.searchUtils.page, this.searchUtils.size, refine, this.searchPage.getSearchAPIQueryForRangeFields(params)+this.searchPage.getSearchAPIQueryForRefineFields(params, firstLoad));
165 141
      firstLoad = false;
......
242 218
                this.searchPage.buildPageURLParameters(this.filters, this.rangeFilters, false);
243 219
              }
244 220

  
221
            this.searchPage.hideFilters = false;
222

  
245 223
            //var errorCodes:ErrorCodes = new ErrorCodes();
246 224
              this.searchUtils.status = this.errorCodes.DONE;
247 225
              if(this.searchUtils.totalResults == 0 ){
......
285 263
              //this.searchPage.closeLoading();
286 264
              this.disableForms = false;
287 265
            this.searchPageUpdates.emit({disableForms: this.disableForms, disableRefineForms: this.disableRefineForms, searchUtils: this.searchUtils})
288

  
266
            this.searchPage.hideFilters = false;
289 267
          }
290 268
      ));
291 269
    }

Also available in: Unified diff