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 64b94092ccf6f12b72351e2abb756baa98c8bf7e Author: Yannick Martel <martel@©odelutin.com> Date: Mon Dec 8 11:26:48 2014 +0100 add tooltip in questions list --- .../fr/ifremer/coselmar/beans/QuestionBean.java | 10 ++++---- .../coselmar/converter/BeanEntityConverter.java | 2 +- .../coselmar/services/v1/DocumentsWebService.java | 1 - .../coselmar/services/v1/QuestionsWebService.java | 2 +- .../src/main/webapp/js/coselmar-controllers.js | 30 ++++++++++++++++++---- .../main/webapp/views/questions/editquestion.html | 4 +-- .../src/main/webapp/views/questions/questions.html | 22 +++++++++++++--- 7 files changed, 52 insertions(+), 19 deletions(-) diff --git a/coselmar-rest/src/main/java/fr/ifremer/coselmar/beans/QuestionBean.java b/coselmar-rest/src/main/java/fr/ifremer/coselmar/beans/QuestionBean.java index 7f306c6..3cab9f2 100644 --- a/coselmar-rest/src/main/java/fr/ifremer/coselmar/beans/QuestionBean.java +++ b/coselmar-rest/src/main/java/fr/ifremer/coselmar/beans/QuestionBean.java @@ -15,7 +15,7 @@ public class QuestionBean implements Serializable { protected Date deadline; - protected Set<String> theme; + protected Set<String> themes; protected String summary; @@ -74,12 +74,12 @@ public class QuestionBean implements Serializable { this.deadline = deadline; } - public Set<String> getTheme() { - return theme; + public Set<String> getThemes() { + return themes; } - public void setTheme(Set<String> theme) { - this.theme = theme; + public void setThemes(Set<String> themes) { + this.themes = themes; } public String getSummary() { diff --git a/coselmar-rest/src/main/java/fr/ifremer/coselmar/converter/BeanEntityConverter.java b/coselmar-rest/src/main/java/fr/ifremer/coselmar/converter/BeanEntityConverter.java index 589260d..76449ea 100644 --- a/coselmar-rest/src/main/java/fr/ifremer/coselmar/converter/BeanEntityConverter.java +++ b/coselmar-rest/src/main/java/fr/ifremer/coselmar/converter/BeanEntityConverter.java @@ -116,7 +116,7 @@ public class BeanEntityConverter { Collection<String> theme = question.getTheme(); if (theme != null && !theme.isEmpty()) { - result.setTheme(new HashSet(theme)); + result.setThemes(new HashSet(theme)); } Date submissionDate = question.getSubmissionDate(); diff --git a/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/DocumentsWebService.java b/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/DocumentsWebService.java index 528257c..0ad800c 100644 --- a/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/DocumentsWebService.java +++ b/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/DocumentsWebService.java @@ -175,7 +175,6 @@ public class DocumentsWebService extends CoselmarWebServiceSupport { // If document has a file, manager it ! if (document.isWithFile()) { - documentName = uploadFile.getName(); contentType = managerDocumentFile(uploadFile, owner); } 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 4284cb9..adb7cbb 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 @@ -82,7 +82,7 @@ public class QuestionsWebService extends CoselmarWebServiceSupport { questionEntity.setType(question.getType()); - Set<String> themes = question.getTheme(); + Set<String> themes = question.getThemes(); if (themes != null) { questionEntity.setTheme(new HashSet(themes)); } diff --git a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js index 9a217cc..0d03c42 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js @@ -277,12 +277,12 @@ coselmarControllers.controller("NewQuestionCtrl", ['$scope', '$route', '$locatio questionsService, userService, documentService){ $scope.question = {'privacy' : 'PUBLIC', - 'themes' : [], 'experts' : [], 'externalExperts' : [], + 'themes' : [], 'participants' : [], 'externalExperts' : [], 'clients' : [], 'relatedDocuments': [] }; - $scope.users = { 'experts' : [], 'clients': [], 'supervisors' : []}; + $scope.users = { 'participants' : [], 'clients': [], 'supervisors' : []}; questionsService.findUsers({'role': 'EXPERT', 'active': 'true'}, function(users) { - $scope.users.experts = users; + $scope.users.participants = users; }); questionsService.findUsers({'role': 'CLIENT', 'active': 'true'}, function(users) { $scope.users.clients = users; @@ -388,7 +388,6 @@ coselmarControllers.controller("QuestionsCtrl", ['$scope', '$route', '$routePara $scope.deleteQuestion = function(questionId) { - console.log("prepare to delete " + questionId); questionsService.deleteQuestion(questionId, function(questions) { // success : just get the questions @@ -398,7 +397,28 @@ coselmarControllers.controller("QuestionsCtrl", ['$scope', '$route', '$routePara // Fail function : TODO console.log(error); }); - } + }; + + $scope.getUserNames = function(users) { + + var names = ""; + for(var i=0; i < users.length; i++) { + names += users[i].firstName + " " + users[i].name + "<br />"; + } + + return names; + }; + + $scope.getDocumentTitles = function(documents) { + + var titles = ""; + for(var i=0; i < documents.length; i++) { + titles += documents[i].name; + titles += "<br />"; + } + + return titles; + }; }]); diff --git a/coselmar-ui/src/main/webapp/views/questions/editquestion.html b/coselmar-ui/src/main/webapp/views/questions/editquestion.html index 4680816..745cc33 100644 --- a/coselmar-ui/src/main/webapp/views/questions/editquestion.html +++ b/coselmar-ui/src/main/webapp/views/questions/editquestion.html @@ -122,7 +122,7 @@ <div class="col-md-4"> - <ui-select multiple ng-model="question.experts" + <ui-select multiple ng-model="question.participants" theme="bootstrap" reset-search-input="true" ng-disabled="disabled" class="form-control"> @@ -131,7 +131,7 @@ </ui-select-match> <ui-select-choices - repeat="expert in users.experts | propsFilter: {name: $select.search, firstName: $select.search, organization: $select.search}"> + repeat="expert in users.participants | propsFilter: {name: $select.search, firstName: $select.search, organization: $select.search}"> {{expert.firstName}} {{expert.name}} ({{expert.organization}}) </ui-select-choices> </ui-select> diff --git a/coselmar-ui/src/main/webapp/views/questions/questions.html b/coselmar-ui/src/main/webapp/views/questions/questions.html index c51c66c..87d02e1 100644 --- a/coselmar-ui/src/main/webapp/views/questions/questions.html +++ b/coselmar-ui/src/main/webapp/views/questions/questions.html @@ -28,11 +28,25 @@ <tr ng-repeat="question in questions" > <td><a href="#/questions/{{question.id}}" tooltip-placement="bottom" tooltip-html-unsafe="{{question.summary}}">{{question.title}}</a></td> <td>{{question.submissionDate | date:'mediumDate'}}</td> - <td>{{question.theme}}</td> + <td><span ng-repeat="theme in question.themes">{{theme}}, </span></td> <td>{{question.deadline | date:'mediumDate'}}</td> - <td>{{question.clients.length}}</td> - <td>{{question.participants.length}}</td> - <td>{{question.relatedDocuments.length}}</td> + <!-- clients : we use ng-if for better tooltip management --> + <td ng-if="question.clients"> + <span tooltip-placement="bottom" tooltip-html-unsafe="{{getUserNames(question.clients)}}" >{{question.clients.length}}</span> + </td> + <td ng-if="!question.clients">0</td> + <!-- participants --> + <td ng-if="question.participants"> + <span tooltip-placement="bottom" tooltip-html-unsafe="{{getUserNames(question.participants)}}" >{{question.participants.length}}</span> + </td> + <td ng-if="!question.participants">0</td> + + <!-- related documents --> + <td ng-if="question.relatedDocuments"> + <span tooltip-placement="bottom" tooltip-html-unsafe="{{getDocumentTitles(question.relatedDocuments)}}" tooltip-trigger="mouseenter" >{{question.relatedDocuments.length}}</span> + </td> + <td ng-if="!question.relatedDocuments">0</td> + <td> <!--<a class="btn btn-action btn-disable" ng-click="closeQuestion(question.id)"--> <!--ng-if="currentUser.role == 'SUPERVISOR'">--> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.