aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2010-05-03 15:36:00 +0200
committerMatěj Cepl <mcepl@redhat.com>2010-05-03 15:36:00 +0200
commitdda060987910a8b5b0b74d25ddd79417af4b1e18 (patch)
treede46e8e810951c7527d73f92910d6e5488153221
parentf579c40405261af671d7b71bfef4370393938864 (diff)
downloadbugzilla-triage-dda060987910a8b5b0b74d25ddd79417af4b1e18.tar.gz
Generalized isEnterprise method and adding more logging.
-rw-r--r--bugzillaBugTriage.js22
1 files changed, 18 insertions, 4 deletions
diff --git a/bugzillaBugTriage.js b/bugzillaBugTriage.js
index 97b9568..410ca08 100644
--- a/bugzillaBugTriage.js
+++ b/bugzillaBugTriage.js
@@ -1409,13 +1409,25 @@ RHBugzillaPage.prototype.collectComments = function() {
return outStr.trim();
};
+RHBugzillaPage.prototype.ProfessionalProducts = [
+ "Red Hat Enterprise Linux",
+ "Red Hat Enterprise MRG"
+];
+
/**
* Is this bug a RHEL bug?
*
* @return Boolean true if it is a RHEL bug
*/
-RHBugzillaPage.prototype.isRHEL = function() {
- return (/Red Hat Enterprise Linux/).test(this.product);
+RHBugzillaPage.prototype.isEnterprise = function() {
+ var prod = this.product;
+ console.log("Testing whether the bug with product = " + prod +
+ " is an enterprise bug.");
+ var result = this.ProfessionalProducts.some(function(elem,idx,arr) {
+ return new RegExp(elem).test(prod);
+ });
+ console.log("result = " + result);
+ return result;
};
/**
@@ -1448,13 +1460,15 @@ RHBugzillaPage.prototype.setBranding = function() {
var brandColor = {};
var TriagedColor = {};
- if (this.isRHEL()) {
+ if (this.isEnterprise()) {
+ console.log("This is an enterprise bug.");
if (this.its && (this.its.length > 0)) {
brandColor = this.RHITColor;
} else {
brandColor = this.RHColor;
}
} else if (new RegExp("Fedora").test(this.product)) {
+ console.log("This is NOT an enterprise bug.");
if (this.version == 999) {
brandColor = this.RawhideColor;
} else {
@@ -2178,7 +2192,7 @@ RHBugzillaPage.prototype.generalPurposeCureForAllDisease = function(addString,
if (!hlpr.isInList(this.maintCCAddr, this.CCList)) {
this.doc.getElementById("newcc").textContent = this.maintCCAddr;
}
- if ((!this.isRHEL()) && (verNo < TriagedDistro)) {
+ if ((!this.isEnterprise()) && (verNo < TriagedDistro)) {
this.selectOption("bug_status", nextState);
}
this.setKeyword("Triaged");