@sumaris-net/ngx-components 1.20.39 → 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.
- package/bundles/sumaris-net.ngx-components.umd.js +30 -10
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/esm2015/src/app/core/form/entity-editor-modal.class.js +17 -6
- package/fesm2015/sumaris-net.ngx-components.js +16 -5
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/src/app/core/form/entity-editor-modal.class.d.ts +1 -0
- package/sumaris-net.ngx-components.metadata.json +1 -1
|
@@ -29775,18 +29775,22 @@
|
|
|
29775
29775
|
console.debug(this._logPrefix + 'Saving data...');
|
|
29776
29776
|
_c.label = 2;
|
|
29777
29777
|
case 2:
|
|
29778
|
-
_c.trys.push([2,
|
|
29779
|
-
|
|
29780
|
-
|
|
29781
|
-
|
|
29782
|
-
|
|
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
|
|
29783
29785
|
_b = this;
|
|
29784
29786
|
return [4 /*yield*/, this.getValue()];
|
|
29785
|
-
case
|
|
29787
|
+
case 4:
|
|
29788
|
+
// Fill data
|
|
29786
29789
|
_b.data = _c.sent();
|
|
29790
|
+
// Mark as submitted
|
|
29787
29791
|
this.submitted = true;
|
|
29788
|
-
return [2 /*return*/,
|
|
29789
|
-
case
|
|
29792
|
+
return [2 /*return*/, true];
|
|
29793
|
+
case 5:
|
|
29790
29794
|
err_2 = _c.sent();
|
|
29791
29795
|
this.submitted = true;
|
|
29792
29796
|
this.setError(err_2);
|
|
@@ -29795,10 +29799,10 @@
|
|
|
29795
29799
|
this.markAsDirty();
|
|
29796
29800
|
this.enable();
|
|
29797
29801
|
return [2 /*return*/, false];
|
|
29798
|
-
case
|
|
29802
|
+
case 6:
|
|
29799
29803
|
this.markAsSaved();
|
|
29800
29804
|
return [7 /*endfinally*/];
|
|
29801
|
-
case
|
|
29805
|
+
case 7: return [2 /*return*/];
|
|
29802
29806
|
}
|
|
29803
29807
|
});
|
|
29804
29808
|
});
|
|
@@ -29922,6 +29926,22 @@
|
|
|
29922
29926
|
this.markForCheck();
|
|
29923
29927
|
};
|
|
29924
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
|
+
};
|
|
29925
29945
|
AppEntityEditorModal.prototype.waitWhilePending = function (opts) {
|
|
29926
29946
|
return AppFormUtils.waitWhilePending(this, opts);
|
|
29927
29947
|
};
|