[pollen] branch feature/importFavoriteList updated (c721979 -> 816ac2a)
This is an automated email from the git hooks/post-receive script. New change to branch feature/importFavoriteList in repository pollen. See http://git.chorem.org/pollen.git from c721979 add error when import favorite list from csv file new 816ac2a add redirect when error 403 to / on favoriteListCtrl The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 816ac2a76baa75fc586c7cccd0361cbc8e0adfe3 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Thu Aug 21 13:32:29 2014 +0200 add redirect when error 403 to / on favoriteListCtrl Summary of changes: .../main/webapp/js/controllers/favoriteListCtrl.js | 38 +++++++++++++++------- 1 file changed, 27 insertions(+), 11 deletions(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/importFavoriteList in repository pollen. See http://git.chorem.org/pollen.git commit 816ac2a76baa75fc586c7cccd0361cbc8e0adfe3 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Thu Aug 21 13:32:29 2014 +0200 add redirect when error 403 to / on favoriteListCtrl --- .../main/webapp/js/controllers/favoriteListCtrl.js | 38 +++++++++++++++------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/pollen-ui-angular/src/main/webapp/js/controllers/favoriteListCtrl.js b/pollen-ui-angular/src/main/webapp/js/controllers/favoriteListCtrl.js index a0fe4b7..4548fca 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/favoriteListCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/favoriteListCtrl.js @@ -21,8 +21,8 @@ 'use strict'; angular.module('favoriteListControllers', []) -.controller('FavoriteListCtrl', ['$scope', 'FavoriteList', 'FavoriteListMember', '$translate', '$routeParams', 'Page', - function ($scope, FavoriteList, FavoriteListMember, $translate, $routeParams, Page) { +.controller('FavoriteListCtrl', ['$scope', '$rootScope', 'FavoriteList', 'FavoriteListMember', '$translate', '$routeParams', 'Page', '$location', + function ($scope, $rootScope, FavoriteList, FavoriteListMember, $translate, $routeParams, Page, $location) { $scope.data = {}; Page.setTitle('user.favoriteList'); @@ -51,13 +51,18 @@ angular.module('favoriteListControllers', []) FavoriteList.get({paginationParameter:paginationParameter}, function (data) { $scope.data.favoriteList = data.elements; $scope.data.favoriteListPagination = data.pagination; + }, function (error) { + if (error.status === 403) { + $rootScope.$broadcast('newError', 'error.forbidden'); + $location.url('/'); + } }); }; initFavoriteList(); }]) -.controller('FavoriteListEditCtrl', ['$scope', 'FavoriteList', 'FavoriteListMember', '$translate', '$routeParams', '$timeout', '$q', '$location', '$route', - function ($scope, FavoriteList, FavoriteListMember, $translate, $routeParams, $timeout, $q, $location, $route) { +.controller('FavoriteListEditCtrl', ['$scope', '$rootScope', 'FavoriteList', 'FavoriteListMember', '$translate', '$routeParams', '$timeout', '$q', '$location', '$route', + function ($scope, $rootScope, FavoriteList, FavoriteListMember, $translate, $routeParams, $timeout, $q, $location, $route) { $scope.data = {}; var paginationParameter = {pageSize: conf.favoriteListMemberDefaultPageSize}; @@ -89,6 +94,11 @@ angular.module('favoriteListControllers', []) FavoriteList.get({favoriteListId:$routeParams.favoriteListId}, function (favList) { $scope.data.favoriteList = favList; initFavoriteListMember(); + }, function (error) { + if (error.status === 403) { + $rootScope.$broadcast('newError', 'error.forbidden'); + $location.url('/'); + } }); } else { @@ -98,13 +108,19 @@ angular.module('favoriteListControllers', []) var initFavoriteListMember = function () { var deferred = $q.defer(); - FavoriteListMember.get({favoriteListId:$routeParams.favoriteListId, paginationParameter:paginationParameter}, function (members) { - $timeout(function () { - $scope.data.favoriteList.members = members.elements; - $scope.data.favoriteListMemberPagination = members.pagination; - deferred.resolve(); - }, 100); - }); + FavoriteListMember.get({favoriteListId:$routeParams.favoriteListId, paginationParameter:paginationParameter}, + function (members) { + $timeout(function () { + $scope.data.favoriteList.members = members.elements; + $scope.data.favoriteListMemberPagination = members.pagination; + deferred.resolve(); + }, 100); + }, function (error) { + if (error.status === 403) { + $rootScope('newError', 'error.forbidden'); + $location.url('/'); + } + }); return deferred.promise; }; -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm