Details
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 0b48d4c..2644379 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
@@ -2513,6 +2513,7 @@ module.controller('ClientRegPolicyDetailCtrl', function($scope, realm, clientReg
if ($scope.providerType.properties) {
ComponentUtils.addLastEmptyValueToMultivaluedLists($scope.providerType.properties, $scope.instance.config);
+ ComponentUtils.addMvOptionsToMultivaluedLists($scope.providerType.properties);
}
var oldCopy = angular.copy($scope.instance);
@@ -2523,7 +2524,7 @@ module.controller('ClientRegPolicyDetailCtrl', function($scope, realm, clientReg
$scope.changed = true;
}
}, true);
-
+
$scope.reset = function() {
$route.reload();
};
diff --git a/themes/src/main/resources/theme/base/admin/resources/js/services.js b/themes/src/main/resources/theme/base/admin/resources/js/services.js
index fca7b33..b084a4f 100755
--- a/themes/src/main/resources/theme/base/admin/resources/js/services.js
+++ b/themes/src/main/resources/theme/base/admin/resources/js/services.js
@@ -232,6 +232,25 @@ module.factory('ComponentUtils', function() {
}
}
}
+
+ // Allows you to use ui-select2 with <input> tag.
+ // In HTML you will then use property.mvOptions like this:
+ // <input ui-select2="prop.mvOptions" ng-model="...
+ utils.addMvOptionsToMultivaluedLists = function(properties) {
+ if (!properties) return;
+
+ for (var i=0 ; i<properties.length ; i++) {
+ var prop = properties[i];
+ if (prop.type !== 'MultivaluedList') continue;
+
+ prop.mvOptions = {
+ 'multiple' : true,
+ 'simple_tags' : true,
+ 'tags' : angular.copy(prop.options)
+ }
+ }
+
+ }
return utils;
});
diff --git a/themes/src/main/resources/theme/base/admin/resources/templates/kc-component-config.html b/themes/src/main/resources/theme/base/admin/resources/templates/kc-component-config.html
index c5172c0..0f99038 100755
--- a/themes/src/main/resources/theme/base/admin/resources/templates/kc-component-config.html
+++ b/themes/src/main/resources/theme/base/admin/resources/templates/kc-component-config.html
@@ -17,9 +17,7 @@
</select>
</div>
<div class="col-md-6" data-ng-if="option.type == 'MultivaluedList'">
- <select ui-select2 data-ng-model="config[ option.name ]" data-placeholder="{{:: 'selectMultiple' | translate}}..." multiple>
- <option ng-repeat="val in option.options" value="{{val}}" ng-selected="true">{{val}}</option>
- </select>
+ <input ui-select2="option.mvOptions" ng-model="config[ option.name ]" data-placeholder="{{:: 'selectMultiple' | translate}}..."/>
</div>
<div class="col-md-6" data-ng-if="option.type == 'Role'">
<div class="row">