Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

table resizing #386

Merged
merged 3 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 style="width: 100%" class="jenkins-!-margin-bottom-0">
<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";
3 changes: 3 additions & 0 deletions src/main/resources/scss/pages/_tables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.jenkins-icon-size {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.jenkins prefix shouldn't be used in the design library, its jdl

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this even used though?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The t:iconsSize internally uses this class and has a larger bottom margin. As the jdl-component-sample has a large padding those two would lead to bigger gap in the UI between table and sample code:
Without that it looks like this
image

With margin removed:
image

Found a way to avoid using it

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
Loading