aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-07-11 22:02:51 +0000
committerOlivier Lamy <olamy@apache.org>2012-07-11 22:02:51 +0000
commit450f03a6a6c68ad02985cff93ff40daeebba0d70 (patch)
treef7c148cdcf6a98929a8bc67bd746508a04d1282f /archiva-modules
parentcd03511cc9b094e37476de23ec3294577aa8d0ff (diff)
downloadarchiva-450f03a6a6c68ad02985cff93ff40daeebba0d70.tar.gz
archiva-450f03a6a6c68ad02985cff93ff40daeebba0d70.zip
avoid npe when admin user has not been created
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1360435 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/pom.xml3
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html12
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js17
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/menu.html3
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/test/tomcat/tomcat-context-archiva.xml2
5 files changed, 18 insertions, 19 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/pom.xml b/archiva-modules/archiva-web/archiva-webapp-js/pom.xml
index ac061bcb4..99fc1a63c 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/pom.xml
+++ b/archiva-modules/archiva-web/archiva-webapp-js/pom.xml
@@ -808,7 +808,8 @@
<appserver.base>${archivaAppServerBase}</appserver.base>
<appserver.home>${archivaAppServerBase}</appserver.home>
<derby.system.home>${archivaAppServerBase}/logs</derby.system.home>
- <redback.admin.creation.file>${basedir}/target/auto-admin-creation.properties</redback.admin.creation.file>
+ <!-- remove admin auto creation that must be tested too -->
+ <!--redback.admin.creation.file>${basedir}/target/auto-admin-creation.properties</redback.admin.creation.file-->
<java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
<archiva.user.configFileName>${archivaAppServerBase}/conf/archiva.xml</archiva.user.configFileName>
<archiva.devMode>${archiva.devMode}</archiva.devMode>
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html
index b5dc9a0f3..d1c1bf26f 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html
@@ -148,9 +148,6 @@
}
});
-
-
-
require(['jquery','i18n','sammy','startup','utils','domReady!'], function (domReady) {
loadi18n(function () {
$.ajax({
@@ -162,13 +159,10 @@
window.archivaRuntimeInfo=data;
require(['sammy','archiva.main','domReady!'],function (domReady) {
- $.log("startArchivaApplication");
- startArchivaApplication();
- $("#loadingDiv").hide();
+ $.log("startArchivaApplication");
+ startArchivaApplication();
+ $("#loadingDiv").hide();
})
-
-
-
}
})
})
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js
index 137328d28..4b7167314 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js
@@ -269,7 +269,8 @@ function() {
});
this.get('#:folder', function () {
self.activeMenuId(this.params.folder);
- ko.utils.arrayFirst(self.artifactMenuItems.concat(self.usersMenuItems, self.administrationMenuItems), function(p) {
+ var baseItems = self.artifactMenuItems?self.artifactMenuItems:[];
+ ko.utils.arrayFirst(baseItems.concat(self.usersMenuItems, self.administrationMenuItems), function(p) {
if ( p.href == "#"+self.activeMenuId()) {
p.func();
return;
@@ -277,21 +278,27 @@ function() {
});
});
+ this.get('#open-admin-create-box',function(){
+ $.log("#open-admin-create-box");
+ adminCreateBox();
+ });
//this.get('', function () { this.app.runRoute('get', '#search') });
} );
sammyArchivaApplication.run();
}
startArchivaApplication=function(){
+
$.log("startArchivaApplication");
$('#topbar-menu-container').html($("#topbar_menu_tmpl" ).tmpl());
$('#sidebar-content').html($("#main_menu_tmpl").tmpl());
ko.bindingHandlers.redbackP = {
- init: function(element, valueAccessor) {
- $(element).attr("redback-permissions",valueAccessor);
- }
+ init: function(element, valueAccessor) {
+ $(element).attr("redback-permissions",valueAccessor);
+ }
};
+
ko.applyBindings(new MainMenuViewModel());
hideElementWithKarma();
@@ -299,8 +306,6 @@ function() {
checkCreateAdminLink();
$('#footer-content').html($('#footer-tmpl').tmpl(window.archivaRuntimeInfo));
-
-
$( "#quick-search-autocomplete" ).autocomplete({
minLength: 3,
delay: 600,
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/menu.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/menu.html
index 89f6cd722..f77c8db58 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/menu.html
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/menu.html
@@ -28,7 +28,6 @@
<a data-bind="text: text, attr: { id: id, href: href}"></a>
</li>
<!-- /ko -->
-
</ul>
<ul class="nav nav-list" redback-permissions="{permissions: ['archiva-manage-configuration']}" data-bind="foreach: administrationMenuItems">
@@ -65,7 +64,7 @@
<div id="organisation-logo" class="pull-left"></div>
<ul class="nav pull-right">
<li id="create-admin-link" style="display: none">
- <a href="#" onclick="adminCreateBox();" id="create-admin-link-a">
+ <a href="#open-admin-create-box" onclick="adminCreateBox();" id="create-admin-link-a">
<span class="label label-important">${$.i18n.prop('create.admin.page.link')}</span>
</a>
</li>
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/test/tomcat/tomcat-context-archiva.xml b/archiva-modules/archiva-web/archiva-webapp-js/src/test/tomcat/tomcat-context-archiva.xml
index fda8f8221..4f7ce1d69 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/test/tomcat/tomcat-context-archiva.xml
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/test/tomcat/tomcat-context-archiva.xml
@@ -22,7 +22,7 @@
username="sa"
password=""
driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
- url="jdbc:derby:${catalina.base}/target/database/users;create=true"
+ url="jdbc:derby:${appserver.base}/database/users;create=true"
/>
<Resource name="mail/Session" auth="Container"
type="javax.mail.Session"