@saltcorn/data 1.4.0-beta.1 → 1.4.0-beta.10
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/base-plugin/actions.d.ts +157 -49
- package/dist/base-plugin/actions.d.ts.map +1 -1
- package/dist/base-plugin/actions.js +116 -16
- package/dist/base-plugin/actions.js.map +1 -1
- package/dist/base-plugin/fileviews.js +3 -3
- package/dist/base-plugin/fileviews.js.map +1 -1
- package/dist/base-plugin/index.d.ts.map +1 -1
- package/dist/base-plugin/viewtemplates/edit.d.ts.map +1 -1
- package/dist/base-plugin/viewtemplates/edit.js +12 -12
- package/dist/base-plugin/viewtemplates/edit.js.map +1 -1
- package/dist/base-plugin/viewtemplates/list.d.ts.map +1 -1
- package/dist/base-plugin/viewtemplates/list.js +52 -2
- package/dist/base-plugin/viewtemplates/list.js.map +1 -1
- package/dist/base-plugin/viewtemplates/viewable_fields.d.ts +1 -1
- package/dist/base-plugin/viewtemplates/viewable_fields.d.ts.map +1 -1
- package/dist/base-plugin/viewtemplates/viewable_fields.js +9 -8
- package/dist/base-plugin/viewtemplates/viewable_fields.js.map +1 -1
- package/dist/db/state.d.ts +9 -3
- package/dist/db/state.d.ts.map +1 -1
- package/dist/db/state.js +55 -29
- package/dist/db/state.js.map +1 -1
- package/dist/models/config.d.ts.map +1 -1
- package/dist/models/config.js +9 -0
- package/dist/models/config.js.map +1 -1
- package/dist/models/crash.d.ts.map +1 -1
- package/dist/models/crash.js +9 -3
- package/dist/models/crash.js.map +1 -1
- package/dist/models/expression.d.ts +1 -1
- package/dist/models/expression.d.ts.map +1 -1
- package/dist/models/expression.js +4 -2
- package/dist/models/expression.js.map +1 -1
- package/dist/models/fieldrepeat.d.ts +1 -1
- package/dist/models/fieldrepeat.d.ts.map +1 -1
- package/dist/models/fieldrepeat.js +12 -4
- package/dist/models/fieldrepeat.js.map +1 -1
- package/dist/models/file.d.ts.map +1 -1
- package/dist/models/file.js +2 -0
- package/dist/models/file.js.map +1 -1
- package/dist/models/form.js +1 -1
- package/dist/models/form.js.map +1 -1
- package/dist/models/index.d.ts +1 -1
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/page.d.ts.map +1 -1
- package/dist/models/page.js +2 -1
- package/dist/models/page.js.map +1 -1
- package/dist/models/scheduler.d.ts.map +1 -1
- package/dist/models/scheduler.js +2 -1
- package/dist/models/scheduler.js.map +1 -1
- package/dist/models/table.d.ts +17 -8
- package/dist/models/table.d.ts.map +1 -1
- package/dist/models/table.js +151 -80
- package/dist/models/table.js.map +1 -1
- package/dist/models/trigger.d.ts.map +1 -1
- package/dist/models/trigger.js +1 -1
- package/dist/models/trigger.js.map +1 -1
- package/dist/models/workflow_run.d.ts +1 -1
- package/dist/models/workflow_run.d.ts.map +1 -1
- package/dist/models/workflow_run.js +30 -5
- package/dist/models/workflow_run.js.map +1 -1
- package/dist/plugin-helper.d.ts.map +1 -1
- package/dist/plugin-helper.js +73 -2
- package/dist/plugin-helper.js.map +1 -1
- package/dist/tests/actions.test.js +18 -2
- package/dist/tests/actions.test.js.map +1 -1
- package/dist/tests/auth.test.js +15 -2
- package/dist/tests/auth.test.js.map +1 -1
- package/dist/tests/calc.test.js +5 -0
- package/dist/tests/calc.test.js.map +1 -1
- package/dist/tests/edit.test.js +2 -2
- package/dist/tests/edit.test.js.map +1 -1
- package/dist/tests/exact_views.test.js +4 -4
- package/dist/tests/exact_views.test.js.map +1 -1
- package/dist/tests/form.test.js +65 -0
- package/dist/tests/form.test.js.map +1 -1
- package/package.json +8 -8
|
@@ -706,7 +706,7 @@ export namespace delete_rows {
|
|
|
706
706
|
table_name: any;
|
|
707
707
|
};
|
|
708
708
|
user: any;
|
|
709
|
-
}): Promise<
|
|
709
|
+
}): Promise<{}>;
|
|
710
710
|
export { run_10 as run };
|
|
711
711
|
let namespace_10: string;
|
|
712
712
|
export { namespace_10 as namespace };
|
|
@@ -1217,10 +1217,118 @@ export namespace reload_embedded_view {
|
|
|
1217
1217
|
let namespace_20: string;
|
|
1218
1218
|
export { namespace_20 as namespace };
|
|
1219
1219
|
}
|
|
1220
|
-
export namespace
|
|
1220
|
+
export namespace progress_bar {
|
|
1221
1221
|
let description_21: string;
|
|
1222
1222
|
export { description_21 as description };
|
|
1223
1223
|
let configFields_22: ({
|
|
1224
|
+
name: string;
|
|
1225
|
+
label: string;
|
|
1226
|
+
sublabel: string;
|
|
1227
|
+
type: string;
|
|
1228
|
+
class?: undefined;
|
|
1229
|
+
required?: undefined;
|
|
1230
|
+
showIf?: undefined;
|
|
1231
|
+
attributes?: undefined;
|
|
1232
|
+
} | {
|
|
1233
|
+
name: string;
|
|
1234
|
+
label: string;
|
|
1235
|
+
type: string;
|
|
1236
|
+
class: string;
|
|
1237
|
+
required: boolean;
|
|
1238
|
+
sublabel: string;
|
|
1239
|
+
showIf: {
|
|
1240
|
+
blocking: boolean;
|
|
1241
|
+
close: boolean;
|
|
1242
|
+
};
|
|
1243
|
+
attributes?: undefined;
|
|
1244
|
+
} | {
|
|
1245
|
+
name: string;
|
|
1246
|
+
label: string;
|
|
1247
|
+
type: string;
|
|
1248
|
+
sublabel: string;
|
|
1249
|
+
showIf: {
|
|
1250
|
+
blocking: boolean;
|
|
1251
|
+
close: boolean;
|
|
1252
|
+
};
|
|
1253
|
+
class?: undefined;
|
|
1254
|
+
required?: undefined;
|
|
1255
|
+
attributes?: undefined;
|
|
1256
|
+
} | {
|
|
1257
|
+
name: string;
|
|
1258
|
+
label: string;
|
|
1259
|
+
type: string;
|
|
1260
|
+
showIf: {
|
|
1261
|
+
blocking: boolean;
|
|
1262
|
+
close: boolean;
|
|
1263
|
+
};
|
|
1264
|
+
sublabel?: undefined;
|
|
1265
|
+
class?: undefined;
|
|
1266
|
+
required?: undefined;
|
|
1267
|
+
attributes?: undefined;
|
|
1268
|
+
} | {
|
|
1269
|
+
name: string;
|
|
1270
|
+
label: string;
|
|
1271
|
+
type: string;
|
|
1272
|
+
showIf: {
|
|
1273
|
+
close: boolean;
|
|
1274
|
+
blocking?: undefined;
|
|
1275
|
+
};
|
|
1276
|
+
sublabel?: undefined;
|
|
1277
|
+
class?: undefined;
|
|
1278
|
+
required?: undefined;
|
|
1279
|
+
attributes?: undefined;
|
|
1280
|
+
} | {
|
|
1281
|
+
name: string;
|
|
1282
|
+
label: string;
|
|
1283
|
+
type: string;
|
|
1284
|
+
sublabel: string;
|
|
1285
|
+
attributes: {
|
|
1286
|
+
min: number;
|
|
1287
|
+
max: number;
|
|
1288
|
+
};
|
|
1289
|
+
showIf: {
|
|
1290
|
+
close: boolean;
|
|
1291
|
+
blocking?: undefined;
|
|
1292
|
+
};
|
|
1293
|
+
class?: undefined;
|
|
1294
|
+
required?: undefined;
|
|
1295
|
+
})[];
|
|
1296
|
+
export { configFields_22 as configFields };
|
|
1297
|
+
export function run_20({ row, user, configuration: { blocking, id, close, title, message, percent, maxHeight, popupWidth, }, req, }: {
|
|
1298
|
+
row: any;
|
|
1299
|
+
user: any;
|
|
1300
|
+
configuration: {
|
|
1301
|
+
blocking: any;
|
|
1302
|
+
id: any;
|
|
1303
|
+
close: any;
|
|
1304
|
+
title: any;
|
|
1305
|
+
message: any;
|
|
1306
|
+
percent: any;
|
|
1307
|
+
maxHeight: any;
|
|
1308
|
+
popupWidth: any;
|
|
1309
|
+
};
|
|
1310
|
+
req: any;
|
|
1311
|
+
}): Promise<{
|
|
1312
|
+
page_load_tag: any;
|
|
1313
|
+
progress_bar_update: {
|
|
1314
|
+
blocking: any;
|
|
1315
|
+
id: string;
|
|
1316
|
+
close: any;
|
|
1317
|
+
message: string;
|
|
1318
|
+
title: string;
|
|
1319
|
+
percent: any;
|
|
1320
|
+
maxHeight: any;
|
|
1321
|
+
popupWidth: any;
|
|
1322
|
+
};
|
|
1323
|
+
}>;
|
|
1324
|
+
export { run_20 as run };
|
|
1325
|
+
let namespace_21: string;
|
|
1326
|
+
export { namespace_21 as namespace };
|
|
1327
|
+
}
|
|
1328
|
+
export namespace sleep {
|
|
1329
|
+
let description_22: string;
|
|
1330
|
+
export { description_22 as description };
|
|
1331
|
+
let configFields_23: ({
|
|
1224
1332
|
name: string;
|
|
1225
1333
|
label: string;
|
|
1226
1334
|
type: string;
|
|
@@ -1235,8 +1343,8 @@ export namespace sleep {
|
|
|
1235
1343
|
type?: undefined;
|
|
1236
1344
|
required?: undefined;
|
|
1237
1345
|
})[];
|
|
1238
|
-
export {
|
|
1239
|
-
export function
|
|
1346
|
+
export { configFields_23 as configFields };
|
|
1347
|
+
export function run_21({ configuration: { seconds, sleep_where } }: {
|
|
1240
1348
|
configuration: {
|
|
1241
1349
|
seconds: any;
|
|
1242
1350
|
sleep_where: any;
|
|
@@ -1244,25 +1352,25 @@ export namespace sleep {
|
|
|
1244
1352
|
}): Promise<{
|
|
1245
1353
|
eval_js: string;
|
|
1246
1354
|
} | undefined>;
|
|
1247
|
-
export {
|
|
1248
|
-
let
|
|
1249
|
-
export {
|
|
1355
|
+
export { run_21 as run };
|
|
1356
|
+
let namespace_22: string;
|
|
1357
|
+
export { namespace_22 as namespace };
|
|
1250
1358
|
}
|
|
1251
1359
|
export namespace refresh_user_session {
|
|
1252
|
-
let
|
|
1253
|
-
export {
|
|
1254
|
-
export function
|
|
1360
|
+
let description_23: string;
|
|
1361
|
+
export { description_23 as description };
|
|
1362
|
+
export function run_22({ user, req }: {
|
|
1255
1363
|
user: any;
|
|
1256
1364
|
req: any;
|
|
1257
1365
|
}): Promise<void>;
|
|
1258
|
-
export {
|
|
1259
|
-
let
|
|
1260
|
-
export {
|
|
1366
|
+
export { run_22 as run };
|
|
1367
|
+
let namespace_23: string;
|
|
1368
|
+
export { namespace_23 as namespace };
|
|
1261
1369
|
}
|
|
1262
1370
|
export namespace notify_user {
|
|
1263
|
-
let
|
|
1264
|
-
export {
|
|
1265
|
-
export function
|
|
1371
|
+
let description_24: string;
|
|
1372
|
+
export { description_24 as description };
|
|
1373
|
+
export function configFields_24(): ({
|
|
1266
1374
|
name: string;
|
|
1267
1375
|
label: string;
|
|
1268
1376
|
type: string;
|
|
@@ -1273,20 +1381,20 @@ export namespace notify_user {
|
|
|
1273
1381
|
required: boolean;
|
|
1274
1382
|
type: string;
|
|
1275
1383
|
})[];
|
|
1276
|
-
export {
|
|
1277
|
-
export function
|
|
1384
|
+
export { configFields_24 as configFields };
|
|
1385
|
+
export function run_23({ row, user, configuration: { title, body, link, user_spec }, }: {
|
|
1278
1386
|
row: object;
|
|
1279
1387
|
configuration: object;
|
|
1280
1388
|
user: object;
|
|
1281
1389
|
}): Promise<void>;
|
|
1282
|
-
export {
|
|
1283
|
-
let
|
|
1284
|
-
export {
|
|
1390
|
+
export { run_23 as run };
|
|
1391
|
+
let namespace_24: string;
|
|
1392
|
+
export { namespace_24 as namespace };
|
|
1285
1393
|
}
|
|
1286
1394
|
export namespace convert_session_to_user {
|
|
1287
|
-
let
|
|
1288
|
-
export {
|
|
1289
|
-
export function
|
|
1395
|
+
let description_25: string;
|
|
1396
|
+
export { description_25 as description };
|
|
1397
|
+
export function configFields_25({ table }: {
|
|
1290
1398
|
table: any;
|
|
1291
1399
|
}): Promise<({
|
|
1292
1400
|
name: string;
|
|
@@ -1307,8 +1415,8 @@ export namespace convert_session_to_user {
|
|
|
1307
1415
|
input_type?: undefined;
|
|
1308
1416
|
options?: undefined;
|
|
1309
1417
|
})[]>;
|
|
1310
|
-
export {
|
|
1311
|
-
export function
|
|
1418
|
+
export { configFields_25 as configFields };
|
|
1419
|
+
export function run_24({ row, configuration: { table_name, session_field, user_field }, user, }: {
|
|
1312
1420
|
row: any;
|
|
1313
1421
|
configuration: {
|
|
1314
1422
|
table_name: any;
|
|
@@ -1317,15 +1425,15 @@ export namespace convert_session_to_user {
|
|
|
1317
1425
|
};
|
|
1318
1426
|
user: any;
|
|
1319
1427
|
}): Promise<void>;
|
|
1320
|
-
export {
|
|
1321
|
-
let
|
|
1322
|
-
export {
|
|
1428
|
+
export { run_24 as run };
|
|
1429
|
+
let namespace_25: string;
|
|
1430
|
+
export { namespace_25 as namespace };
|
|
1323
1431
|
}
|
|
1324
1432
|
export namespace train_model_instance {
|
|
1325
|
-
let
|
|
1326
|
-
export {
|
|
1433
|
+
let description_26: string;
|
|
1434
|
+
export { description_26 as description };
|
|
1327
1435
|
export function disableIf(): boolean;
|
|
1328
|
-
export function
|
|
1436
|
+
export function configFields_26(): Promise<({
|
|
1329
1437
|
name: string;
|
|
1330
1438
|
label: string;
|
|
1331
1439
|
input_type: string;
|
|
@@ -1364,8 +1472,8 @@ export namespace train_model_instance {
|
|
|
1364
1472
|
options?: undefined;
|
|
1365
1473
|
attributes?: undefined;
|
|
1366
1474
|
})[]>;
|
|
1367
|
-
export {
|
|
1368
|
-
export function
|
|
1475
|
+
export { configFields_26 as configFields };
|
|
1476
|
+
export function run_25({ row, configuration: { model_id, instance_name, where, hyperparameters }, user, }: {
|
|
1369
1477
|
row: any;
|
|
1370
1478
|
configuration: {
|
|
1371
1479
|
model_id: any;
|
|
@@ -1375,14 +1483,14 @@ export namespace train_model_instance {
|
|
|
1375
1483
|
};
|
|
1376
1484
|
user: any;
|
|
1377
1485
|
}): Promise<void>;
|
|
1378
|
-
export {
|
|
1379
|
-
let
|
|
1380
|
-
export {
|
|
1486
|
+
export { run_25 as run };
|
|
1487
|
+
let namespace_26: string;
|
|
1488
|
+
export { namespace_26 as namespace };
|
|
1381
1489
|
}
|
|
1382
1490
|
export namespace download_file_to_browser {
|
|
1383
|
-
let
|
|
1384
|
-
export {
|
|
1385
|
-
export function
|
|
1491
|
+
let description_27: string;
|
|
1492
|
+
export { description_27 as description };
|
|
1493
|
+
export function configFields_27({ table, mode }: {
|
|
1386
1494
|
table: any;
|
|
1387
1495
|
mode: any;
|
|
1388
1496
|
}): Promise<{
|
|
@@ -1400,8 +1508,8 @@ export namespace download_file_to_browser {
|
|
|
1400
1508
|
options: any;
|
|
1401
1509
|
};
|
|
1402
1510
|
}[]>;
|
|
1403
|
-
export {
|
|
1404
|
-
export function
|
|
1511
|
+
export { configFields_27 as configFields };
|
|
1512
|
+
export function run_26({ row, configuration: { filepath_expr, file_field }, user, mode, }: {
|
|
1405
1513
|
row: any;
|
|
1406
1514
|
configuration: {
|
|
1407
1515
|
filepath_expr: any;
|
|
@@ -1416,14 +1524,14 @@ export namespace download_file_to_browser {
|
|
|
1416
1524
|
blob: Buffer<ArrayBufferLike>;
|
|
1417
1525
|
};
|
|
1418
1526
|
} | undefined>;
|
|
1419
|
-
export {
|
|
1527
|
+
export { run_26 as run };
|
|
1420
1528
|
}
|
|
1421
1529
|
export namespace install_progressive_web_app {
|
|
1422
|
-
let
|
|
1423
|
-
export {
|
|
1424
|
-
export function
|
|
1425
|
-
export {
|
|
1426
|
-
export function
|
|
1530
|
+
let description_28: string;
|
|
1531
|
+
export { description_28 as description };
|
|
1532
|
+
export function configFields_28(): never[];
|
|
1533
|
+
export { configFields_28 as configFields };
|
|
1534
|
+
export function run_27({ req }: {
|
|
1427
1535
|
req: any;
|
|
1428
1536
|
}): Promise<{
|
|
1429
1537
|
eval_js: string;
|
|
@@ -1432,7 +1540,7 @@ export namespace install_progressive_web_app {
|
|
|
1432
1540
|
error: any;
|
|
1433
1541
|
eval_js?: undefined;
|
|
1434
1542
|
}>;
|
|
1435
|
-
export {
|
|
1543
|
+
export { run_27 as run };
|
|
1436
1544
|
}
|
|
1437
1545
|
export {};
|
|
1438
1546
|
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../base-plugin/actions.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../base-plugin/actions.js"],"names":[],"mappings":"AA+FA;;;;;;;;;GASG;AACH;;;;;;;;;;iBAiHC;;;;;;;;;;;;;;;;IAyCiB;;;;;;;;;;;;;;;;;;;;;;;;;;;SAqBb;;IAQI,oFALF;QAAqB,GAAG,EAAhB,MAAM;QACO,aAAa,EAA1B,MAAM;QACO,IAAI,EAAj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
|
const db = require("../db");
|
|
24
24
|
const { isNode, isWeb, ppVal, getFetchProxyOptions } = require("../utils");
|
|
25
25
|
const { available_languages } = require("../models/config");
|
|
26
|
+
const MetaData = require("../models/metadata");
|
|
26
27
|
//action use cases: field modify, like/rate (insert join), notify, send row to webhook
|
|
27
28
|
// todo add translation
|
|
28
29
|
const consoleInterceptor = (state) => {
|
|
@@ -138,6 +139,7 @@ const run_code = async ({ row, table, channel, configuration: { code, run_where
|
|
|
138
139
|
user,
|
|
139
140
|
console: consoleInterceptor(getState()),
|
|
140
141
|
Actions,
|
|
142
|
+
MetaData,
|
|
141
143
|
emitEvent,
|
|
142
144
|
sleep,
|
|
143
145
|
fetchJSON,
|
|
@@ -1063,7 +1065,7 @@ module.exports = {
|
|
|
1063
1065
|
{
|
|
1064
1066
|
name: "row_expr",
|
|
1065
1067
|
label: "Row expression",
|
|
1066
|
-
sublabel: "Expression for JavaScript object. Example: <code>{first_name: name.split(' ')[0]}</code>",
|
|
1068
|
+
sublabel: "Expression for JavaScript object or array of objects. Example: <code>{first_name: name.split(' ')[0]}</code>",
|
|
1067
1069
|
type: "String",
|
|
1068
1070
|
fieldview: "textarea",
|
|
1069
1071
|
class: "validate-expression",
|
|
@@ -1102,14 +1104,30 @@ module.exports = {
|
|
|
1102
1104
|
});
|
|
1103
1105
|
const calcrow = await f(row || {}, user);
|
|
1104
1106
|
const table_for_insert = Table.findOne({ name: configuration.table });
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1107
|
+
if (Array.isArray(calcrow)) {
|
|
1108
|
+
const ids = [];
|
|
1109
|
+
const all_results = {};
|
|
1110
|
+
for (const insrow of calcrow) {
|
|
1111
|
+
const results = {};
|
|
1112
|
+
const res = await table_for_insert.insertRow(insrow, user, results);
|
|
1113
|
+
ids.push(res);
|
|
1114
|
+
mergeActionResults(all_results, results);
|
|
1115
|
+
}
|
|
1116
|
+
if (configuration.id_variable)
|
|
1117
|
+
return { [configuration.id_variable]: ids, ...all_results };
|
|
1118
|
+
else
|
|
1119
|
+
return all_results;
|
|
1120
|
+
}
|
|
1121
|
+
else {
|
|
1122
|
+
const results = {};
|
|
1123
|
+
const res = await table_for_insert.tryInsertRow(calcrow, user, results);
|
|
1124
|
+
if (res.error)
|
|
1125
|
+
return res;
|
|
1126
|
+
else if (configuration.id_variable)
|
|
1127
|
+
return { [configuration.id_variable]: res.success, ...results };
|
|
1128
|
+
else
|
|
1129
|
+
return results;
|
|
1130
|
+
}
|
|
1113
1131
|
},
|
|
1114
1132
|
namespace: "Database",
|
|
1115
1133
|
},
|
|
@@ -1244,16 +1262,17 @@ module.exports = {
|
|
|
1244
1262
|
];
|
|
1245
1263
|
},
|
|
1246
1264
|
run: async ({ row, table, configuration: { delete_triggering_row, delete_where, table_name }, user, ...rest }) => {
|
|
1265
|
+
const resultCollector = {};
|
|
1247
1266
|
if (delete_triggering_row) {
|
|
1248
1267
|
if (!table || !row?.[table.pk_name])
|
|
1249
1268
|
throw new Error("delete_rows cannot find triggering row");
|
|
1250
|
-
await table.deleteRows({ [table.pk_name]: row[table.pk_name] }, user);
|
|
1251
|
-
return;
|
|
1269
|
+
await table.deleteRows({ [table.pk_name]: row[table.pk_name] }, user, false, resultCollector);
|
|
1270
|
+
return resultCollector;
|
|
1252
1271
|
}
|
|
1253
1272
|
const where = eval_expression(delete_where, row || {}, user, "recalculate_stored_fields where");
|
|
1254
1273
|
const tbl = Table.findOne({ name: table_name });
|
|
1255
|
-
await tbl.deleteRows(where, user);
|
|
1256
|
-
return;
|
|
1274
|
+
await tbl.deleteRows(where, user, false, resultCollector);
|
|
1275
|
+
return resultCollector;
|
|
1257
1276
|
},
|
|
1258
1277
|
namespace: "Database",
|
|
1259
1278
|
},
|
|
@@ -1499,15 +1518,15 @@ module.exports = {
|
|
|
1499
1518
|
"console",
|
|
1500
1519
|
"Actions",
|
|
1501
1520
|
a({
|
|
1502
|
-
href: "/admin/jsdoc/classes/_saltcorn_data.models_table.
|
|
1521
|
+
href: "/admin/jsdoc/classes/_saltcorn_data.models_table.Table.html",
|
|
1503
1522
|
target: "_blank",
|
|
1504
1523
|
}, "Table"),
|
|
1505
1524
|
a({
|
|
1506
|
-
href: "/admin/jsdoc/classes/_saltcorn_data.models_file.
|
|
1525
|
+
href: "/admin/jsdoc/classes/_saltcorn_data.models_file.File.html",
|
|
1507
1526
|
target: "_blank",
|
|
1508
1527
|
}, "File"),
|
|
1509
1528
|
a({
|
|
1510
|
-
href: "/admin/jsdoc/classes/_saltcorn_data.models_user.
|
|
1529
|
+
href: "/admin/jsdoc/classes/_saltcorn_data.models_user.User.html",
|
|
1511
1530
|
target: "_blank",
|
|
1512
1531
|
}, "User"),
|
|
1513
1532
|
...(table ? ["table"] : []),
|
|
@@ -1929,6 +1948,87 @@ module.exports = {
|
|
|
1929
1948
|
},
|
|
1930
1949
|
namespace: "User interface",
|
|
1931
1950
|
},
|
|
1951
|
+
progress_bar: {
|
|
1952
|
+
description: "Display or update progress messages and/or progress bar",
|
|
1953
|
+
configFields: [
|
|
1954
|
+
{
|
|
1955
|
+
name: "blocking",
|
|
1956
|
+
label: "Blocking",
|
|
1957
|
+
sublabel: "Display progress in a blocking popup modal, If not checked, display as toast",
|
|
1958
|
+
type: "Bool",
|
|
1959
|
+
},
|
|
1960
|
+
{
|
|
1961
|
+
name: "close",
|
|
1962
|
+
label: "Close",
|
|
1963
|
+
sublabel: "Close this progress window",
|
|
1964
|
+
type: "Bool",
|
|
1965
|
+
},
|
|
1966
|
+
{
|
|
1967
|
+
name: "id",
|
|
1968
|
+
label: "Identifier",
|
|
1969
|
+
type: "String",
|
|
1970
|
+
class: "validate-identifier",
|
|
1971
|
+
required: true,
|
|
1972
|
+
sublabel: "A valid JavaScript identifier for updating existing progress toasts",
|
|
1973
|
+
showIf: { blocking: false, close: false },
|
|
1974
|
+
},
|
|
1975
|
+
{
|
|
1976
|
+
name: "maxHeight",
|
|
1977
|
+
label: "max-height (px)",
|
|
1978
|
+
type: "Integer",
|
|
1979
|
+
sublabel: "If set, progress messages will be added to scrolling container with this maximum height",
|
|
1980
|
+
showIf: { blocking: true, close: false },
|
|
1981
|
+
},
|
|
1982
|
+
{
|
|
1983
|
+
name: "popupWidth",
|
|
1984
|
+
label: "Popup width (px)",
|
|
1985
|
+
type: "Integer",
|
|
1986
|
+
showIf: { blocking: true, close: false },
|
|
1987
|
+
},
|
|
1988
|
+
{
|
|
1989
|
+
name: "title",
|
|
1990
|
+
label: "Title",
|
|
1991
|
+
type: "String",
|
|
1992
|
+
showIf: { close: false },
|
|
1993
|
+
},
|
|
1994
|
+
{
|
|
1995
|
+
name: "message",
|
|
1996
|
+
label: "Message",
|
|
1997
|
+
type: "String",
|
|
1998
|
+
showIf: { close: false },
|
|
1999
|
+
},
|
|
2000
|
+
{
|
|
2001
|
+
name: "percent",
|
|
2002
|
+
label: "Percent",
|
|
2003
|
+
type: "Integer",
|
|
2004
|
+
sublabel: "Optional. 0-100",
|
|
2005
|
+
attributes: {
|
|
2006
|
+
min: 0,
|
|
2007
|
+
max: 100,
|
|
2008
|
+
},
|
|
2009
|
+
showIf: { close: false },
|
|
2010
|
+
},
|
|
2011
|
+
],
|
|
2012
|
+
run: async ({ row, user, configuration: { blocking, id, close, title, message, percent, maxHeight, popupWidth, }, req, }) => {
|
|
2013
|
+
const msg = interpolate(message, row, user, "progress_bar message");
|
|
2014
|
+
const title1 = interpolate(title, row, user, "progress_bar title");
|
|
2015
|
+
const id1 = interpolate(id, row, user, "progress_bar id");
|
|
2016
|
+
return {
|
|
2017
|
+
page_load_tag: req?.headers?.["page-load-tag"],
|
|
2018
|
+
progress_bar_update: {
|
|
2019
|
+
blocking,
|
|
2020
|
+
id: id1,
|
|
2021
|
+
close,
|
|
2022
|
+
message: msg,
|
|
2023
|
+
title: title1,
|
|
2024
|
+
percent,
|
|
2025
|
+
maxHeight,
|
|
2026
|
+
popupWidth,
|
|
2027
|
+
},
|
|
2028
|
+
};
|
|
2029
|
+
},
|
|
2030
|
+
namespace: "User interface",
|
|
2031
|
+
},
|
|
1932
2032
|
sleep: {
|
|
1933
2033
|
description: "Delay for a set number of seconds",
|
|
1934
2034
|
configFields: [
|