Skip to content

Commit

Permalink
table resizing (#386)
Browse files Browse the repository at this point in the history
  • Loading branch information
mawinter69 authored Jan 6, 2025
1 parent bf374bf commit 5601ba3
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 65 deletions.
120 changes: 70 additions & 50 deletions src/main/resources/io/jenkins/plugins/designlibrary/Table/index.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -23,60 +23,80 @@ THE SOFTWARE.
-->

<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:s="/lib/samples">
<j:jelly xmlns:j="jelly:core" xmlns:s="/lib/samples" xmlns:t="/lib/hudson" xmlns:l="/lib/layout">
<s:layout>
<s:section hideBorder="true">
<s:group>
<s:preview>
<table class="jenkins-table sortable jenkins-!-margin-bottom-0">
<thead>
<th>
Name
</th>
<th>
Status
</th>
<th>
Reason
</th>
</thead>
<tbody>
<tr>
<td>
<a href="#" class="jenkins-table__link">Link 1</a>
</td>
<td>
Success
<a href="#" class="jenkins-table__link jenkins-table__badge model-link">#7</a>
</td>
<td>
No Errors
</td>
</tr>
<tr>
<td>
<a href="#" class="jenkins-table__link">Link 2</a>
</td>
<td>
Failure
</td>
<td>
Can't compile
</td>
</tr>
<tr>
<td>
<a href="#" class="jenkins-table__link">Link 3</a>
</td>
<td>
Unstable
</td>
<td>
Test Failed
</td>
</tr>
</tbody>
</table>
<div class="jdl-table-container">
<t:setIconSize/>
<table class="jenkins-table sortable ${iconSize == '16x16' ? 'jenkins-table--small' : iconSize == '24x24' ? 'jenkins-table--medium' : ''}">
<thead>
<th>
Name
</th>
<th class="jenkins-table__cell--tight">S</th>
<th>
Status
</th>
<th>
Reason
</th>
</thead>
<tbody>
<tr>
<td>
<a href="#" class="jenkins-table__link">Link 1</a>
</td>
<td class="jenkins-table__cell--tight jenkins-table__icon">
<div class="jenkins-table__cell__button-wrapper">
<l:icon src="symbol-status-blue"/>
</div>
</td>
<td>
Success
<a href="#" class="jenkins-table__link jenkins-table__badge model-link">#7</a>
</td>
<td>
No Errors
</td>
</tr>
<tr>
<td>
<a href="#" class="jenkins-table__link">Link 2</a>
</td>
<td class="jenkins-table__cell--tight jenkins-table__icon">
<div class="jenkins-table__cell__button-wrapper">
<l:icon src="symbol-status-red"/>
</div>
</td>
<td>
Failure
</td>
<td>
Can't compile
</td>
</tr>
<tr>
<td>
<a href="#" class="jenkins-table__link">Link 3</a>
</td>
<td class="jenkins-table__cell--tight jenkins-table__icon">
<div class="jenkins-table__cell__button-wrapper">
<l:icon src="symbol-status-yellow"/>
</div>
</td>
<td>
Unstable
</td>
<td>
Test Failed
</td>
</tr>
</tbody>
</table>
<t:iconSize/>
</div>
</s:preview>
<s:code file="index.jelly" />
</s:group>
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/scss/pages/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
@use "notifications";
@use "spacing";
@use "symbols";
@use "tables";
8 changes: 8 additions & 0 deletions src/main/resources/scss/pages/_tables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.jdl-table-container {
width: 100%;
margin-bottom: 0;
}

.jdl-table-container>div:last-child {
margin-bottom: 0;
}
46 changes: 32 additions & 14 deletions src/main/webapp/Table/index.jelly
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
<table class="jenkins-table sortable">
<thead>
<th>
Name
</th>
<th>
Status
</th>
<th>
Reason
</th>
</thead>
<tbody>
<t:setIconSize/>
<table class="jenkins-table sortable ${iconSize == '16x16' ? 'jenkins-table--small' : iconSize == '24x24' ? 'jenkins-table--medium' : ''}">
<thead>
<th>
Name
</th>
<th class="jenkins-table__cell--tight">S</th>
<th>
Status
</th>
<th>
Reason
</th>
</thead>
<tbody>
<tr>
<td>
<a href="#" class="jenkins-table__link">Link 1</a>
</td>
<td class="jenkins-table__cell--tight jenkins-table__icon">
<div class="jenkins-table__cell__button-wrapper">
<l:icon src="symbol-status-blue"/>
</div>
</td>
<td>
Success
<a href="#" class="jenkins-table__link jenkins-table__badge model-link">#7</a>
Expand All @@ -27,6 +34,11 @@
<td>
<a href="#" class="jenkins-table__link">Link 2</a>
</td>
<td class="jenkins-table__cell--tight jenkins-table__icon">
<div class="jenkins-table__cell__button-wrapper">
<l:icon src="symbol-status-red"/>
</div>
</td>
<td>
Failure
</td>
Expand All @@ -38,12 +50,18 @@
<td>
<a href="#" class="jenkins-table__link">Link 3</a>
</td>
<td class="jenkins-table__cell--tight jenkins-table__icon">
<div class="jenkins-table__cell__button-wrapper">
<l:icon src="symbol-status-yellow"/>
</div>
</td>
<td>
Unstable
</td>
<td>
Test Failed
</td>
</tr>
</tbody>
</tbody>
</table>
<t:iconSize/>
3 changes: 2 additions & 1 deletion src/test/java/ValidRelativeUrlsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ private boolean filterUrl(DomNode anchor) {
&& !url.equals("..")
&& !url.equals("twoColumn")
&& !url.equals("oneColumn")
&& !url.equals("fullscreen");
&& !url.equals("fullscreen")
&& !url.startsWith("/jenkins/iconSize");

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

0 comments on commit 5601ba3

Please sign in to comment.