web-mojo 2.1.1098 → 2.1.1100
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/dist/admin.cjs.js +1 -1
- package/dist/admin.es.js +9 -9
- package/dist/auth.cjs.js +1 -1
- package/dist/auth.es.js +1 -1
- package/dist/charts.cjs.js +1 -1
- package/dist/charts.es.js +3 -3
- package/dist/chunks/{ChatView-BCtENksD.js → ChatView-D5QdhLLu.js} +2 -2
- package/dist/chunks/{ChatView-BCtENksD.js.map → ChatView-D5QdhLLu.js.map} +1 -1
- package/dist/chunks/{ChatView-CYJPSylg.js → ChatView-SeOtA6Ln.js} +6 -6
- package/dist/chunks/{ChatView-CYJPSylg.js.map → ChatView-SeOtA6Ln.js.map} +1 -1
- package/dist/chunks/{Collection-DpdzB_n7.js → Collection-CsAk0UhA.js} +2 -2
- package/dist/chunks/{Collection-DpdzB_n7.js.map → Collection-CsAk0UhA.js.map} +1 -1
- package/dist/chunks/{ContextMenu-CLRRrCUp.js → ContextMenu-Dfdrnd0f.js} +2 -2
- package/dist/chunks/{ContextMenu-CLRRrCUp.js.map → ContextMenu-Dfdrnd0f.js.map} +1 -1
- package/dist/chunks/{Dialog-ua-xN2r0.js → Dialog-Ba8-_bwZ.js} +2 -2
- package/dist/chunks/{Dialog-ua-xN2r0.js.map → Dialog-Ba8-_bwZ.js.map} +1 -1
- package/dist/chunks/{Dialog-CJI-4RvO.js → Dialog-DhUxk9f6.js} +3 -3
- package/dist/chunks/{Dialog-CJI-4RvO.js.map → Dialog-DhUxk9f6.js.map} +1 -1
- package/dist/chunks/{FormView-Cd20wDM9.js → FormView-6msHIICZ.js} +3 -3
- package/dist/chunks/{FormView-Cd20wDM9.js.map → FormView-6msHIICZ.js.map} +1 -1
- package/dist/chunks/{FormView-kvFr4UJs.js → FormView-BhNE8_ux.js} +49 -5
- package/dist/chunks/{FormView-kvFr4UJs.js.map → FormView-BhNE8_ux.js.map} +1 -1
- package/dist/chunks/{ListView-B2gyVSMW.js → ListView-BGJG4GYH.js} +2 -2
- package/dist/chunks/{ListView-B2gyVSMW.js.map → ListView-BGJG4GYH.js.map} +1 -1
- package/dist/chunks/{MetricsMiniChartWidget-B-DkwhEe.js → MetricsMiniChartWidget-DpdCMZZq.js} +2 -2
- package/dist/chunks/{MetricsMiniChartWidget-B-DkwhEe.js.map → MetricsMiniChartWidget-DpdCMZZq.js.map} +1 -1
- package/dist/chunks/{MetricsMiniChartWidget-Dt_tkyLi.js → MetricsMiniChartWidget-jCLMh6Bm.js} +2 -2
- package/dist/chunks/{MetricsMiniChartWidget-Dt_tkyLi.js.map → MetricsMiniChartWidget-jCLMh6Bm.js.map} +1 -1
- package/dist/chunks/{PDFViewer-etF76Hp4.js → PDFViewer-Daqgh9u9.js} +2 -2
- package/dist/chunks/{PDFViewer-etF76Hp4.js.map → PDFViewer-Daqgh9u9.js.map} +1 -1
- package/dist/chunks/{PDFViewer-TJVI4Fk_.js → PDFViewer-kcsI_Orb.js} +2 -2
- package/dist/chunks/{PDFViewer-TJVI4Fk_.js.map → PDFViewer-kcsI_Orb.js.map} +1 -1
- package/dist/chunks/{TokenManager-D_DIqspn.js → TokenManager-B8v1e48O.js} +4 -4
- package/dist/chunks/{TokenManager-D_DIqspn.js.map → TokenManager-B8v1e48O.js.map} +1 -1
- package/dist/chunks/{TokenManager-DVaAsp-g.js → TokenManager-_H9DetR8.js} +2 -2
- package/dist/chunks/{TokenManager-DVaAsp-g.js.map → TokenManager-_H9DetR8.js.map} +1 -1
- package/dist/chunks/{version-BSojz3ia.js → version-DMeIxex5.js} +4 -4
- package/dist/chunks/{version-BSojz3ia.js.map → version-DMeIxex5.js.map} +1 -1
- package/dist/chunks/{version-Cf0LAYex.js → version-DQJsIARK.js} +2 -2
- package/dist/chunks/{version-Cf0LAYex.js.map → version-DQJsIARK.js.map} +1 -1
- package/dist/docit.cjs.js +1 -1
- package/dist/docit.es.js +5 -5
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +11 -11
- package/dist/lightbox.cjs.js +1 -1
- package/dist/lightbox.es.js +4 -4
- package/dist/map.es.js +1 -1
- package/dist/timeline.es.js +2 -2
- package/package.json +1 -1
|
@@ -6198,15 +6198,25 @@ class FormView extends View {
|
|
|
6198
6198
|
*/
|
|
6199
6199
|
async executeBatchSave() {
|
|
6200
6200
|
if (this.isSaving || this.pendingSaveFields.size === 0) return;
|
|
6201
|
+
const changes = Object.fromEntries(this.pendingSaveFields);
|
|
6202
|
+
const fieldNames = Array.from(this.pendingSaveFields.keys());
|
|
6201
6203
|
try {
|
|
6202
6204
|
this.isSaving = true;
|
|
6203
|
-
const changes = Object.fromEntries(this.pendingSaveFields);
|
|
6204
|
-
const fieldNames = Array.from(this.pendingSaveFields.keys());
|
|
6205
6205
|
this.pendingSaveFields.clear();
|
|
6206
6206
|
this.batchSaveTimeout = null;
|
|
6207
6207
|
this._isFormDrivenChange = true;
|
|
6208
6208
|
if (typeof this.model.save === "function") {
|
|
6209
|
-
await this.model.save(changes);
|
|
6209
|
+
const resp = await this.model.save(changes);
|
|
6210
|
+
if (!resp || !resp.success || resp.data && !resp.data.status) {
|
|
6211
|
+
const errorMsg = resp?.data?.error || resp?.error || resp?.message || "Save failed";
|
|
6212
|
+
this.getApp()?.toast?.error(errorMsg);
|
|
6213
|
+
this.revertFields(fieldNames);
|
|
6214
|
+
fieldNames.forEach((fieldName) => {
|
|
6215
|
+
const statusManager = this.getFieldStatusManager(fieldName);
|
|
6216
|
+
statusManager.showStatus("error", { message: errorMsg });
|
|
6217
|
+
});
|
|
6218
|
+
return;
|
|
6219
|
+
}
|
|
6210
6220
|
} else {
|
|
6211
6221
|
Object.entries(changes).forEach(([key, val]) => {
|
|
6212
6222
|
this.model.set(key, val);
|
|
@@ -6218,7 +6228,9 @@ class FormView extends View {
|
|
|
6218
6228
|
});
|
|
6219
6229
|
} catch (error) {
|
|
6220
6230
|
console.error("Batch save error:", error);
|
|
6221
|
-
|
|
6231
|
+
this.getApp()?.toast?.error(error.message || "An error occurred while saving");
|
|
6232
|
+
this.revertFields(fieldNames);
|
|
6233
|
+
fieldNames.forEach((fieldName) => {
|
|
6222
6234
|
const statusManager = this.getFieldStatusManager(fieldName);
|
|
6223
6235
|
statusManager.showStatus("error", { message: error.message });
|
|
6224
6236
|
});
|
|
@@ -6226,6 +6238,38 @@ class FormView extends View {
|
|
|
6226
6238
|
this.isSaving = false;
|
|
6227
6239
|
}
|
|
6228
6240
|
}
|
|
6241
|
+
/**
|
|
6242
|
+
* Revert form fields to their original model values
|
|
6243
|
+
* Called when save fails to keep UI in sync with server state
|
|
6244
|
+
* @param {Array<string>} fieldNames - Names of fields to revert
|
|
6245
|
+
* @private
|
|
6246
|
+
*/
|
|
6247
|
+
revertFields(fieldNames) {
|
|
6248
|
+
if (!this.model) return;
|
|
6249
|
+
const wasPopulating = this._isPopulating;
|
|
6250
|
+
this._isPopulating = true;
|
|
6251
|
+
try {
|
|
6252
|
+
fieldNames.forEach((fieldName) => {
|
|
6253
|
+
const originalValue = this.model.get(fieldName);
|
|
6254
|
+
this.data[fieldName] = originalValue;
|
|
6255
|
+
const fieldElement = this.element?.querySelector(`[name="${fieldName}"]`);
|
|
6256
|
+
if (fieldElement) {
|
|
6257
|
+
const fieldConfig = this.getFormFieldConfig(fieldName);
|
|
6258
|
+
if (fieldConfig) {
|
|
6259
|
+
this.setFieldValue(fieldElement, fieldConfig, originalValue);
|
|
6260
|
+
} else {
|
|
6261
|
+
if (fieldElement.type === "checkbox") {
|
|
6262
|
+
fieldElement.checked = Boolean(originalValue);
|
|
6263
|
+
} else {
|
|
6264
|
+
fieldElement.value = originalValue ?? "";
|
|
6265
|
+
}
|
|
6266
|
+
}
|
|
6267
|
+
}
|
|
6268
|
+
});
|
|
6269
|
+
} finally {
|
|
6270
|
+
this._isPopulating = wasPopulating;
|
|
6271
|
+
}
|
|
6272
|
+
}
|
|
6229
6273
|
/**
|
|
6230
6274
|
* Get or create a field status manager for a specific field
|
|
6231
6275
|
* @param {string} fieldName - Name of the field
|
|
@@ -7784,4 +7828,4 @@ export {
|
|
|
7784
7828
|
applyFileDropMixin as a,
|
|
7785
7829
|
FormView$1 as b
|
|
7786
7830
|
};
|
|
7787
|
-
//# sourceMappingURL=FormView-
|
|
7831
|
+
//# sourceMappingURL=FormView-BhNE8_ux.js.map
|