Skip to content
Permalink
Browse files
[JENKINS-47051] Hide plain text link for pipeline steps
Only instances of Run are capable of displaying the plain text or the
/timestamps/ page, so hide the link if the context is of a different
type.
  • Loading branch information
StevenGBrown committed May 8, 2018
1 parent 53c91f9 commit b4311e8b36ebcaba57a0dd424bc798239db2ee2b
@@ -111,6 +111,9 @@ public Timestamp getTimestamp(Object context) {
TimestampFormat format = TimestampFormatProvider.get();
Timestamp timestamp = getTimestamp(context);
format.markup(text, timestamp);
if (!(context instanceof Run<?, ?>)) {
text.addMarkup(0, "<style>.timestamper-plain-text {visibility: hidden;}</style>");
}
return null; // each time-stamp note affects one line only
}

@@ -29,7 +29,7 @@ THE SOFTWARE.
<tr>
<td class="pane-header">
<span style="text-align:left;">${%Timestamps}</span>
<span style="float:right;"><a href="${it.plainTextUrl}">${%View as plain text}</a></span>
<span style="float:right;"><a class="timestamper-plain-text" href="${it.plainTextUrl}">${%View as plain text}</a></span>
</td>
</tr>
<tr>

0 comments on commit b4311e8

Please sign in to comment.