Skip to content

Commit 5601ba3

Browse files
authored
table resizing (#386)
1 parent bf374bf commit 5601ba3

File tree

5 files changed

+113
-65
lines changed

5 files changed

+113
-65
lines changed

src/main/resources/io/jenkins/plugins/designlibrary/Table/index.jelly

Lines changed: 70 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -23,60 +23,80 @@ THE SOFTWARE.
2323
-->
2424

2525
<?jelly escape-by-default='true'?>
26-
<j:jelly xmlns:j="jelly:core" xmlns:s="/lib/samples">
26+
<j:jelly xmlns:j="jelly:core" xmlns:s="/lib/samples" xmlns:t="/lib/hudson" xmlns:l="/lib/layout">
2727
<s:layout>
2828
<s:section hideBorder="true">
2929
<s:group>
3030
<s:preview>
31-
<table class="jenkins-table sortable jenkins-!-margin-bottom-0">
32-
<thead>
33-
<th>
34-
Name
35-
</th>
36-
<th>
37-
Status
38-
</th>
39-
<th>
40-
Reason
41-
</th>
42-
</thead>
43-
<tbody>
44-
<tr>
45-
<td>
46-
<a href="#" class="jenkins-table__link">Link 1</a>
47-
</td>
48-
<td>
49-
Success
50-
<a href="#" class="jenkins-table__link jenkins-table__badge model-link">#7</a>
51-
</td>
52-
<td>
53-
No Errors
54-
</td>
55-
</tr>
56-
<tr>
57-
<td>
58-
<a href="#" class="jenkins-table__link">Link 2</a>
59-
</td>
60-
<td>
61-
Failure
62-
</td>
63-
<td>
64-
Can't compile
65-
</td>
66-
</tr>
67-
<tr>
68-
<td>
69-
<a href="#" class="jenkins-table__link">Link 3</a>
70-
</td>
71-
<td>
72-
Unstable
73-
</td>
74-
<td>
75-
Test Failed
76-
</td>
77-
</tr>
78-
</tbody>
79-
</table>
31+
<div class="jdl-table-container">
32+
<t:setIconSize/>
33+
<table class="jenkins-table sortable ${iconSize == '16x16' ? 'jenkins-table--small' : iconSize == '24x24' ? 'jenkins-table--medium' : ''}">
34+
<thead>
35+
<th>
36+
Name
37+
</th>
38+
<th class="jenkins-table__cell--tight">S</th>
39+
<th>
40+
Status
41+
</th>
42+
<th>
43+
Reason
44+
</th>
45+
</thead>
46+
<tbody>
47+
<tr>
48+
<td>
49+
<a href="#" class="jenkins-table__link">Link 1</a>
50+
</td>
51+
<td class="jenkins-table__cell--tight jenkins-table__icon">
52+
<div class="jenkins-table__cell__button-wrapper">
53+
<l:icon src="symbol-status-blue"/>
54+
</div>
55+
</td>
56+
<td>
57+
Success
58+
<a href="#" class="jenkins-table__link jenkins-table__badge model-link">#7</a>
59+
</td>
60+
<td>
61+
No Errors
62+
</td>
63+
</tr>
64+
<tr>
65+
<td>
66+
<a href="#" class="jenkins-table__link">Link 2</a>
67+
</td>
68+
<td class="jenkins-table__cell--tight jenkins-table__icon">
69+
<div class="jenkins-table__cell__button-wrapper">
70+
<l:icon src="symbol-status-red"/>
71+
</div>
72+
</td>
73+
<td>
74+
Failure
75+
</td>
76+
<td>
77+
Can't compile
78+
</td>
79+
</tr>
80+
<tr>
81+
<td>
82+
<a href="#" class="jenkins-table__link">Link 3</a>
83+
</td>
84+
<td class="jenkins-table__cell--tight jenkins-table__icon">
85+
<div class="jenkins-table__cell__button-wrapper">
86+
<l:icon src="symbol-status-yellow"/>
87+
</div>
88+
</td>
89+
<td>
90+
Unstable
91+
</td>
92+
<td>
93+
Test Failed
94+
</td>
95+
</tr>
96+
</tbody>
97+
</table>
98+
<t:iconSize/>
99+
</div>
80100
</s:preview>
81101
<s:code file="index.jelly" />
82102
</s:group>

src/main/resources/scss/pages/_index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
@use "notifications";
1010
@use "spacing";
1111
@use "symbols";
12+
@use "tables";
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.jdl-table-container {
2+
width: 100%;
3+
margin-bottom: 0;
4+
}
5+
6+
.jdl-table-container>div:last-child {
7+
margin-bottom: 0;
8+
}

src/main/webapp/Table/index.jelly

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
1-
<table class="jenkins-table sortable">
2-
<thead>
3-
<th>
4-
Name
5-
</th>
6-
<th>
7-
Status
8-
</th>
9-
<th>
10-
Reason
11-
</th>
12-
</thead>
13-
<tbody>
1+
<t:setIconSize/>
2+
<table class="jenkins-table sortable ${iconSize == '16x16' ? 'jenkins-table--small' : iconSize == '24x24' ? 'jenkins-table--medium' : ''}">
3+
<thead>
4+
<th>
5+
Name
6+
</th>
7+
<th class="jenkins-table__cell--tight">S</th>
8+
<th>
9+
Status
10+
</th>
11+
<th>
12+
Reason
13+
</th>
14+
</thead>
15+
<tbody>
1416
<tr>
1517
<td>
1618
<a href="#" class="jenkins-table__link">Link 1</a>
1719
</td>
20+
<td class="jenkins-table__cell--tight jenkins-table__icon">
21+
<div class="jenkins-table__cell__button-wrapper">
22+
<l:icon src="symbol-status-blue"/>
23+
</div>
24+
</td>
1825
<td>
1926
Success
2027
<a href="#" class="jenkins-table__link jenkins-table__badge model-link">#7</a>
@@ -27,6 +34,11 @@
2734
<td>
2835
<a href="#" class="jenkins-table__link">Link 2</a>
2936
</td>
37+
<td class="jenkins-table__cell--tight jenkins-table__icon">
38+
<div class="jenkins-table__cell__button-wrapper">
39+
<l:icon src="symbol-status-red"/>
40+
</div>
41+
</td>
3042
<td>
3143
Failure
3244
</td>
@@ -38,12 +50,18 @@
3850
<td>
3951
<a href="#" class="jenkins-table__link">Link 3</a>
4052
</td>
53+
<td class="jenkins-table__cell--tight jenkins-table__icon">
54+
<div class="jenkins-table__cell__button-wrapper">
55+
<l:icon src="symbol-status-yellow"/>
56+
</div>
57+
</td>
4158
<td>
4259
Unstable
4360
</td>
4461
<td>
4562
Test Failed
4663
</td>
4764
</tr>
48-
</tbody>
65+
</tbody>
4966
</table>
67+
<t:iconSize/>

src/test/java/ValidRelativeUrlsTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ private boolean filterUrl(DomNode anchor) {
7474
&& !url.equals("..")
7575
&& !url.equals("twoColumn")
7676
&& !url.equals("oneColumn")
77-
&& !url.equals("fullscreen");
77+
&& !url.equals("fullscreen")
78+
&& !url.startsWith("/jenkins/iconSize");
7879

7980
if (!response) {
8081
System.out.println("🤫 Ignoring URL: " + url);

0 commit comments

Comments
 (0)