This is an automated email from the git hooks/post-receive script. New commit to branch feature/april in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit ef820b701db338b62f55e7d67b5c8960024077c6 Author: jcouteau <couteau@codelutin.com> Date: Thu Jan 10 13:47:10 2019 +0100 refs #233 : Votes Table is now ok --- .../src/main/java/org/chorem/pollen/rest/api/v1/VoteApi.java | 2 +- pollen-ui-riot-js/src/main/web/js/Poll.js | 3 ++- pollen-ui-riot-js/src/main/web/tag/poll/Votes.tag.html | 2 +- pollen-ui-riot-js/src/main/web/tag/poll/VotesTable.tag.html | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/VoteApi.java b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/VoteApi.java index adb3be41..e8cea259 100644 --- a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/VoteApi.java +++ b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/VoteApi.java @@ -59,7 +59,7 @@ public class VoteApi { @GET public PaginationResultBean<VoteBean> getVotes(@Context VoteService voteService, @PathParam("pollId") PollenEntityId<Poll> pollId, - @PathParam("questionId") PollenEntityId<Poll> questionId, + @PathParam("questionId") PollenEntityId<Question> questionId, @BeanParam PaginationParameterBean paginationParameter) { return voteService.getVotes(pollId.getEntityId(), questionId.getEntityId(), paginationParameter); 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 73094c00..e8bc808f 100644 --- a/pollen-ui-riot-js/src/main/web/js/Poll.js +++ b/pollen-ui-riot-js/src/main/web/js/Poll.js @@ -127,7 +127,8 @@ class Poll { if (this._initPromise) { return voteService.getVotes(this.id, questionId, pagination, this.getPermission()).then((result) => { if (this.voteIsVisible) { - this.voteCount = result.pagination.count; + //TODO JC190110-Should use questionId + this.questions[0].voteCount = result.pagination.count; } return result; }); diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Votes.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Votes.tag.html index 22e4e859..a9e0443a 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Votes.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Votes.tag.html @@ -69,7 +69,7 @@ </form> <!-- Show votes --> - <VotesTable if="{poll.voteCount > 0}" on-edit-vote={editVote}/> + <VotesTable if="{poll.questions[0] && poll.questions[0].voteCount > 0}" on-edit-vote={editVote}/> </div> diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/VotesTable.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/VotesTable.tag.html index e6cfed79..b118c2e3 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/VotesTable.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/VotesTable.tag.html @@ -114,7 +114,7 @@ }; this.lazyLoad = pagination => { - return this.poll.loadLazyVotes(pagination).then((result) => { + return this.poll.loadLazyVotes(this.poll.questions[0].id, pagination).then((result) => { this.loaded = result.pagination.count > 0; this.update(); return result; -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.