From f27178e79281519ec61136132431d647719a9004 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 16 Nov 2012 14:23:35 +0000 Subject: [PATCH] add route to edit group directly git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1410357 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/webapp/js/archiva/main.js | 8 ++++++++ .../main/webapp/js/archiva/repository-groups.js | 15 ++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) 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); + } + } } ); -- 2.39.5