From 7d0b9d75d0c57661729ff931ee283675016b53f2 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Tue, 16 Oct 2012 15:39:40 +0800 Subject: Bug 800691: guided bug entry - thunderbird - default to Untriaged and remove General components --- extensions/GuidedBugEntry/web/js/guided.js | 5 +++++ extensions/GuidedBugEntry/web/js/products.js | 16 +++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) (limited to 'extensions/GuidedBugEntry/web/js') diff --git a/extensions/GuidedBugEntry/web/js/guided.js b/extensions/GuidedBugEntry/web/js/guided.js index e98237fab..1883e4eb6 100644 --- a/extensions/GuidedBugEntry/web/js/guided.js +++ b/extensions/GuidedBugEntry/web/js/guided.js @@ -624,6 +624,11 @@ var bugForm = { } Dom.get('submit').disabled = false; + // filter components + if (products[productName] && products[productName].componentFilter) { + product.details.components = products[productName].componentFilter(product.details.components); + } + // build components var elComponent = Dom.get('component'); diff --git a/extensions/GuidedBugEntry/web/js/products.js b/extensions/GuidedBugEntry/web/js/products.js index 9f9b62a14..026e94f0d 100644 --- a/extensions/GuidedBugEntry/web/js/products.js +++ b/extensions/GuidedBugEntry/web/js/products.js @@ -94,7 +94,21 @@ var products = { "Thunderbird": { related: [ "Core", "Toolkit", "MailNews Core" ], - detectPlatform: true + detectPlatform: true, + defaultComponent: "Untriaged", + componentFilter : function(components) { + var index = -1; + for (var i = 0, l = components.length; i < l; i++) { + if (components[i].name == 'General') { + index = i; + break; + } + } + if (index != -1) { + components.splice(index, 1); + } + return components; + } }, "Penelope": { -- cgit v1.2.3-24-g4f1b