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 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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
@@ -1 +1,2 @@
confirm=Are you sure you want to abort {0}?
cancel=Cancel
2 changes: 1 addition & 1 deletion core/src/main/resources/lib/hudson/executors.jelly
Expand Up @@ -126,7 +126,7 @@ THE SOFTWARE.
</st:include>
<td class="pane" align="center" valign="middle">
<j:if test="${h.hasPermission(exeparent,exeparent.READ) and e.hasStopPermission()}">
<l:stopButton href="${rootURL}/${c.url}${url}/stopBuild?runExtId=${h.urlEncode(exe.externalizableId)}" confirm="${%confirm(exe.fullDisplayName)}" alt="${%terminate this build}" />
<l:stopButton href="${rootURL}/${c.url}${url}/stopBuild?runExtId=${h.urlEncode(exe.externalizableId)}" confirm="${%confirm(exe.fullDisplayName)}" alt="${%Cancel}" />
Copy link
Member

Choose a reason for hiding this comment

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

This will break the i18n, it would be better to use Cancel in the properties as {en} translation. Or rename all translations.

</j:if>
</td>
</j:otherwise>
Expand Down
8 changes: 4 additions & 4 deletions core/src/main/resources/lib/layout/stopButton.jelly
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
30 changes: 30 additions & 0 deletions war/src/main/scss/components/_buttons.scss
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: 16px;
height: 16px;
border-radius: 4px;

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

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

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