branch develop updated (1e73bf2 -> 4bef73f)
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 1e73bf2 move config to persistence package, add an unit test about cascade deletion bug with document and questions, use snapshot topia solution new f7f716d fix default locale new 4bef73f fix relatedQuestion info from documents Fix view of document in question 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 4bef73f27e6c6aac96aa0349b323e519453d0357 Author: Yannick Martel <martel@©odelutin.com> Date: Fri Jan 23 17:23:24 2015 +0100 fix relatedQuestion info from documents Fix view of document in question commit f7f716dd1b92160d4b23199d67228371bf0c2a05 Author: Yannick Martel <martel@©odelutin.com> Date: Fri Jan 23 17:23:01 2015 +0100 fix default locale Summary of changes: .../src/main/java/fr/ifremer/coselmar/beans/DocumentBean.java | 9 +++++++++ .../fr/ifremer/coselmar/services/v1/DocumentsWebService.java | 5 +++++ .../fr/ifremer/coselmar/services/v1/QuestionsWebService.java | 2 +- coselmar-ui/src/main/webapp/js/coselmar-controllers.js | 4 +--- coselmar-ui/src/main/webapp/views/documents/documents.html | 2 +- .../src/main/webapp/views/documents/modalDocumentSearch.html | 1 - 6 files changed, 17 insertions(+), 6 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 f7f716dd1b92160d4b23199d67228371bf0c2a05 Author: Yannick Martel <martel@©odelutin.com> Date: Fri Jan 23 17:23:01 2015 +0100 fix default locale --- coselmar-ui/src/main/webapp/js/coselmar-controllers.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js index 2312bea..154fd7e 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js @@ -63,9 +63,7 @@ coselmarControllers.controller("HomeCtrl", ['$scope', '$http', '$location', '$ro // i18n Management $scope.locale = localStorage.getItem('coselmar-locale'); - console.log($scope.locale); - - if (angular.isUndefined($scope.locale)) { + if (!$scope.locale) { // set locale with browser preference $scope.locale = navigator.language || navigator.userLanguage; $scope.locale = $scope.locale.substring(0,2); -- 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 4bef73f27e6c6aac96aa0349b323e519453d0357 Author: Yannick Martel <martel@©odelutin.com> Date: Fri Jan 23 17:23:24 2015 +0100 fix relatedQuestion info from documents Fix view of document in question --- .../src/main/java/fr/ifremer/coselmar/beans/DocumentBean.java | 9 +++++++++ .../fr/ifremer/coselmar/services/v1/DocumentsWebService.java | 5 +++++ .../fr/ifremer/coselmar/services/v1/QuestionsWebService.java | 2 +- coselmar-ui/src/main/webapp/views/documents/documents.html | 2 +- .../src/main/webapp/views/documents/modalDocumentSearch.html | 1 - 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/coselmar-rest/src/main/java/fr/ifremer/coselmar/beans/DocumentBean.java b/coselmar-rest/src/main/java/fr/ifremer/coselmar/beans/DocumentBean.java index 76ec1db..3b203e9 100644 --- a/coselmar-rest/src/main/java/fr/ifremer/coselmar/beans/DocumentBean.java +++ b/coselmar-rest/src/main/java/fr/ifremer/coselmar/beans/DocumentBean.java @@ -58,6 +58,7 @@ public class DocumentBean implements Serializable { protected String mimeType; protected String externalUrl; protected Set<QuestionBean> relatedQuestions; + protected int nbRelatedQuestions; public DocumentBean(String id, String name, String ownerName, String ownerId, String privacy, Date depositDate, Collection<String> keywords, @@ -272,4 +273,12 @@ public class DocumentBean implements Serializable { } this.relatedQuestions.add(relatedQuestion); } + + public int getNbRelatedQuestions() { + return nbRelatedQuestions; + } + + public void setNbRelatedQuestions(int nbRelatedQuestions) { + this.nbRelatedQuestions = nbRelatedQuestions; + } } 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 68c9eab..df083b8 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 @@ -161,6 +161,11 @@ public class DocumentsWebService extends CoselmarWebServiceSupport { for (Document document : documentList) { DocumentBean documentBean = BeanEntityConverter.toBean(getPersistenceContext().getTopiaIdFactory(), document); + + // Manage related Question + long relatedQuestions = getQuestionDao().forRelatedDocumentsContains(document).count(); + documentBean.setNbRelatedQuestions((int) relatedQuestions); + result.add(documentBean); } 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 b2614b0..15ef989 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 @@ -383,7 +383,7 @@ public class QuestionsWebService extends CoselmarWebServiceSupport { // Client is not allowed to see documents if (CoselmarUserRole.CLIENT == currentUser.getRole() - || (question.getClients() != null && question.getClients().contains(currentUser))) { + || (CoselmarUserRole.SUPERVISOR != currentUser.getRole() && question.getClients() != null && question.getClients().contains(currentUser))) { // clients does not have to see all documents result.setRelatedDocuments(null); diff --git a/coselmar-ui/src/main/webapp/views/documents/documents.html b/coselmar-ui/src/main/webapp/views/documents/documents.html index 9fe4165..bc97596 100644 --- a/coselmar-ui/src/main/webapp/views/documents/documents.html +++ b/coselmar-ui/src/main/webapp/views/documents/documents.html @@ -62,7 +62,7 @@ <td><span ng-repeat="keyword in document.keywords">{{keyword}} ,</span></td> <td>{{document.ownerName}}</td> <td>{{document.depositDate | date:'mediumDate'}}</td> - <td class="text-center">{{document.relatedQuestions.length || 0}}</td> + <td class="text-center">{{document.nbRelatedQuestions || 0}}</td> <td ng-if="currentUser.role == 'ADMIN'"><a class="btn btn-action btn-disable" ng-confirm-message="document.message.delete" ng-confirm-click="deleteDocument(document.id)"> diff --git a/coselmar-ui/src/main/webapp/views/documents/modalDocumentSearch.html b/coselmar-ui/src/main/webapp/views/documents/modalDocumentSearch.html index 227c9a2..9730d1d 100644 --- a/coselmar-ui/src/main/webapp/views/documents/modalDocumentSearch.html +++ b/coselmar-ui/src/main/webapp/views/documents/modalDocumentSearch.html @@ -50,7 +50,6 @@ <th>{{ 'document.metadata.keywords' | translate }}</th> <th>{{ 'document.metadata.depositor' | translate }}</th> <th>{{ 'document.metadata.depositDate' | translate }}</th> - <th>{{ 'document.metadata.relatedQuestions' | translate }}</th> <th></th> </tr> <tr ng-repeat="document in documents"> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm