1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

B #5578: Fix misbehave in service user inputs (#1540)

(cherry picked from commit d4e55969c62e5abb5b1ebb38384e239c47322fed)
This commit is contained in:
Frederick Borges 2021-10-25 16:47:22 +02:00 committed by Tino Vazquez
parent dbc4e3208b
commit 518059d0b1
No known key found for this signature in database
GPG Key ID: 14201E424D02047E

View File

@ -298,16 +298,17 @@ define(function(require) {
$.each(that.service_template_json.DOCUMENT.TEMPLATE.BODY.roles, function(index, role){
var temp_role = {};
$.extend( temp_role, role);
vm_template_contents = TemplateUtils.stringToTemplate(role.vm_template_contents);
var div_id = "user_input_role_"+index;
var tmp_json = {};
$.extend( tmp_json, WizardFields.retrieve($("#"+div_id, context)) );
$.each(tmp_json, function(key, value){
if (Array.isArray(value)){
delete tmp_json[key];
tmp_json[key] = value.join(",");
delete vm_template_contents[key];
vm_template_contents[key] = value.join(",");
}
});
temp_role.user_inputs_values = tmp_json;
temp_role.vm_template_contents = TemplateUtils.templateToString(vm_template_contents);
var stringCustomValues = TemplateUtils.templateToString(customAttrsValues);
if (stringCustomValues) {
(temp_role.vm_template_contents)