Commit a211e49b authored by Caleb Weeks's avatar Caleb Weeks

fixing issue with templating when map is at the room

parent 9d96d2a9
......@@ -155,10 +155,13 @@ module.exports.process=function(data,$,cb){
}
if(key.indexOf('/bl:templated/') > -1){
let splitParts = key.split('/bl:map/bl:templated/');
let relativeSlingPath = splitParts.join('/');
let templateValueParts = splitParts[0].split('/').concat(['bl:map', 'bl:templated', splitParts[1]]);
let mapAtRoot = key.indexOf('bl:map/bl:templated/') === 0;
let splitParts = key.split((mapAtRoot ? '' : '/') + 'bl:map/bl:templated/');
let relativeSlingPath = mapAtRoot ? splitParts[1] : splitParts.join('/');
let templateValueParts = (mapAtRoot ? [] : splitParts[0].split('/')).concat(['bl:map', 'bl:templated', splitParts[1]]);
let templateValue = _.get(slingData, templateValueParts);
//console.log('templated handling', {key, splitParts, relativeSlingPath, templateValueParts, templateValue});
_.set(slingData, relativeSlingPath.split('/'), templateValue);
templatedFields.push(relativeSlingPath);
}
......
......@@ -70,7 +70,6 @@ module.exports.renderDialogPage = function(blMaps, resourceType){
mappingWidgets.push(componentInheritTemplate({resourceType : inheritedType, "json5": JSON5.stringify(result.componentMap)}));
}
console.log('result.directives', result.directives);
//we're only going to include a map if it already has directive setup
if(_.size(result.directives) || mapPath === 'bl:map'){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment