diff options
author | Dylan William Hardison <dylan@hardison.net> | 2014-10-29 16:21:11 +0100 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2015-02-02 14:45:45 +0100 |
commit | 2344279351712a6ad4176da273ecebb0bf1ff57d (patch) | |
tree | b273d9e3d369bc9d478cab6b6f01985182662f30 /extensions/GuidedBugEntry/web | |
parent | 1ccc683d4d94ea70e763fbd4af9721cb4bca1c0d (diff) | |
download | bugzilla-2344279351712a6ad4176da273ecebb0bf1ff57d.tar.gz bugzilla-2344279351712a6ad4176da273ecebb0bf1ff57d.tar.xz |
Bug 1050226 - Offer web devs a more focused set of product/components to file bugs in
Diffstat (limited to 'extensions/GuidedBugEntry/web')
-rw-r--r-- | extensions/GuidedBugEntry/web/js/guided.js | 55 | ||||
-rw-r--r-- | extensions/GuidedBugEntry/web/style/guided.css | 6 |
2 files changed, 45 insertions, 16 deletions
diff --git a/extensions/GuidedBugEntry/web/js/guided.js b/extensions/GuidedBugEntry/web/js/guided.js index 6a4419ddf..d7fe2c75b 100644 --- a/extensions/GuidedBugEntry/web/js/guided.js +++ b/extensions/GuidedBugEntry/web/js/guided.js @@ -13,6 +13,7 @@ var History = YAHOO.util.History; var guided = { _currentStep: '', + _defaultStep: 'product', detectedPlatform: '', detectedOpSys: '', currentUser: '', @@ -23,6 +24,9 @@ var guided = { // initialise new step this.updateStep = true; switch(newStep) { + case 'webdev': + webdev.onShow(); + break; case 'product': product.onShow(); break; @@ -36,7 +40,7 @@ var guided = { bugForm.onShow(); break; default: - guided.setStep('product'); + guided.setStep(this._defaultStep); return; } @@ -60,11 +64,14 @@ var guided = { } }, - init: function() { + init: function(conf) { // init history manager + if (conf.webdev) { + this._defaultStep = 'webdev'; + this.webdev = true; + } try { - History.register('h', History.getBookmarkedState('h') || 'product', - this._onStateChange); + History.register('h', History.getBookmarkedState('h') || this._defaultStep, this._onStateChange); History.initialize("yui-history-field", "yui-history-iframe"); History.onReady(function () { guided._onStateChange(History.getCurrentState('h'), true); @@ -74,6 +81,7 @@ var guided = { } // init steps + webdev.onInit(); product.onInit(); dupes.onInit(); bugForm.onInit(); @@ -95,6 +103,16 @@ var guided = { } }; +// webdev step + +var webdev = { + details: false, + + onInit: function () { }, + + onShow: function () { } +}; + // product step var product = { @@ -109,8 +127,22 @@ var product = { Dom.removeClass('advanced', 'hidden'); }, - select: function(productName) { + select: function(productName, componentName) { + var prod = products[productName]; + // called when a product is selected + if (componentName) { + this.setPreselectedComponent(componentName); + if (prod && prod.defaultComponent) { + prod.originalDefaultComponent = prod.originalDefaultComponent || prod.defaultComponent; + prod.defaultComponent = componentName; + } + } + else { + if (prod && prod.defaultComponent && prod.originalDefaultComponent) { + prod.defaultComponent = prod.originalDefaultComponent; + } + } this.setName(productName); dupes.reset(); guided.setStep('dupes'); @@ -184,7 +216,7 @@ var product = { } // show/hide component selection row - if (products[productName] && products[productName].noComponentSelection) { + if (products[productName] && products[productName].noComponentSelection || guided.webdev) { if (!Dom.hasClass('componentTR', 'hidden')) { Dom.addClass('componentTR', 'hidden'); } @@ -468,7 +500,7 @@ var dupes = { // a search has happened Dom.addClass('advanced', 'hidden'); Dom.addClass('dupes_continue_button_top', 'hidden'); - var prod = product.getName(); + var prod = product.getName(); if (products[prod] && products[prod].l10n) { Dom.removeClass('l10n_message', 'hidden'); Dom.get('l10n_product').textContent = product.getName(); @@ -682,13 +714,10 @@ var bugForm = { // build components var elComponent = Dom.get('component'); - if (products[productName] && products[productName].noComponentSelection) { - + if (products[productName] && products[productName].noComponentSelection || guided.webdev) { elComponent.value = products[productName].defaultComponent; bugForm._mandatoryFields = [ 'short_desc', 'version_select' ]; - } else { - bugForm._mandatoryFields = [ 'short_desc', 'component_select', 'version_select' ]; // check for the default component @@ -836,10 +865,14 @@ var bugForm = { elReset.disabled = false; elDescription.value = filename; elDescription.disabled = false; + Dom.removeClass('reset_data', 'hidden'); + Dom.removeClass('data_description_tr', 'hidden'); } else { elReset.disabled = true; elDescription.value = ''; elDescription.disabled = true; + Dom.addClass('reset_data', 'hidden'); + Dom.addClass('data_description_tr', 'hidden'); } }, diff --git a/extensions/GuidedBugEntry/web/style/guided.css b/extensions/GuidedBugEntry/web/style/guided.css index eca500c69..1676880ce 100644 --- a/extensions/GuidedBugEntry/web/style/guided.css +++ b/extensions/GuidedBugEntry/web/style/guided.css @@ -207,14 +207,10 @@ ul.product-list > li > .product-item { padding: 5px; } -#bugForm tr:nth-child(even) td, #bugForm tr:nth-child(even) th { +#bugForm tr { background: #e0e0e0; } -#bugForm tr.odd td { - background: inherit; -} - #bugForm .label { text-align: left; font-weight: bold; |