Skip to content
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

Update for new header #194

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open

Conversation

janfaracik
Copy link

@janfaracik janfaracik commented Feb 12, 2025

image image image

This PR updates the plugin to be compatible with the [new Jenkins header]. The thinking behind this PR is to minimise the need for completely overriding the header, instead relying on replaceable slots in core's header. This will make it easier to update core in the future, without risk of breaking/impacting this plugin.

I've also added some examples themes to the plugin, demonstrating it's customizability and also making it easy for users to revert to the classic header theme if they prefer.

Screenshot 2025-02-12 at 22 08 08

Testing done

  • Changing colours, text, and the logo works as expected (is it usual to need to clear cache for it to apply?)
  • Changing colours, text, and the logo works as expected from user config works as expected

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@janfaracik janfaracik requested a review from a team as a code owner February 12, 2025 22:00
@janfaracik janfaracik marked this pull request as draft February 12, 2025 22:08
</j:if>
<script src="${resURL}/plugin/customizable-header/js/messages.js" type="text/javascript"></script>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should that not stay on the line it had been , since you only want to import the js when you are using it.enabled

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking was that you might want system messages without changing anything else about the header.

@janfaracik janfaracik marked this pull request as ready for review February 22, 2025 09:29
return header;
}
return new JenkinsHeaderSelector();
// TODO - come back to this
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO.

}
}

// TODO - this should be combined with CustomHeaderConfiguration#401
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO

.collect(Collectors.toList());
}

// TODO - this should be combined with CustomHeaderConfiguration#407
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO

@janfaracik
Copy link
Author

Outside of the TODOs remaining, any thoughts on this @mawinter69?

Copy link
Contributor

@mawinter69 mawinter69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if it makes sense to keep the title field with this header. Both are now put inside the logo.jelly which is inside the link to the Jenkins root.

<j:if test="${link.type == 'link'}">
<a href="${link.url}" class="jenkins-dropdown__item">
<div class="jenkins-dropdown__item__icon">
<j:out value="${link.iconXml}" escapeText="false" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iconXML might not be defined, e.g. when the chosen image is not a symbol but a simple png

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually the content aware header previously still allowed to define a default logo. So what we would need is more something like a logo behaviour (static, content aware (with the suboptions to show the weather). I even have some branch with a random logo where I used all the SVG found at https://www.jenkins.io/artwork/

@mawinter69
Copy link
Contributor

What I would like to be able to do is having a header like it was possible before
image
That would require some changes in the core change, mainly providing most of the things via the header taglib

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants