aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2010-05-26 15:17:35 +0200
committerMatěj Cepl <mcepl@redhat.com>2010-05-26 15:17:35 +0200
commitd3d6aea97ebab16dd8819a5d63db579fbb7a22e3 (patch)
treec4012095e1422ef3d39ead6bb187b0387134d561
parent42d700237558058eae8267ee91d95e46083fc9be (diff)
downloadbugzilla-triage-d3d6aea97ebab16dd8819a5d63db579fbb7a22e3.tar.gz
Removing unnecessary console.log calls ... logs was just one pure mess.
-rw-r--r--bugzillaBugTriage.js75
1 files changed, 8 insertions, 67 deletions
diff --git a/bugzillaBugTriage.js b/bugzillaBugTriage.js
index 619ed33..b043cd5 100644
--- a/bugzillaBugTriage.js
+++ b/bugzillaBugTriage.js
@@ -296,16 +296,11 @@ hlpr.valToArray = function valToArray(val) {
* @return String with merged lists
*/
hlpr.addCSVValue = function addCSVValue(str, value) {
- console.log("addCSVValue: str = " + str + ", value = " + value);
- console.log("addCSVValue: typeof str = " + typeof str + ", typeof value = " + typeof value);
let parts = (str.trim().length > 0 ? str.split(",") : []);
- console.log("parts before = " + parts.toSource());
if (!hlpr.isInList(value,parts)) {
let newValue = hlpr.valToArray(value);
- console.log("newValue = " + newValue);
parts = parts.concat(newValue);
}
- console.log("parts on leaving = " + parts.toSource());
return parts.join(", ");
};
@@ -396,7 +391,6 @@ hlpr.loadJSON = function(URL, cb_function, what) {
what = this;
}
- console.log("URL = " + URL);
hlpr.loadText(URL, function(text) {
let data = JSON.parse(text);
cb_function.call(what, data);
@@ -657,8 +651,6 @@ Logger.prototype.addLogRecord = function(that) {
"Enter comments for this comment");
if (comment && comment.length > 0) {
comment = comment.trim();
- console.log("comment = " + comment);
- console.log("");
rec.comment = comment;
let recKey = hlpr.getISODate(rec.date) + "+" + hlpr.getHost(rec.url)
+ "+" + that.bugNo;
@@ -681,15 +673,12 @@ Logger.prototype.getBugzillaAbbr = function(url) {
// for https://bugzilla.redhat.com/show_bug.cgi?id=579123 get RH
// for https://bugzilla.mozilla.org/show_bug.cgi?id=579123 get MoFo
var abbr = this.abbsMap[hlpr.getHost(url)];
- console.log("abbr = " + abbr);
return abbr;
}
Logger.prototype.timeSheetRecordsPrinter = function(body, records) {
let that = this;
let commentBugRE = new RegExp("[bB]ug\\s+([0-9]+)","g");
- console.log("body = " + body);
- console.log("records = " + records);
// sort the records into temporary array
let tmpArr = [];
@@ -715,11 +704,9 @@ Logger.prototype.timeSheetRecordsPrinter = function(body, records) {
body.innerHTML += "<hr/><p><strong>" + currentDay
+ "</strong></p>";
}
- console.log("comment = " + x.comment);
// replace "bug ####" with a hyperlink to the current bugzilla
let comment = x.comment.replace(commentBugRE,
"<a href='http://"+host+"/show_bug.cgi?id=$1'>$&</a>");
- console.log("comment = " + comment);
body.innerHTML += "<p><em><a href='"
+ x.url
+ "'>Bug "
@@ -749,7 +736,6 @@ Logger.prototype.createBlankPage = function (ttl, bodyBuildCB) {
Logger.prototype.generateTimeSheet = function(body) {
let doc = body.ownerDocument;
- console.log("doc = " + doc);
this.timeSheetRecordsPrinter(body, this.store);
};
@@ -832,14 +818,7 @@ BZPage.prototype.getInstalledPackages = function() {
* @param cmdParams Object with the appropriate parameters for the command
*/
BZPage.prototype.centralCommandDispatch = function (cmdLabel, cmdParams) {
- console.log("BZPage centralCommandDispatch\n"+
- "cmdLabel = " + cmdLabel + ", cmdParams = " + cmdParams);
switch (cmdLabel) {
- // FIXME we don't have guaranteed order of execution, but
- // for example resolution can be executed only after status;
- // we may need to eliminate these two commands and replace them
- // with "closed", "assigned", etc. with parameter resolution?
- // or only "closed" and other commands which require resolution?
case "resolution":
case "product":
case "component":
@@ -906,9 +885,7 @@ BZPage.prototype.centralCommandDispatch = function (cmdLabel, cmdParams) {
this.addStuffToTextBox("comment", cmdParams);
break;
case "commentIdx":
- console.log("commentIdx: idx = " + cmdParams);
let commentText = this.commentStrings[cmdParams];
- console.log("comment = " + commentText);
this.addStuffToTextBox("comment", commentText);
break;
case "setNeedinfo":
@@ -939,15 +916,10 @@ BZPage.prototype.centralCommandDispatch = function (cmdLabel, cmdParams) {
* this.centralCommandDispatch to execute them.
*/
BZPage.prototype.executeCommand = function(cmd) {
- console.log("executeCommand / cmd = " + cmd);
let [pkg, id] = cmd.split("//");
let commentObj = this.packages[pkg][id];
- console.log("commentObj:\n" + commentObj.toSource()+
- "\n----------------------------------");
for (let key in commentObj) {
- console.log("key = " + key +
- "\ncommentObj = " + commentObj.toSource());
this.centralCommandDispatch(key,commentObj[key]);
}
};
@@ -970,7 +942,6 @@ BZPage.prototype.changeAssignee = function(newAssignee) {
if (this.getDefaultAssignee) {
if (newAssignee == "default") {
let defAss = this.getDefaultAssignee();
- console.log("defAss = " + defAss);
if (defAss) {
newAssignee = defAss;
} else {
@@ -1240,9 +1211,6 @@ BZPage.prototype.filterByRegexp = function(list, chosingMark) {
*/
BZPage.prototype.addStuffToTextBox = function(id, stuff) {
let textBox = this.doc.getElementById(id);
- console.log("textBox.id = " + id);
- console.log("textBox.stuff = " + stuff);
- console.log("textBox.tagname = " + textBox.tagName.toLowerCase());
if (textBox.tagName.toLowerCase() === "textarea") {
stuff = textBox.value ? "\n\n" + stuff : stuff;
textBox.value += stuff;
@@ -1276,7 +1244,6 @@ BZPage.prototype.idContainsWord = function(id, str) {
// For those who don't have particular element at all or if it is empty
return false;
}
- console.log("id = " + id + ", kwd = " + kwd.trim());
return (kwd.trim().indexOf(str) != -1);
};
@@ -1325,9 +1292,7 @@ BZPage.prototype.getOwner = function() {
.parentNode.parentNode.parentNode;
let assigneeAElement = priorityParent.querySelector("tr:nth-of-type(1) a.email");
let assgineeHref = decodeURI(assigneeAElement.getAttribute("href"));
- console.log("assignee href = " + assgineeHref);
let email = assgineeHref.split(":")[1];
- console.log("assignee's email = " + email);
return email;
};
@@ -1340,7 +1305,6 @@ BZPage.prototype.getLogin = function () {
let lastLIElement = this.doc.querySelector("#header ul.links li:last-of-type");
let loginArr = lastLIElement.textContent.split("\n");
let loginStr = loginArr[loginArr.length - 1].trim();
- console.log("login = " + loginStr);
return loginStr;
};
@@ -1351,9 +1315,7 @@ BZPage.prototype.getLogin = function () {
* @return String with the maintainer's email address
*/
BZPage.prototype.getDefaultBugzillaMaintainer = function(component) {
- console.log("getDefaultBugzillaMaintainer / component = " + component);
let address = this.filterByRegexp(this.defBugzillaMaintainerArr, component);
- console.log("getDefaultBugzillaMaintainer / address = " + address);
return address;
}
@@ -1412,7 +1374,6 @@ BZPage.prototype.getPassword = function() {
*
*/
BZPage.prototype.setUpLogging = function() {
- console.log("Logging setUpLogging");
// For adding additional buttons to the top toolbar
let additionalButtons = this.doc.querySelector("#bugzilla-body *.related_actions");
let that = this;
@@ -1484,7 +1445,6 @@ BZPage.prototype.setUpLogging = function() {
* of the bugzilla should be added
*/
BZPage.prototype.addToCCList = function(who) {
- console.log("who = " + who);
if (!who) {
return ;
}
@@ -1586,7 +1546,6 @@ RHBugzillaPage = function(doc) {
this.btSnippet = "";
let parseAbrtBacktraces = config.gJSONData.configData.parseAbrtBacktraces;
- console.log("parseAbrtBacktraces = " + parseAbrtBacktraces);
if (parseAbrtBacktraces && this.RE.Abrt.test(this.title)) {
this.pasteBacktraceInComments();
}
@@ -1641,8 +1600,6 @@ RHBugzillaPage.prototype.getDefaultAssignee = function() {
RHBugzillaPage.prototype.setDefaultAssignee = function() {
this.defaultAssignee = this.getDefaultAssignee();
let defAss = this.defaultAssignee;
- console.log("defAss = " + defAss);
- console.log("owner = " + this.getOwner());
// Add setting default assignee
if ((defAss.length > 0) && (defAss !== this.getOwner())) {
@@ -1683,8 +1640,6 @@ RHBugzillaPage.prototype.closeSomeRelease = function() {
* Additional commands specific for this subclass, overriding superclass one.
*/
RHBugzillaPage.prototype.centralCommandDispatch = function(cmdLabel, cmdParams) {
- console.log("RHBugzillaPage centralCommandDispatch\n"+
- "cmdLabel = " + cmdLabel + ", cmdParams = " + cmdParams);
switch (cmdLabel) {
// Set up our own commands
case "closeUpstream":
@@ -1911,8 +1866,6 @@ RHBugzillaPage.prototype.pasteBacktraceInComments = function() {
btAttachments.forEach(function(x) {
attURL = "https://bugzilla.redhat.com/attachment.cgi?id="
+ x[1];
- console.log("attURL = " + attURL);
- console.log("btSnippet = " + this.btSnippet);
if (!this.btSnippet) {
let btRaw = hlpr.loadText(attURL, function(ret) {
this.btSnippet = this.parseBacktrace(ret);
@@ -1955,12 +1908,9 @@ RHBugzillaPage.prototype.markBadAttachments = function() {
*/
RHBugzillaPage.prototype.isEnterprise = function() {
let prod = this.product;
- console.log("Testing whether the bug with product = " + prod +
- " is an enterprise bug.");
let result = this.ProfessionalProducts.some(function(elem,idx,arr) {
return new RegExp(elem).test(prod);
});
- console.log("result = " + result);
return result;
};
@@ -2176,7 +2126,6 @@ RHBugzillaPage.prototype.fillInChipMagic = function () {
filter(function (v,i,a) {
return this.RE.Chipset.test(v);
});
- console.log("interestingLineArr = " + interestingLineArr.toSource());
if (interestingLineArr.length >0) {
interestingArray = this.RE.Chipset.exec(interestingLineArr[0]);
interestingLine = interestingArray[2].
@@ -2203,15 +2152,15 @@ RHBugzillaPage.prototype.fillInChipMagic = function () {
*
* @param text to be searched for
* @param component String with the component name (maybe latter regexp?)
- * @param product (optional) string with the product name
+ * @param product (optional) string with the product name, if undefined,
+ * search in all products
* @return None
*
*/
RHBugzillaPage.prototype.queryInNewTab = function(text, component, product) {
- // Optional parameter
- if (product === undefined) {
- product = this.product;
- }
+ console.log("queryInNewTab / text = " + text);
+ console.log("queryInNewTab / component = " + component);
+ console.log("queryInNewTab / product = " + product);
let url = "https://bugzilla.redhat.com/buglist.cgi?query_format=advanced";
if (product) {
url += "&product=" + product.trim();
@@ -2252,9 +2201,12 @@ RHBugzillaPage.prototype.queryInNewTab = function(text, component, product) {
*/
RHBugzillaPage.prototype.queryForSelection = function() {
let text = jetpack.selection.text;
+ console.log("selection = " + text);
if (!text) {
text = jetpack.clipboard.get();
+ console.log("clipboard = " + text);
}
+ console.log("text = " + text);
if (text) {
this.queryInNewTab(text, this.component);
}
@@ -2412,17 +2364,13 @@ RHBugzillaPage.prototype.fixAttachById = function(id, type, email) {
}
let msg = new XMLRPCMessage("bugzilla.updateAttachMimeType");
- console.log("XML-RPC before:\n"+msg.xml())
msg.addParameter( {
'attach_id' : id,
'mime_type' : type,
'nomail' : !email
});
- console.log("XML-RPC message:\n"+msg.xml());
msg.addParameter(this.login);
- console.log("XML-RPC message:\n"+msg.xml());
msg.addParameter(this.password);
- console.log("XML-RPC message:\n"+msg.xml());
let req = new XMLHttpRequest();
let that = this;
@@ -2523,7 +2471,6 @@ RHBugzillaPage.prototype.addClosingUpstream = function() {
externalBugID = parseInt(inputBox.value, 10);
let bugzillaHostname = this.doc.getElementById("external_id").value;
wholeURL = bugzillaHostname+"show_bug.cgi?id="+externalBugID;
- console.log("wholeURL = " + wholeURL);
} else {
// no inputBox.value -- maybe there is an external bug from
// the previous commit?
@@ -2561,11 +2508,8 @@ RHBugzillaPage.prototype.markBugTriaged = function() {
let ver = this.getVersion();
let assignee = this.getOwner();
if ((!this.isEnterprise()) && (ver < TriagedDistro)) {
- console.log("setting ASSIGNED");
this.selectOption("bug_status", "ASSIGNED");
}
- console.log("calling addStuffToTextBox in markBugTriaged with\n" +
- "keywords and Triaged");
this.addStuffToTextBox("keywords","Triaged");
}
@@ -2612,7 +2556,6 @@ config.matches = [
"https://bugzilla.mozilla.org/show_bug.cgi"
];
hlpr.loadJSON(jetpack.storage.settings.JSONURL, function(parsedData) {
- console.log("jsonDataURL = " + jetpack.storage.settings.JSONURL);
config.gJSONData = parsedData;
// Get card translation table
@@ -2620,8 +2563,6 @@ hlpr.loadJSON(jetpack.storage.settings.JSONURL, function(parsedData) {
for (let key in config.gJSONData) {
keys += key + " ";
}
-// console.log("configData = " + config.gJSONData.toSource());
- console.log("keys = " + keys);
if ("PCIIDsURL" in config.gJSONData.configData) {
hlpr.loadJSON(config.gJSONData.configData.PCIIDsURL, function(response) {
config.PCI_ID_Array = response;