Skip to content

Commit

Permalink
Update action icons
Browse files Browse the repository at this point in the history
Use Jenkins design library icons.
  • Loading branch information
cronik committed Feb 9, 2023
1 parent 430a80c commit 6d4c967
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 105 deletions.
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@
<artifactId>test-harness</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>ionicons-api</artifactId>
</dependency>
</dependencies>

<!-- get every artifact through repo.jenkins-ci.org, which proxies all the artifacts that we need -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import javax.servlet.ServletException;
import jenkins.model.Jenkins;
import net.sf.json.JSONObject;
import org.jenkins.ui.icon.IconSpec;
import org.kohsuke.stapler.AncestorInPath;
import org.kohsuke.stapler.HttpResponse;
import org.kohsuke.stapler.HttpResponses;
Expand All @@ -25,7 +26,7 @@
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.interceptor.RequirePOST;

public class ScheduleBuildAction implements Action, StaplerProxy {
public class ScheduleBuildAction implements Action, StaplerProxy, IconSpec {

private static final Logger LOGGER = Logger.getLogger(ScheduleBuildAction.class.getName());

Expand All @@ -45,8 +46,13 @@ public ScheduleBuildAction(final Job<?, ?> target) {

@Override
public String getIconFileName() {
return null;
}

@Override
public String getIconClassName() {
return target.hasPermission(Job.BUILD) && this.target.isBuildable()
? "/plugin/schedule-build/images/schedule.svg"
? "symbol-calendar-outline plugin-ionicons-api"
: null;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt" xmlns:local="local">
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:l="/lib/layout" xmlns:f="/lib/form">
<l:layout title="Test" norefresh="true">
<st:include page="sidepanel.jelly" it="${it.owner}" />
<l:main-panel>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?jelly escape-by-default='true'?>
<!-- TODO add taglibs such as: xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" -->
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:i="jelly:fmt">
<td>
<j:if test="${job.buildable and job.hasPermission(job.BUILD)}">
<a href="job/${job.name}/schedule" title="${%ScheduleBuildColumn.Title}">
<img alt="${%ScheduleBuildColumn.Title}" src="${rootURL}/plugin/schedule-build/images/schedule.svg" style="width: 24px; height: 24px; " title="${%ScheduleBuildColumn.Title}" />
</a>
</j:if>
<j:jelly xmlns:j="jelly:core" xmlns:l="/lib/layout">
<td class="jenkins-table__cell--tight">
<j:if test="${job.buildable and job.hasPermission(job.BUILD)}">
<div class="jenkins-table__cell__button-wrapper">
<a href="job/${job.name}/schedule" tooltip="${%ScheduleBuildColumn.Title}" class="jenkins-table__button">
<l:icon src="symbol-calendar-outline plugin-ionicons-api" />
</a>
</div>
</j:if>
</td>
</j:jelly>
94 changes: 0 additions & 94 deletions src/main/webapp/images/schedule.svg

This file was deleted.

0 comments on commit 6d4c967

Please sign in to comment.