From ccc4f5a114d4f0edf7457f648eed22bdb099bffd Mon Sep 17 00:00:00 2001 From: Viliam Rockai Date: Tue, 11 Mar 2014 16:07:48 +0100 Subject: [PATCH] KEYCLOAK-362 - fixing the select2 with req user actions --- .../resources/admin/js/controllers/users.js | 27 +------------------ .../resources/admin/partials/user-detail.html | 4 ++- 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/admin-ui/src/main/resources/META-INF/resources/admin/js/controllers/users.js b/admin-ui/src/main/resources/META-INF/resources/admin/js/controllers/users.js index 00b4e8f69c..577b6617ab 100755 --- a/admin-ui/src/main/resources/META-INF/resources/admin/js/controllers/users.js +++ b/admin-ui/src/main/resources/META-INF/resources/admin/js/controllers/users.js @@ -179,38 +179,13 @@ module.controller('UserDetailCtrl', function($scope, realm, user, User, $locatio $scope.changed = false; // $scope.create; // ID - Name map for required actions. IDs are enum names. - var userReqActionList = [ + $scope.userReqActionList = [ {id: "VERIFY_EMAIL", text: "Verify Email"}, {id: "UPDATE_PROFILE", text: "Update Profile"}, {id: "CONFIGURE_TOTP", text: "Configure Totp"}, {id: "UPDATE_PASSWORD", text: "Update Password"} ]; - // Options for the req actions tag selector - $scope.userReqActionsOptions = { - 'multiple' : true, - 'tags' : userReqActionList - }; - - // Model for the req actions tag selector - $scope.userActions = []; - for (var i = 0; i < userReqActionList.length; i++){ - var action = userReqActionList[i]; - - if ($scope.user.requiredActions && $scope.user.requiredActions.indexOf(action.id) > -1){ - $scope.userActions.push({id: action.id, text: action.text}); - } - } - - // Watching ui-select2 model to properly format the req actions for user - $scope.$watch("userActions", function(newValue, oldValue) { - $scope.user.requiredActions = []; - for (var i=0; i < newValue.length; i++){ - var action = newValue[i]; - $scope.user.requiredActions.push(action.id); - } - }); - $scope.$watch('user', function() { if (!angular.equals($scope.user, user)) { $scope.changed = true; diff --git a/admin-ui/src/main/resources/META-INF/resources/admin/partials/user-detail.html b/admin-ui/src/main/resources/META-INF/resources/admin/partials/user-detail.html index 0894d18855..892e8a8e92 100755 --- a/admin-ui/src/main/resources/META-INF/resources/admin/partials/user-detail.html +++ b/admin-ui/src/main/resources/META-INF/resources/admin/partials/user-detail.html @@ -76,7 +76,9 @@
- +