Project

General

Profile

« Previous | Next » 

Revision 47340

Removed modal for loading in Search Pages and added an alert message (while loading all forms, inputs, buttons are disabled)

View differences:

searchPublications.component.ts
22 22
                 [(filters)] = "filters" [(results)] = "results"
23 23
                 [(searchUtils)] = "searchUtils"   [(baseUrl)] = baseUrl
24 24
                 (queryChange)="queryChanged($event)" (downloadClick)="downloadClicked($event)"
25
                 [csvParams]="csvParams" csvPath="publications" advancedSearchLink="/search/advanced/publications">
25
                 [csvParams]="csvParams" csvPath="publications" advancedSearchLink="/search/advanced/publications"
26
                 [disableForms]="disableForms">
26 27
    </search-page>
27 28

  
28 29
    `
......
50 51
                  };
51 52
  public CSVDownloaded = false;
52 53
  public csvParams: string;
54
  public disableForms: boolean = false;
53 55

  
54 56
  constructor (private route: ActivatedRoute, private _searchPublicationsService: SearchPublicationsService ) {
55 57
    var errorCodes:ErrorCodes = new ErrorCodes();
......
185 187

  
186 188
  var errorCodes:ErrorCodes = new ErrorCodes();
187 189
  this.searchUtils.status = errorCodes.LOADING;
188
  this.searchPage.openLoading();
190
  //this.searchPage.openLoading();
191
  this.disableForms = true;
192
  this.results = [];
193
  this.searchUtils.totalResults = 0;
189 194

  
190 195
  this.subResults = this._searchPublicationsService.searchPublications(parameters,(refine)?this.searchPage.getRefineFieldsQuery():null, page, size, this.searchPage.getFields()).subscribe(
191 196
      data => {
......
202 207
          if(this.searchUtils.totalResults == 0 ){
203 208
            this.searchUtils.status = errorCodes.NONE;
204 209
          }
205
          this.searchPage.closeLoading();
210
          //this.searchPage.closeLoading();
211
          this.disableForms = false;
206 212
      },
207 213
      err => {
208 214
          console.log(err);
......
212 218
          // }
213 219
          var errorCodes:ErrorCodes = new ErrorCodes();
214 220
          this.searchUtils.status = errorCodes.ERROR;
215
          this.searchPage.closeLoading();
221
          //this.searchPage.closeLoading();
222
          this.disableForms = false;
216 223

  
217 224
      }
218 225
  );

Also available in: Unified diff