KEYCLOAK-3943 Admin console issues when updating LDAP Storage provider
This commit is contained in:
parent
2d4cda7eda
commit
d8c8afe070
4 changed files with 16 additions and 6 deletions
|
@ -319,7 +319,7 @@ public class AdminConsole {
|
|||
@Path("messages.json")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public Properties getMessages(@QueryParam("lang") String lang) {
|
||||
return AdminRoot.getMessages(session, realm, "admin-messages", lang);
|
||||
return AdminRoot.getMessages(session, realm, lang, "admin-messages");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -288,7 +288,16 @@ public class AdminRoot {
|
|||
}
|
||||
}
|
||||
|
||||
public static Properties getMessages(KeycloakSession session, RealmModel realm, String bundle, String lang) {
|
||||
public static Properties getMessages(KeycloakSession session, RealmModel realm, String lang, String... bundles) {
|
||||
Properties compound = new Properties();
|
||||
for (String bundle : bundles) {
|
||||
Properties current = getMessages(session, realm, lang, bundle);
|
||||
compound.putAll(current);
|
||||
}
|
||||
return compound;
|
||||
}
|
||||
|
||||
private static Properties getMessages(KeycloakSession session, RealmModel realm, String lang, String bundle) {
|
||||
try {
|
||||
Theme theme = getTheme(session, realm);
|
||||
Locale locale = lang != null ? Locale.forLanguageTag(lang) : Locale.ENGLISH;
|
||||
|
|
|
@ -188,7 +188,7 @@ public class ComponentResource {
|
|||
}
|
||||
|
||||
private Response localizedErrorResponse(ComponentValidationException cve) {
|
||||
Properties messages = AdminRoot.getMessages(session, realm, "admin-messages", auth.getAuth().getToken().getLocale());
|
||||
Properties messages = AdminRoot.getMessages(session, realm, auth.getAuth().getToken().getLocale(), "admin-messages", "messages");
|
||||
|
||||
Object[] localizedParameters = cve.getParameters()==null ? null : Arrays.asList(cve.getParameters()).stream().map((Object parameter) -> {
|
||||
|
||||
|
|
|
@ -1728,6 +1728,7 @@ module.controller('LDAPUserStorageCtrl', function($scope, $location, Notificatio
|
|||
}
|
||||
|
||||
$scope.changed = false;
|
||||
$scope.lastVendor = instance.config['vendor'][0];
|
||||
}
|
||||
|
||||
initUserStorageSettings();
|
||||
|
@ -1740,7 +1741,7 @@ module.controller('LDAPUserStorageCtrl', function($scope, $location, Notificatio
|
|||
}
|
||||
|
||||
if (!angular.equals($scope.instance.config['vendor'][0], $scope.lastVendor)) {
|
||||
console.log("LDAP vendor changed");
|
||||
console.log("LDAP vendor changed. Previous=" + $scope.lastVendor + " New=" + $scope.instance.config['vendor'][0]);
|
||||
$scope.lastVendor = $scope.instance.config['vendor'][0];
|
||||
|
||||
if ($scope.lastVendor === "ad") {
|
||||
|
@ -1787,8 +1788,8 @@ module.controller('LDAPUserStorageCtrl', function($scope, $location, Notificatio
|
|||
|
||||
$scope.save = function() {
|
||||
$scope.changed = false;
|
||||
if (!parseInt($scope.instance.config['batchSizeForSync'[0]])) {
|
||||
$scope.instance.config['batchSizeForSync'][0] = DEFAULT_BATCH_SIZE;
|
||||
if (!parseInt($scope.instance.config['batchSizeForSync'][0])) {
|
||||
$scope.instance.config['batchSizeForSync'] = [ DEFAULT_BATCH_SIZE ];
|
||||
} else {
|
||||
$scope.instance.config['batchSizeForSync'][0] = parseInt($scope.instance.config.batchSizeForSync).toString();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue