diff --git a/heat_dashboard/static/dashboard/project/heat_dashboard/template_generator/js/components/modal-node.controller.js b/heat_dashboard/static/dashboard/project/heat_dashboard/template_generator/js/components/modal-node.controller.js index 6d41a416..7e1eb45b 100644 --- a/heat_dashboard/static/dashboard/project/heat_dashboard/template_generator/js/components/modal-node.controller.js +++ b/heat_dashboard/static/dashboard/project/heat_dashboard/template_generator/js/components/modal-node.controller.js @@ -128,7 +128,7 @@ connected_options[property] = []; } connected_options[property].push({ - value: hotgenUtils.get_resource_string(hotgenStates.get_label_by_uuid(node.id)), + value: { 'get_resource': hotgenStates.get_label_by_uuid(node.id) }, id: node.id, resource_type: node.title, edge: edge diff --git a/heat_dashboard/static/dashboard/project/heat_dashboard/template_generator/js/components/modal-template.controller.js b/heat_dashboard/static/dashboard/project/heat_dashboard/template_generator/js/components/modal-template.controller.js index 3691d62d..f744d4e5 100644 --- a/heat_dashboard/static/dashboard/project/heat_dashboard/template_generator/js/components/modal-template.controller.js +++ b/heat_dashboard/static/dashboard/project/heat_dashboard/template_generator/js/components/modal-template.controller.js @@ -131,7 +131,7 @@ var output_key = resource_name + '_' + output_detail[idx].property; outputs_root[output_key] = { description: 'The ' + output_detail[idx].property + ' of ' + resource_name +'.', - value: '{ get_attr: ['+resource_name+', '+output_detail[idx].property+'] }', + value: { 'get_attr': [resource_name, output_detail[idx].property] }, }; } diff --git a/heat_dashboard/static/dashboard/project/heat_dashboard/template_generator/js/components/utils.module.js b/heat_dashboard/static/dashboard/project/heat_dashboard/template_generator/js/components/utils.module.js index 30ac74eb..fb7d12bf 100644 --- a/heat_dashboard/static/dashboard/project/heat_dashboard/template_generator/js/components/utils.module.js +++ b/heat_dashboard/static/dashboard/project/heat_dashboard/template_generator/js/components/utils.module.js @@ -94,9 +94,6 @@ } }]) .factory('hotgenUtils', function(){ - var get_resource_string = function(identity){ - return '{ get_resource: '+identity+' }'; - } var filter_and_return_get_resource_element = function(array, property){ var return_val = []; var idx = array.length-1; @@ -201,7 +198,8 @@ } var strip_property = function check_property(resource_data, property){ - if (resource_data[property] == null || resource_data[property] == ''){ + // remove empty properties or private Angular properties (start with $$) + if (resource_data[property] == null || resource_data[property] == '' || property.lastIndexOf("$$",0) === 0){ delete resource_data[property]; } else if (resource_data[property].constructor && resource_data[property].constructor == Object){ extract_dict(resource_data[property]); @@ -217,7 +215,6 @@ } return { - get_resource_string: get_resource_string, escape_characters: escape_characters, extract_keyvalue: extract_keyvalue, extract_list_of_keyvalue: extract_list_of_keyvalue, diff --git a/heat_dashboard/static/dashboard/project/heat_dashboard/template_generator/js/components/utils.module.spec.js b/heat_dashboard/static/dashboard/project/heat_dashboard/template_generator/js/components/utils.module.spec.js index d67e669b..2f7cb79e 100644 --- a/heat_dashboard/static/dashboard/project/heat_dashboard/template_generator/js/components/utils.module.spec.js +++ b/heat_dashboard/static/dashboard/project/heat_dashboard/template_generator/js/components/utils.module.spec.js @@ -169,12 +169,6 @@ expect(hotgenUtils).toBeDefined(); }); - it('should return string contains get_resource', function(){ - var returnValue = hotgenUtils.get_resource_string('identity'); - - expect(returnValue).toEqual('{ get_resource: identity }'); - }); - it('should filter elements', function(){ var property = 'name'; var array = ['ignore me', 1, '{ get_resource: find me }',