Skip to content

Commit

Permalink
feat: add a JIRO link in the header with a link to the jiro github repo
Browse files Browse the repository at this point in the history
Signed-off-by: sebastien.heurtematte <[email protected]>
  • Loading branch information
heurtematte committed Jul 16, 2024
1 parent 9728040 commit d0a3ba5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions build/gen-jenkins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,23 @@ echo "/* GENERATED FILE - DO NOT EDIT */" > "${target}/${jenkinsTheme}.css.overr
hbs -s -D "${instance}/target/config.json" "${jenkinsTemplateFolder}/${jenkinsTheme}.css.hbs" >> "${target}/${jenkinsTheme}.css.override"

displayName="$(jq -r '.project.displayName' "${instance}/target/config.json")"
fullName="$(jq -r '.project.fullName' "${instance}/target/config.json")"
cat <<EOF > "${target}/title.js"
document.title = "${displayName} - " + document.title;
document.addEventListener('DOMContentLoaded', function() {
let header = document.querySelector('.page-header__brand');
if (header) {
let newLink = document.createElement('a');
newLink.href = 'https://github.com/eclipse-cbi/jiro/blob/master/instances/${fullName}/target/config.json';
newLink.textContent = 'JIRO';
newLink.style = 'color: white; border-left: 1px solid white; padding-left: 1em; font-size: 1.1em; position: relative; top: 0.2em; left: -1.6em;';
newLink.target = '_blank';
newLink.title = 'JIRO Configuration as Code';
header.appendChild(newLink);
} else {
console.log('Element with class "header" not found.');
}
});
EOF

mkdir -p "${target}/partials"
Expand Down

0 comments on commit d0a3ba5

Please sign in to comment.