From a773d5cf8fad4834d1f011b14195fee4b625a51d Mon Sep 17 00:00:00 2001 From: jos Date: Fri, 26 Apr 2019 21:34:17 +0200 Subject: [PATCH] Fixed JMESPath query wizard not correctly handling selection of multiple fields --- HISTORY.md | 6 ++++++ src/js/showTransformModal.js | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 5a5b498..b3a4836 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -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 diff --git a/src/js/showTransformModal.js b/src/js/showTransformModal.js index 50d749b..70f1715 100644 --- a/src/js/showTransformModal.js +++ b/src/js/showTransformModal.js @@ -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(', ') + '}'; }