installation
- Install controlfreak in chrome
- Add script for PullRequest page
- Add JQuery library
Note: Change teamcity , branchkey, and buildTypeid.
var teamcity = "teamcity:8000" | |
var buildTypeid = "bt233"; | |
var branchkey = "project34"; | |
if($('button#inc').length == 0){ | |
var inc_button = $("<button id='inc' class=''>+</button>"); | |
var dec_button = $("<button id='dec' class=''>-</button>"); | |
$('h3.title').append(inc_button); | |
$('h3.title').append(dec_button); | |
$('button#inc').click(function() { | |
var x = $('#aui-page-panel-content-body > div > section > div > div > div > div.file-tree-container'); | |
x.width(x.width() + 150); | |
}); | |
$('button#dec').click(function() { | |
var x = $('#aui-page-panel-content-body > div > section > div > div > div > div.file-tree-container'); | |
x.width(0); | |
}); | |
var branch = $('header.pull-request-metadata > div > div.pull-request-metadata-primary > div.pull-request-branches > span.aui-lozenge.source-branch.ref-lozenge.monospace-lozenge > span > span.name').text(); | |
$('h3.title').append($( | |
"<a href='http://"+teamcity+"/viewType.html?buildTypeId="+buildTypeid+"&tab=buildTypeStatusDiv&branch_"+branchkey+"="+branch+"'>"+ | |
"<img src='http://"+teamcity+"/app/rest/builds/buildType:(id:"+buildTypeid+"),branch:"+ branch +"/statusIcon'/></a>")) | |
} | |
function addbuildstatus( name, buildTypeid, branch) { | |
return $( | |
"<a href='http://"+teamcity+"/viewType.html?buildTypeId="+buildTypeid+"&tab=buildTypeStatusDiv&branch_"+branchkey+"="+branch+"'>"+ | |
name + ": <img src='http://"+teamcity+"/app/rest/builds/buildType:(id:"+buildTypeid+"),branch:"+ branch +"/statusIcon'/></a></br>"); | |
} | |
$(".source .name").each(function(){ | |
branch = $(this).text(); | |
$(this).closest("td.source") | |
.append( addbuildstatus("CI", "bt237", branch)) // bt237&branch_project34 | |
.append( addbuildstatus("CI long", "bt238", branch)) // bt238&branch_project34 | |
.append( addbuildstatus("release", "bt233", branch)); | |
}); | |
$(".pull-request-row").filter(function(n){ | |
var text = $(this).text(); | |
function includes(text2) | |
{ | |
return text.indexOf(text2) > -1 | |
} | |
return | |
includes("Vijayanand Gummi") || | |
includes("Naveen Kumar") || | |
includes("Gopal Reddy") || | |
includes("Kasyap Krishnan") ; | |
} | |
).hide(); |