From 425d780e7f77d8cc38191331cbcc84d7af5c871a Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Tue, 14 Jul 2015 14:52:03 +0800 Subject: Bug 1173442 - Implement admin UI changes to allow selecting default product security group instead of editing code --- extensions/GuidedBugEntry/Extension.pm | 4 ---- .../template/en/default/pages/guided_products.js.tmpl | 9 --------- extensions/GuidedBugEntry/web/js/guided.js | 10 ++-------- 3 files changed, 2 insertions(+), 21 deletions(-) (limited to 'extensions/GuidedBugEntry') diff --git a/extensions/GuidedBugEntry/Extension.pm b/extensions/GuidedBugEntry/Extension.pm index e36d0a2e4..93cab9787 100644 --- a/extensions/GuidedBugEntry/Extension.pm +++ b/extensions/GuidedBugEntry/Extension.pm @@ -107,10 +107,6 @@ sub page_before_template { return unless $page eq 'guided_products.js'; - # import data from the BMO ext - - $vars->{'product_sec_groups'} = \%product_sec_groups; - my %bug_formats; foreach my $product (keys %create_bug_formats) { if (my $format = Bugzilla::Extension::BMO::forced_format($product)) { diff --git a/extensions/GuidedBugEntry/template/en/default/pages/guided_products.js.tmpl b/extensions/GuidedBugEntry/template/en/default/pages/guided_products.js.tmpl index b58df8298..a57f0b581 100644 --- a/extensions/GuidedBugEntry/template/en/default/pages/guided_products.js.tmpl +++ b/extensions/GuidedBugEntry/template/en/default/pages/guided_products.js.tmpl @@ -15,12 +15,3 @@ products['[% product.key FILTER js %]'].format = '[% product.value FILTER js %]'; [% END %] [% END %] - -[% IF product_sec_groups %] - [% FOREACH product = product_sec_groups %] - if (!products['[% product.key FILTER js %]']) [% ~%] - products['[% product.key FILTER js %]'] = {}; - products['[% product.key FILTER js %]'].secgroup = '[% product.value FILTER js %]'; - [% END %] -[% END %] - diff --git a/extensions/GuidedBugEntry/web/js/guided.js b/extensions/GuidedBugEntry/web/js/guided.js index 0ff438782..339a6fc65 100644 --- a/extensions/GuidedBugEntry/web/js/guided.js +++ b/extensions/GuidedBugEntry/web/js/guided.js @@ -189,13 +189,6 @@ var product = { return; } - // use the correct security group - if (products[productName] && products[productName].secgroup) { - Dom.get('groups').value = products[productName].secgroup; - } else { - Dom.get('groups').value = products['_default'].secgroup; - } - // show support message if (products[productName] && products[productName].support) { Dom.get("product_support_message").innerHTML = products[productName].support; @@ -824,9 +817,10 @@ var bugForm = { } bugForm.onVersionChange(elVersions.value); - // set default hw/os + // 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; }, onComponentChange: function(componentName) { -- cgit v1.2.3-24-g4f1b