Fixed JMESPath query wizard not correctly handling selection of multiple fields

This commit is contained in:
jos 2019-04-26 21:34:17 +02:00
parent b781a47702
commit a773d5cf8f
2 changed files with 8 additions and 2 deletions

View File

@ -3,6 +3,12 @@
https://github.com/josdejong/jsoneditor https://github.com/josdejong/jsoneditor
## not yet released, version 5.32.5
- Fixed a bug in the JMESPath query wizard which didn't correctly handle
selecting multiple fields.
## 2019-04-10, version 5.32.4 ## 2019-04-10, version 5.32.4
- Fixed #682 and #687: JSONEditor not being able to handle JSON schema - Fixed #682 and #687: JSONEditor not being able to handle JSON schema

View File

@ -233,14 +233,14 @@ function showTransformModal (node, container) {
} }
if (values.length === 1) { if (values.length === 1) {
query.value += '.' + selectedValue; query.value += '.' + values[0];
} }
else if (values.length > 1) { else if (values.length > 1) {
query.value += '.{' + query.value += '.{' +
values.map(function (value) { values.map(function (value) {
var parts = value.split('.'); var parts = value.split('.');
var last = parts[parts.length - 1]; var last = parts[parts.length - 1];
return last + ': ' + selectedValue; return last + ': ' + value;
}).join(', ') + }).join(', ') +
'}'; '}';
} }