pywebexec 2.4.17__py3-none-any.whl → 2.4.19__py3-none-any.whl
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.
- pywebexec/static/js/schemaform.js +5 -2
- pywebexec/static/jsonform/lib/jsonform.js +25 -3
- pywebexec/version.py +2 -2
- {pywebexec-2.4.17.dist-info → pywebexec-2.4.19.dist-info}/METADATA +1 -1
- {pywebexec-2.4.17.dist-info → pywebexec-2.4.19.dist-info}/RECORD +9 -9
- {pywebexec-2.4.17.dist-info → pywebexec-2.4.19.dist-info}/WHEEL +0 -0
- {pywebexec-2.4.17.dist-info → pywebexec-2.4.19.dist-info}/entry_points.txt +0 -0
- {pywebexec-2.4.17.dist-info → pywebexec-2.4.19.dist-info}/licenses/LICENSE +0 -0
- {pywebexec-2.4.17.dist-info → pywebexec-2.4.19.dist-info}/top_level.txt +0 -0
@@ -153,6 +153,9 @@ function orderCheckboxes() {
|
|
153
153
|
const key = checkboxes.getAttribute('name');
|
154
154
|
const cboxes = checkboxes
|
155
155
|
const matchingElements = [];
|
156
|
+
if (! value || ! value[key] || !value[key].length) {
|
157
|
+
return;
|
158
|
+
}
|
156
159
|
for (let val = 0; val < value[key].length; val++) {
|
157
160
|
for (let i = 0; i < cboxes.children.length; i++) {
|
158
161
|
if (cboxes.children[i].querySelector('label').innerText === value.scope[val]) {
|
@@ -231,7 +234,7 @@ function createSchemaForm($form, schema, onSubmit, schemaName) {
|
|
231
234
|
}
|
232
235
|
convertObjectsToJsonStrings(value, schema);
|
233
236
|
} else {
|
234
|
-
value =
|
237
|
+
value = undefined;
|
235
238
|
}
|
236
239
|
// recreate form to remove event listeners
|
237
240
|
$form.off();
|
@@ -371,7 +374,7 @@ function createSchemaForm($form, schema, onSubmit, schemaName) {
|
|
371
374
|
evt.preventDefault();
|
372
375
|
evt.stopPropagation();
|
373
376
|
evt.stopImmediatePropagation();
|
374
|
-
schemaValues[schemaName]
|
377
|
+
delete schemaValues[schemaName];
|
375
378
|
createSchemaForm($form, schema, onSubmit, schemaName);
|
376
379
|
},
|
377
380
|
},
|
@@ -835,7 +835,7 @@ jsonform.elementTypes = {
|
|
835
835
|
}
|
836
836
|
},
|
837
837
|
'checkboxes': {
|
838
|
-
'template': '<div id="<%= id %>" class="checkboxes" ><ul name="<%= node.key %>"
|
838
|
+
'template': '<div id="<%= id %>" class="checkboxes" ><ul name="<%= node.key %>"class="_jsonform-array-ul sortable"><%= choiceshtml %></ul></div>',
|
839
839
|
'fieldtemplate': true,
|
840
840
|
'inputfield': true,
|
841
841
|
'onBeforeRender': function (data, node) {
|
@@ -2395,7 +2395,26 @@ formNode.prototype.computeInitialValues = function (values, ignoreDefaultValues)
|
|
2395
2395
|
});
|
2396
2396
|
}
|
2397
2397
|
}
|
2398
|
+
// fjo
|
2399
|
+
function setNestedValue(obj, keyPath, value) {
|
2400
|
+
// Split the keyPath into individual keys
|
2401
|
+
const keys = keyPath.split('.');
|
2402
|
+
// Store the reference to the current level of the object
|
2403
|
+
let current = obj;
|
2398
2404
|
|
2405
|
+
// Traverse the object until the second to last key
|
2406
|
+
for (let i = 0; i < keys.length - 1; i++) {
|
2407
|
+
// If the key doesn't exist, create a new object
|
2408
|
+
if (current[keys[i]] === undefined) {
|
2409
|
+
current[keys[i]] = {};
|
2410
|
+
}
|
2411
|
+
// Move to the next level
|
2412
|
+
current = current[keys[i]];
|
2413
|
+
}
|
2414
|
+
|
2415
|
+
// Assign the value to the final key
|
2416
|
+
current[keys[keys.length - 1]] = value;
|
2417
|
+
}
|
2399
2418
|
if (this.view && this.view.inputfield && this.schemaElement) {
|
2400
2419
|
// Case 1: simple input field
|
2401
2420
|
if (values) {
|
@@ -2457,11 +2476,14 @@ formNode.prototype.computeInitialValues = function (values, ignoreDefaultValues)
|
|
2457
2476
|
// be a complex structure that needs to be pushed down the subtree.
|
2458
2477
|
// The easiest way is probably to generate a "values" object and
|
2459
2478
|
// compute initial values from that object
|
2460
|
-
|
2479
|
+
// fjo start: TODO convert this.key to be used in values
|
2461
2480
|
else if (this.schemaElement['default']) {
|
2481
|
+
values = {};
|
2482
|
+
setNestedValue(values, this.key, this.schemaElement['default']);
|
2483
|
+
// values[this.key] = this.schemaElement['default'];
|
2462
2484
|
nbChildren = this.schemaElement['default'].length;
|
2463
2485
|
}
|
2464
|
-
|
2486
|
+
// fjo end
|
2465
2487
|
else if (nbChildren === 0) {
|
2466
2488
|
// If form has already been submitted with no children, the array
|
2467
2489
|
// needs to be rendered without children. If there are no previously
|
pywebexec/version.py
CHANGED
@@ -2,7 +2,7 @@ pywebexec/__init__.py,sha256=197fHJy0UDBwTTpGCGortZRr-w2kTaD7MxqdbVmTEi0,61
|
|
2
2
|
pywebexec/host_ip.py,sha256=oiCMlo2o3AkkgXDarUSx8T3FWXKI0vk1-EPnx5FGBd8,1332
|
3
3
|
pywebexec/pywebexec.py,sha256=avBfvbhLbjvrJ168bBmQVrm-DjbjGJoAapHHIEAD6V4,48515
|
4
4
|
pywebexec/swagger.yaml,sha256=I_oLpp7Hqel8SDEEykvpmCT-Gv3ytGlziq9bvQOrtZY,7598
|
5
|
-
pywebexec/version.py,sha256=
|
5
|
+
pywebexec/version.py,sha256=RG2wRk5re9j83NrpBrwB9_-yiVfz-BBwgqrM7DZypPQ,513
|
6
6
|
pywebexec/static/css/form.css,sha256=pLM_llJw-arBEgxcKSte_SYVRwDSsLWCOMUYabXWQZU,8658
|
7
7
|
pywebexec/static/css/markdown.css,sha256=br4-iK9wigTs54N2KHtjgZ4KLH0THVSvJo-XZAdMHiE,1970
|
8
8
|
pywebexec/static/css/style.css,sha256=TX60M-mzIPTGVDmaypRCOcyxc8A7dOjx-p1_bpJ6t9M,11772
|
@@ -36,7 +36,7 @@ pywebexec/static/images/swagger-ui.svg,sha256=FR0yeOVwe4zCYKZAjCGcT_m0Mf25NexIVa
|
|
36
36
|
pywebexec/static/js/exceljs.min.js,sha256=fknaaFiOJQ27i7oZDSyqirN4fMAoS9odiy-AXE33Qsk,947702
|
37
37
|
pywebexec/static/js/executables.js,sha256=xD4rauofJUymUWyu3oUzUAm9djy4gp6G-Gh9tFBtlBI,11996
|
38
38
|
pywebexec/static/js/popup.js,sha256=X-Q__R0jeZFO_I8EWucP1KkUJa9-Atz8bdnyWp6ibzY,11376
|
39
|
-
pywebexec/static/js/schemaform.js,sha256=
|
39
|
+
pywebexec/static/js/schemaform.js,sha256=ZtBn_He94NKSpSb-H0m7Shz7chrvgNvcdStxWWV7tyI,16515
|
40
40
|
pywebexec/static/js/script.js,sha256=2Jys1IpB94ygkjnpFkUvcZdchM-gZrfPOFuS74SxgZI,21508
|
41
41
|
pywebexec/static/js/swagger-form.js,sha256=CLcSHMhk5P4-_2MIRBoJLgEnIj_9keDDSzUugXHZjio,4565
|
42
42
|
pywebexec/static/js/tablefilter.js,sha256=YuFc4Q7OOld6tX3v4HhG5lSToEJczQM9RlU2-pITSms,11099
|
@@ -71,14 +71,14 @@ pywebexec/static/jsonform/deps/ace/theme-github_light_default.js,sha256=4-_JXMA3
|
|
71
71
|
pywebexec/static/jsonform/deps/ace/theme-twilight.js,sha256=3FCPUePtyW8RjnVAC51dgwKyNVpB7liV9AjEy4uEP8c,3474
|
72
72
|
pywebexec/static/jsonform/deps/ace/worker-json.js,sha256=FalZfSbOglLQIOUYUprFqETrljooqsGwM5Tey7vhbxs,24390
|
73
73
|
pywebexec/static/jsonform/deps/img/glyphicons-halflings.png,sha256=hpJM0AbbMLnU8UGOBs172D7vK-dooQ8n0s_ybml3zO0,13826
|
74
|
-
pywebexec/static/jsonform/lib/jsonform.js,sha256=
|
74
|
+
pywebexec/static/jsonform/lib/jsonform.js,sha256=ybg60zKhoNQ9u0ZnegoUZiIHerMSZ34nl8jnPZ6BTEs,139972
|
75
75
|
pywebexec/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
76
76
|
pywebexec/templates/index.html,sha256=sTytur1jHuEAMTvuNqMEB3i3NNFoJRbYQgfmvDrAuJQ,4286
|
77
77
|
pywebexec/templates/popup.html,sha256=3kpMccKD_OLLhJ4Y9KRw6Ny8wQWjVaRrUfV9y5-bDiQ,1580
|
78
78
|
pywebexec/templates/swagger_ui.html,sha256=MAPr-z96VERAecDvX37V8q2Nxph-O0fNDBul1x2w9SI,1147
|
79
|
-
pywebexec-2.4.
|
80
|
-
pywebexec-2.4.
|
81
|
-
pywebexec-2.4.
|
82
|
-
pywebexec-2.4.
|
83
|
-
pywebexec-2.4.
|
84
|
-
pywebexec-2.4.
|
79
|
+
pywebexec-2.4.19.dist-info/licenses/LICENSE,sha256=gRJf0JPT_wsZJsUGlWPTS8Vypfl9vQ1qjp6sNbKykuA,1064
|
80
|
+
pywebexec-2.4.19.dist-info/METADATA,sha256=WNhNof34pnrDNmcsgPA-TIMGwb32iBtdqkPHClbXAwk,13016
|
81
|
+
pywebexec-2.4.19.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
82
|
+
pywebexec-2.4.19.dist-info/entry_points.txt,sha256=l52GBkPCXRkmlHfEyoVauyfBdg8o-CAtC8qQpOIjJK0,55
|
83
|
+
pywebexec-2.4.19.dist-info/top_level.txt,sha256=vHoHyzngrfGdm_nM7Xn_5iLmaCrf10XO1EhldgNLEQ8,10
|
84
|
+
pywebexec-2.4.19.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|