File tree 5 files changed +34
-26
lines changed
java/io/jenkins/plugins/pipelinegraphview/cards/items
resources/io/jenkins/plugins/pipelinegraphview
5 files changed +34
-26
lines changed Original file line number Diff line number Diff line change @@ -17,21 +17,21 @@ public static Optional<RunDetailsItem> get(WorkflowRun run) {
17
17
18
18
AbstractTestResultAction <?> action = run .getAction (AbstractTestResultAction .class );
19
19
20
- if (action != null ) {
21
- RunDetailsItem testResult = new RunDetailsItem .Builder ()
22
- .ionicon ("clipboard-outline" )
23
- .text (Messages .testResults ())
24
- .href ("../%s" .formatted (action .getUrlName ()))
25
- .tooltip ("Passed: %s%nFailed: %s%nSkipped: %s%nTotal: %s"
26
- .formatted (
27
- action .getTotalCount () - action .getFailCount () - action .getSkipCount (),
28
- action .getFailCount (),
29
- action .getSkipCount (),
30
- action .getTotalCount ()))
31
- .build ();
32
- return Optional .of (testResult );
20
+ if (action == null ) {
21
+ return Optional .empty ();
33
22
}
34
23
35
- return Optional .empty ();
24
+ String passed =
25
+ Messages .testResults_passed (action .getTotalCount () - action .getFailCount () - action .getSkipCount ());
26
+ String failed = Messages .testResults_failed (action .getFailCount ());
27
+ String skipped = Messages .testResults_skipped (action .getSkipCount ());
28
+ String total = Messages .testResults_total (action .getTotalCount ());
29
+ RunDetailsItem testResult = new RunDetailsItem .Builder ()
30
+ .ionicon ("clipboard-outline" )
31
+ .text (Messages .testResults ())
32
+ .href ("../" + action .getUrlName ())
33
+ .tooltip (passed + "\n " + failed + "\n " + skipped + "\n " + total )
34
+ .build ();
35
+ return Optional .of (testResult );
36
36
}
37
37
}
Original file line number Diff line number Diff line change 1
1
package io .jenkins .plugins .pipelinegraphview .cards .items ;
2
2
3
3
import hudson .Util ;
4
+ import io .jenkins .plugins .pipelinegraphview .Messages ;
4
5
import io .jenkins .plugins .pipelinegraphview .cards .RunDetailsItem ;
5
6
import java .util .ArrayList ;
6
7
import java .util .Date ;
@@ -15,9 +16,8 @@ public static List<RunDetailsItem> get(WorkflowRun run) {
15
16
16
17
RunDetailsItem startedItem = new RunDetailsItem .Builder ()
17
18
.ionicon ("time-outline" )
18
- .text ("Started "
19
- + Util .getTimeSpanString (Math .abs (run .getTime ().getTime () - new Date ().getTime ()))
20
- + " ago" )
19
+ .text (Messages .startedAgo (
20
+ Util .getTimeSpanString (Math .abs (run .getTime ().getTime () - new Date ().getTime ()))))
21
21
.build ();
22
22
runDetailsItems .add (startedItem );
23
23
@@ -26,15 +26,15 @@ public static List<RunDetailsItem> get(WorkflowRun run) {
26
26
if (timeInQueueAction != null ) {
27
27
RunDetailsItem queuedItem = new RunDetailsItem .Builder ()
28
28
.ionicon ("hourglass-outline" )
29
- .text ("Queued " + Util .getTimeSpanString (timeInQueueAction .getQueuingDurationMillis ()))
29
+ .text (Messages . queued ( Util .getTimeSpanString (timeInQueueAction .getQueuingDurationMillis () )))
30
30
.build ();
31
31
32
32
runDetailsItems .add (queuedItem );
33
33
}
34
34
35
35
RunDetailsItem timerItem = new RunDetailsItem .Builder ()
36
36
.ionicon ("timer-outline" )
37
- .text ("Took " + run .getDurationString ())
37
+ .text (Messages . took ( run .getDurationString () ))
38
38
.build ();
39
39
40
40
runDetailsItems .add (timerItem );
Original file line number Diff line number Diff line change 2
2
3
3
import hudson .model .Cause ;
4
4
import hudson .model .CauseAction ;
5
+ import io .jenkins .plugins .pipelinegraphview .Messages ;
5
6
import io .jenkins .plugins .pipelinegraphview .cards .RunDetailsItem ;
6
7
import java .util .List ;
7
8
import java .util .Objects ;
@@ -17,12 +18,11 @@ public static Optional<RunDetailsItem> get(WorkflowRun run) {
17
18
return causes .stream ()
18
19
.filter (cause -> cause instanceof Cause .UpstreamCause )
19
20
.map (upstreamCause -> (Cause .UpstreamCause ) upstreamCause )
20
- .map (upstreamCause -> upstreamCause . getUpstreamRun () )
21
+ .map (Cause . UpstreamCause :: getUpstreamRun )
21
22
.filter (Objects ::nonNull )
22
- // TODO i18n
23
23
.map (upstreamRun -> new RunDetailsItem .Builder ()
24
24
.ionicon ("play-circle-outline" )
25
- .text ("Started by upstream pipeline " + upstreamRun .getDisplayName ())
25
+ .text (Messages . cause_upstream ( upstreamRun .getDisplayName () ))
26
26
.href (DisplayURLProvider .get ().getRunURL (upstreamRun ))
27
27
.build ())
28
28
.findAny ();
Original file line number Diff line number Diff line change 3
3
import hudson .model .Cause ;
4
4
import hudson .model .CauseAction ;
5
5
import hudson .model .User ;
6
+ import io .jenkins .plugins .pipelinegraphview .Messages ;
6
7
import io .jenkins .plugins .pipelinegraphview .cards .RunDetailsItem ;
7
8
import java .util .HashMap ;
8
9
import java .util .List ;
@@ -20,11 +21,9 @@ public static Optional<RunDetailsItem> get(WorkflowRun run) {
20
21
.map (userIdCause -> (Cause .UserIdCause ) userIdCause )
21
22
.map (userIdCause -> User .get (userIdCause .getUserId (), false , new HashMap <>()))
22
23
.filter (Objects ::nonNull )
23
- // TODO i18n
24
- .map (user -> "Manually run by " + user .getDisplayName ())
25
- .map (startedAt -> new RunDetailsItem .Builder ()
24
+ .map (user -> new RunDetailsItem .Builder ()
26
25
.ionicon ("person-outline" )
27
- .text (startedAt )
26
+ .text (Messages . cause_user ( user . getDisplayName ()) )
28
27
.build ())
29
28
.findAny ();
30
29
}
Original file line number Diff line number Diff line change 1
1
startedAgo =Started {0} ago
2
2
noBuilds =No builds
3
+ queued =Queued {0}
4
+ took =Took {0}
3
5
4
6
node.start =Start
5
7
node.end =End
@@ -13,4 +15,11 @@ timings.month ={0} mo
13
15
timings.year ={0} yr
14
16
15
17
testResults =Test results
18
+ testResults.passed =Passed {0}
19
+ testResults.failed =Failed {0}
20
+ testResults.skipped =Skipped {0}
21
+ testResults.total = Total {0}
16
22
artifacts =Artifacts
23
+
24
+ cause.upstream =Started by upstream pipeline {0}
25
+ cause.user =Manually run by {0}
You can’t perform that action at this time.
0 commit comments