diff options
author | Matěj Cepl <mcepl@redhat.com> | 2011-02-14 17:51:53 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2011-02-14 17:57:45 +0100 |
commit | 04657077ba12e8f23feaa0c3787b590c44446056 (patch) | |
tree | ebe206422871e71b142985786a9472ff447be0cd /data/rhbzpage.js | |
parent | 838c1d4abd72bd87dcc8ee41310ca3a8af498c96 (diff) | |
download | bugzilla-triage-04657077ba12e8f23feaa0c3787b590c44446056.tar.gz |
Basic functionality working. Switching to this bug for my day-to-day work.
Diffstat (limited to 'data/rhbzpage.js')
-rw-r--r-- | data/rhbzpage.js | 49 |
1 files changed, 31 insertions, 18 deletions
diff --git a/data/rhbzpage.js b/data/rhbzpage.js index 60dda35..fa511c7 100644 --- a/data/rhbzpage.js +++ b/data/rhbzpage.js @@ -78,8 +78,11 @@ function setDefaultAssignee() { // Add setting default assignee if ((defAss.length > 0) && (defAss !== getOwner())) { - constantData.defaultAssigneeTrigger = true; - createNewButton("bz_assignee_edit_container",true,"rh-common","setDefaultAssignee"); + createNewButton("bz_assignee_edit_container",true, { + "name": "Def. Assignee", + "assignee": "default" + }); // TODO when this will be a production we can remove + // rh-common/setDefaultAssignee from RH_Data-packages.json } } @@ -111,7 +114,6 @@ function closeSomeRelease() { * Additional commands specific for this subclass, overriding superclass one. */ function RHcentralCommandDispatch(cmdLabel, cmdParams) { - console.log("cmdLabel = " + cmdLabel + ", cmdParams = " + cmdParams); switch (cmdLabel) { // Set up our own commands case "closeUpstream": @@ -155,7 +157,7 @@ function addAttachment(data, callback, param) { var params = []; if (!constantData.passwordState.passAvailable) { - console.log("No password, no XML-RPC calls; sorry"); + console.log("addAttachment : No password, no XML-RPC calls; sorry"); return null; } @@ -341,8 +343,20 @@ function addCheckShowLink(oldAtt, snippet) { */ function markBadAttachments(atts) { var badMIMEArray = [ "application/octet-stream", "text/x-log", "undefined" ]; +/* FIXME +error: An exception occurred. +Traceback (most recent call last): + File "/home/matej/archiv/2011/projekty/bugzilla-triage/data/bzpage.js", line 1005, in + File "/home/matej/archiv/2011/projekty/bugzilla-triage/data/bzpage.js", line 998, in startup + File "/home/matej/archiv/2011/projekty/bugzilla-triage/data/rhbzpage.js", line 915, in RHBZinit + File "/home/matej/archiv/2011/projekty/bugzilla-triage/data/rhbzpage.js", line 344, in markBadAttachments +TypeError: "use strict";constantData.passwordState is undefined +*/ + // FIXME this should work + console.log("markBadAttachments : constantData.passwordState.toSource() = " + + constantData.passwordState.toSource()); if (!constantData.passwordState.passAvailable) { - console.log("No password, no XML-RPC calls; sorry"); + console.log("markBadAttachments : No password, no XML-RPC calls; sorry"); return null; } @@ -456,15 +470,13 @@ function setBranding() { } */ -/* // mark suspicious components FIXME var compElems; - if (suspiciousComponents - && isInList(getComponent(), suspiciousComponents) + if (config.suspiciousComponents + && isInList(getComponent(), config.suspiciousComponents) && (compElems = document .getElementById("bz_component_edit_container"))) { compElems.style.background = "red none"; } -*/ } /** @@ -649,13 +661,13 @@ function fillInChipMagic(XorgLogAttList, XorgLogAttListIndex) { interestingArray = ChipsetRE.exec(interestingLineArr[0]); interestingLine = interestingArray[2]. replace(/[\s"]+/g," ").trim(); - // Persuade createNewButton to have mercy and to actually add - // non-default button - constantData.chipMagicTrigger = true; - // FIXME packages don't exist anymore // that.packages["rh-xorg"].chipMagic.chipMagic = interestingLine+"\t"+interestingArray[1] // .toUpperCase(); - createNewButton("status_whiteboard", true, "rh-xorg", "chipMagic"); + // TODO we can remove rh-common / chipMagic element from RH_Data-packages.json + createNewButton("status_whiteboard", true, { + "name": "Fill In", + "chipMagic": true + }); } } } @@ -667,7 +679,7 @@ function analyzeXorgLog(attachID) { postMessage(new Message("GetURL", { url: "https://bugzilla.redhat.com/attachment.cgi?id=" + attachID, backMessage: "AnalyzeXorgLogBacktrace" - }; + })); } function analyzeXorgLogBacktrace(reponseText) { @@ -897,6 +909,7 @@ function parseBacktrace (ret) { function RHBZinit() { // inheritance ... call superobject's constructor + console.log("We are in RHBZinit"); var AbrtRE = new RegExp("^\\s*\\[abrt\\]"); var btSnippet = ""; @@ -915,7 +928,7 @@ function RHBZinit() { var attachments = getAttachments(); markBadAttachments(attachments); - parsedAttachments = attachments.filter(function (att) { + var parsedAttachments = attachments.filter(function (att) { return (new RegExp(titleParsedAttachment).test(att[0])); }); @@ -926,7 +939,7 @@ function RHBZinit() { // Dig out backtrace protection against double-firing? btSnippet = ""; - var parseAbrtBacktraces = config.gJSONData.configData.parseAbrtBacktraces; + var parseAbrtBacktraces = config.parseAbrtBacktraces; if (parseAbrtBacktraces && AbrtRE.test(getSummary())) { pasteBacktraceInComments(parsedAttachments); } @@ -952,7 +965,7 @@ function RHBZinit() { */ // Take care of signature for Fedora bugzappers - if (config.signature.length > 0) { + if (config.signature && config.signature.length > 0) { var signatureFedoraString = config.signature; document.forms.namedItem("changeform").addEventListener("submit", function(aEvt) { |