Merge "Fix template generated by Template Generator"

This commit is contained in:
Zuul 2024-03-12 01:40:18 +00:00 committed by Gerrit Code Review
commit ecfa725666
4 changed files with 4 additions and 13 deletions

View File

@ -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

View File

@ -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] },
};
}

View File

@ -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,

View File

@ -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 }',