diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/general-admin.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/general-admin.js index 391b29bc8..e27f4857e 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/general-admin.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/general-admin.js @@ -1257,7 +1257,10 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout" this.ldapGroups.subscribe(function(newValue){self.modified(true)}); this.ldapGroupMappings=ko.observableArray([]); - this.ldapGroupMappings.subscribe(function(newValue){self.modified(true);}); + this.ldapGroupMappings.subscribe(function(newValue){ + self.modified(true); + $.log('ldapGroupMappings modified:'+newValue.group); + }); } @@ -1279,13 +1282,8 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout" if (!$.isArray(configurationPropertiesEntries)){ configurationPropertiesEntries=[]; - } else { - configurationPropertiesEntries = $.each(configurationPropertiesEntries,function(item){ - $.log("each configurationPropertiesEntries"); - $.log("key:"+item); - return item; - }); } + redbackRuntimeConfiguration.configurationPropertiesEntries(configurationPropertiesEntries); redbackRuntimeConfiguration.modified(false); return redbackRuntimeConfiguration; @@ -1388,11 +1386,29 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout" rowText: "value" } ], - pageSize: 10,//self.redbackRuntimeConfiguration().configurationPropertiesEntries.length, + pageSize: 10, gridUpdateCallBack: function(){ activatePopoverDoc(); } - }); + }); + + self.ldapGroupMappingsViewModel=new ko.simpleGrid.viewModel({ + data: self.redbackRuntimeConfiguration().ldapGroupMappings, + columns: [ + { + headerText: $.i18n.prop('redback.runtime.ldap.mapping.group.label'), + rowText: "group" + }, + { + headerText: $.i18n.prop('redback.runtime.ldap.mapping.roles.label'), + rowText: "value" + } + ], + pageSize: 10, + gridUpdateCallBack: function(){ + activatePopoverDoc(); + } + }); findUserManagerImplementationInformation=function(id){ for(var i= 0;i roleNames; this.roleNames=ko.observableArray(roleNames); - this.roleNames.subscribe(function(newValue){self.modified(true)}); + this.roleNames.subscribe(function(newValue){ + self.modified(true); + $.log("roleNames modified"); + if(subscribeFn){ + subscribeFn(newValue) + } + }); + + this.automatic=automatic?automatic:false; } - mapLdapGroupMappings=function(data){ + mapLdapGroupMappings=function(data,modifyLdapGroupMapping){ if(data!=null){ return $.map(data,function(item){ - return new LdapGroupMapping(item.group,item.roleNames?item.roleNames:[]); + return new LdapGroupMapping(item.group,item.roleNames?item.roleNames:[],false,modifyLdapGroupMapping); }) } return []; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/general-admin.html b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/general-admin.html index 56be27cc1..20d067185 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/general-admin.html +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/general-admin.html @@ -1131,13 +1131,12 @@
-
-
@@ -1261,7 +1260,6 @@ {{/each}} -