diff options
author | Olivier Lamy <olamy@apache.org> | 2012-04-02 19:27:38 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-04-02 19:27:38 +0000 |
commit | 59420ec4c489cb93803bdc156c3ae92f3c9b516b (patch) | |
tree | 7f8b081421aaf0d9c5a35539a1106f0a8afc88cd | |
parent | 69f3413fcb2dce7afcc6af60d9b9c54a16b52082 (diff) | |
download | archiva-59420ec4c489cb93803bdc156c3ae92f3c9b516b.tar.gz archiva-59420ec4c489cb93803bdc156c3ae92f3c9b516b.zip |
adding repository with existing location, confirm modal was not closed
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1308494 13f79535-47bb-0310-9956-ffa450edef68
2 files changed, 9 insertions, 4 deletions
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java index 4dee8b409..6aa3341f4 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java @@ -568,6 +568,7 @@ public class DefaultManagedRepositoryAdmin if ( !indexDirectory.isAbsolute() ) { indexDirectory = new File( managedRepository, repository.getIndexDirectory() ); + repository.setIndexDirectory( indexDirectory.getAbsolutePath() ); } } else @@ -579,6 +580,7 @@ public class DefaultManagedRepositoryAdmin getRegistry().getString( "appserver.base" ) + File.separatorChar + "repositories" + File.separatorChar + repository.getLocation(), ".indexer" ); + repository.setIndexDirectory( indexDirectory.getAbsolutePath() ); } } diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js index 9ad0ca221..f48d16bca 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js @@ -211,8 +211,9 @@ define("archiva.repositories",["jquery","i18n","jquery.tmpl","bootstrap","jquery dataType: 'json', success: function(data) { if (data){ + var completeCallbackFn = function(){window.modalConfirmDialog.modal('hide')}; openDialogConfirm( - function(){addManagedRepository(self.managedRepository),function(){window.modalConfirmDialog.modal('hide')}}, + function(){addManagedRepository(self.managedRepository,completeCallbackFn)}, $.i18n.prop('ok'), $.i18n.prop('cancel'), $.i18n.prop('managedrepository.add.title'), $("#managed-repository-location-warning-tmpl").tmpl(self.managedRepository)); @@ -225,7 +226,6 @@ define("archiva.repositories",["jquery","i18n","jquery.tmpl","bootstrap","jquery } addManagedRepository=function(managedRepository,completeCallbackFn){ - $.log("add managedRepo"); var curManagedRepository=managedRepository; var callbackFn = completeCallbackFn; $.ajax("restServices/archivaServices/managedRepositoriesService/addManagedRepository", @@ -235,9 +235,9 @@ define("archiva.repositories",["jquery","i18n","jquery.tmpl","bootstrap","jquery data: ko.toJSON(managedRepository), dataType: 'json', success: function(data) { - curManagedRepository.location(data.managedRepository.location); + curManagedRepository.location(data.location); self.managedRepositoriesViewModel.managedRepositories.push(curManagedRepository); - displaySuccessMessage($.i18n.prop('managedrepository.added')); + displaySuccessMessage($.i18n.prop('managedrepository.added',curManagedRepository.id())); curManagedRepository.modified(false); activateManagedRepositoriesGridTab(); }, @@ -247,7 +247,10 @@ define("archiva.repositories",["jquery","i18n","jquery.tmpl","bootstrap","jquery }, complete:function(data){ if(callbackFn){ + $.log("complete with callback"); callbackFn(); + } else { + $.log("complete with no callback"); } } } |