aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2010-03-20 18:18:52 +0100
committerMatěj Cepl <mcepl@redhat.com>2010-03-20 18:18:52 +0100
commit6db662a9d56ea1ed0eb807f7764a54a66a0d8276 (patch)
tree711e3c72b8e63107edfca1c9b72795d946f6fb4c
parent4c033b481b157bc180b5191d5a8a14b1ee272a0b (diff)
downloadbugzilla-triage-6db662a9d56ea1ed0eb807f7764a54a66a0d8276.tar.gz
Add upstream bugzilla query button
-rw-r--r--BugZappers_data.json5
-rw-r--r--bugzillaBugTriage.js29
2 files changed, 30 insertions, 4 deletions
diff --git a/BugZappers_data.json b/BugZappers_data.json
index 1d03b6f..97303e7 100644
--- a/BugZappers_data.json
+++ b/BugZappers_data.json
@@ -89,8 +89,9 @@
"queryButton": true,
"upstreamButton": false,
"submitsLogging": false,
- "upstreamBugzillas": [
-
+ "newUpstreamBug": [
+ ],
+ "queryUpstreamBug": [
],
"suspiciousComponents": [
diff --git a/bugzillaBugTriage.js b/bugzillaBugTriage.js
index b5e8e74..7eda565 100644
--- a/bugzillaBugTriage.js
+++ b/bugzillaBugTriage.js
@@ -148,7 +148,8 @@ loadJSON(jsonDataURL, function(response) {
queryButtonAvailable = response.queryButton;
upstreamButtonAvailable = response.upstreamButton;
logSubmits = response.submitsLogging;
- upstreamBugzillasArray = response.upstreamBugzillas;
+ newUpstreamBugsURLArray = response.newUpstreamBug;
+ queryUpstreamBugsURLArray = response.queryUpstreamBug;
chipIDsGroupings = response.chipIDsGroupings;
topRow = response.topRow;
bottomRow = response.bottomRow;
@@ -1382,10 +1383,25 @@ BzPage.prototype.queryForSelection = function() {
};
/**
+ * Search simple query in the upstream bugzilla appropriate for the component.
+ */
+BzPage.prototype.queryUpstream = function() {
+ var text = jetpack.selection.text;
+ if (!text) {
+ text = jetpack.clipboard.get();
+ }
+ if (text) {
+ var text = encodeURIComponent(text.trim());
+ var url = filterByRegexp(queryUpstreamBugsURLArray,this.component);
+ jetpack.tabs.open(url+text);
+ }
+}
+
+/**
*
*/
BzPage.prototype.sendBugUpstream = function() {
- var url = filterByRegexp(upstreamBugzillasArray, this
+ var url = filterByRegexp(newUpstreamBugsURLArray, this
.getOptionValue("component"));
var ret = jetpack.tabs.open(url);
@@ -1847,6 +1863,8 @@ BzPage.prototype.generalPurposeCureForAllDisease = function(addString,
this.setKeyword("Triaged");
} else if (nextState === "QUERYSEL") {
this.queryForSelection();
+ } else if (nextState === "QUERYUP") {
+ this.queryUpstream();
} else if (nextState === "SENDUPSTREAM") {
this.sendBugUpstream();
} else if (nextState === "SETDEFASS") {
@@ -1939,6 +1957,13 @@ BzPage.prototype.buildButtons = function(above, below) {
this.addNewButton(brElementPlacer, "newqueryintab", "Query for string",
"", "QUERYSEL", "", false);
}
+ if (queryUpstreamBugsURLArray) {
+ console.log("Adding upstream query search box");
+ if (filterByRegexp(queryUpstreamBugsURLArray,this.component)) {
+ this.addNewButton(brElementPlacer, "upstreamqueryintab", "Query upstream",
+ "", "QUERYUP", "", false);
+ }
+ }
// Button for upstreaming
if (upstreamButtonAvailable) {
this.addNewButton(brElementPlacer, "sendupstream", "Send upstream", "",