]> source.dussan.org Git - archiva.git/commitdiff
adding repository with existing location, confirm modal was not closed
authorOlivier Lamy <olamy@apache.org>
Mon, 2 Apr 2012 19:27:38 +0000 (19:27 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 2 Apr 2012 19:27:38 +0000 (19:27 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1308494 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js

index 4dee8b409cfa9dc385889aa36ead6cf7e8ed795a..6aa3341f4f2bda94d391c513ffdd2ca97313a856 100644 (file)
@@ -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() );
                 }
             }
 
index 9ad0ca2215c141c4d89521648b1f5f59162e22c9..f48d16bcae4802d15262fabf20aa569cdfabcb0e 100644 (file)
@@ -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");
             }
           }
         }