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

Overhaul ui-samples as the Jenkins Design Library #14

Merged
merged 112 commits into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
d1d1918
Initial
janfaracik Feb 15, 2022
8ec2f40
Getting there
janfaracik Feb 15, 2022
6d3c084
Initial work with custom symbols + colors page
janfaracik Feb 23, 2022
e03e793
Add more components
janfaracik Mar 8, 2022
cff342b
Add radios example
janfaracik Mar 8, 2022
c8af226
Merge branch 'master' into overhaul
timja Mar 16, 2022
80cdaf7
Rename several files
janfaracik Mar 16, 2022
2839714
Update index.jelly
janfaracik Mar 16, 2022
343347c
Replace progress bar page with jelly
janfaracik Mar 16, 2022
3c1a1fe
Merge branch 'overhaul' of github.com:janfaracik/ui-samples-plugin in…
timja Mar 16, 2022
56518f3
Add missing descriptors
timja Mar 16, 2022
cb51768
Tweak buttons page
timja Mar 16, 2022
31d7027
Load example via JavaScript
timja Mar 16, 2022
afeec01
Update example
timja Mar 17, 2022
2a6aec3
Remove test code
timja Mar 17, 2022
b28a1d5
Handle prism running before code loading
timja Mar 17, 2022
a335229
Update home page, add icons, update some content
janfaracik Mar 17, 2022
367de54
Update homepage, add symbols content
janfaracik Mar 17, 2022
251967a
Make remote loading easy
timja Mar 17, 2022
cfe01eb
Merge branch 'overhaul' of github.com:janfaracik/ui-samples-plugin in…
timja Mar 17, 2022
c677903
Add examples to symbols page
timja Mar 17, 2022
0c8a781
Extract table sample out and show code sample without duplication
timja Mar 17, 2022
567b2bd
Improve rendering of Notifications
timja Mar 17, 2022
319d171
Improve button sample
timja Mar 17, 2022
3c92243
Update buttons docs
timja Mar 18, 2022
ff928f8
More improvements
timja Mar 18, 2022
3427e19
Add link to gitter
timja Mar 18, 2022
eca5946
Add checkboxes documentation
timja Mar 18, 2022
1bb809c
Add more content to homepage
janfaracik Mar 18, 2022
d459a27
Merge branch 'overhaul' of https://github.com/janfaracik/ui-samples-p…
janfaracik Mar 18, 2022
931ba87
Add links, update Gitter logo to be larger
janfaracik Mar 18, 2022
077c81f
Update youtube.svg
janfaracik Mar 18, 2022
724fc1a
Minor text change
timja Mar 18, 2022
1b29e5f
Temp hack to improve App logo
timja Mar 18, 2022
6fc0717
Re-brand to design library
timja Mar 18, 2022
be81e4c
Sync title and heading on home
timja Mar 18, 2022
4ca07c3
Add some content around buttons
timja Mar 18, 2022
d3b8aa6
Add sunburst to Jenkins card
janfaracik Mar 18, 2022
3d3dbe6
Merge branch 'overhaul' of https://github.com/janfaracik/ui-samples-p…
janfaracik Mar 18, 2022
bb9f53c
Copy changes
timja Mar 18, 2022
d847538
Merge branch 'overhaul' of github.com:janfaracik/ui-samples-plugin in…
timja Mar 18, 2022
457272f
Remove something we don't want to promote
timja Mar 18, 2022
fc37d39
Narrowed it down a bit
timja Mar 18, 2022
ab6b502
Fix CSRF issues
timja Mar 18, 2022
bb54e7d
Update colors page, add code for progress
janfaracik Mar 18, 2022
de16802
Update progress
timja Mar 18, 2022
866c8de
Merge branch 'overhaul' of github.com:janfaracik/ui-samples-plugin in…
timja Mar 18, 2022
d3cf9ef
Add rest of icons
janfaracik Mar 18, 2022
49c2f90
Merge branch 'overhaul' of https://github.com/janfaracik/ui-samples-p…
janfaracik Mar 18, 2022
5a0eff1
Remove titles
janfaracik Mar 18, 2022
c15f8f0
Remove unneeded data from SVGs
janfaracik Mar 18, 2022
cd32294
Improve select content
timja Mar 18, 2022
d7e8888
Cleanup CSS
janfaracik Mar 18, 2022
179ee92
Merge branch 'overhaul' of github.com:janfaracik/ui-samples-plugin in…
timja Mar 18, 2022
a45f1f3
Minor improvements to text box
timja Mar 18, 2022
3377aff
Update spacing, move code out of component sample div
janfaracik Mar 18, 2022
a54ec51
Merge branch 'master' into overhaul
janfaracik Mar 19, 2022
fe1f797
Update pom.xml
janfaracik Mar 19, 2022
89d81a1
Update index.jelly
janfaracik Mar 19, 2022
8a1fe68
Move progressively rendered page to progress
janfaracik Mar 19, 2022
27b3ae1
Improve formatting
timja Mar 19, 2022
4dafbe5
Add bit more to warning
timja Mar 19, 2022
d1f33ab
Add some examples to Validation
timja Mar 19, 2022
4c125d2
Remove unused descriptions
timja Mar 19, 2022
7316b01
Add example for basic textbox
timja Mar 19, 2022
3d91e50
Fix textbox size in component box
janfaracik Mar 19, 2022
44a9465
Set max width on samples, finish home content
janfaracik Mar 19, 2022
5c74f68
Fix pom urls
timja Mar 19, 2022
8198fbc
Rename in README
timja Mar 19, 2022
ee64398
Apply suggestions from code review
timja Mar 19, 2022
d2fa29a
Add some symbol guidance
timja Mar 19, 2022
1fbafb9
Remove xmp
timja Mar 19, 2022
9f297bf
Fix tooltip rendering
timja Mar 19, 2022
96f77a7
Add code sample to dropdown dynamic
timja Mar 19, 2022
5e0ebe7
Somewhat fix breadcrumb, content needs improving
timja Mar 20, 2022
07218cd
Delete index.groovy
janfaracik Mar 20, 2022
08853e0
Rename all packages
timja Mar 21, 2022
672a4fa
Replace deprecated editable combo box
timja Mar 21, 2022
99ac8bd
Remove select2 improve text box
timja Mar 21, 2022
8d2f2a2
Add spacing details
janfaracik Mar 22, 2022
46a7805
Update sample.css
janfaracik Mar 22, 2022
696ac85
Update Colors.java
janfaracik Mar 22, 2022
0be7211
Update src/main/resources/io/jenkins/plugins/designlibrary/Spacing/in…
janfaracik Mar 22, 2022
a3b4684
Button formatting improvements
timja Mar 23, 2022
b888a10
Fix checkbox formatting
timja Mar 23, 2022
a0d2a19
Add braces
timja Mar 23, 2022
c013ede
Add help button
janfaracik Mar 24, 2022
0b9cbe1
Merge branch 'overhaul' of https://github.com/janfaracik/ui-samples-p…
janfaracik Mar 24, 2022
ed916b3
Update index.jelly
janfaracik Mar 24, 2022
d745fac
Add plugin name to class
timja Mar 25, 2022
307413a
Merge branch 'overhaul' of github.com:janfaracik/ui-samples-plugin in…
timja Mar 25, 2022
859dae2
Add missing plugin qualifier
timja Mar 25, 2022
9e3e76f
adjunct must be loaded inside layout
timja Mar 25, 2022
7378921
Polish
timja Mar 26, 2022
dfc8dbb
Add suggestion from Wadeck
timja Mar 26, 2022
0f0836c
Cleanup links
timja Mar 27, 2022
3e2cbe6
Add where to get artifact ID
timja Mar 27, 2022
fc972f0
Large numbers become max value
timja Mar 27, 2022
b1b8c55
Move dynamic dropdown to select
timja Mar 27, 2022
fcd5b6c
Syntax highlighting for heterolist
timja Mar 27, 2022
3f75571
Iniital JavaScript proxy import from wiki
timja Mar 27, 2022
e5ca3eb
Polish JavaScript proxy
timja Mar 27, 2022
6f95302
Add small docs for AppBar, add share button for supported browsers
janfaracik Mar 27, 2022
80c9286
Polish app-bar
timja Mar 28, 2022
dce98fd
Add app-bar symbol
janfaracik Mar 28, 2022
616a407
Fix share icon
janfaracik Mar 28, 2022
dec401a
Change icon to symbol
janfaracik Mar 28, 2022
19bd345
Attempt at a fix/workaround for JS error
janfaracik Mar 28, 2022
0348a01
Second potential fix
janfaracik Mar 28, 2022
7639b13
Merge branch 'master' into overhaul
timja Mar 29, 2022
31939f9
Merge branch 'overhaul' of github.com:janfaracik/ui-samples-plugin in…
timja Mar 29, 2022
2e7081a
Disable test
timja Mar 29, 2022
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
.settings/
.idea/
.DS_Store
*.iml
21 changes: 21 additions & 0 deletions src/main/java/io/jenkins/plugins/designlibrary/AppBar.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package io.jenkins.plugins.designlibrary;

import hudson.Extension;

@Extension
public class AppBar extends UISample {
@Override
public String getDisplayName() {
return "App bars";
}

@Override
public String getIconFileName() {
return "symbol-app-bar";
timja marked this conversation as resolved.
Show resolved Hide resolved
}

@Extension
public static final class DescriptorImpl extends UISampleDescriptor {
}
}

1 change: 1 addition & 0 deletions src/main/resources/images/symbols/share.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:s="/lib/samples" xmlns:l="/lib/layout" xmlns:t="/lib/hudson">
<s:sample>
<div class="app-component-sample app-component-sample--full-width">
<div class="jenkins-app-bar jenkins-!-margin-bottom-0">
<div class="jenkins-app-bar__content">
<h1>Page title</h1>
</div>
<div class="jenkins-app-bar__controls">
<button class="jenkins-button jenkins-button--primary">
<l:icon src="symbol-add" />
Primary control
</button>
<button class="jenkins-button">Secondary</button>
<button class="jenkins-button">Secondary</button>
<t:help href="https://www.jenkins.io" />
Comment on lines +10 to +16
Copy link
Member

@timja timja Mar 28, 2022

Choose a reason for hiding this comment

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

the spacing looks not good on the buttons

image

is that just the branch I'm using (jenkinsci/jenkins#6395)

Copy link
Member

Choose a reason for hiding this comment

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

That is part of the latest weekly as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fix for that should be in with the help button component merge 👍

Copy link
Member

Choose a reason for hiding this comment

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

I think my branch has the help button component update in it

</div>
</div>
</div>
<pre>
<code class="sample-remote language-xml" data-sample="appBar.jelly" />
</pre>

<p class="jenkins-description">
App bars provide glanceable information as well as important actions about the current page.
</p>
</s:sample>
</j:jelly>
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
margin-bottom: var(--section-padding);
}

.app-component-sample--full-width {
align-items: unset;
}

.app-component-sample .jenkins-form-item {
width: 100%;
max-width: unset;
Expand Down
17 changes: 17 additions & 0 deletions src/main/resources/io/jenkins/plugins/designlibrary/sample.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,21 @@ document.addEventListener("DOMContentLoaded", () =>{
element.innerHTML = Prism.highlight(element.innerHTML, Prism.languages[language], language)
}
});

if (!navigator.canShare) {
document.querySelector('#button-share').style.display = "none"
}

document.querySelector('#button-share').addEventListener('click', async () => {
Copy link
Member

Choose a reason for hiding this comment

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

Looks like html unit breaks on this syntax, https://github.com/jenkinsci/ui-samples-plugin/pull/14/checks?check_run_id=5716218242

missing formal parameter

may be related to HtmlUnit/htmlunit#232

try {
const shareData = {
title: document.title,
text: `Learn about ${document.querySelector("h1").textContent} on Jenkins Design Library`,
url: document.location.href
}
await navigator.share(shareData)
} catch (error) {
console.log(error)
}
});
});
8 changes: 6 additions & 2 deletions src/main/resources/lib/samples/sample.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,17 @@ THE SOFTWARE.

<st:include page="header" optional="true" />

<l:app-bar title="${title}">
<button id="button-share" class="jenkins-button" tooltip="${%Share page}">
<l:icon src="symbol-share" />
</button>
</l:app-bar>

<l:side-panel>
<s:sidepanel />
</l:side-panel>

<l:main-panel>
<h1>${title}</h1>

<d:invokeBody/>
</l:main-panel>
</l:layout>
Expand Down
9 changes: 9 additions & 0 deletions src/main/webapp/AppBar/appBar.jelly
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<l:app-bar title="Page title">
<button class="jenkins-button jenkins-button--primary">
<l:icon src="symbol-add" />
Primary control
</button>
<button class="jenkins-button">Secondary</button>
<button class="jenkins-button">Secondary</button>
<t:help href="https://www.jenkins.io" />
</l:app-bar>