@gipisistemas/ng-core 1.1.9 → 1.1.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -26082,6 +26082,9 @@ var AbstractFindComponent = /** @class */ (function (_super) {
26082
26082
  }
26083
26083
  if (ObjectUtil.isNull(pageEvent) && !ObjectUtil.isNull(this.tablePageEventDTO)) {
26084
26084
  pageEvent = this.tablePageEventDTO;
26085
+ if (ObjectUtil.hasPropertyInObj(pageEvent, 'pageIndex')) {
26086
+ pageEvent.pageIndex = 0;
26087
+ }
26085
26088
  }
26086
26089
  if (pageEvent) {
26087
26090
  this.tablePageEventDTO = pageEvent;
@@ -26220,10 +26223,11 @@ var AbstractCrudComponent = /** @class */ (function (_super) {
26220
26223
  var moment$6 = moment_;
26221
26224
  var AuthenticationService = /** @class */ (function (_super) {
26222
26225
  __extends(AuthenticationService, _super);
26223
- function AuthenticationService(router, http) {
26226
+ function AuthenticationService(router, http, _matDialog) {
26224
26227
  var _this = _super.call(this) || this;
26225
26228
  _this.router = router;
26226
26229
  _this.http = http;
26230
+ _this._matDialog = _matDialog;
26227
26231
  _this._tokenSubject$ = new BehaviorSubject(JSON.parse(localStorage.getItem('token')));
26228
26232
  _this.token$ = _this._tokenSubject$.asObservable();
26229
26233
  return _this;
@@ -26245,6 +26249,7 @@ var AuthenticationService = /** @class */ (function (_super) {
26245
26249
  var _this = this;
26246
26250
  this.revokeToken().subscribe(function (_) {
26247
26251
  _this.removeSession();
26252
+ _this._matDialog.closeAll();
26248
26253
  _this.router.navigate(['/oauth/login'], { queryParams: { returnUrl: _this.router.routerState.snapshot.url } });
26249
26254
  }, function (error) {
26250
26255
  throw new Error(error);
@@ -26307,13 +26312,15 @@ var AuthenticationService = /** @class */ (function (_super) {
26307
26312
  };
26308
26313
  AuthenticationService.ctorParameters = function () { return [
26309
26314
  { type: Router },
26310
- { type: HttpClient }
26315
+ { type: HttpClient },
26316
+ { type: MatDialog }
26311
26317
  ]; };
26312
- AuthenticationService.ngInjectableDef = ɵɵdefineInjectable({ factory: function AuthenticationService_Factory() { return new AuthenticationService(ɵɵinject(Router), ɵɵinject(HttpClient)); }, token: AuthenticationService, providedIn: "root" });
26318
+ AuthenticationService.ngInjectableDef = ɵɵdefineInjectable({ factory: function AuthenticationService_Factory() { return new AuthenticationService(ɵɵinject(Router), ɵɵinject(HttpClient), ɵɵinject(MatDialog$1)); }, token: AuthenticationService, providedIn: "root" });
26313
26319
  AuthenticationService = __decorate([
26314
26320
  Injectable({ providedIn: 'root' }),
26315
26321
  __metadata("design:paramtypes", [Router,
26316
- HttpClient])
26322
+ HttpClient,
26323
+ MatDialog])
26317
26324
  ], AuthenticationService);
26318
26325
  return AuthenticationService;
26319
26326
  }(AbstractService));
@@ -27226,13 +27233,13 @@ var GIPIAbstractCrudComponent = /** @class */ (function (_super) {
27226
27233
  GIPIAbstractCrudComponent.prototype.ngOnDestroy = function () {
27227
27234
  _super.prototype.ngOnDestroy.call(this);
27228
27235
  };
27229
- GIPIAbstractCrudComponent.prototype.onInitForm = function () {
27236
+ GIPIAbstractCrudComponent.prototype.onInitForm = function (version) {
27230
27237
  var _this = this;
27231
27238
  try {
27232
27239
  this.loading = true;
27233
27240
  var id = this.activatedRoute.snapshot.params.id;
27234
27241
  if (this.UUIDIsValid(id)) {
27235
- this.abstractCrudService.getOne(id).toPromise().then(function (entity) {
27242
+ this.abstractCrudService.getOne(id, version).toPromise().then(function (entity) {
27236
27243
  _this.entity = entity;
27237
27244
  _this.onAfterGetOne();
27238
27245
  _this.loading = false;
@@ -27253,7 +27260,7 @@ var GIPIAbstractCrudComponent = /** @class */ (function (_super) {
27253
27260
  };
27254
27261
  GIPIAbstractCrudComponent.prototype.onAfterGetOne = function () { };
27255
27262
  GIPIAbstractCrudComponent.prototype.preSave = function (entity) { };
27256
- GIPIAbstractCrudComponent.prototype.save = function (entity, toGoBack) {
27263
+ GIPIAbstractCrudComponent.prototype.save = function (entity, toGoBack, version) {
27257
27264
  var _this = this;
27258
27265
  if (toGoBack === void 0) { toGoBack = true; }
27259
27266
  try {
@@ -27263,7 +27270,7 @@ var GIPIAbstractCrudComponent = /** @class */ (function (_super) {
27263
27270
  }
27264
27271
  if (this.isValid(entity)) {
27265
27272
  this.preSave(entity);
27266
- this.abstractCrudService.save(entity).toPromise().then(function (resp) {
27273
+ this.abstractCrudService.save(entity, version).toPromise().then(function (resp) {
27267
27274
  _this.addSuccessMessage(INJECTOR.get(APP_MESSAGES).SUCCESS);
27268
27275
  if (toGoBack) {
27269
27276
  _this.navigateByUrl(_this.getPath(), [_this.getPath()], true);
@@ -27430,9 +27437,12 @@ var GIPIAbstractFindComponent = /** @class */ (function (_super) {
27430
27437
  if (ObjectUtil.isNull(this.filter)) {
27431
27438
  this.filter = this.newFilter();
27432
27439
  }
27433
- // if (ObjectUtil.isNull(pageEvent) && !ObjectUtil.isNull(this.tablePageEventDTO)) {
27434
- // pageEvent = this.tablePageEventDTO;
27435
- // }
27440
+ if (ObjectUtil.isNull(pageEvent) && !ObjectUtil.isNull(this.tablePageEventDTO)) {
27441
+ pageEvent = this.tablePageEventDTO;
27442
+ if (ObjectUtil.hasPropertyInObj(pageEvent, 'pageIndex')) {
27443
+ pageEvent.pageIndex = 0;
27444
+ }
27445
+ }
27436
27446
  if (pageEvent) {
27437
27447
  this.tablePageEventDTO = pageEvent;
27438
27448
  this.filter.pageNumber = pageEvent.pageIndex;
@@ -27501,7 +27511,7 @@ var GIPIAbstractFindComponent = /** @class */ (function (_super) {
27501
27511
  this.navigateByUrl(this.getPath(), [this.getPath(), 'edit', id], true);
27502
27512
  }
27503
27513
  };
27504
- GIPIAbstractFindComponent.prototype.deleteRegister = function (id, permission, fetchAgain) {
27514
+ GIPIAbstractFindComponent.prototype.deleteRegister = function (id, permission, fetchAgain, version) {
27505
27515
  if (fetchAgain === void 0) { fetchAgain = true; }
27506
27516
  try {
27507
27517
  id = this.handleEntityId(id);
@@ -27509,7 +27519,7 @@ var GIPIAbstractFindComponent = /** @class */ (function (_super) {
27509
27519
  return;
27510
27520
  }
27511
27521
  if (StringUtil.isEmpty(permission) && ObjectUtil.isNull(this.basePermissionList)) {
27512
- this._deleteRegister(id, fetchAgain);
27522
+ this._deleteRegister(id, fetchAgain, version);
27513
27523
  }
27514
27524
  else {
27515
27525
  if (StringUtil.isEmpty(permission) && !ObjectUtil.isNull(this.basePermissionList)) {
@@ -27519,7 +27529,7 @@ var GIPIAbstractFindComponent = /** @class */ (function (_super) {
27519
27529
  this.addWarningMessage(INJECTOR.get(APP_MESSAGES).NOT_PERMISSION);
27520
27530
  return;
27521
27531
  }
27522
- this._deleteRegister(id, fetchAgain);
27532
+ this._deleteRegister(id, fetchAgain, version);
27523
27533
  }
27524
27534
  }
27525
27535
  catch (e) {
@@ -27531,7 +27541,7 @@ var GIPIAbstractFindComponent = /** @class */ (function (_super) {
27531
27541
  }
27532
27542
  };
27533
27543
  /** @Internal */
27534
- GIPIAbstractFindComponent.prototype._deleteRegister = function (id, fetchAgain) {
27544
+ GIPIAbstractFindComponent.prototype._deleteRegister = function (id, fetchAgain, version) {
27535
27545
  var _this = this;
27536
27546
  if (fetchAgain === void 0) { fetchAgain = true; }
27537
27547
  try {
@@ -27543,7 +27553,7 @@ var GIPIAbstractFindComponent = /** @class */ (function (_super) {
27543
27553
  _this.loading = true;
27544
27554
  _this.page = _this.newPage();
27545
27555
  _this.preDelete(id);
27546
- _this.abstractCrudService.delete(id).toPromise().then(function () {
27556
+ _this.abstractCrudService.delete(id, version).toPromise().then(function () {
27547
27557
  if (fetchAgain) {
27548
27558
  _this.findAll();
27549
27559
  }
@@ -27560,7 +27570,7 @@ var GIPIAbstractFindComponent = /** @class */ (function (_super) {
27560
27570
  throw new Error(e);
27561
27571
  }
27562
27572
  };
27563
- GIPIAbstractFindComponent.prototype.deleteAllRegister = function (idList, permission, fetchAgain) {
27573
+ GIPIAbstractFindComponent.prototype.deleteAllRegister = function (idList, permission, fetchAgain, version) {
27564
27574
  if (fetchAgain === void 0) { fetchAgain = true; }
27565
27575
  try {
27566
27576
  idList = this.handleEntityIdList(idList);
@@ -27568,7 +27578,7 @@ var GIPIAbstractFindComponent = /** @class */ (function (_super) {
27568
27578
  return;
27569
27579
  }
27570
27580
  if (StringUtil.isEmpty(permission) && ObjectUtil.isNull(this.basePermissionList)) {
27571
- this._deleteAllRegister(idList, fetchAgain);
27581
+ this._deleteAllRegister(idList, fetchAgain, version);
27572
27582
  }
27573
27583
  else {
27574
27584
  if (StringUtil.isEmpty(permission) && !ObjectUtil.isNull(this.basePermissionList)) {
@@ -27578,7 +27588,7 @@ var GIPIAbstractFindComponent = /** @class */ (function (_super) {
27578
27588
  this.addWarningMessage(INJECTOR.get(APP_MESSAGES).NOT_PERMISSION);
27579
27589
  return;
27580
27590
  }
27581
- this._deleteAllRegister(idList, fetchAgain);
27591
+ this._deleteAllRegister(idList, fetchAgain, version);
27582
27592
  }
27583
27593
  }
27584
27594
  catch (e) {
@@ -27590,7 +27600,7 @@ var GIPIAbstractFindComponent = /** @class */ (function (_super) {
27590
27600
  }
27591
27601
  };
27592
27602
  /** @Internal */
27593
- GIPIAbstractFindComponent.prototype._deleteAllRegister = function (idList, fetchAgain) {
27603
+ GIPIAbstractFindComponent.prototype._deleteAllRegister = function (idList, fetchAgain, version) {
27594
27604
  var _this = this;
27595
27605
  if (fetchAgain === void 0) { fetchAgain = true; }
27596
27606
  try {
@@ -27602,7 +27612,7 @@ var GIPIAbstractFindComponent = /** @class */ (function (_super) {
27602
27612
  _this.loading = true;
27603
27613
  _this.page = _this.newPage();
27604
27614
  _this.preDelete();
27605
- _this.abstractCrudService.deleteAll(idList).toPromise().then(function () {
27615
+ _this.abstractCrudService.deleteAll(idList, version).toPromise().then(function () {
27606
27616
  if (fetchAgain) {
27607
27617
  _this.findAll();
27608
27618
  }
@@ -27648,7 +27658,7 @@ var GIPIAbstractFindComponent = /** @class */ (function (_super) {
27648
27658
  this.viewRegister(id, permission);
27649
27659
  }
27650
27660
  };
27651
- GIPIAbstractFindComponent.prototype.enableOrDisableRegister = function (action, id, permission, fetchAgain) {
27661
+ GIPIAbstractFindComponent.prototype.enableOrDisableRegister = function (action, id, permission, fetchAgain, version) {
27652
27662
  if (fetchAgain === void 0) { fetchAgain = true; }
27653
27663
  try {
27654
27664
  id = this.handleEntityId(id);
@@ -27656,7 +27666,7 @@ var GIPIAbstractFindComponent = /** @class */ (function (_super) {
27656
27666
  return;
27657
27667
  }
27658
27668
  if (StringUtil.isEmpty(permission) && ObjectUtil.isNull(this.basePermissionList)) {
27659
- this._enableOrDisableRegister(action, id, fetchAgain);
27669
+ this._enableOrDisableRegister(action, id, fetchAgain, version);
27660
27670
  }
27661
27671
  else {
27662
27672
  if (StringUtil.isEmpty(permission) && !ObjectUtil.isNull(this.basePermissionList)) {
@@ -27666,7 +27676,7 @@ var GIPIAbstractFindComponent = /** @class */ (function (_super) {
27666
27676
  this.addWarningMessage(INJECTOR.get(APP_MESSAGES).NOT_PERMISSION);
27667
27677
  return;
27668
27678
  }
27669
- this._enableOrDisableRegister(action, id, fetchAgain);
27679
+ this._enableOrDisableRegister(action, id, fetchAgain, version);
27670
27680
  }
27671
27681
  }
27672
27682
  catch (e) {
@@ -27678,7 +27688,7 @@ var GIPIAbstractFindComponent = /** @class */ (function (_super) {
27678
27688
  }
27679
27689
  };
27680
27690
  /** @Internal */
27681
- GIPIAbstractFindComponent.prototype._enableOrDisableRegister = function (action, id, fetchAgain) {
27691
+ GIPIAbstractFindComponent.prototype._enableOrDisableRegister = function (action, id, fetchAgain, version) {
27682
27692
  var _this = this;
27683
27693
  if (fetchAgain === void 0) { fetchAgain = true; }
27684
27694
  try {
@@ -27689,7 +27699,7 @@ var GIPIAbstractFindComponent = /** @class */ (function (_super) {
27689
27699
  _this.setFilterSessionStorage();
27690
27700
  _this.loading = true;
27691
27701
  _this.page = _this.newPage();
27692
- _this.abstractCrudService.enableOrDisable(id, action).toPromise().then(function () {
27702
+ _this.abstractCrudService.enableOrDisable(id, action, version).toPromise().then(function () {
27693
27703
  if (fetchAgain) {
27694
27704
  _this.findAll();
27695
27705
  }
@@ -27706,7 +27716,7 @@ var GIPIAbstractFindComponent = /** @class */ (function (_super) {
27706
27716
  throw new Error(e);
27707
27717
  }
27708
27718
  };
27709
- GIPIAbstractFindComponent.prototype.enableAndDisableAllRegister = function (action, idList, permission, fetchAgain) {
27719
+ GIPIAbstractFindComponent.prototype.enableAndDisableAllRegister = function (action, idList, permission, fetchAgain, version) {
27710
27720
  if (fetchAgain === void 0) { fetchAgain = true; }
27711
27721
  try {
27712
27722
  idList = this.handleEntityIdList(idList);
@@ -27714,7 +27724,7 @@ var GIPIAbstractFindComponent = /** @class */ (function (_super) {
27714
27724
  return;
27715
27725
  }
27716
27726
  if (StringUtil.isEmpty(permission) && ObjectUtil.isNull(this.basePermissionList)) {
27717
- this._enableAndDisableAllRegister(action, idList, fetchAgain);
27727
+ this._enableAndDisableAllRegister(action, idList, fetchAgain, version);
27718
27728
  }
27719
27729
  else {
27720
27730
  if (StringUtil.isEmpty(permission) && !ObjectUtil.isNull(this.basePermissionList)) {
@@ -27724,7 +27734,7 @@ var GIPIAbstractFindComponent = /** @class */ (function (_super) {
27724
27734
  this.addWarningMessage(INJECTOR.get(APP_MESSAGES).NOT_PERMISSION);
27725
27735
  return;
27726
27736
  }
27727
- this._enableAndDisableAllRegister(action, idList, fetchAgain);
27737
+ this._enableAndDisableAllRegister(action, idList, fetchAgain, version);
27728
27738
  }
27729
27739
  }
27730
27740
  catch (e) {
@@ -27736,7 +27746,7 @@ var GIPIAbstractFindComponent = /** @class */ (function (_super) {
27736
27746
  }
27737
27747
  };
27738
27748
  /** @Internal */
27739
- GIPIAbstractFindComponent.prototype._enableAndDisableAllRegister = function (action, idList, fetchAgain) {
27749
+ GIPIAbstractFindComponent.prototype._enableAndDisableAllRegister = function (action, idList, fetchAgain, version) {
27740
27750
  var _this = this;
27741
27751
  if (fetchAgain === void 0) { fetchAgain = true; }
27742
27752
  try {
@@ -27747,7 +27757,7 @@ var GIPIAbstractFindComponent = /** @class */ (function (_super) {
27747
27757
  _this.setFilterSessionStorage();
27748
27758
  _this.loading = true;
27749
27759
  _this.page = _this.newPage();
27750
- _this.abstractCrudService.enableOrDisableAll(idList, action).toPromise().then(function () {
27760
+ _this.abstractCrudService.enableOrDisableAll(idList, action, version).toPromise().then(function () {
27751
27761
  if (fetchAgain) {
27752
27762
  _this.findAll();
27753
27763
  }