From 6045447a5f165382f5289ff9f7cc9c775b7e4d1d Mon Sep 17 00:00:00 2001 From: Sergio Betanzos Date: Thu, 28 Jan 2021 19:06:03 +0100 Subject: [PATCH] B #5237: Fix onegate context attributes in sunstone (#707) (cherry picked from commit b03be57ca89ec12aaa63fb6caead63b545c88ef1) --- .../form-panels/create/wizard-tabs/context.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/context.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/context.js index 728bbeed0f..d77dd43602 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/context.js +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/context.js @@ -299,9 +299,8 @@ define(function(require) { var token_regexp = /^TOKEN$/; var report_ready_regexp = /^REPORT_READY$/; var publickey_regexp = /\$USER\[SSH_PUBLIC_KEY\]/; - - var net_flag = false; - var files = []; + var publickey_regexp = /\$USER\[SSH_PUBLIC_KEY\]/; + var yes_value = /^(yes|YES)$/; var customTagsJSON = {}; $.each(contextJSON, function(key, value) { @@ -311,11 +310,11 @@ define(function(require) { if (!publickey_regexp.test(value)) { WizardFields.fillInput($("#ssh_public_key", context), value); } - } else if (token_regexp.test(key)) { + } else if (token_regexp.test(key) && yes_value.test(value)) { $(".token_context", context).prop('checked', 'checked'); - } else if (report_ready_regexp.test(key)) { + } else if (report_ready_regexp.test(key) && yes_value.test(value)) { $(".report_ready_context", context).prop('checked', 'checked'); - } else if (net_regexp.test(key)) { + } else if (net_regexp.test(key) && yes_value.test(value)) { $(".network_context", context).prop('checked', 'checked'); } else if ("INIT_SCRIPTS" == key) { WizardFields.fillInput($("input.INIT_SCRIPTS", context), value);