@processmaker/screen-builder 3.6.0 → 3.8.0
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/vue-form-builder.css +1 -1
- package/dist/vue-form-builder.es.js +202 -175
- package/dist/vue-form-builder.es.js.map +1 -1
- package/dist/vue-form-builder.umd.js +21 -21
- package/dist/vue-form-builder.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/task.vue +5 -1
- package/src/components/vue-form-builder.vue +39 -4
- package/src/form-builder-controls.js +1 -0
package/package.json
CHANGED
package/src/components/task.vue
CHANGED
|
@@ -247,7 +247,11 @@ export default {
|
|
|
247
247
|
return json;
|
|
248
248
|
},
|
|
249
249
|
showSimpleErrorMessage() {
|
|
250
|
-
|
|
250
|
+
// This triggers a re-render if it has already been displayed.
|
|
251
|
+
this.renderComponent = null;
|
|
252
|
+
setTimeout(() => {
|
|
253
|
+
this.renderComponent = 'simpleErrorMessage';
|
|
254
|
+
}, 0);
|
|
251
255
|
},
|
|
252
256
|
loadScreen(id) {
|
|
253
257
|
this.disabled = true;
|
|
@@ -1381,16 +1381,22 @@ export default {
|
|
|
1381
1381
|
}
|
|
1382
1382
|
return index > this.pageDelete ? index - 1 : index;
|
|
1383
1383
|
},
|
|
1384
|
+
// This function is used to calculate the new index of the references FormRecordList
|
|
1385
|
+
calcNewIndexForFormRecordList(index, referencedBy) {
|
|
1386
|
+
return index > this.pageDelete ? index - 1 : index;
|
|
1387
|
+
},
|
|
1384
1388
|
// Update Record list references
|
|
1385
1389
|
updateRecordListReferences() {
|
|
1386
1390
|
this.config.forEach((page) => {
|
|
1387
1391
|
page.items.forEach((item) => {
|
|
1388
1392
|
if (item.component === "FormRecordList") {
|
|
1389
1393
|
// eslint-disable-next-line no-param-reassign
|
|
1390
|
-
item.config.form
|
|
1391
|
-
item.config.form
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
+
if (this.isValidInteger(item.config.form)) {
|
|
1395
|
+
item.config.form = this.calcNewIndexForFormRecordList(
|
|
1396
|
+
item.config.form * 1,
|
|
1397
|
+
item.config.label,
|
|
1398
|
+
);
|
|
1399
|
+
}
|
|
1394
1400
|
}
|
|
1395
1401
|
});
|
|
1396
1402
|
});
|
|
@@ -1414,6 +1420,9 @@ export default {
|
|
|
1414
1420
|
},
|
|
1415
1421
|
async deletePage() {
|
|
1416
1422
|
const back = _.cloneDeep(this.config);
|
|
1423
|
+
if(!this.isNotReferenceToRecordForm()) {
|
|
1424
|
+
return;
|
|
1425
|
+
}
|
|
1417
1426
|
try {
|
|
1418
1427
|
this.updateRecordListReferences();
|
|
1419
1428
|
this.updateNavigationButtonsReferences();
|
|
@@ -1434,6 +1443,32 @@ export default {
|
|
|
1434
1443
|
});
|
|
1435
1444
|
this.$store.dispatch("clipboardModule/pushState", this.clipboardPage.items);
|
|
1436
1445
|
},
|
|
1446
|
+
isNotReferenceToRecordForm() {
|
|
1447
|
+
for (let page of this.config) {
|
|
1448
|
+
for (let item of page.items) {
|
|
1449
|
+
if (item.component === "FormRecordList") {
|
|
1450
|
+
if (this.isValidInteger(item.config.form) && Number(item.config.form) === this.pageDelete) {
|
|
1451
|
+
const referencedBy = item.config.label;
|
|
1452
|
+
const message = `${this.$t("Can not delete this page, it is referenced by")}: ${referencedBy}`;
|
|
1453
|
+
globalObject.ProcessMaker.alert(message, "danger");
|
|
1454
|
+
return false;
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
return true;
|
|
1460
|
+
},
|
|
1461
|
+
isValidInteger(value) {
|
|
1462
|
+
if (typeof value === 'boolean' || value === null || value === undefined) {
|
|
1463
|
+
return false;
|
|
1464
|
+
}
|
|
1465
|
+
const str = String(value).trim();
|
|
1466
|
+
if (str === '') {
|
|
1467
|
+
return false;
|
|
1468
|
+
}
|
|
1469
|
+
const num = Number(str);
|
|
1470
|
+
return Number.isInteger(num);
|
|
1471
|
+
},
|
|
1437
1472
|
inspect(element = {}) {
|
|
1438
1473
|
this.closeTemplatesPanel();
|
|
1439
1474
|
this.inspection = element;
|