diff --git a/src/components/Records/Record/AdditionalInfo.vue b/src/components/Records/Record/AdditionalInfo.vue index 3889fdd5a7..32295bcd30 100644 --- a/src/components/Records/Record/AdditionalInfo.vue +++ b/src/components/Records/Record/AdditionalInfo.vue @@ -88,9 +88,15 @@ export default { // if received node is not an array if (!isArray(selectedNode)) { this.tempData[key] = [] - Object.keys(selectedNode).forEach(item_key => { - this.tempData[key].push({[item_key]: selectedNode[item_key]}) - }) + // Special case this is a string + if (typeof selectedNode === 'string' ){ + this.tempData[key].push({"Value": selectedNode}) + } + else { + Object.keys(selectedNode).forEach(item_key => { + this.tempData[key].push({[item_key]: selectedNode[item_key]}) + }) + } return } // if received node is an array diff --git a/tests/unit/components/Records/Record/AdditionalInfo.spec.js b/tests/unit/components/Records/Record/AdditionalInfo.spec.js index 93723552c4..41890f223f 100644 --- a/tests/unit/components/Records/Record/AdditionalInfo.spec.js +++ b/tests/unit/components/Records/Record/AdditionalInfo.spec.js @@ -71,6 +71,7 @@ describe("AdditionalInfo.vue", function(){ await wrapper.vm.setAvailableData(selectedNode,'n') selectedNode = [{}] await wrapper.vm.setAvailableData(selectedNode,'a') + await wrapper.vm.setAvailableData("Hello",'justString') expect(wrapper.vm.tempData).toStrictEqual({ "a": [ { @@ -88,6 +89,11 @@ describe("AdditionalInfo.vue", function(){ { "a": [] } + ], + "justString": [ + { + "Value": "Hello" + } ] }); });