From 0fcb34de5aa72cbb46e5a38400782c7131fc35c5 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Fri, 20 Nov 2009 12:01:24 +0100 Subject: Trailing spaces removed (again, have to fix it somewhere in gedit) Add "SOMERELEASE" resolution for closing intelligently changing resolution according to circumstances. --- bugzillaBugTriage.js | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) (limited to 'bugzillaBugTriage.js') diff --git a/bugzillaBugTriage.js b/bugzillaBugTriage.js index 9af7695..731ca7d 100644 --- a/bugzillaBugTriage.js +++ b/bugzillaBugTriage.js @@ -1,5 +1,5 @@ /*jslint onevar: false, browser: true, evil: true, laxbreak: true, undef: true, nomen: true, eqeqeq: true, bitwise: true, maxerr: 100, immed: false, white: false, plusplus: false, regexp: false, undef: false */ -/*global jQuery, $, jetpack */ +/*global jQuery, $, jetpack */ // Released under the MIT/X11 license // http://www.opensource.org/licenses/mit-license.php @@ -218,7 +218,7 @@ Color.prototype.hs = function(nStr) { } else if (nStr.length < 2) { return "0" + nStr; } else { - return nStr; + return nStr; } }; @@ -401,7 +401,7 @@ Color.prototype.hsvToRgb = function (h, s, v){ }; /** - * Provide + * Provide */ Color.prototype.lightColor = function() { var hslArray = this.hsl(); @@ -434,7 +434,7 @@ bzPage.prototype.hasKeyword = function (str) { * @return none */ bzPage.prototype.setKeyword = function (str) { - var keywordInput = $('#keywords', this.doc); + var keywordInput = $('#keywords', this.doc); var kwd = $.trim(keywordInput.val()); if (!/str/.test(kwd)) { keywordInput.val(kwd ? kwd + ", " + str : str); @@ -580,7 +580,7 @@ bzPage.prototype.setBranding = function () { "font-weight": "bolder", "text-decoration": "underline"}); } - + // mark suspicious components // FIXME use https://bugzilla.redhat.com/show_bug.cgi?id=538818 for testing if (suspiciousComponents && isInList(this.component,suspiciousComponents)) { @@ -748,7 +748,7 @@ bzPage.prototype.fillInChipMagic = function () { var XorgLogFound = false; var attURL = "", interestingLine = ""; var interestingArray = []; - + // Find out Xorg.0.log attachment URL this.XorgLogAttList = this.attachments.filter(function (value, index, array) { @@ -1026,11 +1026,11 @@ updateAttachMimeType($data_ref, $username, $password) Update the attachment mime type of an attachment. The first argument is a data hash containing information on the new MIME type and the attachment id that you want to act on. $data_ref = { - "attach_id" => "", + "attach_id" => "", # Attachment ID to perform MIME type change on. - "mime_type" => "", + "mime_type" => "", # Legal MIME type value that you want to change the attachment to. - "nomail" => 0, + "nomail" => 0, # OPTIONAL Flag that is either 1 or 0 if you want email to be sent or not for this change }; */ @@ -1043,7 +1043,7 @@ bzPage.prototype.createXMLRPCMessage = function(login,password,attachId,mimeType email = false; } var emailStr = email ? "0" : "1"; - + var msg = bugzilla.updateAttachMimeType @@ -1102,7 +1102,7 @@ bzPage.prototype.fixAttachById = function(id,type) { // FIXME content-type MUST be text/xml this.reqCounter++; }; - + bzPage.prototype.fixAllAttachments = function(list) { var tmpElem = {}; @@ -1216,6 +1216,8 @@ bzPage.prototype.generateToolBar = function(anchor,array) { */ bzPage.prototype.generalPurposeCureForAllDisease = function (addString,nextState,secondParameter) { + var verNo = 1; + if (addString.length >0) { this.addTextToComment(addString); } @@ -1224,11 +1226,22 @@ bzPage.prototype.generalPurposeCureForAllDisease = function if (secondParameter === "UPSTREAM") { this.addClosingUpstream(); } else if (secondParameter === "SOMERELEASE") { - // TODO for RAWHIDE close as RAWHIDE, + // for RAWHIDE close as RAWHIDE, // if active selection -> CURRENTRELEASE // and put the release version to // "Fixed in Version" textbox // otherwise -> NEXTRELEASE + verNo = this.getVersion(); + this.selectOption("bug_status", nextState); + var text = $.trim(jetpack.selection.text); + if (text.length > 0) { + this.selectOption("resolution","CURRENTRELEASE"); + $("#cf_fixed_in",this.doc).val(text); + } else if (verNo === 999) { + this.selectOption("resolution","RAWHIDE"); + } else { + this.selectOption("resolution","NEXTRELEASE"); + } } else if (secondParameter.length > 0) { this.selectOption("bug_status", nextState); this.selectOption("resolution",secondParameter); @@ -1255,9 +1268,9 @@ bzPage.prototype.generalPurposeCureForAllDisease = function if (!isInList(this.maintCCAddr, this.CCList)) { $("#newcc",this.doc).text(this.maintCCAddr); } - var verNo = this.getVersion(); + verNo = this.getVersion(); if ((!this.isRHEL()) && (verNo < TriagedDistro)) { - this.selectOption("bug_status", nextState); + this.selectOption("bug_status", nextState); } else { this.setKeyword("Triaged"); } @@ -1342,7 +1355,7 @@ function bzPage(doc) { this.password = this.doc.get(0).defaultView.prompt("Enter your Bugzilla password",""); myConfig.BZpassword = this.password; } - + var bugNoTitle = $.trim($("#title > p:first", this.doc).text()); this.bugNo = new RegExp("[0-9]+").exec(bugNoTitle)[0]; -- cgit