Skip to content

Commit

Permalink
[JENKINS-39990] fix Exceptions on user config page (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernhard Grünewaldt authored and James William Dumay committed Nov 27, 2016
1 parent 504d1c6 commit e2b73c4
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
20 changes: 20 additions & 0 deletions README.md
Expand Up @@ -49,6 +49,26 @@ Remember to clean the `work` dir if something strange is happening, like plugin
rm -rf work/*
```

### Pre Release Tests

**Testcase 1: Favorite Column on Job List Page**

* You are on the Job List Page and have created at least one Build Job.
* On the right a column 'Fav' needs to show up and show a grey star for the job.
* With a click on the grey star the star turns golden and the job is added as favorite.
* Preview:
* ![testcase-1-favorite-column](https://cloud.githubusercontent.com/assets/12599965/20640106/2d7b5094-b3d6-11e6-8623-180056acb82d.gif)


**Testcase 2: Favorite Entries on User Config Page**

* On the Jenkins Start Page click on the small arrow right to your username in the top right corner.
* In the appearing dropdown click on configure.
* When scrolling down to 'Favorites' section you will see all your favorites.
* When clicking the golden star you can remove a job as favorite.
* Preview:
* ![testcase-2-favorite-config](https://cloud.githubusercontent.com/assets/12599965/20640200/f0c3b806-b3d7-11e6-9fd9-43a2676b0dc8.gif)

## License

Licensed under [MIT License](./LICENSE.md)
8 changes: 8 additions & 0 deletions src/main/java/hudson/plugins/favorite/assets/Asset.java
@@ -0,0 +1,8 @@
package hudson.plugins.favorite.assets;

/**
* Just a dummy class for the jelly st:include which otherwise throws exceptions
* in config.jelly when st:include to css.jelly is called without class parameter
*/
public class Asset {
}
Expand Up @@ -8,6 +8,7 @@
import hudson.model.Descriptor;
import hudson.model.UserProperty;
import hudson.model.UserPropertyDescriptor;
import hudson.plugins.favorite.assets.Asset;
import net.sf.json.JSONObject;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.StaplerRequest;
Expand Down Expand Up @@ -128,4 +129,8 @@ Object readResolve() {
}
return this;
}

public Class getAssetClass() {
return Asset.class;
}
}
@@ -1,8 +1,8 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<st:include page="/hudson/plugins/favorite/assets/css.jelly" />
<st:include page="/hudson/plugins/favorite/assets/javascript.jelly" />
<st:include page="/hudson/plugins/favorite/assets/css.jelly" class="${instance.assetClass}" />
<st:include page="/hudson/plugins/favorite/assets/javascript.jelly" class="${instance.assetClass}" />
<f:block>
<table id="favorites">
<j:forEach var="favorite" items="${instance.favorites}">
Expand Down

0 comments on commit e2b73c4

Please sign in to comment.