aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bzpage.js
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2010-09-25 18:38:50 +0200
committerMatěj Cepl <mcepl@redhat.com>2010-09-25 18:38:50 +0200
commit9f0a351e875dd5464cdc5562b572eabe44d131b0 (patch)
treec63a4bba60917fa29ac0e350b6ec9ced2378e762 /lib/bzpage.js
parent3f68c63721f90e97aa9f5c8e297c7c84b7f9659d (diff)
downloadbugzilla-triage-9f0a351e875dd5464cdc5562b572eabe44d131b0.tar.gz
Search in our bugzilla could be done in multiple components at once.
* Equivalent components are defined by a regular expression in the array config.gJSONData.constantData.equivalentComponents Fixes #50
Diffstat (limited to 'lib/bzpage.js')
-rw-r--r--lib/bzpage.js17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/bzpage.js b/lib/bzpage.js
index 2aeaf51..5a1751a 100644
--- a/lib/bzpage.js
+++ b/lib/bzpage.js
@@ -1002,9 +1002,22 @@ BZPage.prototype.queryInNewTab = function(text, component, product) {
urlStr += "&product=" + product.trim();
}
if (component) {
- urlStr += "&field0-0-0=component&type0-0-0=substring&value0-0-0="
- + component.trim();
+ if ("equivalentComponents" in this.constantData) {
+ var equivCompsArr = this.constantData["equivalentComponents"].
+ filter(function (REstr) {
+ return new RegExp(REstr).test(this.getComponent());
+ }, this);
+ if (equivCompsArr.length > 0) {
+ component = equivCompsArr[0];
+ }
+ urlStr += "&field0-0-0=component&type0-0-0=regexp&value0-0-0="
+ + component.trim();
+ } else {
+ urlStr += "&field0-0-0=component&type0-0-0=substring&value0-0-0="
+ + component.trim();
+ }
}
+
// using more complicated query tables here, because they can be more easily
// edited
// for further investigative searches