Added documentation for Empty States#407
Conversation
…ccidentally removed newline in File.java
| <ul class="jdl-list"> | ||
| <li>title - ${%parameters.title}</li> | ||
| <li>icon - ${%parameters.icon}</li> | ||
| <li>text - ${%parameters.text}</li> |
There was a problem hiding this comment.
text parameter doesn't exist - notice.jelly
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:l="/lib/layout" xmlns:d="jelly:define">
<st:documentation>
<st:attribute name="title" use="required">
Sets the title for the notice. HTML isn't supported.
</st:attribute>
<st:attribute name="icon" use="required">
Sets the icon for the notice. Supports Jenkins Symbols and regular images.
</st:attribute>
</st:documentation>
<div class="jenkins-notice">
<l:icon src="${attrs.icon}" />
<div>${attrs.title}</div>
<div class="jenkins-notice__description">
<d:invokeBody />
</div>
</div>
</j:jelly>There was a problem hiding this comment.
Thanks for the clarification!
I included the text parameter because I saw it in this PR (in systemInfo.jelly).
|
This looks great! Thanks for contributing. |
|
Margin and size of the notice is a little off, we add custom styling to .jenkins-notice {
margin-bottom: 0;
width: 100%;
max-width: 650px;
} |
| <s:group> | ||
| <s:preview> | ||
| <l:notice title="${%childNoticeTitle}" icon="symbol-weather-icon-health-00to19"> | ||
| ${%childNotionContent} |
There was a problem hiding this comment.
if you're including content like this I think it would make for sense to include some HTML like maybe a call to action.
e.g. a button.
There's a (complex) example here:
I would suggest something like (adjust the formatting to something that looks good in the example)::
| ${%childNotionContent} | |
| <button | |
| type="button" | |
| class="jenkins-button jenkins-button--secondary">${%New item}</button> | |
There was a problem hiding this comment.
Thanks for the review.
As you suggested, I included a button. For the styling I used the suggested class "jenkins-button jenkins-button--secondary". I've tried also others like "jenkins-button jenkins-button--primary" or "jenkins-button jenkins-button--terniary", but I believe the suggested one fits best.
src/main/resources/io/jenkins/plugins/designlibrary/EmptyStates/index.properties
Outdated
Show resolved
Hide resolved
src/main/resources/io/jenkins/plugins/designlibrary/EmptyStates/index.properties
Outdated
Show resolved
Hide resolved
Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com>
…s/index.properties Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com>
src/main/resources/io/jenkins/plugins/designlibrary/EmptyStates/index.properties
Outdated
Show resolved
Hide resolved
src/main/resources/io/jenkins/plugins/designlibrary/EmptyStates/index.properties
Outdated
Show resolved
Hide resolved
src/main/java/io/jenkins/plugins/designlibrary/EmptyStates.java
Outdated
Show resolved
Hide resolved
src/main/resources/io/jenkins/plugins/designlibrary/EmptyStates/index.properties
Outdated
Show resolved
Hide resolved
…s/index.properties
timja
left a comment
There was a problem hiding this comment.
Thanks! I ran this locally and just made some minor tweaks.
Much appreciated for this!
|
Thanks again! :) |
Description
This PR fixes #406. It demonstrates how to use <l:notice> to display messages when no content or data is available.
Files Added:
Testing done
Here you can find the screenshots of the rendered UI:
Submitter checklist