Skip to content

Commit

Permalink
Revert "Update with HeaderAction"
Browse files Browse the repository at this point in the history
This reverts commit 2ea0b1f.
  • Loading branch information
janfaracik committed Feb 1, 2025
1 parent bee9422 commit 19b4f27
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 50 deletions.
6 changes: 1 addition & 5 deletions core/src/main/java/jenkins/views/FullHeader.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import hudson.model.Action;
import java.util.List;

import hudson.model.RootAction;
import jenkins.model.Jenkins;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
Expand All @@ -26,13 +24,11 @@ public boolean isCompatible() {
* @return a list of {@link Action} to show in the header, defaults to {@link hudson.model.RootAction} extensions
*/
@Restricted(NoExternalUse.class)
public List<HeaderAction> getActions() {
public List<Action> getActions() {
return Jenkins.get()
.getActions()
.stream()
.filter(e -> e.getIconFileName() != null)
.map(e -> (RootAction) e)
.map(e -> new HeaderAction(e.getDisplayName(), e.getIconFileName(), e.getUrlName(), e.getBadge()))
.toList();
}
}
42 changes: 0 additions & 42 deletions core/src/main/java/jenkins/views/HeaderAction.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
<div class="jenkins-header__actions">
<l:overflowButton clazz="jenkins-button--tertiary jenkins-mobile-show">
<j:forEach var="action" items="${it.actions}">
<j:if test="${action.iconClassName != null}">
<j:if test="${action.iconFileName != null}">
<dd:item href="${h.getActionUrl(app.url, action)}"
icon="${action.iconClassName}"
icon="${action.iconFileName}"
text="${action.displayName}" />
</j:if>
</j:forEach>
Expand Down Expand Up @@ -73,7 +73,7 @@
<x:attribute name="data-tippy-theme">${interactive ? 'dropdown' : 'tooltip'}</x:attribute>
<x:attribute name="draggable">false</x:attribute>
<x:attribute name="class">jenkins-button ${isCurrent ? '' : 'jenkins-button--tertiary'}</x:attribute>
<l:icon src="${action.iconClassName}" />
<l:icon src="${action.iconFileName}" />
<span class="jenkins-visually-hidden">${action.displayName}</span>
<j:if test="${action.badge != null}">
<span class="jenkins-badge jenkins-!-${action.badge.severity}-color" />
Expand Down

0 comments on commit 19b4f27

Please sign in to comment.