zek 19.0.2 → 19.0.4

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.
package/fesm2022/zek.mjs CHANGED
@@ -1540,6 +1540,9 @@ class AuthService {
1540
1540
  const user = StorageHelper.get(AuthService.USER_KEY);
1541
1541
  if (user) {
1542
1542
  this._init(user);
1543
+ if (this._isAuthenticated) {
1544
+ this.emitOnRefreshToken();
1545
+ }
1543
1546
  }
1544
1547
  }
1545
1548
  get _isAuthenticated() {
@@ -1808,19 +1811,25 @@ class CrudService extends BaseService {
1808
1811
  return this.api.delete(`api/${this.controller}/${id}/${id2}`).pipe(catchError(this.handleError(this.delete2.name, null)));
1809
1812
  }
1810
1813
  restore(id) {
1811
- return this.api.patch(`api/${this.controller}/${id}/Restore`).pipe(catchError(this.handleError(this.restore.name, null)));
1814
+ return this.api.patch(`api/${this.controller}/${id}/restore`).pipe(catchError(this.handleError(this.restore.name, null)));
1815
+ }
1816
+ approve(id, model) {
1817
+ return this.api.patch(`api/${this.controller}/${id}/approve`, model).pipe(catchError(this.handleError(this.approve.name, null)));
1812
1818
  }
1813
- approve(model) {
1814
- return this.api.patch(`api/${this.controller}/Approve`, model).pipe(catchError(this.handleError(this.approve.name, null)));
1819
+ bulkApprove(model) {
1820
+ return this.api.patch(`api/${this.controller}/bulk-approve`, model).pipe(catchError(this.handleError(this.bulkApprove.name, null)));
1815
1821
  }
1816
- disapprove(model) {
1817
- return this.api.patch(`api/${this.controller}/Disapprove`, model).pipe(catchError(this.handleError(this.disapprove.name, null)));
1822
+ disapprove(id, model) {
1823
+ return this.api.patch(`api/${this.controller}/${id}/disapprove`, model).pipe(catchError(this.handleError(this.disapprove.name, null)));
1824
+ }
1825
+ bulkDisapprove(model) {
1826
+ return this.api.patch(`api/${this.controller}/bulk-disapprove`, model).pipe(catchError(this.handleError(this.bulkDisapprove.name, null)));
1818
1827
  }
1819
1828
  batch(model) {
1820
- return this.api.post(`api/${this.controller}/Batch`, model).pipe(catchError(this.handleError(this.batch.name, null)));
1829
+ return this.api.post(`api/${this.controller}/batch`, model).pipe(catchError(this.handleError(this.batch.name, null)));
1821
1830
  }
1822
1831
  export(model, fileTypeId) {
1823
- return this.api.getBlob(`api/${this.controller}/Export/${fileTypeId}`, model).pipe(catchError(this.handleError('export', null)));
1832
+ return this.api.getBlob(`api/${this.controller}/export/${fileTypeId}`, model).pipe(catchError(this.handleError('export', null)));
1824
1833
  }
1825
1834
  }
1826
1835
 
@@ -2582,7 +2591,6 @@ class EditFormComponent extends BaseComponent {
2582
2591
  }
2583
2592
  async approve() {
2584
2593
  if (this.id) {
2585
- this.approveModel.ids = [this.id];
2586
2594
  const approved = await this.internalApprove(this.approveModel);
2587
2595
  if (approved) {
2588
2596
  this.load();
@@ -2667,7 +2675,7 @@ class EditBaseComponent extends EditFormComponent {
2667
2675
  }
2668
2676
  }
2669
2677
  async internalApprove(model) {
2670
- const data = await firstValueFrom(this.service.approve(model));
2678
+ const data = await firstValueFrom(this.service.approve(this.id, model));
2671
2679
  if (data && data.length > 0) {
2672
2680
  const message = await firstValueFrom(this.translate.get('Alert.Approved'));
2673
2681
  this.alert.success(message, null, 'fa-solid fa-floppy-disk');
@@ -2680,7 +2688,7 @@ class EditBaseComponent extends EditFormComponent {
2680
2688
  }
2681
2689
  }
2682
2690
  async internalDisapprove(model) {
2683
- const data = await firstValueFrom(this.service.disapprove(model));
2691
+ const data = await firstValueFrom(this.service.disapprove(this.id, model));
2684
2692
  if (data && data.length > 0) {
2685
2693
  const message = await firstValueFrom(this.translate.get('Alert.Disapproved'));
2686
2694
  this.alert.success(message, null, 'fa-solid fa-floppy-disk');
@@ -2693,7 +2701,7 @@ class EditBaseComponent extends EditFormComponent {
2693
2701
  }
2694
2702
  }
2695
2703
  async internalSubmit(model) {
2696
- const data = await firstValueFrom(this.service.approve(model));
2704
+ const data = await firstValueFrom(this.service.approve(this.id, model));
2697
2705
  if (data && data.length > 0) {
2698
2706
  const message = await firstValueFrom(this.translate.get('Alert.Submitted'));
2699
2707
  this.alert.success(message, null, 'fa-solid fa-floppy-disk');
@@ -3391,14 +3399,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
3391
3399
  }] } });
3392
3400
 
3393
3401
  class ZekValidation {
3394
- alertService;
3402
+ alert;
3395
3403
  alerts = [];
3396
3404
  subscription;
3397
- constructor(alertService) {
3398
- this.alertService = alertService;
3405
+ constructor(alert) {
3406
+ this.alert = alert;
3399
3407
  }
3400
3408
  ngOnInit() {
3401
- this.subscription = this.alertService.getAlert().subscribe((alert) => {
3409
+ this.subscription = this.alert.getAlert().subscribe((alert) => {
3402
3410
  if (!alert) {
3403
3411
  // clear alerts when an empty alert is received
3404
3412
  this.alerts = [];
@@ -3412,7 +3420,7 @@ class ZekValidation {
3412
3420
  this.subscription?.unsubscribe();
3413
3421
  }
3414
3422
  clear() {
3415
- this.alertService.clear();
3423
+ this.alert.clear();
3416
3424
  }
3417
3425
  remove(alert) {
3418
3426
  this.alerts = this.alerts.filter(x => x !== alert);