branch develop updated (3493d5f -> f6cffe1)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository coselmar. See http://git.codelutin.com/coselmar.git from 3493d5f Refs #7906 : Ajout de l'écran de chargement new 9913e0e refs-50 #7906 add loading on documents new 1c5681c refs-70 #7906 add loading on users new f6cffe1 fixes #7906 add loading on projects The 3 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 f6cffe19cbfb692db35d75b35c66100d6f3ade2b Author: Yannick Martel <martel@©odelutin.com> Date: Mon Jan 18 11:45:03 2016 +0100 fixes #7906 add loading on projects commit 1c5681c70c094559defaf1bb9ae67734725c1f35 Author: Yannick Martel <martel@©odelutin.com> Date: Mon Jan 18 11:03:38 2016 +0100 refs-70 #7906 add loading on users commit 9913e0eef39a324ebbb3b4e24306d8ef8605ab78 Author: Yannick Martel <martel@©odelutin.com> Date: Mon Jan 18 10:52:47 2016 +0100 refs-50 #7906 add loading on documents Summary of changes: coselmar-ui/src/main/webapp/index.html | 2 +- .../src/main/webapp/js/coselmar-controllers.js | 103 +++++++++++++++++---- .../main/webapp/js/coselmar-questions-services.js | 12 +-- .../src/main/webapp/js/coselmar-services.js | 16 ++-- .../src/main/webapp/js/coselmar-user-services.js | 16 ++-- 5 files changed, 107 insertions(+), 42 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
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 9913e0eef39a324ebbb3b4e24306d8ef8605ab78 Author: Yannick Martel <martel@©odelutin.com> Date: Mon Jan 18 10:52:47 2016 +0100 refs-50 #7906 add loading on documents --- coselmar-ui/src/main/webapp/index.html | 2 +- .../src/main/webapp/js/coselmar-controllers.js | 29 +++++++++++++++++++--- .../src/main/webapp/js/coselmar-services.js | 16 ++++++------ 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/coselmar-ui/src/main/webapp/index.html b/coselmar-ui/src/main/webapp/index.html index 652853f..ba09a4f 100644 --- a/coselmar-ui/src/main/webapp/index.html +++ b/coselmar-ui/src/main/webapp/index.html @@ -212,7 +212,7 @@ </div> </footer> - <div id="loading" ng-if="application-loading"> + <div id="loading" ng-if="applicationLoading"> <i class="fa fa-spinner fa-pulse"></i> </div> diff --git a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js index 500f88e..50e420a 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js @@ -105,6 +105,14 @@ coselmarControllers.controller("HomeCtrl", ['$scope', '$http', '$location', '$ro } } + $scope.$on('dataLoading', function(event, args) { + $scope.applicationLoading = true; + }); + + $scope.$on('dataLoaded', function(event, args) { + $scope.applicationLoading = false; + }); + }]); // Controller when got 401 @@ -170,6 +178,7 @@ coselmarControllers.controller("homeConnectedCtrl", ['$scope', 'questionsService coselmarControllers.controller("DocumentsCtrl", ['$scope', '$route', '$routeParams', '$location', 'notify', 'documentService', 'errorService', function($scope, $route, $routeParams, $location, notify, documentService, errorService){ + $scope.$emit('dataLoading'); //manage keywords if given $scope.search = { searchKeywords : []}; $scope.example = { keywords: []}; @@ -190,7 +199,9 @@ coselmarControllers.controller("DocumentsCtrl", ['$scope', '$route', '$routePara documentService.getDocuments($scope.search.searchKeywords, function(documents) { $scope.documents = documents; - }, errorService.defaultFailOnCall); + }, errorService.defaultFailOnCall, function() { + $scope.$emit('dataLoaded'); + }); $scope.deleteDocument = function(documentId){ @@ -230,8 +241,11 @@ coselmarControllers.controller("DocumentsCtrl", ['$scope', '$route', '$routePara $scope.example.publicationBeforeDate = $scope.example.publicationBeforeDate.getTime(); } + $scope.$emit('dataLoading'); documentService.getAdvancedDocuments($scope.example, function(documents){ $scope.documents = documents; + }, errorService.defaultFailOnCall, function() { + $scope.$emit('dataLoaded'); }); }; @@ -304,6 +318,7 @@ coselmarControllers.controller("NewDocumentCtrl", ['$scope', '$location', 'notif $scope.keywordsError = true; } else { // Call service to create a new document + $scope.$emit('dataLoading'); documentService.saveDocument($scope.document, function(document) { if ($scope.upload.file) { @@ -328,7 +343,11 @@ coselmarControllers.controller("NewDocumentCtrl", ['$scope', '$location', 'notif }); $location.path("/documents"); } - }, errorService.defaultFailOnCall); + }, + errorService.defaultFailOnCall, + function() { + $scope.$emit('dataLoaded'); + }); } @@ -449,6 +468,7 @@ coselmarControllers.controller("DocumentViewCtrl", $scope.hasErrors = true; } else if ($scope.isFormValid()) { + $scope.$emit('dataLoading'); $scope.hasErrors = false; // Adapt publicationDate to send a timestamp @@ -479,7 +499,10 @@ coselmarControllers.controller("DocumentViewCtrl", }); $location.search(""); } - }, errorService.defaultFailOnCall); + }, errorService.defaultFailOnCall, + function() { + $scope.$emit('dataLoaded'); + }); } else { $scope.hasErrors = true; diff --git a/coselmar-ui/src/main/webapp/js/coselmar-services.js b/coselmar-ui/src/main/webapp/js/coselmar-services.js index 38e90a8..09d5438 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-services.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-services.js @@ -34,7 +34,7 @@ function Document(resource, config){ var baseURL = config.BASE_URL + "/documents"; var usersURL = config.BASE_URL + "/users"; - this.saveDocument = function(document, successFunction, failFunction) { + this.saveDocument = function(document, successFunction, failFunction, finallyFunction) { var param = $.param({ 'document': JSON.stringify(document)}); @@ -48,7 +48,7 @@ function Document(resource, config){ 'save': { method: 'POST'} }); - saveDocumentResource.save(null, param, successFunction, failFunction); + saveDocumentResource.save(null, param, successFunction, failFunction).$promise.finally(finallyFunction); }; this.saveDocumentFile = function(documentId, file, successFunction, failFunction) { @@ -92,10 +92,10 @@ function Document(resource, config){ docResource.upload(null, formData, successFunction, failFunction); }; - this.getDocument = function(id, successFunction, failFunction){ + this.getDocument = function(id, successFunction, failFunction, finallyFunction){ // Load the document var docResource = resource(baseURL + '/:documentId', {documentId:'@documentId'}); - docResource.get({documentId:id}, successFunction, failFunction); + docResource.get({documentId:id}, successFunction, failFunction).$promise.finally(finallyFunction); }; this.deleteDocument = function(id, scope, successFunction, failFunction){ @@ -113,10 +113,10 @@ function Document(resource, config){ }); }; - this.getDocuments = function(searchKeywords, successFunction, failFunction){ + this.getDocuments = function(searchKeywords, successFunction, failFunction, finallyFunction){ // Load all documents var docResource = resource(baseURL, {'searchBean' : {'fullTextSearch' : searchKeywords}}); - docResource.query(successFunction, failFunction); + docResource.query(successFunction, failFunction).$promise.finally(finallyFunction); }; this.findAllTypes = function(successFunction){ @@ -135,10 +135,10 @@ function Document(resource, config){ }; - this.getAdvancedDocuments = function(searchExample, successFunction){ + this.getAdvancedDocuments = function(searchExample, successFunction, failFunction, finallyFunction){ // Load documents with search example var docResource = resource(baseURL, {'searchBean' : searchExample}); - docResource.query(successFunction); + docResource.query(successFunction, failFunction).$promise.finally(finallyFunction); }; }; \ No newline at end of file -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
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 1c5681c70c094559defaf1bb9ae67734725c1f35 Author: Yannick Martel <martel@©odelutin.com> Date: Mon Jan 18 11:03:38 2016 +0100 refs-70 #7906 add loading on users --- .../src/main/webapp/js/coselmar-controllers.js | 34 +++++++++++++++++----- .../src/main/webapp/js/coselmar-user-services.js | 16 +++++----- 2 files changed, 34 insertions(+), 16 deletions(-) diff --git a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js index 50e420a..a14cbdd 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js @@ -594,7 +594,9 @@ coselmarControllers.directive('ngFileModel', ['$parse', function ($parse) { ///////////////////////////////////////////////// // Controller for All User View -coselmarControllers.controller("UsersCtrl", ['$scope', '$route', '$routeParams', '$location', 'userService', 'notify', function($scope, $route, $routeParams, $location, userService, notify){ +coselmarControllers.controller("UsersCtrl", ['$scope', '$route', '$routeParams', '$location', 'userService', 'errorService', 'notify', function($scope, $route, $routeParams, $location, userService, errorService, notify){ + + $scope.$emit('dataLoading'); //manage keywords if given $scope.example = { fullTextSearch : [], active : "true", role : ''}; @@ -620,8 +622,10 @@ coselmarControllers.controller("UsersCtrl", ['$scope', '$route', '$routeParams', } userService.getUsers($scope.example.fullTextSearch, $scope.example.showDisable, function(users) { - $scope.users = users; - }); + $scope.users = users; + }, errorService.defaultFailOnCall, function() { + $scope.$emit('dataLoaded'); + }); $scope.deleteUser = function(userId){ @@ -682,10 +686,14 @@ coselmarControllers.controller("UsersCtrl", ['$scope', '$route', '$routeParams', // Because "ALL" role is just a hack to select no role, remove it from example delete $scope.example.role; }; + $scope.$emit('dataLoading'); userService.getAdvancedUsers($scope.example, function(users){ - $scope.users = users; - }); + $scope.users = users; + }, errorService.defaultFailOnCall, function() { + $scope.$emit('dataLoaded'); + } + ); }; $scope.searchMode = function(type) { @@ -725,6 +733,7 @@ coselmarControllers.controller("NewUserCtrl", ['$scope', '$route', '$location', // Call service to create a new user if(isValidForm) { + $scope.$emit('dataLoading'); userService.saveUser($scope.user, function() { notify({ message: "user.message.created", @@ -758,7 +767,9 @@ coselmarControllers.controller("NewUserCtrl", ['$scope', '$route', '$location', }); } - }); + }, function() { + $scope.$emit('dataLoaded'); + }); } }; @@ -769,6 +780,8 @@ coselmarControllers.controller("UserViewCtrl", ['$scope', '$route', '$location', 'userService', '$routeParams', 'notify', 'errorService', function($scope, $route, $location, userService, $routeParams, notify, errorService) { + $scope.$emit('dataLoading'); + $scope.editMode = $routeParams.edit; if ($scope.editMode) { $scope.editPassword = true; @@ -779,7 +792,9 @@ coselmarControllers.controller("UserViewCtrl", $scope.user = user; var emailPattern = /^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+((\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)?)+@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/; $scope.simpleLogin = !emailPattern.test(user.mail); - }, errorService.defaultFailOnCall); + }, errorService.defaultFailOnCall, function() { + $scope.$emit('dataLoaded'); + }); $scope.deleteUser = function(userId){ @@ -844,6 +859,7 @@ coselmarControllers.controller("UserViewCtrl", // Call service to create a new user if(isValidForm) { + $scope.$emit('dataLoading'); userService.saveUser($scope.user, function() { // Notification @@ -887,7 +903,9 @@ coselmarControllers.controller("UserViewCtrl", }); } - }); + }, function() { + $scope.$emit('dataLoaded'); + }); } }; diff --git a/coselmar-ui/src/main/webapp/js/coselmar-user-services.js b/coselmar-ui/src/main/webapp/js/coselmar-user-services.js index 3f1e1d9..d200bde 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-user-services.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-user-services.js @@ -33,7 +33,7 @@ function User(resource, config){ var baseURL = config.BASE_URL + "/users"; var exportURL = config.BASE_URL + "/export/users"; - this.saveUser = function(user, successFunction, failFunction){ + this.saveUser = function(user, successFunction, failFunction, finallyFunction){ var param = $.param({ 'user': JSON.stringify(user)}); @@ -47,13 +47,13 @@ function User(resource, config){ method:'POST' } }); - userResource.save(null, param, successFunction, failFunction); + userResource.save(null, param, successFunction, failFunction).$promise.finally(finallyFunction); } - this.getUser = function(id, successFunction, failFunction){ + this.getUser = function(id, successFunction, failFunction, finallyFunction){ // Load the User var userResource = resource(baseURL + '/:userId', {userId:'@userId'}); - userResource.get({userId:id}, successFunction, failFunction); + userResource.get({userId:id}, successFunction, failFunction).$promise.finally(finallyFunction); } this.deleteUser = function(id, scope, successFunction){ @@ -62,16 +62,16 @@ function User(resource, config){ userResource.delete({userId:id}, successFunction); } - this.getUsers = function(searchKeywords, showDisable, successFunction){ + this.getUsers = function(searchKeywords, showDisable, successFunction, failFunction, finallyFunction){ // Load all users var userResource = resource(baseURL, {'search' : {'fullTextSearch' : searchKeywords, 'activeAndInactive': showDisable, 'active': true}}); - userResource.query(successFunction); + userResource.query(successFunction, failFunction).$promise.finally(finallyFunction); }; - this.getAdvancedUsers = function(searchExample, successFunction){ + this.getAdvancedUsers = function(searchExample, successFunction, failFunction, finallyFunction){ // Load all users var userResource = resource(baseURL, {'search' : searchExample}); - userResource.query(successFunction); + userResource.query(successFunction, failFunction).$promise.finally(finallyFunction); }; this.login = function(mail, password, successFunction, failFunction){ -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
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 f6cffe19cbfb692db35d75b35c66100d6f3ade2b Author: Yannick Martel <martel@©odelutin.com> Date: Mon Jan 18 11:45:03 2016 +0100 fixes #7906 add loading on projects --- .../src/main/webapp/js/coselmar-controllers.js | 40 +++++++++++++++++----- .../main/webapp/js/coselmar-questions-services.js | 12 +++---- 2 files changed, 38 insertions(+), 14 deletions(-) diff --git a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js index a14cbdd..76b6688 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js @@ -964,6 +964,7 @@ coselmarControllers.directive('identicalCheck', [function () { // Controller for All Question View coselmarControllers.controller("QuestionsCtrl", ['$scope', '$route', '$routeParams', '$location', 'questionsService', 'notify', 'errorService', function($scope, $route, $routeParams, $location, questionsService, notify, errorService){ + $scope.$emit('dataLoading'); $scope.searchOptions = { 'privacy' : '', 'status' : '', 'fullTextSearch' : []}; @@ -978,12 +979,17 @@ coselmarControllers.controller("QuestionsCtrl", ['$scope', '$route', '$routePara // success : just get the questions $scope.questions = questions; - }, errorService.defaultFailOnCall); + }, errorService.defaultFailOnCall, function() { + $scope.$emit('dataLoaded'); + }); $scope.searchQuestions = function() { + $scope.$emit('dataLoading'); questionsService.getQuestions($scope.searchOptions, function(questions) { $scope.questions = questions; - }, errorService.defaultFailOnCall); + }, errorService.defaultFailOnCall, function() { + $scope.$emit('dataLoaded'); + }); }; @@ -998,6 +1004,7 @@ coselmarControllers.controller("QuestionsCtrl", ['$scope', '$route', '$routePara }; $scope.advancedSearchQuestions = function() { + $scope.$emit('dataLoading'); //Convert Dates to timestamp if (angular.isDate($scope.searchOptions.submissionAfterDate)) { @@ -1018,7 +1025,9 @@ coselmarControllers.controller("QuestionsCtrl", ['$scope', '$route', '$routePara questionsService.getQuestions($scope.searchOptions, function(questions){ $scope.questions = questions; - }, errorService.defaultFailOnCall); + }, errorService.defaultFailOnCall, function() { + $scope.$emit('dataLoaded'); + }); }; @@ -1177,6 +1186,7 @@ coselmarControllers.controller("QuestionCtrl", ['$scope', '$route', '$routeParam }; if ($routeParams.questionId) { + $scope.$emit('dataLoading'); questionsService.getQuestion($routeParams.questionId, function(question) { // success : just get the questions @@ -1219,7 +1229,9 @@ coselmarControllers.controller("QuestionCtrl", ['$scope', '$route', '$routeParam $scope.question.links = []; } - }, errorService.defaultFailOnCall); + }, errorService.defaultFailOnCall, function() { + $scope.$emit('dataLoaded'); + }); }; //Deletion @@ -1246,6 +1258,7 @@ coselmarControllers.controller("QuestionCtrl", ['$scope', '$route', '$routeParam if (!$scope.question.themes || $scope.question.themes.length == 0) { $scope.themesError = true; } else { + $scope.$emit('dataLoading'); // Call service to create a new question questionsService.saveQuestion($scope.question, function() { // Notification @@ -1260,7 +1273,9 @@ coselmarControllers.controller("QuestionCtrl", ['$scope', '$route', '$routeParam } else { $location.path("/questions"); } - }, errorService.defaultFailOnCall); + }, errorService.defaultFailOnCall, function() { + $scope.$emit('dataLoaded'); + }); } }; @@ -1272,6 +1287,7 @@ coselmarControllers.controller("QuestionCtrl", ['$scope', '$route', '$routeParam $scope.question.deadline = $scope.question.deadline.getTime(); } + $scope.$emit('dataLoading'); questionsService.saveQuestion($scope.question, function() { // Notification notify({ @@ -1281,7 +1297,9 @@ coselmarControllers.controller("QuestionCtrl", ['$scope', '$route', '$routeParam templateUrl: "views/notificationTemplate.html" }); $route.reload(); - },errorService.defaultFailOnCall); + },errorService.defaultFailOnCall, function() { + $scope.$emit('dataLoaded'); + }); }; $scope.openCloseQuestionSession = function(){ @@ -1300,6 +1318,7 @@ coselmarControllers.controller("QuestionCtrl", ['$scope', '$route', '$routeParam $scope.question.deadline = $scope.question.deadline.getTime(); } + $scope.$emit('dataLoading'); questionsService.saveQuestion($scope.question, function() { // Notification notify({ @@ -1309,7 +1328,9 @@ coselmarControllers.controller("QuestionCtrl", ['$scope', '$route', '$routeParam templateUrl: "views/notificationTemplate.html" }); $route.reload(); - },errorService.defaultFailOnCall); + },errorService.defaultFailOnCall, function() { + $scope.$emit('dataLoaded'); + }); }; $scope.adjournQuestion = function(){ @@ -1320,6 +1341,7 @@ coselmarControllers.controller("QuestionCtrl", ['$scope', '$route', '$routeParam $scope.question.deadline = $scope.question.deadline.getTime(); } + $scope.$emit('dataLoading'); questionsService.saveQuestion($scope.question, function() { // Notification notify({ @@ -1329,7 +1351,9 @@ coselmarControllers.controller("QuestionCtrl", ['$scope', '$route', '$routeParam templateUrl: "views/notificationTemplate.html" }); $route.reload(); - },errorService.defaultFailOnCall); + },errorService.defaultFailOnCall, function() { + $scope.$emit('dataLoaded'); + }); }; // New documents added diff --git a/coselmar-ui/src/main/webapp/js/coselmar-questions-services.js b/coselmar-ui/src/main/webapp/js/coselmar-questions-services.js index 3b60067..5f1217f 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-questions-services.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-questions-services.js @@ -34,7 +34,7 @@ function Question(resource, http, config){ var exportURL = config.BASE_URL + "/export/questions"; var usersURL = config.BASE_URL + "/users"; - this.saveQuestion = function(question, successFunction, failFunction){ + this.saveQuestion = function(question, successFunction, failFunction, finallyFunction){ var formData = new FormData(); formData.append("question", JSON.stringify(question)); @@ -50,7 +50,7 @@ function Question(resource, http, config){ method:'POST', } }); - questionResource.save(null, questionParam, successFunction, failFunction); + questionResource.save(null, questionParam, successFunction, failFunction).$promise.finally(finallyFunction); }; this.findUsers = function(example, successFunction) { @@ -59,7 +59,7 @@ function Question(resource, http, config){ }; - this.getQuestions = function(searchOptions, successFunction, failFunction) { + this.getQuestions = function(searchOptions, successFunction, failFunction, finallyFunction) { if (searchOptions.privacy && searchOptions.privacy.toUpperCase() != "PRIVATE" @@ -76,7 +76,7 @@ function Question(resource, http, config){ } var questionResource = resource(baseURL, {'searchOption' : searchOptions}); - questionResource.query().$promise.then(successFunction, failFunction); + questionResource.query().$promise.then(successFunction, failFunction).finally(finallyFunction); }; this.exportSearchResult = function(searchOptions, successFunction, failFunction) { @@ -110,9 +110,9 @@ function Question(resource, http, config){ questionResource.delete().$promise.then(successFunction, failFunction); }; - this.getQuestion = function(questionId, successFunction, failFunction) { + this.getQuestion = function(questionId, successFunction, failFunction, finallyFunction) { var questionResource = resource(baseURL + "/" + questionId); - questionResource.get().$promise.then(successFunction, failFunction); + questionResource.get().$promise.then(successFunction, failFunction).finally(finallyFunction); }; this.addNewDocuments = function(questionId, documents, successFunction, failFunction) { -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm