aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bzpage.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bzpage.js')
-rw-r--r--lib/bzpage.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/bzpage.js b/lib/bzpage.js
index 1a43191..eac54af 100644
--- a/lib/bzpage.js
+++ b/lib/bzpage.js
@@ -12,6 +12,7 @@ var TriagedDistro = 13;
var NumberOfFrames = 7;
var bugURL = "https://bugzilla.redhat.com/show_bug.cgi?id=";
var BSTPrefNS = "bugzilla-triage.setting.";
+exports.BSTPrefNS = BSTPrefNS;
// ====================================================================================
// BZPage's methods
@@ -97,11 +98,16 @@ BZPage.prototype.getBugId = function getBugId () {
*/
BZPage.prototype.getInstalledPackages = function getInstalledPackages(cfg) {
var installedPackages = {};
+ var prefName = BSTPrefNS+"enabledPacks";
+ var enabledPackages = [];
if (cfg.gJSONData && ("commentPackages" in cfg.gJSONData)) {
- // TODO: Temporary hack ... should be replaced by a proper configuration
- // when replacement for jetpack.storage.settings lands
- var enabledPackages = cfg.gJSONData.configData.enabledPacks.split(/[, ]/);
+ if (preferences.isSet(prefName)) {
+ enabledPackages = preferences.get(prefName,"").split(/[, ]/);
+ } else {
+ preferences.set(prefName,"");
+ }
+
enabledPackages.forEach(function (pkg, idx, arr) {
if (pkg in cfg.gJSONData.commentPackages) {
installedPackages[pkg] = cfg.gJSONData.commentPackages[pkg];
@@ -744,4 +750,4 @@ BZPage.prototype.getCCList = function getCCList () {
};
// exports.BZPage = apiUtils.publicConstructor(BZPage);
-exports.BZPage = BZPage; \ No newline at end of file
+exports.BZPage = BZPage;