diff options
Diffstat (limited to 'bugzillaBugTriage.js')
-rw-r--r-- | bugzillaBugTriage.js | 29 |
1 files changed, 27 insertions, 2 deletions
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", "", |