aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2010-06-16 10:36:13 +0200
committerMatěj Cepl <mcepl@redhat.com>2010-06-16 10:36:13 +0200
commit21374b14830837fe525046c1a77a4b61f31df6fa (patch)
tree2901376c5b97e82413a1b97e6c187236c047843b
parent9c56aebdc7182fab939c900a6cf9580f38855f32 (diff)
downloadbugzilla-triage-21374b14830837fe525046c1a77a4b61f31df6fa.tar.gz
Port bugfixes from the -prototype branch. simpleStorage is apparently
not that simple and it will need to be fixed.
-rw-r--r--.hgignore1
-rw-r--r--jsons/RH_Data-packages.json169
-rw-r--r--lib/bzpage.js5
-rw-r--r--lib/logger.js12
-rw-r--r--lib/main.js20
-rw-r--r--lib/rhbzpage.js28
6 files changed, 46 insertions, 189 deletions
diff --git a/.hgignore b/.hgignore
index b6261c9..6912cd1 100644
--- a/.hgignore
+++ b/.hgignore
@@ -1 +1,2 @@
.*~
+tmp/.*
diff --git a/jsons/RH_Data-packages.json b/jsons/RH_Data-packages.json
deleted file mode 100644
index 8414794..0000000
--- a/jsons/RH_Data-packages.json
+++ /dev/null
@@ -1,169 +0,0 @@
-{
- "constantData": {
- "bugzillalabelNames": {
- "bugzilla.mozilla.org": "Mozilla Foundation",
- "bugs.freedesktop.org": "FreeDesktop.org",
- "bugs.eclipse.org": "Eclipse Project",
- "bugzilla.gnome.org": "GNOME Desktop",
- "bugzilla.redhat.com": "Red Hat"
- },
- "bugzillalabelAbbreviations": {
- "bugzilla.mozilla.org": "MoFo",
- "bugs.freedesktop.org": "FDo",
- "bugs.eclipse.org": "Eclipse",
- "bugzilla.gnome.org": "bgo",
- "bugzilla.redhat.com": "RH"
- },
- "defaultAssignee": [
- {
- "regexp": "xorg-x11-drv-(ati|mach.*|r128)",
- "addr": "jglisse@redhat.com"
- },
- {
- "regexp": "xorg-x11-drv-intel",
- "addr": "ajax@redhat.com"
- },
- {
- "regexp": "xorg-x11-(server.*|drv-vesa|drv-mga)",
- "addr": "ajax@redhat.com"
- },
- {
- "regexp": "xorg-x11-drv-(keyboard|mouse|evdev)|xkeyboard-config|linuxwacom",
- "addr": "peter.hutterer@redhat.com"
- },
- {
- "regexp": "(seamonkey|nss.*)",
- "addr": "kengert@redhat.com"
- },
- {
- "regexp": "thunderbird",
- "addr": "jhorak@redhat.com"
- },
- {
- "regexp": "xorg-x11-init",
- "addr": "sandmann@redhat.com"
- },
- {
- "regexp": "(firefox|xulrunner)",
- "addr": "stransky@redhat.com"
- },
- {
- "regexp": "xorg-x11-drv-(nv|nouveau)",
- "addr": "bskeggs@redhat.com"
- }
- ],
- "CCmaintainer": [
- {
- "regexp": "xorg|X11|compiz|chkfontpath|imake|libdmx|libdrm|libfontenc|libFS|libICE|libSM|libwnck|libxkbfile|mesa|pyxf86config|system-config-display|xkeyboard-config|xrestop|xsri",
- "addr": [
- "xgl-maint@redhat.com"
- ]
- },
- {
- "regexp": "epiphany.*|firefox|galeon|gecko-sharp2|htmlview|^mozilla|seamonkey|thunderbird|xulrunner|nspluginwrapper",
- "addr": [
- "gecko-bugs-nobody@fedoraproject.org" ,
- "gecko-bugs-nobody@redhat.com"
- ]
- }
- ],
- "newUpstreamBug": [
- {
- "regexp": "thunderbird",
- "addr": "https://bugzilla.mozilla.org/enter_bug.cgi?product=Thunderbird"
- },
- {
- "regexp": "firefox",
- "addr": "https://bugzilla.mozilla.org/enter_bug.cgi?product=Firefox"
- },
- {
- "regexp": "xulrunner",
- "addr": "https://bugzilla.mozilla.org/enter_bug.cgi?product=Core"
- }
- ],
- "queryUpstreamBug": [
- {
- "regexp": "thunderbird|firefox|xulrunner",
- "addr": "https://bugzilla.mozilla.org/buglist.cgi?quicksearch="
- }
- ]
- },
- "childIDsGroupings": [
- {
- "regexp": "RADEON,R(100|[VS][12]00|S200M|S250|N50)",
- "addr": "R100"
- },
- {
- "regexp": "RADEON,R(200|V2[58]0|C350|S3[05]0)",
- "addr": "R200"
- },
- {
- "regexp": "RADEON,R(3[056]0|V3[56][10])",
- "addr": "R300"
- },
- {
- "regexp": "RADEON,RV3[78]0",
- "addr": "R300e"
- },
- {
- "regexp": "RADEON,RS4[08][025]",
- "addr": "IGP300"
- },
- {
- "regexp": "RADEON,R(4[123]0|481)",
- "addr": "R400"
- },
- {
- "regexp": "RADEON,R(V410|423|4[38]0)",
- "addr": "R420"
- },
- {
- "regexp": "RADEON,R(V51[56]|V53[05]|V5[67]0|5[28]0|580\\+)",
- "addr": "R500"
- },
- {
- "regexp": "RADEON,RS(6[09]|74)0C?",
- "addr": "IGP600"
- },
- {
- "regexp": "RADEON,R(V6[1273][50]|R6[80]0).*",
- "addr": "R600"
- },
- {
- "regexp": "RADEON,RS([78]80)[CD]?",
- "addr": "IGP700"
- },
- {
- "regexp": "RADEON,R(V7[13479]0.*|700)",
- "addr": "R700"
- },
- {
- "regexp": "RADEON,(Juniper|Cypress|Hemlock).*",
- "addr": "R800"
- },
- {
- "regexp": "RADEON,M(9|10).*",
- "addr": "FireGL"
- },
- {
- "regexp": "NOUVEAU,NV[13456]",
- "addr": "preGeForce"
- },
- {
- "regexp": "NOUVEAU,NV10",
- "addr": "GeForce"
- },
- {
- "regexp": "NOUVEAU,NV1[156]",
- "addr": "GeForce2"
- },
- {
- "regexp": "NOUVEAU,NV20",
- "addr": "GeForce3"
- },
- {
- "regexp": "INTEL,865PE",
- "addr": "AGP8x"
- }
- ]
-} \ No newline at end of file
diff --git a/lib/bzpage.js b/lib/bzpage.js
index 8f11eb5..aebcac6 100644
--- a/lib/bzpage.js
+++ b/lib/bzpage.js
@@ -664,11 +664,6 @@ BZPage.prototype.setUpLogging = function() {
console.log("this.store wiped out!");
}, false);
- if (!this.store) {
- console.log("No this.store defined!");
- this.store = {};
- }
-
if (this.log.store.length > 0) {
clearLogAElem.style.color = this.log.FullLogsColor;
clearLogAElem.style.fontWeight = "bolder";
diff --git a/lib/logger.js b/lib/logger.js
index 6bd8142..8481f66 100644
--- a/lib/logger.js
+++ b/lib/logger.js
@@ -25,19 +25,21 @@ Logger.prototype.addLogRecord = function(that) {
let recKey = utilMod.getISODate(rec.date) + "+"
+ urlMod.parse(rec.url).host
+ "+" + that.bugNo;
+ console.log("rec = " + rec.toSource());
+
let clearLogAElem = that.doc.getElementById("clearLogs");
- clearLogAElem.style.color = this.FullLogsColor;
- clearLogAElem.style.fontWeight = "bolder";
+ if (clearLogAElem.style.color != this.FullLogsColor) {
+ clearLogAElem.style.color = this.FullLogsColor;
+ clearLogAElem.style.fontWeight = "bolder";
+ }
if (this.store[recKey]) {
this.store[recKey].comment += "<br/>\n" + comment;
} else {
this.store[recKey] = rec;
}
jetpack.storage.simple.sync();
- return rec;
- } else {
- return comment;
}
+ return comment;
};
Logger.prototype.getBugzillaAbbr = function(url) {
diff --git a/lib/main.js b/lib/main.js
index 365d445..ac2fd04 100644
--- a/lib/main.js
+++ b/lib/main.js
@@ -15,7 +15,20 @@
var util = require("util");
var logger = require("logger");
var file = require("file");
+
+// FIXME this apparently is not good, properties of the object
+// itself must be set, not variable referring to it
var myStorage = require("simple-storage").storage;
+// FIXME we should follow private browsing state
+/*
+simpleStorage.storage.history = [];
+var privateBrowsing = require("private-browsing");
+if (!privateBrowsing.active) {
+ var url = getSelectedTabURL();
+ simpleStorage.storage.history.push(url);
+}
+
+*/
var TriagedDistro = 13;
var NumberOfFrames = 7;
@@ -83,12 +96,19 @@ util.loadJSON(jetpack.storage.settings.JSONURL, function(parsedData) {
for (let key in config.gJSONData) {
keys += key + " ";
}
+ console.log("keys = " + keys);
+
if ("PCIIDsURL" in config.gJSONData.configData) {
util.loadJSON(config.gJSONData.configData.PCIIDsURL, function(response) {
config.PCI_ID_Array = response;
});
}
+ if (!myStorage.logs) {
+ console.log("No store for logs defined!");
+ myStorage.logs = {};
+ }
+
config.logger = new logger.Logger(myStorage.logs,
config.gJSONData.constantData.bugzillalabelAbbreviations);
diff --git a/lib/rhbzpage.js b/lib/rhbzpage.js
index c9d9b9f..9f8a39f 100644
--- a/lib/rhbzpage.js
+++ b/lib/rhbzpage.js
@@ -7,6 +7,7 @@ var util = require("util");
var xrpc = require("xmlrpc");
var xhr = require("xhr");
var clip = require("clipboard");
+var selection = require("selection");
// var TriagedDistro = 13;
// var NumberOfFrames = 7;
// var XMLRPCurl = "https://bugzilla.redhat.com/xmlrpc.cgi";
@@ -182,6 +183,7 @@ RHBugzillaPage.prototype.closeSomeRelease = function() {
* Additional commands specific for this subclass, overriding superclass one.
*/
RHBugzillaPage.prototype.centralCommandDispatch = function(cmdLabel, cmdParams) {
+ console.log("cmdLabel = " + cmdLabel + ", cmdParams = " + cmdParams);
switch (cmdLabel) {
// Set up our own commands
case "closeUpstream":
@@ -193,7 +195,7 @@ RHBugzillaPage.prototype.centralCommandDispatch = function(cmdLabel, cmdParams)
case "queryStringOurBugzilla":
this.queryForSelection();
break;
- case "queryUpstreamBugzilla":
+ case "queryStringUpstreamBugzilla":
this.queryUpstream();
break;
case "sendBugUpstream":
@@ -586,14 +588,23 @@ RHBugzillaPage.prototype.queryInNewTab = function(text, component, product) {
* Get the text to search for and prepare other things for the real executive
* function this.queryInNewTab, and run it.
*/
-RHBugzillaPage.prototype.queryForSelection = function() {
- let text = jetpack.selection.text;
+RHBugzillaPage.prototype.getSelectionOrClipboard = function() {
+ var text = selection.text;
console.log("selection = " + text);
if (!text) {
text = clip.get();
console.log("clipboard = " + text);
}
console.log("text = " + text);
+ return text;
+};
+
+/**
+ * Get the text to search for and prepare other things for the real executive
+ * function this.queryInNewTab, and run it.
+ */
+RHBugzillaPage.prototype.queryForSelection = function() {
+ var text = this.getSelectionOrClipboard();
if (text) {
this.queryInNewTab(text, this.component);
}
@@ -603,12 +614,9 @@ RHBugzillaPage.prototype.queryForSelection = function() {
* Search simple query in the upstream bugzilla appropriate for the component.
*/
RHBugzillaPage.prototype.queryUpstream = function() {
- let text = jetpack.selection.text;
- if (!text) {
- text = clip.get();
- }
+ var text = this.getSelectionOrClipboard();
if (text) {
- let text = encodeURIComponent(text.trim());
+ text = encodeURIComponent(text.trim());
let queryUpstreamBugsURLArray = this.constantData.queryUpstreamBug;
let url = util.filterByRegexp(queryUpstreamBugsURLArray, this.component);
jetpack.tabs.open(url + text);
@@ -619,8 +627,8 @@ RHBugzillaPage.prototype.queryUpstream = function() {
*
*/
RHBugzillaPage.prototype.sendBugUpstream = function() {
- let url = util.filterByRegexp(this.constantData.newUpstreamBug, this
- .getOptionValue("component"));
+ var url = util.filterByRegexp(this.constantData.newUpstreamBug,
+ this.component);
let ret = jetpack.tabs.open(url);
let that = this;