🐛 Fix variable selector bug with arrays in arrays

This commit is contained in:
Jan Oberhauser 2019-12-10 16:37:22 +01:00
parent f31049d454
commit 5a0d1bf993

View file

@ -171,14 +171,16 @@ export default mixins(
return returnData; return returnData;
} else if (Array.isArray(inputData)) { } else if (Array.isArray(inputData)) {
let newPropertyName = propertyName; let newPropertyName = propertyName;
let newParentPath = parentPath;
if (propertyIndex !== undefined) { if (propertyIndex !== undefined) {
newPropertyName += `[${propertyIndex}]`; newParentPath += `["${propertyName}"]`;
newPropertyName = propertyIndex.toString();
} }
const arrayData: IVariableSelectorOption[] = []; const arrayData: IVariableSelectorOption[] = [];
for (let i = 0; i < inputData.length; i++) { for (let i = 0; i < inputData.length; i++) {
arrayData.push.apply(arrayData, this.jsonDataToFilterOption(inputData[i], parentPath, newPropertyName, filterText, i, `[Item: ${i}]`, skipKey)); arrayData.push.apply(arrayData, this.jsonDataToFilterOption(inputData[i], newParentPath, newPropertyName, filterText, i, `[Item: ${i}]`, skipKey));
} }
returnData.push( returnData.push(