Skip to content

Commit a107388

Browse files
authored
Merge pull request #346 from jenkinsci/symbol-stub
Add `JenkinsFacade` to details column (stubbing of symbol registry)
2 parents 9bbb1bb + fc501a5 commit a107388

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,13 @@
260260
</execution>
261261
</executions>
262262
</plugin>
263+
<plugin>
264+
<groupId>org.revapi</groupId>
265+
<artifactId>revapi-maven-plugin</artifactId>
266+
<configuration>
267+
<skip>true</skip>
268+
</configuration>
269+
</plugin>
263270
</plugins>
264271
</build>
265272

src/main/java/io/jenkins/plugins/datatables/TableColumn.java

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package io.jenkins.plugins.datatables;
22

33
import org.apache.commons.lang3.StringUtils;
4-
import org.jenkins.ui.symbol.Symbol;
54
import org.jenkins.ui.symbol.SymbolRequest.Builder;
65

76
import com.fasterxml.jackson.core.JsonProcessingException;
@@ -38,11 +37,7 @@ public class TableColumn {
3837
* @return the HTML div to create the details column
3938
*/
4039
public static String renderDetailsColumn(final String detailsText) {
41-
return div()
42-
.withClass("details-control")
43-
.attr("data-description", detailsText)
44-
.with(join(symbol("add", "open"),
45-
symbol("remove", "close"))).render();
40+
return renderDetailsColumn(detailsText, new JenkinsFacade());
4641
}
4742

4843
/**
@@ -51,18 +46,20 @@ public static String renderDetailsColumn(final String detailsText) {
5146
* @param detailsText
5247
* the text to show if the column has been expanded.
5348
* @param jenkinsFacade
54-
* facade for Jenkins API calls
49+
* facade for Jenkins API calls to get symbols
5550
*
5651
* @return the HTML div to create the details column
57-
* @deprecated use {@link #renderDetailsColumn(String)}
5852
*/
59-
@Deprecated
60-
public static String renderDetailsColumn(final String detailsText, @SuppressWarnings("unused") final JenkinsFacade jenkinsFacade) {
61-
return renderDetailsColumn(detailsText);
53+
public static String renderDetailsColumn(final String detailsText, final JenkinsFacade jenkinsFacade) {
54+
return div()
55+
.withClass("details-control")
56+
.attr("data-description", detailsText)
57+
.with(join(symbol("add", "open", jenkinsFacade),
58+
symbol("remove", "close", jenkinsFacade))).render();
6259
}
6360

64-
private static String symbol(final String imageName, final String cssId) {
65-
return Symbol.get(new Builder()
61+
private static String symbol(final String imageName, final String cssId, final JenkinsFacade jenkins) {
62+
return jenkins.getSymbol(new Builder()
6663
.withName(imageName + "-circle-outline")
6764
.withPluginName("ionicons-api")
6865
.withClasses("details-icon details-icon-" + cssId)
@@ -354,7 +351,8 @@ public enum ColumnType {
354351
/** Numbers will be shown right aligned, and use a simple number sorting. */
355352
NUMBER("num"),
356353
/**
357-
* Numbers will be shown right aligned, and use a simple number sorting. May contain HTML tags also in the data.
354+
* Numbers will be shown right aligned, and use a simple number sorting. May contain HTML tags also in the
355+
* data.
358356
*/
359357
HTML_NUMBER("html-num"),
360358
/**

0 commit comments

Comments
 (0)