From: Olivier Lamy Date: Fri, 16 Nov 2012 14:23:35 +0000 (+0000) Subject: add route to edit group directly X-Git-Tag: archiva-1.4-M4~623 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f27178e79281519ec61136132431d647719a9004;p=archiva.git add route to edit group directly git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1410357 13f79535-47bb-0310-9956-ffa450edef68 --- 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 1b8793662..0c53e6fda 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 @@ -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)}); + + }); + + }); }; diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js index 0bcd2b4d2..306816a91 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js @@ -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); + } + } } );