From deefae096335cd6ea6b0a92534ec22d93e9bc215 Mon Sep 17 00:00:00 2001 From: Sergio Betanzos Date: Tue, 25 Feb 2020 10:43:15 +0100 Subject: [PATCH] B #4241: Fix visibility of RDP button on the VM (#4253) --- src/sunstone/public/app/opennebula/vm.js | 6 ++++-- src/sunstone/public/app/utils/wizard-fields.js | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/sunstone/public/app/opennebula/vm.js b/src/sunstone/public/app/opennebula/vm.js index d046791f4d..44502fd9c7 100644 --- a/src/sunstone/public/app/opennebula/vm.js +++ b/src/sunstone/public/app/opennebula/vm.js @@ -875,8 +875,10 @@ define(function(require) { function isRDPSupported(element) { return ( element.TEMPLATE && element.TEMPLATE.NIC && - element.TEMPLATE.NIC.length > 0 && - element.TEMPLATE.NIC.filter(nic => nic.RDP && nic.RDP == "YES") + Array.isArray(element.TEMPLATE.NIC) && + element.TEMPLATE.NIC.some(function(nic) { + return nic.RDP && nic.RDP == "YES" + }) ); } diff --git a/src/sunstone/public/app/utils/wizard-fields.js b/src/sunstone/public/app/utils/wizard-fields.js index e75496ab62..a828af5d44 100644 --- a/src/sunstone/public/app/utils/wizard-fields.js +++ b/src/sunstone/public/app/utils/wizard-fields.js @@ -54,7 +54,9 @@ define(function(require) { } function _retrieveInput(value) { - return TemplateUtils.escapeDoubleQuotes( value ); + return (value instanceof $) + ? value.val() + : TemplateUtils.escapeDoubleQuotes( value ); } // TODO: wizard_field_64 for fill method