branch develop updated (bd44409 -> 51cb31a)
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 bd44409 Ajout d'une classe pour fixer le dialect H2 plantant avec les varchar new 3da9a3c refs #6742 #7775 Add list of public project in homepage without connexion new 51cb31a refs-90 #6742 #7775 Add 2 last closed projects in connected users home page list The 2 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 51cb31a31b0b2e2a16d24241c0402df0f895899a Author: Yannick Martel <martel@©odelutin.com> Date: Mon Dec 7 14:55:22 2015 +0100 refs-90 #6742 #7775 Add 2 last closed projects in connected users home page list commit 3da9a3c413e5036005a0aad7c5a67f5c95cd08c7 Author: Yannick Martel <martel@©odelutin.com> Date: Mon Dec 7 12:15:14 2015 +0100 refs #6742 #7775 Add list of public project in homepage without connexion Summary of changes: .../coselmar/services/v1/QuestionsWebService.java | 26 ++++++++++++++ coselmar-rest/src/main/resources/mapping | 1 + coselmar-ui/src/main/webapp/i18n/en.js | 2 +- coselmar-ui/src/main/webapp/i18n/fr.js | 2 +- .../src/main/webapp/js/coselmar-controllers.js | 17 +++++++++ .../main/webapp/js/coselmar-questions-services.js | 6 ++++ coselmar-ui/src/main/webapp/views/home.html | 42 +++++++++++++++++++--- 7 files changed, 89 insertions(+), 7 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 3da9a3c413e5036005a0aad7c5a67f5c95cd08c7 Author: Yannick Martel <martel@©odelutin.com> Date: Mon Dec 7 12:15:14 2015 +0100 refs #6742 #7775 Add list of public project in homepage without connexion --- .../coselmar/services/v1/QuestionsWebService.java | 26 ++++++++++++++++++++++ coselmar-rest/src/main/resources/mapping | 1 + coselmar-ui/src/main/webapp/i18n/en.js | 2 +- coselmar-ui/src/main/webapp/i18n/fr.js | 2 +- .../src/main/webapp/js/coselmar-controllers.js | 7 ++++++ .../main/webapp/js/coselmar-questions-services.js | 6 +++++ coselmar-ui/src/main/webapp/views/home.html | 10 ++++----- 7 files changed, 47 insertions(+), 7 deletions(-) diff --git a/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/QuestionsWebService.java b/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/QuestionsWebService.java index fc5c64e..64d3488 100644 --- a/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/QuestionsWebService.java +++ b/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/QuestionsWebService.java @@ -262,6 +262,32 @@ public class QuestionsWebService extends CoselmarWebServiceSupport { return result; } + public List<QuestionBean> getPublicQuestions() throws InvalidCredentialException, UnauthorizedException { + + // No authentication needed, just filter to get last 5 public questions + QuestionSearchBean searchOption = new QuestionSearchBean(); + searchOption.setPrivacy(Privacy.PUBLIC.name()); + searchOption.setStatus(Status.OPEN.name()); + searchOption.setLimit(5); + searchOption.setPage(1); + + PaginationParameter paginationParameter = PaginationParameter.of(0, 5, Question.PROPERTY_SUBMISSION_DATE, true); + + List<Question> questionList = getQuestionDao().findWithSearchBean(searchOption, paginationParameter); + + List<QuestionBean> result = new ArrayList<>(questionList.size()); + + for (Question question : questionList) { + TopiaIdFactory topiaIdFactory = getPersistenceContext().getTopiaIdFactory(); + + QuestionBean questionBean = BeanEntityConverter.toLightBean(topiaIdFactory, question); + + result.add(questionBean); + } + + return result; + } + public void deleteQuestion(String questionId) throws InvalidCredentialException, UnauthorizedException { // Check authentication diff --git a/coselmar-rest/src/main/resources/mapping b/coselmar-rest/src/main/resources/mapping index ec66430..b933d17 100644 --- a/coselmar-rest/src/main/resources/mapping +++ b/coselmar-rest/src/main/resources/mapping @@ -55,6 +55,7 @@ DELETE /v1/users/{userId} UsersWebService.deleteUser # Questions Api GET /v1/questions QuestionsWebService.getQuestions +GET /v1/questions/public QuestionsWebService.getPublicQuestions GET /v1/questions/themes QuestionsWebService.getThemes GET /v1/questions/types QuestionsWebService.getTypes GET /v1/questions/{questionId} QuestionsWebService.getQuestion diff --git a/coselmar-ui/src/main/webapp/i18n/en.js b/coselmar-ui/src/main/webapp/i18n/en.js index 4c39150..3a61d04 100644 --- a/coselmar-ui/src/main/webapp/i18n/en.js +++ b/coselmar-ui/src/main/webapp/i18n/en.js @@ -314,7 +314,7 @@ var translateEN = { <p>The knowledge base can be queried and the results of queries consulted a variety of views that can be exported. Recent features are being developed.</p>\ <p>Access to this platform is secure. To obtain a right of access to thank you for the request through the Coselmar website contact page (<a href='http://www.coselmar.fr/contact/' target='_blank'>http://www.coselmar.fr/contact/</a>).</p>\ </p>", -"home.connected.lastProjects" : "Last projects", +"home.lastProjects" : "Last projects", "error.message.authentication.title" : "Error with authentication", "error.message.authentication.body" : "Error with authentication, please try to log again.", diff --git a/coselmar-ui/src/main/webapp/i18n/fr.js b/coselmar-ui/src/main/webapp/i18n/fr.js index 71b57e7..0d6ede6 100644 --- a/coselmar-ui/src/main/webapp/i18n/fr.js +++ b/coselmar-ui/src/main/webapp/i18n/fr.js @@ -315,7 +315,7 @@ var translateFR = { Ces dernières fonctionnalités sont en cours de développement.</p>\ <p>L'accès à cette plateforme est sécurisé. Pour obtenir un droit d'accès merci d'en faire la demande au travers de la page contact du site Coselmar (<a href='http://www.coselmar.fr/contact/' target='_blank'>http://www.coselmar.fr/contact/</a>).\ </p>", -"home.connected.lastProjects" : "Derniers projets", +"home.lastProjects" : "Derniers projets", "error.message.authentication.title" : "Échec d'authentification", "error.message.authentication.body" : "Une erreur avec l'authentification est survenue, veuillez vous reconnecter svp.", diff --git a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js index b49fcac..df83aa7 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js @@ -126,6 +126,13 @@ coselmarControllers.controller("homeConnectedCtrl", ['$scope', 'questionsService }, function(fail) { $scope.questions = []; }); + } else { + + questionsService.getPublicQuestions(function(questions) { + $scope.questions = questions; + }, function(fail) { + $scope.questions = []; + }); } }]); 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 e86196b..f8d64d6 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-questions-services.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-questions-services.js @@ -78,6 +78,12 @@ function Question(resource, config){ questionResource.query().$promise.then(successFunction, failFunction); }; + this.getPublicQuestions = function(successFunction, failFunction) { + + var questionResource = resource(baseURL + "/public"); + questionResource.query().$promise.then(successFunction, failFunction); + }; + this.deleteQuestion = function(questionId, successFunction, failFunction) { var questionResource = resource(baseURL + "/" + questionId); questionResource.delete().$promise.then(successFunction, failFunction); diff --git a/coselmar-ui/src/main/webapp/views/home.html b/coselmar-ui/src/main/webapp/views/home.html index 0c0f7da..e5660ec 100644 --- a/coselmar-ui/src/main/webapp/views/home.html +++ b/coselmar-ui/src/main/webapp/views/home.html @@ -25,9 +25,9 @@ <div translate="home.presentation.title"></div> <div style="margin-top : 50px" translate="home.presentation.body"></div> - <!-- In case of user connected, show five last projects --> - <div ng-if="context.currentUser"> - <h2>{{ "home.connected.lastProjects" | translate }}</h2> + <!-- Show five last projects --> + <div> + <h2>{{ "home.lastProjects" | translate }}</h2> <table class="table table-bordered"> <thead> @@ -43,11 +43,11 @@ </thead> <tbody> <tr ng-repeat="question in questions" > - <td ng-if="context.currentUser.role != 'MEMBER'"> + <td ng-if="context.currentUser && context.currentUser.role != 'MEMBER'"> <span class="status-{{question.status|lowercase}}" title="{{question.status | translate}}"></span> <a href="#/questions/{{question.id}}" class="paddingLeft10" tooltip-placement="bottom" tooltip-html-unsafe="{{question.summary}}">{{question.title}}</a> </td> - <td ng-if="context.currentUser.role == 'MEMBER'">{{question.title}}</td> + <td ng-if="!context.currentUSer || context.currentUser.role == 'MEMBER'">{{question.title}}</td> <td>{{question.submissionDate | date:'mediumDate'}}</td> -- 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 51cb31a31b0b2e2a16d24241c0402df0f895899a Author: Yannick Martel <martel@©odelutin.com> Date: Mon Dec 7 14:55:22 2015 +0100 refs-90 #6742 #7775 Add 2 last closed projects in connected users home page list --- .../src/main/webapp/js/coselmar-controllers.js | 10 +++++++ coselmar-ui/src/main/webapp/views/home.html | 32 ++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js index df83aa7..4af43f9 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js @@ -117,6 +117,8 @@ coselmarControllers.controller("unauthorizedCtrl", ['$scope', '$location', funct // Controller for home when user connected, load 5 last projects coselmarControllers.controller("homeConnectedCtrl", ['$scope', 'questionsService', function ($scope, questionsService) { + $scope.closedQuestions = []; + if ($scope.context && $scope.context.currentUser) { var searchOptions = {'status' : 'IN_PROGRESS', 'limit' : 5, 'page' : 0}; @@ -126,6 +128,14 @@ coselmarControllers.controller("homeConnectedCtrl", ['$scope', 'questionsService }, function(fail) { $scope.questions = []; }); + + var closedSearchOptions = {'status' : 'CLOSED', 'limit' : 2, 'page' : 0}; + + questionsService.getQuestions(closedSearchOptions, function(questions) { + $scope.closedQuestions = questions; + }, function(fail) { + $scope.closedQuestions = []; + }); } else { questionsService.getPublicQuestions(function(questions) { diff --git a/coselmar-ui/src/main/webapp/views/home.html b/coselmar-ui/src/main/webapp/views/home.html index e5660ec..f11dc65 100644 --- a/coselmar-ui/src/main/webapp/views/home.html +++ b/coselmar-ui/src/main/webapp/views/home.html @@ -74,6 +74,38 @@ <td ng-if="!question.relatedDocuments && context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'">0</td> </tr> + <tr ng-repeat="question in closedQuestions" > + <td ng-if="context.currentUser && context.currentUser.role != 'MEMBER'"> + <span class="status-{{question.status|lowercase}}" title="{{question.status | translate}}"></span> + <a href="#/questions/{{question.id}}" class="paddingLeft10" tooltip-placement="bottom" tooltip-html-unsafe="{{question.summary}}">{{question.title}}</a> + </td> + <td ng-if="!context.currentUSer || context.currentUser.role == 'MEMBER'">{{question.title}}</td> + + <td>{{question.submissionDate | date:'mediumDate'}}</td> + + <td><span ng-repeat="theme in question.themes">{{theme}}, </span></td> + + <td>{{question.deadline | date:'mediumDate'}}</td> + + <!-- clients : we use ng-if for better tooltip management --> + <td ng-if="question.clients && context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'"> + <span tooltip-placement="bottom" tooltip-html-unsafe="{{getUserNames(question.clients)}}" >{{question.clients.length}}</span> + </td> + <td ng-if="!question.clients && context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'">0</td> + + <!-- participants --> + <td ng-if="question.participants && context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'"> + <span tooltip-placement="bottom" tooltip-html-unsafe="{{getUserNames(question.participants)}}" >{{question.participants.length}}</span> + </td> + <td ng-if="!question.participants && context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'">0</td> + + <!-- related documents --> + <td ng-if="question.relatedDocuments && context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'"> + <span tooltip-placement="bottom" tooltip-html-unsafe="{{getDocumentTitles(question.relatedDocuments)}}" tooltip-trigger="mouseenter" >{{question.relatedDocuments.length}}</span> + </td> + <td ng-if="!question.relatedDocuments && context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'">0</td> + + </tr> </tbody> </table> <p ng-if="questions && questions.length == 0" translate="common.search.noResult" class="info"/> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm