Repository: syncope
Updated Branches:
  refs/heads/2_0_X be37ae73e -> b26624981


[SYNCOPE-1024] now enduser manages correctly enum keys (where provided)


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/b2662498
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/b2662498
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/b2662498

Branch: refs/heads/2_0_X
Commit: b2662498125094997409f3e37cbe7d9561e97dab
Parents: be37ae7
Author: Andrea Patricelli <andrea.patrice...@tirasa.net>
Authored: Wed Mar 1 10:21:20 2017 +0100
Committer: Andrea Patricelli <andrea.patrice...@tirasa.net>
Committed: Wed Mar 1 10:21:20 2017 +0100

----------------------------------------------------------------------
 .../META-INF/resources/app/js/controllers/UserController.js | 1 -
 .../resources/app/js/directives/dynamicPlainAttribute.js    | 9 +++++++++
 .../META-INF/resources/app/views/dynamicPlainAttribute.html | 2 +-
 3 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/b2662498/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js
----------------------------------------------------------------------
diff --git 
a/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js
 
b/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js
index 9be5935..4f0cf7a 100644
--- 
a/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js
+++ 
b/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js
@@ -391,7 +391,6 @@ angular.module("self").controller("UserController", 
['$scope', '$rootScope', '$l
         UserSelfService.update(wrappedUser, 
$scope.captchaInput.value).then(function (response) {
           console.debug("Updated user: ", response);
           AuthService.logout().then(function (response) {
-            console.info("LOGOUT SUCCESS: ", response);
             console.info("User " + $scope.user.username + " 
SUCCESSFULLY_UPDATED");
             $rootScope.currentUser = $scope.user.username;
             $rootScope.currentOp = "SUCCESSFULLY_UPDATED";

http://git-wip-us.apache.org/repos/asf/syncope/blob/b2662498/client/enduser/src/main/resources/META-INF/resources/app/js/directives/dynamicPlainAttribute.js
----------------------------------------------------------------------
diff --git 
a/client/enduser/src/main/resources/META-INF/resources/app/js/directives/dynamicPlainAttribute.js
 
b/client/enduser/src/main/resources/META-INF/resources/app/js/directives/dynamicPlainAttribute.js
index 682a2bf..c267087 100644
--- 
a/client/enduser/src/main/resources/META-INF/resources/app/js/directives/dynamicPlainAttribute.js
+++ 
b/client/enduser/src/main/resources/META-INF/resources/app/js/directives/dynamicPlainAttribute.js
@@ -38,15 +38,24 @@ angular.module('self')
                     break;
                   case "Enum":
                     $scope.enumerationValues = [];
+                    $scope.enumerationKeys = [];
 
                     //SYNCOPE-911 empty value option on non required 
attributes 
                     if (schema.mandatoryCondition !== "true") {
                       $scope.enumerationValues.push("");
+                      $scope.enumerationKeys.push("");
                     }
                     var enumerationValuesSplitted = 
schema.enumerationValues.toString().split(";");
                     for (var i = 0; i < enumerationValuesSplitted.length; i++) 
{
                       
$scope.enumerationValues.push(enumerationValuesSplitted[i]);
                     }
+                    //SYNCOPE-1024 enumeration keys mgmt
+                    if ( schema.enumerationKeys ) {
+                      var enumerationKeysSplitted = 
schema.enumerationKeys.toString().split( ";" );
+                      for ( var i = 0; i < enumerationKeysSplitted.length; i++ 
) {
+                        $scope.enumerationKeys.push( 
enumerationKeysSplitted[i] );
+                      }
+                    }
                     $scope.user.plainAttrs[schema.key].values[index] = 
$scope.user.plainAttrs[schema.key].values[index]
                             || $scope.enumerationValues[0];
                     break;

http://git-wip-us.apache.org/repos/asf/syncope/blob/b2662498/client/enduser/src/main/resources/META-INF/resources/app/views/dynamicPlainAttribute.html
----------------------------------------------------------------------
diff --git 
a/client/enduser/src/main/resources/META-INF/resources/app/views/dynamicPlainAttribute.html
 
b/client/enduser/src/main/resources/META-INF/resources/app/views/dynamicPlainAttribute.html
index 68b9f5a..185f97f 100644
--- 
a/client/enduser/src/main/resources/META-INF/resources/app/views/dynamicPlainAttribute.html
+++ 
b/client/enduser/src/main/resources/META-INF/resources/app/views/dynamicPlainAttribute.html
@@ -98,7 +98,7 @@ under the License.
             ng-model="user.plainAttrs[schema.key].values[index]"
             ng-required="{{schema.mandatoryCondition}}">
       <option ng-repeat="value in enumerationValues" value="{{value}}">
-        {{schema.enumerationKeys[$index]|| value}}
+        {{enumerationKeys[$index] || value}}
       </option>
     </select>
   </div>

Reply via email to