From dda060987910a8b5b0b74d25ddd79417af4b1e18 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Mon, 3 May 2010 15:36:00 +0200 Subject: Generalized isEnterprise method and adding more logging. --- bugzillaBugTriage.js | 22 ++++++++++++++++++---- 1 file 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"); -- cgit