]> source.dussan.org Git - archiva.git/commitdiff
add route to edit group directly
authorOlivier Lamy <olamy@apache.org>
Fri, 16 Nov 2012 14:23:35 +0000 (14:23 +0000)
committerOlivier Lamy <olamy@apache.org>
Fri, 16 Nov 2012 14:23:35 +0000 (14:23 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1410357 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js

index 1b8793662d9347fae6a6493cc6142884eb44ecc1..0c53e6fda6b7189f28e3a6d3c766badf872ab062 100644 (file)
@@ -677,6 +677,14 @@ function(jquery,ui,sammy,tmpl,i18n,jqueryCookie,bootstrap,archivaSearch,jqueryVa
           displayRepositoriesGrid(function(managedRepositoriesViewModel){managedRepositoriesViewModel.editManagedRepositoryWithId(repositoryId)});
         });
 
+        this.get("#repositorygroupedit/:groupId",function(){
+          var groupId=this.params.groupId;
+          $.log("edit repository group:"+groupId);
+          displayRepositoryGroups(function(repositoryGroupsViewModel){repositoryGroupsViewModel.editRepositoryGroupWithId(groupId)});
+
+        });
+
+
       });
   };
 
index 0bcd2b4d2a61c7e8d0817838496d5a56c884b01e..306816a914527fc46d1035b48e1ab85d1ce69747 100644 (file)
@@ -127,6 +127,15 @@ function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,jqueryUi,ko) {
         });
     }
 
+    this.editRepositoryGroupWithId=function(repositoryGroupId){
+
+      $.each(self.repositoryGroups(), function(index, value) {
+        if(value.id()==repositoryGroupId){
+          self.editRepositoryGroup(value);
+        }
+      });
+    }
+
     this.saveRepositoryGroup=function(repositoryGroup){
         clearUserMessages();
         $("#user-messages").html(mediumSpinnerImg());
@@ -187,7 +196,7 @@ function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,jqueryUi,ko) {
 
   }
 
-  displayRepositoryGroups=function(){
+  displayRepositoryGroups=function(successFn){
     screenChange();
     var mainContent = $("#main-content");
     mainContent.html(mediumSpinnerImg());
@@ -237,6 +246,10 @@ function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,jqueryUi,ko) {
 
                   });
 
+                  if(successFn){
+                    successFn(self.repositoryGroupsViewModel);
+                  }
+
                 }
               }
             );