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 all commits
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
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
root = true

[*.{jelly, js, html, less, css, hbs}]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
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
18 changes: 9 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ THE SOFTWARE.
<relativePath />
</parent>

<groupId>org.jenkins-ci.main</groupId> <!-- historical -->
<artifactId>ui-samples-plugin</artifactId> <!-- historical -->
<groupId>io.jenkins.plugins</groupId>
<artifactId>design-library</artifactId>
Comment on lines -36 to +37
Copy link
Member

@NotMyFault NotMyFault Mar 19, 2022

Choose a reason for hiding this comment

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

I'd leave the GAV as-is, because changing it basically creates a new plugin from the plugin manager's perspective which would result in ui-samples-plugin users not being able to update anymore and design-library installations could install the ui-samples-plugin.

Copy link
Member

@timja timja Mar 19, 2022

Choose a reason for hiding this comment

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

Hmm, given it hasn't been released in 8 years it's probably okay to change it, although likely we will want to change the package name as well.

(and also because there's no way this can affect users other than uninstalling the old one and installing the new one)

Copy link
Member

Choose a reason for hiding this comment

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

Would it work out to suspend ui-samples from the update center noting it's superseded by design-library?

Copy link
Member

Choose a reason for hiding this comment

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

possibly

<version>${revision}${changelist}</version>
<packaging>hpi</packaging>

<name>Jenkins UI sample plugin</name>
<description>Demonstration of UI controls available in Jenkins based on Stapler, Jelly, Groovy, etc.</description>
<url>https://github.com/ui-samples-plugin</url>
<name>Jenkins Design Library</name>
<description>Demonstration of UI controls available in Jenkins and guidance on how to use them</description>
<url>https://github.com/jenkinsci/ui-samples-plugin</url>

<properties>
<revision>2.1</revision>
<changelist>-SNAPSHOT</changelist>
<gitHubRepo>github.com/ui-samples-plugin</gitHubRepo>
<gitHubRepo>jenkinsci/ui-samples-plugin</gitHubRepo>
<jenkins.version>2.339</jenkins.version>
<java.level>8</java.level>
</properties>
Expand Down Expand Up @@ -90,9 +90,9 @@ THE SOFTWARE.
</build>

<scm>
<connection>scm:git:https://${gitHubRepo}</connection>
<developerConnection>scm:git:https://${gitHubRepo}</developerConnection>
<url>https://${gitHubRepo}</url>
<connection>scm:git:https://github.com/${gitHubRepo}</connection>
<developerConnection>scm:git:https://github.com/${gitHubRepo}</developerConnection>
<url>https://github.com/${gitHubRepo}</url>
<tag>${scmTag}</tag>
</scm>

Expand Down
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 {
}
}

19 changes: 19 additions & 0 deletions src/main/java/io/jenkins/plugins/designlibrary/Buttons.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package io.jenkins.plugins.designlibrary;

import hudson.Extension;

/**
* @author Kohsuke Kawaguchi
*/
@Extension
public class Buttons extends UISample {
@Override
public String getIconFileName() {
return "symbol-buttons";
}

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

19 changes: 19 additions & 0 deletions src/main/java/io/jenkins/plugins/designlibrary/Checkboxes.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package io.jenkins.plugins.designlibrary;

import hudson.Extension;

/**
* @author Kohsuke Kawaguchi
*/
@Extension
public class Checkboxes extends UISample {
@Override
public String getIconFileName() {
return "symbol-checkboxes";
}

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

25 changes: 25 additions & 0 deletions src/main/java/io/jenkins/plugins/designlibrary/Colors.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package io.jenkins.plugins.designlibrary;

import hudson.Extension;

import java.util.Arrays;
import java.util.List;

@Extension
public class Colors extends UISample {
@Override
public String getIconFileName() {
return "symbol-colors";
}

public List<String> getColors() {
// Uncomment these once these colors are in core
// return Arrays.asList("red", "green", "orange", "yellow", "blue", "indigo", "violet");
return Arrays.asList("red", "green", "orange");
}

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

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* THE SOFTWARE.
*/

package jenkins.plugins.ui_samples;
package io.jenkins.plugins.designlibrary;

import com.google.common.collect.ImmutableList;
import hudson.Extension;
Expand All @@ -45,19 +45,10 @@

@Extension public final class HeteroList extends UISample {

@Override public String getDescription() {
return "Show a heterogeneous list of subitems with different data bindings for radio buttons and checkboxes";
}

@Override public List<SourceFile> getSourceFiles() {
return super.getSourceFiles();
// TODO add others
}

@Extension public static final class DescriptorImpl extends UISampleDescriptor {}

public XmlFile getConfigFile() {
return new XmlFile(new File(Jenkins.getInstance().getRootDir(), "stuff.xml"));
return new XmlFile(new File(Jenkins.get().getRootDir(), "stuff.xml"));
}

private Config config;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package io.jenkins.plugins.designlibrary;

import hudson.Extension;

/**
* @author Kohsuke Kawaguchi
*/
@Extension
public class InpageNavigationWithBreadcrumb extends UISample {
@Extension
public static final class DescriptorImpl extends UISampleDescriptor {
}
}


Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jenkins.plugins.ui_samples;
package io.jenkins.plugins.designlibrary;

import hudson.Extension;
import org.kohsuke.stapler.bind.JavaScriptMethod;
Expand All @@ -12,18 +12,18 @@
@Extension
public class JavaScriptProxy extends UISample {
private int i;

@Override
public String getDescription() {
return "Use JavaScript proxy objects to access server-side Java objects from inside the browser.";
public String getDisplayName() {
return "JavaScript Proxy";
}

/**
* The annotation exposes this method to JavaScript proxy.
*/
@JavaScriptMethod
public int increment(int n) {
return i+=n;
return i += n;
}

@Extension
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jenkins.plugins.ui_samples;
package io.jenkins.plugins.designlibrary;

import hudson.Extension;
import jenkins.model.ModelObjectWithChildren;
Expand All @@ -10,10 +10,10 @@
* @author Kohsuke Kawaguchi
*/
@Extension
public class NavigationContextMenu extends UISample implements ModelObjectWithContextMenu, ModelObjectWithChildren {
public class Links extends UISample implements ModelObjectWithContextMenu, ModelObjectWithChildren {
@Override
public String getDescription() {
return "Integrate with navigational context menu to provider quick access around object graph";
public String getIconFileName() {
return "symbol-links";
}
timja marked this conversation as resolved.
Show resolved Hide resolved

/**
Expand All @@ -28,18 +28,18 @@ public ContextMenu doContextMenu(StaplerRequest request, StaplerResponse respons
// otherwise you can also programatically create them.
// see the javadoc for various convenience methods to add items
return new ContextMenu()
.add("http://jenkins-ci.org/","Jenkins project")
.add("http://www.cloudbees.com/","CloudBees")
.add(new MenuItem().withContextRelativeUrl("/").withStockIcon("gear.png").withDisplayName("top page"));
.add(new MenuItem().withContextRelativeUrl("/").withIconClass("icon-up").withDisplayName("Back to Dashboard"))
.add("https://www.jenkins.io/","Jenkins project")
.add("https://plugins.jenkins.io/","Plugin documentation");
}
}

public ContextMenu doChildrenContextMenu(StaplerRequest request, StaplerResponse response) throws Exception {
// You implement this method in much the same way you do doContextMenu
return new ContextMenu()
.add("http://yahoo.com/","Yahoo")
.add("http://google.com/","Google")
.add("http://microsoft.com/","Microsoft");
.add("https://yahoo.com/","Yahoo")
.add("https://google.com/","Google")
.add("https://microsoft.com/","Microsoft");
}

@Extension
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package io.jenkins.plugins.designlibrary;

import hudson.Extension;

/**
* @author Kohsuke Kawaguchi
*/
@Extension
public class Notifications extends UISample {
@Override
public String getIconFileName() {
return "symbol-notifications";
}

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


Original file line number Diff line number Diff line change
@@ -1,49 +1,34 @@
/*
* The MIT License
*
* Copyright 2012 Jesse Glick.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package jenkins.plugins.ui_samples;
package io.jenkins.plugins.designlibrary;

import hudson.Extension;
import java.util.LinkedList;
import java.util.List;
import jenkins.util.ProgressiveRendering;
import net.sf.json.JSON;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

@Extension
public class ProgressivelyRendered extends UISample {
import java.util.LinkedList;
import java.util.List;

@Override public String getDescription() {
return "Shows how to use progressively rendered content to avoid overloading the server with a slow HTTP request.";
/**
* @author Kohsuke Kawaguchi
*/
@Extension
public class Progress extends UISample {
@Override
public String getIconFileName() {
return "symbol-progress";
}

public ProgressiveRendering factor(final String numberS) {
return new ProgressiveRendering() {
final List<Integer> newFactors = new LinkedList<Integer>();
@Override protected void compute() throws Exception {
int number = Integer.parseInt(numberS); // try entering a nonnumeric value!
int number;
try {
number = Integer.parseInt(numberS); // try entering a nonnumeric value!
} catch (NumberFormatException e) {
number = Integer.MAX_VALUE;
}
// Deliberately inefficient:
for (int i = 1; i <= number; i++) {
if (canceled()) {
Expand Down Expand Up @@ -72,6 +57,7 @@ public ProgressiveRendering factor(final String numberS) {
}

@Extension
public static final class DescriptorImpl extends UISampleDescriptor {}

public static final class DescriptorImpl extends UISampleDescriptor {
}
}

24 changes: 24 additions & 0 deletions src/main/java/io/jenkins/plugins/designlibrary/Radios.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package io.jenkins.plugins.designlibrary;

import hudson.Extension;
import jenkins.model.Jenkins;

import java.util.ArrayList;
import java.util.List;

@Extension
public class Radios extends UISample {
@Override
public String getIconFileName() {
return "symbol-radios";
}

public List<UISample> getRadios() {
return new ArrayList<>(Jenkins.get().getExtensionList(UISample.class)).subList(0, 4);
}

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

Loading