@universis/ngx-tables 6.13.8 → 6.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,7 +23,7 @@ import { BsModalRef, BsModalService, ModalModule } from 'ngx-bootstrap/modal';
23
23
  import { ProgressbarModule } from 'ngx-bootstrap/progressbar';
24
24
  import { GroupByPipe, NgPipesModule } from 'ngx-pipes';
25
25
  import { template, at, cloneDeep, isEmpty } from 'lodash';
26
- import { Injectable, Directive, Optional, Input, Output, EventEmitter, Component, ElementRef, ViewChild, ViewEncapsulation, Pipe, ChangeDetectorRef, NgModule, CUSTOM_ELEMENTS_SCHEMA, defineInjectable, inject, HostListener, InjectionToken, Inject, Injector, ViewContainerRef, ChangeDetectionStrategy } from '@angular/core';
26
+ import { Injectable, Directive, Optional, Input, Output, EventEmitter, Component, ElementRef, ViewChild, ViewEncapsulation, Pipe, ChangeDetectorRef, defineInjectable, inject, HostListener, NgModule, CUSTOM_ELEMENTS_SCHEMA, InjectionToken, Inject, Injector, ViewContainerRef, ErrorHandler, ChangeDetectionStrategy } from '@angular/core';
27
27
  import { ActivatedRoute, Router, NavigationStart, NavigationEnd, RouterModule } from '@angular/router';
28
28
  import { createFeatureSelector, createSelector, select, Store } from '@ngrx/store';
29
29
  import { skip, first, filter } from 'rxjs/operators';
@@ -1421,8 +1421,9 @@ class AdvancedTableComponent {
1421
1421
  * @param {?} _modalService
1422
1422
  * @param {?} _errorService
1423
1423
  * @param {?} _viewContainerRef
1424
+ * @param {?} _errorHandler
1424
1425
  */
1425
- constructor(_context, _columnFormatters, _activatedRoute, _translateService, _injector, _advancedFilterValueProvider, _element, _template, _loading, _http, _columnSelector, _configuration, _exportSpreadsheet, _modalService, _errorService, _viewContainerRef) {
1426
+ constructor(_context, _columnFormatters, _activatedRoute, _translateService, _injector, _advancedFilterValueProvider, _element, _template, _loading, _http, _columnSelector, _configuration, _exportSpreadsheet, _modalService, _errorService, _viewContainerRef, _errorHandler) {
1426
1427
  this._context = _context;
1427
1428
  this._columnFormatters = _columnFormatters;
1428
1429
  this._activatedRoute = _activatedRoute;
@@ -1439,6 +1440,7 @@ class AdvancedTableComponent {
1439
1440
  this._modalService = _modalService;
1440
1441
  this._errorService = _errorService;
1441
1442
  this._viewContainerRef = _viewContainerRef;
1443
+ this._errorHandler = _errorHandler;
1442
1444
  this._firstLoad = true;
1443
1445
  this._showFooter = false;
1444
1446
  this._showHeader = true;
@@ -2706,7 +2708,11 @@ class AdvancedTableComponent {
2706
2708
  return;
2707
2709
  }
2708
2710
  /** @type {?} */
2709
- const q = this._context.model(this.config.model).asQueryable();
2711
+ const queryModel = this._query && this._query.getModel();
2712
+ /** @type {?} */
2713
+ const model = queryModel ? queryModel : this.config.model;
2714
+ /** @type {?} */
2715
+ const q = this._context.model(model).asQueryable();
2710
2716
  Object.keys(this.lastQueryParams).forEach((key) => {
2711
2717
  q.setParam(key, this.lastQueryParams && this.lastQueryParams[key]);
2712
2718
  });
@@ -2875,6 +2881,19 @@ class AdvancedTableComponent {
2875
2881
  }
2876
2882
  if (err) {
2877
2883
  this.lastError = err;
2884
+ if (typeof err.status === 'number') {
2885
+ if (this._errorHandler) {
2886
+ // a backward compatibility assignment of rejection property
2887
+ // following @universis/common#ErrorsHandler.handleError contract
2888
+ Object.assign(err, {
2889
+ rejection: {
2890
+ status: err.status,
2891
+ statusText: err.statusText
2892
+ }
2893
+ });
2894
+ this._errorHandler.handleError(err);
2895
+ }
2896
+ }
2878
2897
  if (innerMessage) {
2879
2898
  innerMessage.innerHTML = err.error && err.error.message ? err.error.message : err.message;
2880
2899
  }
@@ -3218,7 +3237,8 @@ AdvancedTableComponent.ctorParameters = () => [
3218
3237
  { type: ExportSpreadsheetService },
3219
3238
  { type: ModalService },
3220
3239
  { type: ErrorService },
3221
- { type: ViewContainerRef }
3240
+ { type: ViewContainerRef },
3241
+ { type: ErrorHandler, decorators: [{ type: Optional }] }
3222
3242
  ];
3223
3243
  AdvancedTableComponent.propDecorators = {
3224
3244
  table: [{ type: ViewChild, args: ['table',] }],