Use Notice component for views lacking jobs (#9724)

* Use notice for views lacking jobs

* Update _notice.scss

* Rename text to title, use 'invokeBody' rather than description field
This commit is contained in:
Jan Faracik 2024-09-15 20:28:22 +01:00 committed by GitHub
parent 7ff5aaa0fd
commit 239ced05af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 30 additions and 15 deletions

View File

@ -71,7 +71,7 @@ THE SOFTWARE.
<j:choose> <j:choose>
<j:when test="${noPlugins}"> <j:when test="${noPlugins}">
<l:notice icon="symbol-plugins" text="${%No plugins installed}" /> <l:notice icon="symbol-plugins" title="${%No plugins installed}" />
</j:when> </j:when>
<j:otherwise> <j:otherwise>
<table id="plugins" class="jenkins-table sortable"> <table id="plugins" class="jenkins-table sortable">

View File

@ -230,7 +230,7 @@ THE SOFTWARE.
</table> </table>
</j:when> </j:when>
<j:otherwise> <j:otherwise>
<l:notice icon="symbol-up-to-date" text="${%No updates available}" /> <l:notice icon="symbol-up-to-date" title="${%No updates available}" />
</j:otherwise> </j:otherwise>
</j:choose> </j:choose>
<d:invokeBody/> <d:invokeBody/>

View File

@ -67,7 +67,7 @@ THE SOFTWARE.
</l:app-bar> </l:app-bar>
<j:if test="${noLogs}"> <j:if test="${noLogs}">
<l:notice text="${%No logs available}" icon="symbol-journal" /> <l:notice title="${%No logs available}" icon="symbol-journal" />
</j:if> </j:if>
<t:logRecords logRecords="${it.logRecords}"/> <t:logRecords logRecords="${it.logRecords}"/>

View File

@ -23,9 +23,10 @@ THE SOFTWARE.
--> -->
<?jelly escape-by-default='true'?> <?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core"> <j:jelly xmlns:j="jelly:core" xmlns:l="/lib/layout">
${%description_1} <l:notice title="${%description_1}" icon="symbol-weather-icon-health-00to19">
<j:if test="${it.hasPermission(it.CONFIGURE)}"> <j:if test="${it.hasPermission(it.CONFIGURE)}">
${%description_2} ${%description_2}
</j:if> </j:if>
</l:notice>
</j:jelly> </j:jelly>

View File

@ -53,7 +53,7 @@ THE SOFTWARE.
<j:choose> <j:choose>
<j:when test="${empty(app.pluginManager.plugins) and empty(app.pluginManager.failedPlugins)}"> <j:when test="${empty(app.pluginManager.plugins) and empty(app.pluginManager.failedPlugins)}">
<l:notice icon="symbol-plugins" text="${%No plugins installed}" /> <l:notice icon="symbol-plugins" title="${%No plugins installed}" />
</j:when> </j:when>
<j:otherwise> <j:otherwise>
<table class="jenkins-table sortable"> <table class="jenkins-table sortable">

View File

@ -23,10 +23,10 @@ THE SOFTWARE.
--> -->
<?jelly escape-by-default='true'?> <?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:l="/lib/layout"> <j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:l="/lib/layout" xmlns:d="jelly:define">
<st:documentation> <st:documentation>
<st:attribute name="text" use="required"> <st:attribute name="title" use="required">
Sets the text for the notice. HTML isn't supported. Sets the title for the notice. HTML isn't supported.
</st:attribute> </st:attribute>
<st:attribute name="icon" use="required"> <st:attribute name="icon" use="required">
Sets the icon for the notice. Supports Jenkins Symbols and regular images. Sets the icon for the notice. Supports Jenkins Symbols and regular images.
@ -35,6 +35,9 @@ THE SOFTWARE.
<div class="jenkins-notice"> <div class="jenkins-notice">
<l:icon src="${attrs.icon}" /> <l:icon src="${attrs.icon}" />
<div>${attrs.text}</div> <div>${attrs.title}</div>
<div class="jenkins-notice__description">
<d:invokeBody />
</div>
</div> </div>
</j:jelly> </j:jelly>

View File

@ -8,11 +8,22 @@
background: var(--button-background); background: var(--button-background);
border-radius: 0.66rem; border-radius: 0.66rem;
font-size: var(--font-size-base); font-size: var(--font-size-base);
margin-bottom: 30px; margin-bottom: var(--section-padding);
font-weight: 500; font-weight: 450;
padding: calc(var(--section-padding) * 2);
text-align: center;
svg { svg {
width: 2.5rem; width: 2.5rem;
height: 2.5rem; height: 2.5rem;
} }
&__description {
color: var(--text-color-secondary);
margin-top: -0.375rem;
&:empty {
display: none;
}
}
} }