|
|
@ -172,7 +172,7 @@ function resolveComponent( |
|
|
const componentDefinition: ComponentDefinition = { |
|
|
const componentDefinition: ComponentDefinition = { |
|
|
...componentJSON, |
|
|
...componentJSON, |
|
|
components: children, |
|
|
components: children, |
|
|
[collectionsStateMapKey]: collectionsStateMap |
|
|
[collectionsStateMapKey]: collectionsStateMap, |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
return componentDefinition; |
|
|
return componentDefinition; |
|
|
@ -246,14 +246,22 @@ function resolveCurrentItem( |
|
|
collectionItem: CollectionState, |
|
|
collectionItem: CollectionState, |
|
|
path: string, |
|
|
path: string, |
|
|
) { |
|
|
) { |
|
|
const valueIsDataVariable = collectionItem.current_item?.type === DataVariableType; |
|
|
if (variableType === 'current_item') { |
|
|
if (variableType === 'current_item' && valueIsDataVariable) { |
|
|
const valueIsDataVariable = collectionItem.current_item?.type === DataVariableType; |
|
|
const currentItem_path = collectionItem.current_item.path; |
|
|
if (valueIsDataVariable) { |
|
|
const resolvedPath = currentItem_path ? `${currentItem_path}.${path}` : path; |
|
|
const currentItem_path = collectionItem.current_item.path; |
|
|
return { |
|
|
const resolvedPath = currentItem_path ? `${currentItem_path}.${path}` : path; |
|
|
...collectionItem.current_item, |
|
|
return { |
|
|
path: resolvedPath, |
|
|
...collectionItem.current_item, |
|
|
}; |
|
|
path: resolvedPath, |
|
|
|
|
|
}; |
|
|
|
|
|
} else if (!!path) { |
|
|
|
|
|
if (!collectionItem.current_item?.[path]) { |
|
|
|
|
|
throw new Error(`Path not found in current item: ${path}`); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return collectionItem.current_item[path]; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
return collectionItem[variableType]; |
|
|
return collectionItem[variableType]; |
|
|
} |
|
|
} |
|
|
|