]> source.dussan.org Git - archiva.git/commitdiff
correctly display screen when ldap is not activated
authorOlivier Lamy <olamy@apache.org>
Sat, 16 Feb 2013 23:25:11 +0000 (23:25 +0000)
committerOlivier Lamy <olamy@apache.org>
Sat, 16 Feb 2013 23:25:11 +0000 (23:25 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1446978 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/general-admin.js

index 02cf3403c76deb615d882337d0c8b2e7f0b0c5ce..9b0761b86880a2a6b970d0de64efed77fb5e1d6d 100644 (file)
@@ -1715,58 +1715,59 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
               groups = mapStringList(data);
               $.log("groups number:"+groups.length);
               redbackRuntimeConfiguration.ldapGroups=ko.observableArray(groups);
-            },
-            complete: function(data) {
-
+            }
+          } ).always(
+                  function() {
+                    $.log("complete");
+
+                    // load ldap group mappings if any
+                    $.ajax("restServices/redbackServices/ldapGroupMappingService", {
+                      type: "GET",
+                      dataType: 'json',
+                      success: function(data) {
+                        var groupMappings=mapLdapGroupMappings(data,redbackRuntimeConfigurationViewModel.modifyLdapGroupMapping);
+
+                        $.ajax("restServices/redbackServices/roleManagementService/allRoles", {
+                          type: "GET",
+                          dataType: 'json',
+                          success: function(data) {
+
+                            var allRoleNames = $.map(data, function(item) {
+                              return item.name;
+                            });
 
-              // load ldap group mappings if any
-              $.ajax("restServices/redbackServices/ldapGroupMappingService", {
-                type: "GET",
-                dataType: 'json',
-                success: function(data) {
-                  var groupMappings=mapLdapGroupMappings(data,redbackRuntimeConfigurationViewModel.modifyLdapGroupMapping);
-
-                  $.ajax("restServices/redbackServices/roleManagementService/allRoles", {
-                    type: "GET",
-                    dataType: 'json',
-                    success: function(data) {
-
-                      var allRoleNames = $.map(data, function(item) {
-                        return item.name;
-                      });
-
-                      redbackRuntimeConfigurationViewModel.allRoleNames=allRoleNames;
-                      if (redbackRuntimeConfiguration.ldapConfiguration().useRoleNameAsGroup()) {
-                        // if using groups == roles add all as mapping except already mapped
-                        $.each(groups,function(idx,item){
-                          var exists=false;
-                          // avoid duplicate if mapping really exists !
-                          $.each(groupMappings,function(idx2,groupMapping){
-                            if(groupMapping.group()==item){
-                              exists=true;
+                            redbackRuntimeConfigurationViewModel.allRoleNames=allRoleNames;
+                            if (redbackRuntimeConfiguration.ldapConfiguration().useRoleNameAsGroup()) {
+                              // if using groups == roles add all as mapping except already mapped
+                              $.each(groups,function(idx,item){
+                                var exists=false;
+                                // avoid duplicate if mapping really exists !
+                                $.each(groupMappings,function(idx2,groupMapping){
+                                  if(groupMapping.group()==item){
+                                    exists=true;
+                                  }
+                                });
+                                if(!exists){
+                                  groupMappings.push(new LdapGroupMapping(item,[item],true,redbackRuntimeConfigurationViewModel.modifyLdapGroupMapping));
+                                }
+
+                              });
                             }
-                          });
-                          if(!exists){
-                            groupMappings.push(new LdapGroupMapping(item,[item],true,redbackRuntimeConfigurationViewModel.modifyLdapGroupMapping));
-                          }
+                            redbackRuntimeConfiguration.ldapGroupMappings=ko.observableArray(groupMappings);
+                            redbackRuntimeConfiguration.modified(false);
+
+                            mainContent.html( $("#redback-runtime-configuration-main" ).tmpl() );
+                            ko.applyBindings(redbackRuntimeConfigurationViewModel,$("#redback-runtime-configuration-content" ).get(0));
+                            activateRedbackRuntimeGeneralFormValidation();
+                            activateLdapConfigurationFormValidation();
+                            $("#ldap-group-mappings-div select" ).select2({width: "element"});
 
+                          }
                         });
                       }
-                      redbackRuntimeConfiguration.ldapGroupMappings=ko.observableArray(groupMappings);
-                      redbackRuntimeConfiguration.modified(false);
-
-                      mainContent.html( $("#redback-runtime-configuration-main" ).tmpl() );
-                      ko.applyBindings(redbackRuntimeConfigurationViewModel,$("#redback-runtime-configuration-content" ).get(0));
-                      activateRedbackRuntimeGeneralFormValidation();
-                      activateLdapConfigurationFormValidation();
-                      $("#ldap-group-mappings-div select" ).select2({width: "element"});
-
-                    }
-                  });
-                }
-              });
-            }
-          });
+                    });
+                  }
+                );
 
         }
       });