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

Update the appearance of the stop button #8780

Merged
merged 11 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -71,7 +71,7 @@ THE SOFTWARE.
<div class="build-stop">
<!-- Check CANCEL permission for Project, Admin permission otherwise -->
<j:if test="${empty(it.widget.owner.CANCEL) ? h.hasPermission(app.ADMINISTER) : it.widget.owner.hasPermission(it.widget.owner.CANCEL)}">
<l:stopButton href="${link}stop" alt="[cancel]" confirm="${%confirm(build.fullDisplayName)}" />
<l:stopButton href="${link}stop" alt="${%Cancel}" confirm="${%confirm(build.fullDisplayName)}" />
</j:if>
</div>
</j:if>
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/resources/lib/hudson/buildCaption.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ THE SOFTWARE.
<td>
<j:if test="${it.parent.hasAbortPermission()}">
<l:stopButton href="stop" confirm="${%confirm(it.fullDisplayName)}"
alt="[${%cancel}]"/>
alt="${%cancel}"/>
</j:if>
</td>
</tr>
Expand Down
1 change: 1 addition & 0 deletions core/src/main/resources/lib/hudson/buildCaption.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
confirm=Are you sure you want to abort {0}?
cancel=Cancel
1 change: 1 addition & 0 deletions core/src/main/resources/lib/hudson/executors.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
Computers=built-in node{0,choice,0# ({1} of {2} executors busy)|1# + {0,number} agent ({1} of {2} executors busy)|1< + {0,number} agents ({1} of {2} executors busy)}
confirm=Are you sure you want to abort {0}?
launching=launching...
terminate\ this\ build=Cancel
8 changes: 4 additions & 4 deletions core/src/main/resources/lib/layout/stopButton.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ THE SOFTWARE.
</st:documentation>
<j:choose>
<j:when test="${confirm == null}">
<a class="stop-button-link" href="${href}">
<l:icon class="icon-stop icon-sm" alt="${alt}"/>
<a class="stop-button-link" href="${href}" tooltip="${alt}">
<l:icon src="symbol-close" />
</a>
</j:when>
<j:otherwise>
<a class="stop-button-link" href="${href}" data-confirm="${confirm}">
<l:icon class="icon-stop icon-sm" alt="${alt}"/>
<a class="stop-button-link" href="${href}" data-confirm="${confirm}" tooltip="${alt}">
<l:icon src="symbol-close" />
</a>
</j:otherwise>
</j:choose>
Expand Down
4 changes: 2 additions & 2 deletions test/src/test/java/jenkins/security/Security2278Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void testUi() throws Exception {
assertThat(contentAsString, containsString("Build Executor Status"));
assertThat(contentAsString, containsString("Unknown Task"));
assertThat(contentAsString, not(containsString("job/foo/job/bar")));
assertThat(contentAsString, not(containsString("icon-stop")));
assertThat(contentAsString, not(containsString("stop-button-link")));
}

@Test
Expand All @@ -81,7 +81,7 @@ public void testUiWithPermission() throws Exception {
assertThat(contentAsString, containsString("Build Executor Status"));
assertThat(contentAsString, not(containsString("Unknown Task")));
assertThat(contentAsString, containsString("job/foo/job/bar"));
assertThat(contentAsString, containsString("icon-stop"));
assertThat(contentAsString, containsString("stop-button-link"));
}

@Test
Expand Down
30 changes: 30 additions & 0 deletions war/src/main/scss/components/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -299,3 +299,33 @@ $jenkins-split-button-border-radius: 0.2rem;
}
}
}

.stop-button-link {
--item-background--hover: color-mix(in sRGB, var(--red) 20%, transparent);
--item-background--active: color-mix(in sRGB, var(--red) 25%, transparent);
--item-box-shadow--focus: transparent;

@include mixins.item;

position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
width: 1rem;
height: 1rem;
border-radius: 0.25rem;

&::before {
background: color-mix(in sRGB, var(--red) 15%, transparent);
}

svg {
width: 87.5%;
height: 87.5%;
color: var(--red);

* {
stroke-width: 40px;
}
}
}
Loading