From 17f1dfc2f15e6e31d30df76f325c14e23cfca156 Mon Sep 17 00:00:00 2001 From: Kohei Yoshino Date: Mon, 12 Aug 2019 17:46:10 -0400 Subject: [PATCH] =?utf8?q?Bug=201572945=20-=20Cannot=20enter=20bug=20throu?= =?utf8?q?gh=20Guided=20Bug=20Form=20if=20the=20product=E2=80=99s=20defaul?= =?utf8?q?t=20platform=20is=20auto-detect?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- extensions/GuidedBugEntry/web/js/guided.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/extensions/GuidedBugEntry/web/js/guided.js b/extensions/GuidedBugEntry/web/js/guided.js index fd79f2602..b5127f786 100644 --- a/extensions/GuidedBugEntry/web/js/guided.js +++ b/extensions/GuidedBugEntry/web/js/guided.js @@ -724,10 +724,21 @@ var bugForm = { } bugForm.onVersionChange(elVersions.value); - // set default hw/os/group - Dom.get('rep_platform').value = product.details.default_platform; - Dom.get('op_sys').value = product.details.default_op_sys; - Dom.get('groups').value = product.details.default_security_group; + // Set default Platform, OS and Security Group + // Skip if the default value is empty = auto-detect + const { default_platform, default_op_sys, default_security_group } = product.details; + + if (default_platform) { + document.querySelector('#rep_platform').value = default_platform; + } + + if (default_op_sys) { + document.querySelector('#op_sys').value = default_op_sys; + } + + if (default_security_group) { + document.querySelector('#groups').value = default_security_group; + } }, onComponentChange: function(componentName) { -- 2.47.3