This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository coselmar. See http://git.codelutin.com/coselmar.git commit 20137fa3acb692993c6be70e18f5a5dfb42fdfd0 Author: Yannick Martel <martel@©odelutin.com> Date: Tue Jan 27 17:23:07 2015 +0100 fix default example values for advance search on user --- coselmar-ui/src/main/webapp/js/coselmar-controllers.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js index ca3aff5..3e8033e 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js @@ -315,7 +315,7 @@ coselmarControllers.controller("UsersCtrl", ['$scope', '$route', '$routeParams', //manage keywords if given $scope.search = { searchKeywords : []}; - $scope.example = {}; + $scope.example = { active : "true", role : 'ALL'}; var keywords = $routeParams.keywords; if (Array.isArray(keywords)) { @@ -329,7 +329,6 @@ coselmarControllers.controller("UsersCtrl", ['$scope', '$route', '$routeParams', } else { $scope.search.showDisable = false; } - console.log($scope.search.showDisable); userService.getUsers($scope.search.searchKeywords, $scope.search.showDisable, function(users) { $scope.users = users; @@ -364,24 +363,24 @@ coselmarControllers.controller("UsersCtrl", ['$scope', '$route', '$routeParams', }; $scope.searchUsers = function(){ + console.log("launch search"); $location.search('keywords', $scope.search.searchKeyword); $location.search('showDisable', $scope.search.showDisable); }; $scope.advancedSearchUsers = function() { if ($scope.example.role && $scope.example.role == "ALL") { + // Because "ALL" role is just a hack to select no role, remove it from example delete $scope.example.role; }; - if ($scope.example.active) { - if($scope.example.active == "true") { - $scope.example.active = true; - } else { - $scope.example.active = false; - }; - }; console.log($scope.example); + userService.getAdvancedUsers($scope.example, function(users){ $scope.users = users; + if (!$scope.example.role) { + // replace "ALL" as role if there is no specified role + $scope.example.role = "ALL"; + }; }); }; }]); -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.