Skip to content

Commit

Permalink
[JENKINS-47051] Hide plain text link for pipeline steps
Browse files Browse the repository at this point in the history
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 b4311e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/main/java/hudson/plugins/timestamper/TimestampNote.java
Expand Up @@ -111,6 +111,9 @@ public ConsoleAnnotator<Object> annotate(Object context, MarkupText text, int ch
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
}

Expand Down
Expand Up @@ -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>
Expand Down

0 comments on commit b4311e8

Please sign in to comment.