Fixed JMESPath query wizard not correctly handling selection of multiple fields
This commit is contained in:
parent
b781a47702
commit
a773d5cf8f
|
@ -3,6 +3,12 @@
|
|||
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
|
||||
|
||||
- Fixed #682 and #687: JSONEditor not being able to handle JSON schema
|
||||
|
|
|
@ -233,14 +233,14 @@ function showTransformModal (node, container) {
|
|||
}
|
||||
|
||||
if (values.length === 1) {
|
||||
query.value += '.' + selectedValue;
|
||||
query.value += '.' + values[0];
|
||||
}
|
||||
else if (values.length > 1) {
|
||||
query.value += '.{' +
|
||||
values.map(function (value) {
|
||||
var parts = value.split('.');
|
||||
var last = parts[parts.length - 1];
|
||||
return last + ': ' + selectedValue;
|
||||
return last + ': ' + value;
|
||||
}).join(', ') +
|
||||
'}';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue