-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use symbols for build status #8705
Merged
NotMyFault
merged 7 commits into
jenkinsci:master
from
janfaracik:use-symbols-for-build-status-new
Nov 27, 2023
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5f76f38
Init
janfaracik aea4d97
Rename ID
janfaracik 18a8407
Merge branch 'master' into use-symbols-for-build-status-new
janfaracik c6f5db0
Fix icon position
janfaracik 982bc48
Fix app bar build status icon being incorrect
janfaracik 0db4e4e
Merge branch 'master' into use-symbols-for-build-status-new
NotMyFault 9cbbac1
Address missed icons
janfaracik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,76 +67,11 @@ window.buildTimeTrend_displayBuilds = function (data) { | |
/** | ||
* Generate SVG Icon | ||
*/ | ||
function generateSVGIcon(iconName, iconSizeClass) { | ||
const imagesURL = document.head.getAttribute("data-imagesurl"); | ||
|
||
const isInProgress = iconName.endsWith("anime"); | ||
let buildStatus = "never-built"; | ||
switch (iconName) { | ||
case "red": | ||
case "red-anime": | ||
buildStatus = "last-failed"; | ||
break; | ||
case "yellow": | ||
case "yellow-anime": | ||
buildStatus = "last-unstable"; | ||
break; | ||
case "blue": | ||
case "blue-anime": | ||
buildStatus = "last-successful"; | ||
break; | ||
case "grey": | ||
case "grey-anime": | ||
case "disabled": | ||
case "disabled-anime": | ||
buildStatus = "last-disabled"; | ||
break; | ||
case "aborted": | ||
case "aborted-anime": | ||
buildStatus = "last-aborted"; | ||
break; | ||
case "nobuilt": | ||
case "nobuilt-anime": | ||
buildStatus = "never-built"; | ||
break; | ||
} | ||
function generateSVGIcon(iconName) { | ||
const icons = document.querySelector("#jenkins-build-status-icons"); | ||
iconName = iconName.replace("-anime", ""); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. any reason why the anime svgs are excluded? Before they were animated when the build was running |
||
|
||
const svg1 = document.createElementNS("http://www.w3.org/2000/svg", "svg"); | ||
svg1.setAttribute("class", "svg-icon"); | ||
svg1.setAttribute("viewBox", "0 0 24 24"); | ||
const use1 = document.createElementNS("http://www.w3.org/2000/svg", "use"); | ||
use1.setAttribute( | ||
"href", | ||
imagesURL + | ||
"/build-status/build-status-sprite.svg#build-status-" + | ||
(isInProgress ? "in-progress" : "static"), | ||
); | ||
svg1.appendChild(use1); | ||
|
||
const svg2 = document.createElementNS("http://www.w3.org/2000/svg", "svg"); | ||
svg2.setAttribute( | ||
"class", | ||
"svg-icon icon-" + iconName + " " + (iconSizeClass || "icon-sm"), | ||
); | ||
svg2.setAttribute("viewBox", "0 0 24 24"); | ||
const use2 = document.createElementNS("http://www.w3.org/2000/svg", "use"); | ||
use2.setAttribute( | ||
"href", | ||
imagesURL + "/build-status/build-status-sprite.svg#" + buildStatus, | ||
); | ||
svg2.appendChild(use2); | ||
|
||
const span = document.createElement("span"); | ||
span.classList.add("build-status-icon__wrapper", "icon-" + iconName); | ||
|
||
let span2 = document.createElement("span"); | ||
span2.classList.add("build-status-icon__outer"); | ||
span2.appendChild(svg1); | ||
|
||
span.appendChild(span2); | ||
span.appendChild(svg2); | ||
|
||
return span; | ||
return icons.content.querySelector(`#${iconName}`).cloneNode(true); | ||
} | ||
|
||
/** | ||
|
@@ -155,7 +90,7 @@ window.displayBuilds = function (data) { | |
td1.classList.add("jenkins-table__cell--tight", "jenkins-table__icon"); | ||
var div1 = document.createElement("div"); | ||
div1.classList.add("jenkins-table__cell__button-wrapper"); | ||
var svg = generateSVGIcon(e.iconName, p.dataset.iconSizeClass); | ||
var svg = generateSVGIcon(e.iconName); | ||
div1.appendChild(svg); | ||
td1.appendChild(div1); | ||
tr.appendChild(td1); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
war/src/main/resources/images/symbols/status-aborted-anime.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions
6
war/src/main/resources/images/symbols/status-disabled-anime.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions
7
war/src/main/resources/images/symbols/status-nobuilt-anime.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions
6
war/src/main/resources/images/symbols/status-yellow-anime.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caused JENKINS-72407
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is not here but in StatusColumn -> column.jelly