diff --git a/themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js b/themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js index 349247dbee..9e6df9f6c0 100644 --- a/themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js +++ b/themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js @@ -3218,6 +3218,14 @@ module.controller('ClientPoliciesProfilesEditExecutorCtrl', function($scope, rea break; } } + + // Convert boolean properties from the configuration to strings as expected by the kc-provider-config directive + for (var j=0 ; j < $scope.executorType.properties.length ; j++) { + var currentProperty = $scope.executorType.properties[j]; + if (currentProperty.type === 'boolean') { + $scope.executor.config[currentProperty.name] = ($scope.executor.config[currentProperty.name]) ? "true" : "false"; + } + } } } @@ -3231,6 +3239,10 @@ module.controller('ClientPoliciesProfilesEditExecutorCtrl', function($scope, rea } } + if (configProperty.type === 'boolean') { + return (configProperty.defaultValue) ? "true" : "false"; + } + if (configProperty.defaultValue !== undefined) { return configProperty.defaultValue; } else { @@ -3260,6 +3272,14 @@ module.controller('ClientPoliciesProfilesEditExecutorCtrl', function($scope, rea ComponentUtils.removeLastEmptyValue($scope.executor.config); + // Convert String properties required by the kc-provider-config directive back to booleans + for (var j=0 ; j < $scope.executorType.properties.length ; j++) { + var currentProperty = $scope.executorType.properties[j]; + if (currentProperty.type === 'boolean') { + $scope.executor.config[currentProperty.name] = ($scope.executor.config[currentProperty.name] === "true") ? true : false; + } + } + if ($scope.createNew) { var selectedExecutor = { executor: $scope.executorType.id, @@ -3580,6 +3600,14 @@ module.controller('ClientPoliciesEditConditionCtrl', function($scope, realm, ser break; } } + + // Convert boolean properties from the configuration to strings as expected by the kc-provider-config directive + for (var j=0 ; j < $scope.conditionType.properties.length ; j++) { + var currentProperty = $scope.conditionType.properties[j]; + if (currentProperty.type === 'boolean') { + $scope.condition.config[currentProperty.name] = ($scope.condition.config[currentProperty.name]) ? "true" : "false"; + } + } } } @@ -3593,6 +3621,10 @@ module.controller('ClientPoliciesEditConditionCtrl', function($scope, realm, ser } } + if (configProperty.type === 'boolean') { + return (configProperty.defaultValue) ? "true" : "false"; + } + if (configProperty.defaultValue !== undefined) { return configProperty.defaultValue; } else { @@ -3623,6 +3655,14 @@ module.controller('ClientPoliciesEditConditionCtrl', function($scope, realm, ser ComponentUtils.removeLastEmptyValue($scope.condition.config); + // Convert String properties required by the kc-provider-config directive back to booleans + for (var j=0 ; j < $scope.conditionType.properties.length ; j++) { + var currentProperty = $scope.conditionType.properties[j]; + if (currentProperty.type === 'boolean') { + $scope.condition.config[currentProperty.name] = ($scope.condition.config[currentProperty.name] === "true") ? true : false; + } + } + var selectedCondition; if ($scope.createNew) { var selectedCondition = {