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

Revamp Design Library v3 #359

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
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: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<a href="https://weekly.ci.jenkins.io/design-library/">
<img src="https://raw.githubusercontent.com/jenkinsci/design-library-plugin/master/logo.svg">
<img src="logo.svg" alt="Logo">
</a>

[![View Design Library](https://img.shields.io/badge/view-design_library-F2709C)](https://weekly.ci.jenkins.io/design-library)
[![Join the chat at https://gitter.im/jenkinsci/ux-sig](https://badges.gitter.im/jenkinsci/ux-sig.svg)](https://gitter.im/jenkinsci/ux-sig)
[![Jenkins Plugin](https://img.shields.io/jenkins/plugin/v/design-library.svg)](https://plugins.jenkins.io/design-library/)
[![Jenkins Plugin Installs](https://img.shields.io/jenkins/plugin/i/design-library.svg?color=blue)](https://plugins.jenkins.io/design-library/)
Expand All @@ -13,7 +14,7 @@ This plugin contains:
- demonstration of UI components available in Jenkins
- snippets of Jelly ready-to-use examples

## Usage
## Contributing

You can open this project as a [Gitpod workspace](https://www.gitpod.io/) which comes pre-configured with all the tools you will need.

Expand All @@ -25,5 +26,3 @@ which will open the workspace in IntelliJ IDEA using JetBrains Gateway.
Alternatively clone this project and run `mvn hpi:run`.

Go to the **Design Library** menu item or straight to http://localhost:8080/jenkins/design-library/ and play with UI components.

If you just want to see this plugin in action then you can also visit the latest version of this plugin in our [Jenkins "weekly" live installation](https://weekly.ci.jenkins.io/design-library/).
4 changes: 2 additions & 2 deletions logo.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
@@ -1,11 +1,13 @@
package io.jenkins.plugins.designlibrary;

import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;

@Extension
public class AppBar extends UISample {

@Override
public String getDisplayName() {
public @NonNull String getDisplayName() {
return "App bars";
}

Expand All @@ -14,6 +16,11 @@ public String getIconFileName() {
return "symbol-app-bar";
}

@Override
public String getDescription() {
return "Frames your page and contains your most important actions.";
}

@Extension
public static final class DescriptorImpl extends UISampleDescriptor {}
}
9 changes: 5 additions & 4 deletions src/main/java/io/jenkins/plugins/designlibrary/Banner.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@

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

@Override
public String getIconFileName() {
return "symbol-information-circle-outline plugin-ionicons-api";
}

@Override
public String getDescription() {
return "Banners are a handy way to display small snippets of text and actions.";
}

@Extension
public static final class DescriptorImpl extends UISampleDescriptor {}
}
5 changes: 5 additions & 0 deletions src/main/java/io/jenkins/plugins/designlibrary/Buttons.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ public String getIconFileName() {
return "symbol-buttons";
}

@Override
public String getDescription() {
return "Triggers specific actions with a click or tap.";
}

@Extension
public static final class DescriptorImpl extends UISampleDescriptor {}
}
13 changes: 9 additions & 4 deletions src/main/java/io/jenkins/plugins/designlibrary/Cards.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@
public class Cards extends UISample {

@Override
public String getDisplayName() {
return "Cards";
public String getIconFileName() {
return "symbol-cards";
}

@Override
public String getIconFileName() {
return "symbol-cards";
public String getDescription() {
return "Use cards to surface related information and controls to users.";
}

@Override
public String getSince() {
return "2.479.1";
}

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

public enum Category {
COMPONENT("Components"),
PATTERN("Patterns");

Category(String displayName) {
this.displayName = displayName;
}

private final String displayName;

public String getDisplayName() {
return displayName;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ public String getIconFileName() {
return "symbol-checkbox-outline plugin-ionicons-api";
}

@Override
public String getDescription() {
return "Allows users to select one or more options from a list.";
}

@Extension
public static final class DescriptorImpl extends UISampleDescriptor {}
}
10 changes: 10 additions & 0 deletions src/main/java/io/jenkins/plugins/designlibrary/Colors.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ public String getIconFileName() {
return "symbol-water-outline plugins-ionicons-api";
}

@Override
public String getDescription() {
return "Defines the palette for consistent use of color throughout the design system.";
}

@Override
public Category getCategory() {
return Category.PATTERN;
}

public List<Semantic> getSemantics() {
return List.of(
new Semantic("Accent", "Use for branding", "accent-color"),
Expand Down
14 changes: 0 additions & 14 deletions src/main/java/io/jenkins/plugins/designlibrary/Conventions.java

This file was deleted.

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

import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.util.ListBoxModel;

@Extension
public class Dialogs extends UISample {

@NonNull
@Override
public String getDisplayName() {
return super.getDisplayName();
}

@Override
public String getIconFileName() {
return "symbol-chatbox-ellipses-outline plugin-ionicons-api";
}

@Override
public String getDescription() {
return "Displays overlay windows for additional information or user input without navigating away.";
}

@Extension
public static final class DescriptorImpl extends UISampleDescriptor {
public ListBoxModel doFillFlavorItems() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ public String getIconFileName() {
return "symbol-dropdowns";
}

@Override
public String getDescription() {
return "Dropdowns allow you to group similar controls under one roof. They're an effective way to de-clutter your page whilst offering users the actions they need.";
}

@Extension
public static final class DescriptorImpl extends UISampleDescriptor {}
}
9 changes: 5 additions & 4 deletions src/main/java/io/jenkins/plugins/designlibrary/File.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@

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

@Override
public String getIconFileName() {
return "symbol-cloud-upload-outline plugin-ionicons-api";
}

@Override
public String getDescription() {
return "Enables file upload or management functionality.";
}

@Extension
public static final class DescriptorImpl extends UISampleDescriptor {}
}
16 changes: 14 additions & 2 deletions src/main/java/io/jenkins/plugins/designlibrary/HeteroList.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
package io.jenkins.plugins.designlibrary;

import com.google.common.collect.ImmutableList;
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.XmlFile;
import hudson.model.AbstractDescribableImpl;
Expand All @@ -43,7 +44,7 @@
import org.kohsuke.stapler.StaplerRequest;

@Extension
public final class HeteroList extends UISample {
public class HeteroList extends UISample {
janfaracik marked this conversation as resolved.
Show resolved Hide resolved

@Extension
public static final class DescriptorImpl extends UISampleDescriptor {}
Expand All @@ -61,9 +62,20 @@ public HeteroList() throws IOException {
}
}

@Override
public String getIconFileName() {
return "symbol-list-outline plugin-ionicons-api";
}

@NonNull
@Override
public String getDisplayName() {
return "Hetero List";
return "Repeatable list";
}

@Override
public String getDescription() {
return "Displays lists with varying content types or layouts within the same container.";
}

public Config getConfig() {
Expand Down
48 changes: 48 additions & 0 deletions src/main/java/io/jenkins/plugins/designlibrary/Home.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package io.jenkins.plugins.designlibrary;

import hudson.Extension;
import hudson.model.RootAction;
import java.util.List;
import java.util.Map;

/**
* Entry point to all the UI samples.
*
* @author Kohsuke Kawaguchi
*/
@Extension
public class Home implements RootAction {

public String getIconFileName() {
return "symbol-design-library plugin-design-library";
}

public String getDisplayName() {
return "Design Library";
}

public String getUrlName() {
return "design-library";
}

public List<UISample> getAll() {
return UISample.getAll();
}

public static Map<Category, List<UISample>> getGrouped() {
return UISample.getGrouped();
}

/**
* Dynamically retrieves the appropriate UI sample based on the current URL
*/
public UISample getDynamic(String name) {
for (UISample ui : getAll()) {
String urlName = ui.getUrlName();
if (urlName != null && urlName.equals(name)) {
return ui;
}
}
return null;
}
}
Loading
Loading