branch develop updated (f15c7cf -> 921300a)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git from f15c7cf wording + modification de la conf de notification d'un sondage : boolean au lieu d'une enum (il n'y avait plus que 2 valeurs pour l'énum) new 3105f48 modification de libellé, correction sur les doit les lecture de commentaire new 921300a utilisation de la ShortTopiaIdFactory pour avoir des URLs plus courtes 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 921300ad454b6c5cebd603bf5786e5e432b375f3 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Wed May 31 13:34:36 2017 +0200 utilisation de la ShortTopiaIdFactory pour avoir des URLs plus courtes commit 3105f48b3cb90b68a7001e032a7228ccc92c6249 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Wed May 31 11:03:56 2017 +0200 modification de libellé, correction sur les doit les lecture de commentaire Summary of changes: .../src/main/resources/pollen-rest-api.properties | 1 + .../org/chorem/pollen/services/bean/PollenEntityId.java | 6 ++---- .../org/chorem/pollen/services/service/CommentService.java | 4 +++- .../org/chorem/pollen/services/service/PollService.java | 10 ++++++---- pollen-ui-riot-js/src/main/web/i18n.json | 6 ++++-- pollen-ui-riot-js/src/main/web/js/Poll.js | 4 ++++ pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag.html | 13 ++++++------- pollen-ui-riot-js/src/main/web/tag/poll/Settings.tag.html | 2 +- 8 files changed, 27 insertions(+), 19 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 develop in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 3105f48b3cb90b68a7001e032a7228ccc92c6249 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Wed May 31 11:03:56 2017 +0200 modification de libellé, correction sur les doit les lecture de commentaire --- .../org/chorem/pollen/services/service/CommentService.java | 4 +++- .../org/chorem/pollen/services/service/PollService.java | 10 ++++++---- pollen-ui-riot-js/src/main/web/i18n.json | 6 ++++-- pollen-ui-riot-js/src/main/web/js/Poll.js | 4 ++++ pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag.html | 13 ++++++------- pollen-ui-riot-js/src/main/web/tag/poll/Settings.tag.html | 2 +- 6 files changed, 24 insertions(+), 15 deletions(-) diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/service/CommentService.java b/pollen-services/src/main/java/org/chorem/pollen/services/service/CommentService.java index 4267231..fd9fcd8 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/service/CommentService.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/service/CommentService.java @@ -56,6 +56,7 @@ public class CommentService extends PollenServiceSupport { public PaginationResultBean<CommentBean> getComments(String pollId, PaginationParameterBean paginationParameter) { checkNotNull(pollId); + checkPermission(PermissionVerb.readComment, pollId); Poll poll = getPollService().getPoll0(pollId); PaginationParameter page = getPaginationParameter(paginationParameter); @@ -69,6 +70,7 @@ public class CommentService extends PollenServiceSupport { public long getCommentCount(String pollId) { checkNotNull(pollId); + checkPermission(PermissionVerb.readComment, pollId); Poll poll = getPollService().getPoll0(pollId); @@ -79,7 +81,7 @@ public class CommentService extends PollenServiceSupport { checkNotNull(pollId); checkNotNull(commentId); - checkPermission(PermissionVerb.readComment, commentId); + checkPermission(PermissionVerb.readComment, pollId); Poll poll = getPollService().getPoll0(pollId); diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/service/PollService.java b/pollen-services/src/main/java/org/chorem/pollen/services/service/PollService.java index 6c67065..143408d 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/service/PollService.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/service/PollService.java @@ -73,7 +73,8 @@ public class PollService extends PollenServiceSupport { } - input.setCommentIsVisible(isPermitted(PermissionVerb.readComment, input.getEntityId())); + boolean commentIsVisible = isPermitted(PermissionVerb.readComment, input.getEntityId()); + input.setCommentIsVisible(commentIsVisible); input.setVoteIsVisible(isPermitted(PermissionVerb.readVote, input.getEntityId())); @@ -91,9 +92,10 @@ public class PollService extends PollenServiceSupport { && isPermitted(PermissionVerb.addVote, input.getEntityId()); input.setCanVote(canVote); - - long commentCount = getCommentService().getCommentCount(input.getEntityId()); - input.setCommentCount(commentCount); + if (commentIsVisible) { + long commentCount = getCommentService().getCommentCount(input.getEntityId()); + input.setCommentCount(commentCount); + } long voteCount = getVoteService().getVoteCount(input.getEntityId()); input.setVoteCount(voteCount); long participantCount = getVoterListService().getVoterListMemberCount(input.getEntityId()); diff --git a/pollen-ui-riot-js/src/main/web/i18n.json b/pollen-ui-riot-js/src/main/web/i18n.json index 96f1a5d..43b27fb 100644 --- a/pollen-ui-riot-js/src/main/web/i18n.json +++ b/pollen-ui-riot-js/src/main/web/i18n.json @@ -43,8 +43,9 @@ "poll_noVote": "aucun vote", "poll_vote": "vote", "poll_votes": "votes", + "poll_subscribers": "invités", "poll_participants": "participants", - "poll_abstention": "d'abstention", + "poll_participation": "de participation", "poll_closedFrom": "Fermé depuis le", "poll_urlForAdmin" : "Administrer ce sondage avec cette adresse", "poll_urlForVote" : "Inviter de nouveaux participants en leur envoyant cette adresse", @@ -478,8 +479,9 @@ "poll_noVote": "no vote", "poll_vote": "vote", "poll_votes": "votes", + "poll_subscribers": "subscribers", "poll_participants": "participants", - "poll_abstention": "of abstention", + "poll_participation": "of participation", "poll_closedFrom": "Closing from", "poll_urlForAdmin" : "Administrate poll with this address", "poll_urlForVote" : "Invited new participants with this address", diff --git a/pollen-ui-riot-js/src/main/web/js/Poll.js b/pollen-ui-riot-js/src/main/web/js/Poll.js index 8388528..1ffb91c 100644 --- a/pollen-ui-riot-js/src/main/web/js/Poll.js +++ b/pollen-ui-riot-js/src/main/web/js/Poll.js @@ -41,6 +41,10 @@ class Poll { return this._initPromise; } + getPermission() { + return this.permission || this.votePermission; + } + reloadPoll() { return pollService.getPoll(this.id, this.permission || this.votePermission).then(result => { Object.assign(this, result); diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag.html index 4676deb..c354261 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag.html @@ -9,18 +9,18 @@ require("../popup/QrCodeButton.tag.html"); <div class="tabs"> <div class={tab : true, selected : selectedTab === "votes"}> - <a href="#poll/{poll.id}/vote{poll.permission?'/' + poll.permission : ''}"> + <a href="#poll/{poll.id}/vote{poll.getPermission()?'/' + poll.getPermission() : ''}"> <i class="fa fa-thumbs-o-up fa-flip-horizontal fa-15x"></i> {__.votes} ({poll.voteCount}) </a> </div> <div class={tab : true, selected : selectedTab === "results"}> - <a href="#poll/{poll.id}/result{poll.permission?'/' + poll.permission : ''}"> + <a href="#poll/{poll.id}/result{poll.getPermission()?'/' + poll.getPermission() : ''}"> <i class="fa fa-trophy fa-15x"></i> {__.results} </a> </div> <div class={tab : true, selected : selectedTab === "comments"}> - <a href="#poll/{poll.id}/comment{poll.permission?'/' + poll.permission : ''}"> - <i class="fa fa-comments-o fa-15x"></i> {__.comments} ({poll.commentCount}) + <a href="#poll/{poll.id}/comment{poll.getPermission()?'/' + poll.getPermission() : ''}"> + <i class="fa fa-comments-o fa-15x"></i> {__.comments} <span if={poll.commentIsVisible}>({poll.commentCount})</span> </a> </div> @@ -159,8 +159,8 @@ require("../popup/QrCodeButton.tag.html"); <span if={poll.voteCount === 1}>1 {__.vote}</span> <span if={poll.voteCount > 1}>{poll.voteCount} {__.votes}</span> <span if={poll.pollType === "RESTRICTED"}> - - {poll.participantCount} {__.participants} - - {((1 - poll.voteCount / poll.participantCount) * 100).toFixed(2)} % {__.abstention}</span> + - {poll.participantCount} {__.subscribers} + - {((poll.voteCount / poll.participantCount) * 100).toFixed(2)} % {__.participation}</span> <span if={poll.status === "VOTING" && poll.endDate}> {__.votingTo} {formatDate(poll.endDate)}</span> <span if={poll.status === "CLOSED" && poll.endDate}> {__.closedFrom} {formatDate(poll.endDate)}</span> </div> @@ -221,7 +221,6 @@ require("../popup/QrCodeButton.tag.html"); this.confirm(this.__.deletePoll).then((confirm) => { if (confirm) { this.poll.delete().then(() => { - let route = require("riot-route"); route("/home"); }); } diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Settings.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Settings.tag.html index 74fcef8..2b44bde 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Settings.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Settings.tag.html @@ -410,7 +410,7 @@ require("../components/date-time-picker.tag.html"); this.updateVoteCountingTypeHelp(); }; - this.toggleNotifyMeBeforePollEnds = e => { + this.toggleNotifyMeBeforePollEnds = () => { if (!this.notifyMeBeforePollEnds) { this.refs.notifyMeHoursBeforePollEnds = undefined; } -- 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 develop in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 921300ad454b6c5cebd603bf5786e5e432b375f3 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Wed May 31 13:34:36 2017 +0200 utilisation de la ShortTopiaIdFactory pour avoir des URLs plus courtes --- pollen-rest-api/src/main/resources/pollen-rest-api.properties | 1 + .../main/java/org/chorem/pollen/services/bean/PollenEntityId.java | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pollen-rest-api/src/main/resources/pollen-rest-api.properties b/pollen-rest-api/src/main/resources/pollen-rest-api.properties index 66f7e5d..4e3951b 100644 --- a/pollen-rest-api/src/main/resources/pollen-rest-api.properties +++ b/pollen-rest-api/src/main/resources/pollen-rest-api.properties @@ -29,3 +29,4 @@ hibernate.connection.provider_class=org.hibernate.hikaricp.internal.HikariCPConn hibernate.hikari.minimumIdle=2 hibernate.hikari.maximumPoolSize=20 hibernate.hikari.autoCommit=false +topia.persistence.topiaIdFactoryClassName=org.nuiton.topia.persistence.internal.ShortTopiaIdFactory diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/bean/PollenEntityId.java b/pollen-services/src/main/java/org/chorem/pollen/services/bean/PollenEntityId.java index cec4f31..0fc6801 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/bean/PollenEntityId.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/bean/PollenEntityId.java @@ -21,7 +21,6 @@ package org.chorem.pollen.services.bean; * #L% */ -import org.apache.commons.codec.binary.Base64; import org.apache.commons.lang3.StringUtils; import org.nuiton.topia.persistence.TopiaEntity; import org.nuiton.topia.persistence.TopiaIdFactory; @@ -61,7 +60,7 @@ public class PollenEntityId<E extends TopiaEntity> { public static String encode(TopiaIdFactory topiaIdFactory, String entityId) { String randomPart = topiaIdFactory.getRandomPart(entityId); - return new String(Base64.encodeBase64URLSafe(randomPart.getBytes())); + return randomPart; } @@ -112,8 +111,7 @@ public class PollenEntityId<E extends TopiaEntity> { if (reducedId != null && !isTemporaryId()) { - String decodedId = new String(Base64.decodeBase64(reducedId)); - String id = topiaIdFactory.newTopiaId(entityType, decodedId); + String id = topiaIdFactory.newTopiaId(entityType, reducedId); setEntityId(id); } -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm