Skip to content

Commit

Permalink
JENKINS-9598 - Initial installation wizard & curated list of plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
kzantow committed Sep 23, 2015
1 parent 2827e7a commit 0b0c7f7
Show file tree
Hide file tree
Showing 34 changed files with 1,568 additions and 191 deletions.
1 change: 1 addition & 0 deletions core/src/main/java/hudson/model/UpdateCenter.java
Expand Up @@ -710,6 +710,7 @@ private XmlFile getConfigFile() {
UpdateCenter.class.getName()+".xml"));
}

@Exported
public List<Plugin> getAvailables() {
Map<String,Plugin> pluginMap = new LinkedHashMap<String, Plugin>();
for (UpdateSite site : sites) {
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/jenkins/I18n.java
Expand Up @@ -93,7 +93,7 @@ public HttpResponse doResourceBundle(StaplerRequest request) {
String variant = request.getParameter("variant");

try {
Locale locale = Locale.getDefault();
Locale locale = request.getLocale();

if (language != null && country != null && variant != null) {
locale = new Locale(language, country, variant);
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/jenkins/model/Jenkins.java
Expand Up @@ -897,8 +897,8 @@ public StartupType getStartupType() {
* @since FIXME
*/
@Restricted(NoExternalUse.class)
public String getInstallWizardJS() {
return servletContext.getInitParameter("install-wizard-js");
public String getInstallWizardPath() {
return servletContext.getInitParameter("install-wizard-path");
}

/**
Expand Down
@@ -0,0 +1,22 @@
installWizard_welcomePanel_title=Plugin Selection
installWizard_welcomePanel_banner=Welcome to Jenkins
installWizard_welcomePanel_message=Choose the initial set of plugins you would like to have installed in Jenkins
installWizard_welcomePanel_recommendedActionTitle=Recommended Jenkins plugins
installWizard_welcomePanel_recommendedActionDetails=Install the set of plugins the community finds more useful
installWizard_welcomePanel_customizeActionTitle=Customize your plugins
installWizard_welcomePanel_customizeActionDetails=Select your plugins from a community approved list of top plugins
installWizard_offline_title=Offline
installWizard_offline_message=This Jenkins instance appears to be offline...
installWizard_installCustom_title=Plugin Selection
installWizard_installCustom_selectAll=All
installWizard_installCustom_selectNone=None
installWizard_installCustom_selectRecommended=Recommended
installWizard_installCustom_selected=Selected
installWizard_goBack=Back
installWizard_goInstall=Install
installWizard_installing_title=Installing...
installWizard_installing_detailsLink=Details...
installWizard_installComplete_title=Installed
installWizard_installComplete_banner=Jenkins is ready!
installWizard_installComplete_message=Your plugin installations are complete.
installWizard_installComplete_finishButtonLabel=Get Started
@@ -0,0 +1 @@
installWizard_welcomePanel_banner=Willkommen zu Jenkins
@@ -0,0 +1 @@
installWizard_welcomePanel_banner=Bienvenido a Jenkins
11 changes: 6 additions & 5 deletions core/src/main/resources/lib/layout/layout.jelly
Expand Up @@ -102,11 +102,6 @@ ${h.initPageVariables(context)}
<script src="${resURL}/scripts/prototype.js" type="text/javascript"/>
<script src="${resURL}/scripts/behavior.js" type="text/javascript"/>

<j:if test="${h.startupType.name() == 'NEW'}">
<j:invokeStatic var="j" className="jenkins.model.Jenkins" method="getActiveInstance" />
<script src="${resURL}/${j.installWizardJS}" type="text/javascript"/>
</j:if>

<!-- we include our own prototype.js, so don't let stapler pull in another. -->
<st:adjunct assumes="org.kohsuke.stapler.framework.prototype.prototype"
includes="org.kohsuke.stapler.bind"/>
Expand Down Expand Up @@ -159,6 +154,12 @@ ${h.initPageVariables(context)}
</j:forEach>
</j:if>

<j:if test="${h.startupType.name() == 'NEW'}">
<j:invokeStatic var="j" className="jenkins.model.Jenkins" method="getActiveInstance" />
<script src="${resURL}/${j.installWizardPath}.js" type="text/javascript"/>
<link rel="stylesheet" href="${resURL}/${j.installWizardPath}.css" type="text/css" />
</j:if>

<j:if test="${isMSIE}">
<script src="${resURL}/scripts/msie.js" type="text/javascript"/>
</j:if>
Expand Down
13 changes: 10 additions & 3 deletions war/gulpfile.js
Expand Up @@ -9,6 +9,13 @@ var builder = require('jenkins-js-builder');
//
builder.defineTasks(['test', 'bundle', 'rebundle']);

var gulp = require('gulp');
gulp.task('default', ['bundle']);
gulp.task('watch:less', function() {
gulp.watch('src/main/less/**/*.less', ['bundle'])
});
gulp.task('watch', ['watch:less', 'rebundle']);

//
// Sources are not in the default locations. Following a more maven-like pattern here.
// See https://github.com/tfennelly/jenkins-js-builder#setting-src-and-test-spec-paths
Expand All @@ -20,9 +27,9 @@ builder.tests('src/test/js');
// Bundle the modules.
// See https://github.com/tfennelly/jenkins-js-builder#bundling
//
builder.bundle('src/main/js/wizard.js')
builder.bundle('src/main/js/pluginSetupWizard.js')
.withExternalModuleMapping('jquery-detached', 'jquery-detached:jquery2')
.withExternalModuleMapping('jqueryui-detached', 'jquery-detached:jqueryui1')
.withExternalModuleMapping('bootstrap', 'bootstrap:bootstrap3')
.withExternalModuleMapping('handlebars', 'handlebars:handlebars3')
.less('src/main/less/wizard.less')
.less('src/main/less/pluginSetupWizard.less')
.inDir('src/main/webapp/jsbundles');
5 changes: 3 additions & 2 deletions war/package.json
Expand Up @@ -6,13 +6,14 @@
"devDependencies": {
"gulp": "^3.9.0",
"jenkins-js-builder": "0.0.19",
"jenkins-js-test": "0.0.12"
"jenkins-js-test": "0.0.14",
"handlebars": "^3.0.3"
},
"dependencies": {
"jenkins-handlebars-rt": "^1.0.1",
"jenkins-js-modules": "1.0.1",
"jqueryui-detached": "^1.11.4-v8",
"jquery-detached": "^2.1.4-v2",
"bootstrap-detached": "^3.3.4-v6",
"window-handle": "0.0.6"
}
}
12 changes: 12 additions & 0 deletions war/pom.xml
Expand Up @@ -268,6 +268,18 @@ THE SOFTWARE.
<version>1.1</version>
<type>hpi</type>
</artifactItem>
<artifactItem>
<groupId>org.jenkins-ci.ui</groupId>
<artifactId>bootstrap</artifactId>
<version>1.0</version>
<type>hpi</type>
</artifactItem>
<artifactItem>
<groupId>org.jenkins-ci.ui</groupId>
<artifactId>momentjs</artifactId>
<version>1.0</version>
<type>hpi</type>
</artifactItem>
<artifactItem>
<groupId>org.jenkins-ci.ui</groupId>
<artifactId>handlebars</artifactId>
Expand Down
18 changes: 0 additions & 18 deletions war/src/main/js/pluginManager.js

This file was deleted.

10 changes: 10 additions & 0 deletions war/src/main/js/pluginSetupWizard.js
@@ -0,0 +1,10 @@
// Initialize all modules by requiring them. Also makes sure they get bundled (see gulpfile.js).
var $ = require('jquery-detached').getJQuery();

// This is the main module
var pluginSetupWizard = require('./pluginSetupWizardGui');

// This entry point for the bundle only bootstraps the main module in a browser
$(function() {
pluginSetupWizard.init();
});

0 comments on commit 0b0c7f7

Please sign in to comment.