@sumaris-net/ngx-components 1.20.37 → 1.20.40

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.
@@ -4750,7 +4750,7 @@
4750
4750
  function FormGetControlPipe() {
4751
4751
  }
4752
4752
  FormGetControlPipe.prototype.transform = function (form, path) {
4753
- return (form && path && form.get(path) || form);
4753
+ return (form && isNotNil(path) && form.get(path) || form);
4754
4754
  };
4755
4755
  return FormGetControlPipe;
4756
4756
  }());
@@ -15213,7 +15213,8 @@
15213
15213
  console.debug('[graphql] Apply token authentication to headers');
15214
15214
  this.connectionParams.authToken = token;
15215
15215
  }
15216
- else {
15216
+ // Clean auth token
15217
+ else if (this.connectionParams.authToken) {
15217
15218
  console.debug('[graphql] Remove token authentication from headers');
15218
15219
  delete this.connectionParams.authToken;
15219
15220
  // Clear cache
@@ -15225,7 +15226,8 @@
15225
15226
  console.debug('[graphql] Apply basic authentication to headers');
15226
15227
  this.connectionParams.authBasic = basic;
15227
15228
  }
15228
- else {
15229
+ // Clean auth basic
15230
+ else if (this.connectionParams.authBasic) {
15229
15231
  console.debug('[graphql] Remove basic authentication from headers');
15230
15232
  delete this.connectionParams.authBasic;
15231
15233
  // Clear cache
@@ -29773,18 +29775,22 @@
29773
29775
  console.debug(this._logPrefix + 'Saving data...');
29774
29776
  _c.label = 2;
29775
29777
  case 2:
29776
- _c.trys.push([2, 4, 5, 6]);
29777
- saved = Promise.all((this.tables || [])
29778
- .filter(function (c) { return c.dirty; })
29779
- .map(function (c) { return c.save(); }))
29780
- .then(function (res) { return res.findIndex(function (r) { return r !== true; }) === -1; });
29778
+ _c.trys.push([2, 5, 6, 7]);
29779
+ return [4 /*yield*/, this.saveDirtyTables()];
29780
+ case 3:
29781
+ saved = _c.sent();
29782
+ if (!saved)
29783
+ return [2 /*return*/, false];
29784
+ // Fill data
29781
29785
  _b = this;
29782
29786
  return [4 /*yield*/, this.getValue()];
29783
- case 3:
29787
+ case 4:
29788
+ // Fill data
29784
29789
  _b.data = _c.sent();
29790
+ // Mark as submitted
29785
29791
  this.submitted = true;
29786
- return [2 /*return*/, saved];
29787
- case 4:
29792
+ return [2 /*return*/, true];
29793
+ case 5:
29788
29794
  err_2 = _c.sent();
29789
29795
  this.submitted = true;
29790
29796
  this.setError(err_2);
@@ -29793,10 +29799,10 @@
29793
29799
  this.markAsDirty();
29794
29800
  this.enable();
29795
29801
  return [2 /*return*/, false];
29796
- case 5:
29802
+ case 6:
29797
29803
  this.markAsSaved();
29798
29804
  return [7 /*endfinally*/];
29799
- case 6: return [2 /*return*/];
29805
+ case 7: return [2 /*return*/];
29800
29806
  }
29801
29807
  });
29802
29808
  });
@@ -29920,6 +29926,22 @@
29920
29926
  this.markForCheck();
29921
29927
  };
29922
29928
  /* -- protected methods -- */
29929
+ AppEntityEditorModal.prototype.saveDirtyTables = function () {
29930
+ return __awaiter(this, void 0, void 0, function () {
29931
+ var results, saved;
29932
+ return __generator(this, function (_b) {
29933
+ switch (_b.label) {
29934
+ case 0: return [4 /*yield*/, Promise.all((this.tables || [])
29935
+ .filter(function (c) { return c.dirty; })
29936
+ .map(function (c) { return c.save(); }))];
29937
+ case 1:
29938
+ results = _b.sent();
29939
+ saved = results.findIndex(function (result) { return result !== true; }) === -1;
29940
+ return [2 /*return*/, saved];
29941
+ }
29942
+ });
29943
+ });
29944
+ };
29923
29945
  AppEntityEditorModal.prototype.waitWhilePending = function (opts) {
29924
29946
  return AppFormUtils.waitWhilePending(this, opts);
29925
29947
  };