Skip to content

Commit

Permalink
fixes sdavis3#10
Browse files Browse the repository at this point in the history
  • Loading branch information
sdavis3 committed Feb 25, 2017
1 parent f0840ed commit ec57186
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
11 changes: 8 additions & 3 deletions code-coverage1.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
$("#init-label").show();
$("div.big-count").hide();
$("#percent-label").hide();

return WidgetHelpers.WidgetStatusHelper.Success()
}

Expand All @@ -42,7 +43,7 @@
// Populate dropdown with list of recent builds
$.each(query2, function(key, value) {
var buildId = value.id;

var buildWeb = value._links.web.href
// Get code coverage summary for most recent build
TFS_TestMgmt_WebApi.getClient().getCodeCoverageSummary(projectId, buildId)
.then(function (query3) {
Expand Down Expand Up @@ -71,13 +72,14 @@

// Fetch build name
var buildName = query3.build.name;

// Update UI with code coverage percentage
$("div.big-count").text(coveragePct);
$("div.big-count").show();
$("#percent-label").show();
$("#init-label").hide();
$("#build-name").text(buildName);
$("#build-link").prop("href", buildWeb);
}
else {
// Set display values for no coverage data
Expand All @@ -86,6 +88,7 @@
$("#init-label").text("No code coverage details found for this build definition");
$("#init-label").show();
$("#build-name").text("");
$("#build-link").removeProp("href");
}
});
});
Expand Down Expand Up @@ -130,7 +133,9 @@ <h2 class="title"></h2>
<label id="init-label" hidden>No build definition selected</label>
<div class="big-count" hidden></div>
<label id="percent-label" hidden>Percent</label>
<div id="build-name" class="subtitle"></label>
<a id="build-link" target="_blank">
<div id="build-name" class="subtitle"></div>
</a>
</div>
</body>
</html>
2 changes: 2 additions & 0 deletions overview.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#Visual Studio Team Services Code Coverage Widgets#

## Release Notes
* 1.0.162
* Displayed build name now links to build details.
* 1.0.149
* Fixed defect where build was not showing as selected.
* Added configuration option to display build name on widget.
Expand Down
2 changes: 1 addition & 1 deletion vss-extension.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifestVersion": 1,
"id": "code-coverage-dashboard-widgets",
"version": "1.0.151",
"version": "1.0.162",
"name": "Code Coverage Widgets",
"description": "A collection of dashboard widgets for displaying code coverage in VSTS.",
"publisher": "shanebdavis",
Expand Down

0 comments on commit ec57186

Please sign in to comment.