From 518059d0b10b631a23ff88bff03385226403782d Mon Sep 17 00:00:00 2001 From: Frederick Borges Date: Mon, 25 Oct 2021 16:47:22 +0200 Subject: [PATCH] B #5578: Fix misbehave in service user inputs (#1540) (cherry picked from commit d4e55969c62e5abb5b1ebb38384e239c47322fed) --- .../tabs/oneflow-templates-tab/form-panels/instantiate.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sunstone/public/app/tabs/oneflow-templates-tab/form-panels/instantiate.js b/src/sunstone/public/app/tabs/oneflow-templates-tab/form-panels/instantiate.js index f5e6e2313a..4deba9dce6 100644 --- a/src/sunstone/public/app/tabs/oneflow-templates-tab/form-panels/instantiate.js +++ b/src/sunstone/public/app/tabs/oneflow-templates-tab/form-panels/instantiate.js @@ -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)