syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From giacom...@apache.org
Subject syncope git commit: [SYNCOPE-719] Self registration/update wizard steps now can be customized
Date Mon, 22 Feb 2016 16:41:45 GMT
Repository: syncope
Updated Branches:
  refs/heads/master 548799a51 -> e3d7ff37a


[SYNCOPE-719] Self registration/update wizard steps now can be customized


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

Branch: refs/heads/master
Commit: e3d7ff37aa85231c80476ceaf74c348a980f44ae
Parents: 548799a
Author: giacomolm <giacomolm@hotmail.it>
Authored: Mon Feb 22 17:41:14 2016 +0100
Committer: giacomolm <giacomolm@hotmail.it>
Committed: Mon Feb 22 17:41:29 2016 +0100

----------------------------------------------------------------------
 .../resources/META-INF/resources/app/js/app.js  | 13 +++++++++
 .../app/js/directives/navigationButtons.js      | 29 +++++++++++++++++---
 .../META-INF/resources/app/views/editUser.html  | 11 ++------
 .../resources/app/views/navigationButtons.html  |  4 +--
 .../resources/app/views/user-credentials.html   |  4 +--
 .../app/views/user-derived-schemas.html         |  4 +--
 .../resources/app/views/user-form-finish.html   |  4 +--
 .../resources/app/views/user-groups.html        |  4 +--
 .../resources/app/views/user-plain-schemas.html |  4 +--
 .../resources/app/views/user-resources.html     |  4 +--
 .../app/views/user-virtual-schemas.html         |  4 +--
 pom.xml                                         |  2 +-
 12 files changed, 58 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/e3d7ff37/client/enduser/src/main/resources/META-INF/resources/app/js/app.js
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/js/app.js b/client/enduser/src/main/resources/META-INF/resources/app/js/app.js
index 57b45ef..5bf844f 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/js/app.js
+++ b/client/enduser/src/main/resources/META-INF/resources/app/js/app.js
@@ -380,6 +380,19 @@ app.controller('ApplicationController', ['$scope', '$rootScope', 'InfoService',
       $scope.$on('hideErrorMessage', function (event, popupMessage) {
         $scope.hideError(popupMessage, $scope.notification);
       });
+      
+      //wizard active element
+      $scope.wizard = {
+        "credentials" : {url : "/credentials", templateUrl: "views/user-credentials.html"},
+        "groups" : {url : "/groups", templateUrl: "views/user-groups.html"}, 
+        "plainSchemas" : {url : "/plainSchemas", templateUrl: "views/user-plain-schemas.html"},
+        "derivedSchemas" : {url : "/derivedSchemas", templateUrl: "views/user-derived-schemas.html"},

+        "virtualSchemas" : {url : "/virtualSchemas", templateUrl: "views/user-virtual-schemas.html"},
+        "resources" : {url : "/resources", templateUrl: "views/user-resources.html"}, 
+        "finish" : {url : "/finish", templateUrl: "views/user-form-finish.html"}
+      };
+      
+      
     }
   }]);
 app.factory('AuthenticationHelper', ['$q', '$rootScope',

http://git-wip-us.apache.org/repos/asf/syncope/blob/e3d7ff37/client/enduser/src/main/resources/META-INF/resources/app/js/directives/navigationButtons.js
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/js/directives/navigationButtons.js
b/client/enduser/src/main/resources/META-INF/resources/app/js/directives/navigationButtons.js
index 20120ac..70bd8a8 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/js/directives/navigationButtons.js
+++ b/client/enduser/src/main/resources/META-INF/resources/app/js/directives/navigationButtons.js
@@ -19,13 +19,24 @@
 'use strict';
 
 angular.module('self')
-        .directive('navigationButtons', ['$state','GenericUtil', 'ValidationExecutor', function
($state, GenericUtil, ValidationExecutor) {
+        .directive('navigationButtons', ['$state', 'GenericUtil', 'ValidationExecutor', function
($state, GenericUtil, ValidationExecutor) {
             return {
               restrict: 'E',
               templateUrl: 'views/navigationButtons.html',
               scope: {
-                next: "@",
-                previous: "@",
+                base: "@",
+                current: "@"
+              },
+              link: function (scope, element, attrs) {
+                var base = (scope.base && scope.base != "" ? scope.base + "." : "");
+                scope.wizard = scope.$eval(attrs.wizard) || scope.$parent.wizard;
+                scope.previous = "none";
+                if (scope.wizard) {
+                  var urls = Object.keys(scope.wizard);
+                  var index = urls.indexOf(scope.current);
+                  scope.previous = (index > 0 ? base + urls[index - 1] : scope.previous
= "none");
+                  scope.next = (index < urls.length - 1 ? base + urls[index + 1] : scope.next
= "none");
+                }
               },
               controller: function ($scope) {
 
@@ -34,7 +45,12 @@ angular.module('self')
                   var currentForm = GenericUtil.getEnclosingForm(event.target);
                   if (currentForm != null) {
                     if (ValidationExecutor.validate(currentForm, $scope.$parent)) {
-                      $scope.nextTab(state);
+                      if (state) {
+                        $scope.nextTab(state);
+                      }
+                      else if ($scope.wizard) {
+                        $scope.nextTab($scope.next);
+                      }
                     }
                   }
 
@@ -44,6 +60,11 @@ angular.module('self')
                   //change route through parent event
                   $state.go(state);
                 };
+
+                $scope.previousTab = function () {
+                  //change route through parent event
+                  $state.go($scope.previous);
+                };
               }
 
             }

http://git-wip-us.apache.org/repos/asf/syncope/blob/e3d7ff37/client/enduser/src/main/resources/META-INF/resources/app/views/editUser.html
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/views/editUser.html
b/client/enduser/src/main/resources/META-INF/resources/app/views/editUser.html
index c250264..4fdc698 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/views/editUser.html
+++ b/client/enduser/src/main/resources/META-INF/resources/app/views/editUser.html
@@ -35,14 +35,9 @@ under the License.
             <div growl reference="2" inline="true"></div>
             <div id="status-buttons" class="btn-group btn-breadcrumb">
               <a href="#/self" class="btn btn-default"><i class="glyphicon glyphicon-home"></i></a>
-              <!--add class breadcrumb-disabled-link to buttons to prevent click-->
-              <a ui-sref-active="active" ui-sref=".credentials" class="btn btn-default"
ng-class="createMode ? 'disable-link' : ''">Credentials</a>
-              <a ui-sref-active="active" ui-sref=".groups" class="btn btn-default" ng-class="createMode
? 'disable-link' : ''">Groups</a>
-              <a ui-sref-active="active" ui-sref=".plainSchemas" class="btn btn-default"
ng-class="createMode ? 'disable-link' : ''">Plain Schemas</a>
-              <a ui-sref-active="active" ui-sref=".derivedSchemas" class="btn btn-default"
ng-class="createMode ? 'disable-link' : ''">Derived Schemas</a>
-              <a ui-sref-active="active" ui-sref=".virtualSchemas" class="btn btn-default"
ng-class="createMode ? 'disable-link' : ''">Virtual Schemas</a>              
-              <a ui-sref-active="active" ui-sref=".resources" class="btn btn-default"
ng-class="createMode ? 'disable-link' : ''">Resources</a>
-              <a ui-sref-active="active" ui-sref=".finish" class="btn btn-default" ng-class="createMode
? 'disable-link' : ''">Finish</a>
+              <!--add class breadcrumb-disabled-link to buttons to prevent click-->
             
+              <a ng-repeat="(key, value) in wizard" ui-sref-active="active" ui-sref=".{{key}}"
class="btn btn-default" 
+                 ng-class="createMode ? 'disable-link' : ''">{{key}}</a>       
             </div>
           </div>
         </div>

http://git-wip-us.apache.org/repos/asf/syncope/blob/e3d7ff37/client/enduser/src/main/resources/META-INF/resources/app/views/navigationButtons.html
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/views/navigationButtons.html
b/client/enduser/src/main/resources/META-INF/resources/app/views/navigationButtons.html
index 1f1d7a4..b633640 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/views/navigationButtons.html
+++ b/client/enduser/src/main/resources/META-INF/resources/app/views/navigationButtons.html
@@ -17,10 +17,10 @@ specific language governing permissions and limitations
 under the License.
 -->
 <div class="pull-right">
-  <a ng-show="next !== 'none'" id="next" class="btn btn-default" ng-click="validateAndNext($event,
next)">
+  <a ng-show="next !== 'none'" id="next" class="btn btn-default" ng-click="validateAndNext($event)">
     Next <span class="glyphicon glyphicon-circle-arrow-right"></span>
   </a>
-  <a ng-show="previous !== 'none'" id="previous" ui-sref="{{previous}}" class="btn btn-default">
+  <a ng-show="previous !== 'none'" id="previous" ng-click="previousTab()" class="btn btn-default">
     <span class="glyphicon glyphicon-circle-arrow-left"></span> Previous
   </a>
 </div>

http://git-wip-us.apache.org/repos/asf/syncope/blob/e3d7ff37/client/enduser/src/main/resources/META-INF/resources/app/views/user-credentials.html
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/views/user-credentials.html
b/client/enduser/src/main/resources/META-INF/resources/app/views/user-credentials.html
index d024525..faee268 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/views/user-credentials.html
+++ b/client/enduser/src/main/resources/META-INF/resources/app/views/user-credentials.html
@@ -62,8 +62,8 @@ under the License.
 </div>
 
 <div id="attribute" class="form-group row">
-  <navigation-buttons ng-show="createMode" next="create.groups" previous="none"></navigation-buttons>
-  <navigation-buttons ng-show="!createMode" next="update.groups" previous="none"></navigation-buttons>
+  <navigation-buttons ng-show="createMode" base="create" current="credentials" wizard="{{wizard}}"></navigation-buttons>
+  <navigation-buttons ng-show="!createMode" base= "update" current="credentials" wizard="{{wizard}}"></navigation-buttons>
   <div class="pull-left">
     <a id="cancel" href="#/self" class="btn btn-danger pull-left">Cancel</a>
   </div>

http://git-wip-us.apache.org/repos/asf/syncope/blob/e3d7ff37/client/enduser/src/main/resources/META-INF/resources/app/views/user-derived-schemas.html
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/views/user-derived-schemas.html
b/client/enduser/src/main/resources/META-INF/resources/app/views/user-derived-schemas.html
index b7e71d3..23fbc12 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/views/user-derived-schemas.html
+++ b/client/enduser/src/main/resources/META-INF/resources/app/views/user-derived-schemas.html
@@ -21,8 +21,8 @@ under the License.
 </div>
 
 <div id="attribute" class="form-group row">
-  <navigation-buttons ng-show="createMode" next="create.virtualSchemas" previous="create.plainSchemas"></navigation-buttons>
-  <navigation-buttons ng-show="!createMode" next="update.virtualSchemas" previous="update.plainSchemas"></navigation-buttons>
+  <navigation-buttons ng-show="createMode" base="create" current="derivedSchemas" wizard="{{wizard}}"></navigation-buttons>
+  <navigation-buttons ng-show="!createMode" base="update" current="derivedSchemas" wizard="{{wizard}}"></navigation-buttons>
   <div class="pull-left">
     <a id="cancel" href="#/self" class="btn btn-danger">Cancel</a>
   </div>

http://git-wip-us.apache.org/repos/asf/syncope/blob/e3d7ff37/client/enduser/src/main/resources/META-INF/resources/app/views/user-form-finish.html
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/views/user-form-finish.html
b/client/enduser/src/main/resources/META-INF/resources/app/views/user-form-finish.html
index 3512022..5a0003b 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/views/user-form-finish.html
+++ b/client/enduser/src/main/resources/META-INF/resources/app/views/user-form-finish.html
@@ -22,8 +22,8 @@ under the License.
     <captcha input="captchaInput" enabled="captchaEnabled"></captcha>
   </div>
   <button id="save" type="submit" class="btn btn-default pull-right">Save</button>
-  <navigation-buttons ng-show="createMode" next="none" previous="create.resources"></navigation-buttons>
-  <navigation-buttons ng-show="!createMode" next="none" previous="update.resources"></navigation-buttons>
+  <navigation-buttons ng-show="createMode" base="create" current="finish" wizard="{{wizard}}"></navigation-buttons>
+  <navigation-buttons ng-show="!createMode" base="update" current="finish" wizard="{{wizard}}"></navigation-buttons>
   <div class="pull-left">
     <a id="cancel" href="#/self" class="btn btn-danger">Cancel</a>
   </div>

http://git-wip-us.apache.org/repos/asf/syncope/blob/e3d7ff37/client/enduser/src/main/resources/META-INF/resources/app/views/user-groups.html
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/views/user-groups.html
b/client/enduser/src/main/resources/META-INF/resources/app/views/user-groups.html
index 98ce099..0c86b3f 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/views/user-groups.html
+++ b/client/enduser/src/main/resources/META-INF/resources/app/views/user-groups.html
@@ -34,8 +34,8 @@ under the License.
   <auxiliary form="dynamicForm" user="user"></auxiliary>
 </div>
 <div id="attribute" class="form-group row">
-  <navigation-buttons ng-show="createMode" next="create.plainSchemas" previous="create.credentials"></navigation-buttons>
-  <navigation-buttons ng-show="!createMode" next="update.plainSchemas" previous="update.credentials"></navigation-buttons>
+  <navigation-buttons ng-show="createMode" base="create" current="groups" wizard="{{wizard}}"></navigation-buttons>
+  <navigation-buttons ng-show="!createMode" base="update" current="groups" wizard="{{wizard}}"></navigation-buttons>
   <div class="pull-left">
     <a id="cancel" href="#/self" class="btn btn-danger pull-left">Cancel</a>
   </div>

http://git-wip-us.apache.org/repos/asf/syncope/blob/e3d7ff37/client/enduser/src/main/resources/META-INF/resources/app/views/user-plain-schemas.html
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/views/user-plain-schemas.html
b/client/enduser/src/main/resources/META-INF/resources/app/views/user-plain-schemas.html
index 7652981..3baae9a 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/views/user-plain-schemas.html
+++ b/client/enduser/src/main/resources/META-INF/resources/app/views/user-plain-schemas.html
@@ -21,8 +21,8 @@ under the License.
 </div>
 
 <div id="attribute" class="form-group row">
-  <navigation-buttons ng-show="createMode" next="create.derivedSchemas" previous="create.groups"></navigation-buttons>
-  <navigation-buttons ng-show="!createMode" next="update.derivedSchemas" previous="update.groups"></navigation-buttons>
+  <navigation-buttons ng-show="createMode" base="create" current="plainSchemas" wizard="{{wizard}}"></navigation-buttons>
+  <navigation-buttons ng-show="!createMode" base="update" current="plainSchemas" wizard="{{wizard}}"></navigation-buttons>
   <div class="pull-left">
     <a id="cancel" href="#/self" class="btn btn-danger pull-left">Cancel</a>
   </div>

http://git-wip-us.apache.org/repos/asf/syncope/blob/e3d7ff37/client/enduser/src/main/resources/META-INF/resources/app/views/user-resources.html
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/views/user-resources.html
b/client/enduser/src/main/resources/META-INF/resources/app/views/user-resources.html
index bad7ce2..67c9645 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/views/user-resources.html
+++ b/client/enduser/src/main/resources/META-INF/resources/app/views/user-resources.html
@@ -20,8 +20,8 @@ under the License.
   <resources form="dynamicForm" user="user"></resources>
 </div>
 <div id="attribute" class="form-group row">
-  <navigation-buttons ng-show="createMode" next="create.finish" previous="create.virtualSchemas"></navigation-buttons>
-  <navigation-buttons ng-show="!createMode" next="update.finish" previous="update.virtualSchemas"></navigation-buttons>
+  <navigation-buttons ng-show="createMode" base="create" current="resources" wizard="{{wizard}}"></navigation-buttons>
+  <navigation-buttons ng-show="!createMode" base="update" current="resources" wizard="{{wizard}}"></navigation-buttons>
   <div class="pull-left">
     <a id="cancel" href="#/self" class="btn btn-danger">Cancel</a>
   </div>

http://git-wip-us.apache.org/repos/asf/syncope/blob/e3d7ff37/client/enduser/src/main/resources/META-INF/resources/app/views/user-virtual-schemas.html
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/views/user-virtual-schemas.html
b/client/enduser/src/main/resources/META-INF/resources/app/views/user-virtual-schemas.html
index 3de4714..4cb2cf1 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/views/user-virtual-schemas.html
+++ b/client/enduser/src/main/resources/META-INF/resources/app/views/user-virtual-schemas.html
@@ -22,8 +22,8 @@ under the License.
 </div>
 
 <div id="attribute" class="form-group row">
-  <navigation-buttons ng-show="createMode" next="create.resources" previous="create.derivedSchemas"></navigation-buttons>
-  <navigation-buttons ng-show="!createMode" next="update.resources" previous="update.derivedSchemas"></navigation-buttons>
+  <navigation-buttons ng-show="createMode" base="create" current="virtualSchemas" wizard="{{wizard}}"></navigation-buttons>
+  <navigation-buttons ng-show="!createMode" base="update" current="virtualSchemas" wizard="{{wizard}}"></navigation-buttons>
   <div class="pull-left">
     <a id="cancel" href="#/self" class="btn btn-danger">Cancel</a>
   </div>

http://git-wip-us.apache.org/repos/asf/syncope/blob/e3d7ff37/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 3f9c957..f26e99f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -395,7 +395,7 @@ under the License.
     <angular.version>1.5.0</angular.version>
     <angular-ui-router.version>0.2.17</angular-ui-router.version>
     <angular-ui-bootstrap.version>1.1.1-1</angular-ui-bootstrap.version>
-    <angular-ui-select.version>0.13.1</angular-ui-select.version>
+    <angular-ui-select.version>0.14.8</angular-ui-select.version>
     <angular-treasure-overlay-spinner.version>1.1.0</angular-treasure-overlay-spinner.version>
     <ng-password-strength.version>0.2.1</ng-password-strength.version>
     <lodash.version>4.0.0</lodash.version>


Mime
View raw message