Class StatusLabels
data-batch-control-status
(tags/status.jelly), and CSV exports, filter tokens and the JSON summary keep it.
A request, grant or activation status and an incident status are shown as a colour badge:
tone(java.lang.Enum<?>) names the badge's tone, which the element carries in
data-batch-control-tone and the plugin stylesheet colours from the theme. The tone
follows the constant, never a page's own wording of the label. A run cause has no tone and
stays plain text. The one exception is endedTone(java.lang.Enum<?>): in the Ended table of the grants
list and of the activations list an approved request is no longer in effect, so it is neutral
there, whatever the cell words; the caller says where the badge is, the label is not looked at.
Each enum is mapped by a switch expression without a default branch, so a new constant
without a label or a tone does not compile. Views reach this class through
BatchControlRootAction#statusLabel and #statusTone (never
j:invokeStatic, which cannot see plugin classes in a real Jenkins).
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringThe tone of the badge showingvaluein an Ended table (the grants list, the activations list): anRequestStatus.APPROVEDrequest listed there is no longer in effect (its window expired or was revoked, or a later approval replaced it), so it isneutral; every other value has itstone(java.lang.Enum<?>).The result names the incidents' Result filter offers: the results that can open an incident.static StringincidentResultsOpening(Collection<String> configured) The opening of the incidents list's introduction: the configuredincidentResultsthat can open an incident, as their labels (ofResult(java.lang.String)) in lower case after the first word, in the order ofincidentResultNames()whatever order the setting holds, joined with commas and a final "and", then "builds" (Failed and unstable buildsunder the default setting).static StringThe label ofvalue; an empty string fornull.static StringThe label of a build result, worded as core's status icons in English: the one mapping behind the Result filter options and every result cell (the incidents list, the incident page, History, the dashboard, the run request page's Build table), so the two cannot drift apart.static StringofRunRequest(RequestStatus status) The label of a run request's status: an approved run request is one whose run has not started yet (it becomesRequestStatus.EXECUTEDwhen it does).The result names the runs' Result filter offers, best first.static Result#6 (Wave D, D3): the build result named exactlyname(one ofresultNames()), ornullfor anything else, which the Run cell shows as text without a status icon.static StringThe tone of the badge showingvalue, in lower case (warning,info,success,dangerorneutral), for aRequestStatusor anIncidentStatus;nullfor anything else (a run cause,null), which is not a badge.
-
Field Details
-
APPROVED_WAITING_TO_RUN
The run request page's wording for an approved request whose run has not started yet.- See Also:
-
IN_PROGRESS
The label of a build that has no result yet because it is still running.- See Also:
-
-
Method Details
-
resultNames
The result names the runs' Result filter offers, best first. -
incidentResultNames
The result names the incidents' Result filter offers: the results that can open an incident. -
of
The label ofvalue; an empty string fornull. An enum this class does not know is shown as its name in sentence case, without underscores. -
tone
The tone of the badge showingvalue, in lower case (warning,info,success,dangerorneutral), for aRequestStatusor anIncidentStatus;nullfor anything else (a run cause,null), which is not a badge. -
endedTone
The tone of the badge showingvaluein an Ended table (the grants list, the activations list): anRequestStatus.APPROVEDrequest listed there is no longer in effect (its window expired or was revoked, or a later approval replaced it), so it isneutral; every other value has itstone(java.lang.Enum<?>). Everywhere else an approved request isinfo. -
ofRunRequest
The label of a run request's status: an approved run request is one whose run has not started yet (it becomesRequestStatus.EXECUTEDwhen it does). -
ofResult
The label of a build result, worded as core's status icons in English: the one mapping behind the Result filter options and every result cell (the incidents list, the incident page, History, the dashboard, the run request page's Build table), so the two cannot drift apart. A result is plain text, never a badge (notone(java.lang.Enum<?>)). The name itself for a value that is not a result name; an empty string fornull. CSV exports keep the name. -
resultOf
#6 (Wave D, D3): the build result named exactlyname(one ofresultNames()), ornullfor anything else, which the Run cell shows as text without a status icon. -
incidentResultsOpening
The opening of the incidents list's introduction: the configuredincidentResultsthat can open an incident, as their labels (ofResult(java.lang.String)) in lower case after the first word, in the order ofincidentResultNames()whatever order the setting holds, joined with commas and a final "and", then "builds" (Failed and unstable buildsunder the default setting). An empty string when the setting names none of them (the configuration never stores an empty list); the view then leaves the sentence out.
-