Skip to content
This repository has been archived by the owner on Nov 14, 2017. It is now read-only.

Commit

Permalink
Merge pull request #7 from cpfeiffer/no_trend_broken_image
Browse files Browse the repository at this point in the history
Don't show broken image when no test results are available
  • Loading branch information
swestcott committed May 18, 2012
2 parents 47864bc + 9944959 commit 70e9bb1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/hudson/plugins/fitnesse/FitnesseProjectAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,21 @@ public String getUrlName() {
return "fitnesse";
}

/**
* Used in floatingBox.jelly
*/
public boolean hasTrend() {
return getLatestResults() != null;
}

/**
* Used in floatingBox.jelly
*/
public History getTrend() {
FitnesseResultsAction latestResults = getLatestResults();
if (latestResults == null) {
return null;
}
FitnesseResults result = latestResults.getResult();
return new History(result,500,200);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler"
xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson"
xmlns:f="/lib/form" xmlns:i="jelly:fmt">

<j:if test="${action.hasTrend()}">
<div class="test-trend-caption">
${%FitNesse Results Trend}
</div>
<div>
<img src="fitnesse/trend/countGraph/png" lazymap="fitnesse/trend/countGraph/map" alt="[FitNesse results trend chart]"/>
</div>
</j:if>
</j:jelly>

0 comments on commit 70e9bb1

Please sign in to comment.