branch feature/april updated (c029adc4 -> d4f4c521)
This is an automated email from the git hooks/post-receive script. New change to branch feature/april in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git from c029adc4 Fix build new 3a312eff Fix typo new 0539cb96 Can now edit choices in UI new d0f398ab Can add and delete choices in UI. Poll can be saved new f6f55bf7 refs #233 : PollCard ok new 8fd25d63 refs #233 : Fix missing questions and choices when getting saved poll new d4f4c521 refs #233 : Summary Ok The 6 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 d4f4c521af0a869e8e7768b4e0e2832e879f31ad Author: jcouteau <couteau@codelutin.com> Date: Tue Jan 8 12:17:00 2019 +0100 refs #233 : Summary Ok commit 8fd25d63f9f4375f6386d5c3dd1d252bea0785cd Author: jcouteau <couteau@codelutin.com> Date: Tue Jan 8 12:09:58 2019 +0100 refs #233 : Fix missing questions and choices when getting saved poll commit f6f55bf7cb50cd05bb537d9e90d59a6d7716836d Author: jcouteau <couteau@codelutin.com> Date: Tue Jan 8 11:06:48 2019 +0100 refs #233 : PollCard ok commit d0f398aba0a1745a99abb5be3dc905d8c5f34ebb Author: jcouteau <couteau@codelutin.com> Date: Tue Jan 8 10:53:31 2019 +0100 Can add and delete choices in UI. Poll can be saved commit 0539cb96f834dda800b96bf551a12dcc05df56dd Author: jcouteau <couteau@codelutin.com> Date: Tue Jan 8 09:50:10 2019 +0100 Can now edit choices in UI commit 3a312effea76a58b48316e19a8be1d0d238509fb Author: jcouteau <couteau@codelutin.com> Date: Wed Dec 26 11:32:04 2018 +0100 Fix typo Summary of changes: .../chorem/pollen/services/service/PollService.java | 7 +++++-- .../pollen/services/service/QuestionService.java | 5 +++++ pollen-ui-riot-js/src/main/web/js/PollForm.js | 4 ++-- pollen-ui-riot-js/src/main/web/js/PollService.js | 18 ++++++++++++++---- .../src/main/web/tag/components/Draggable.tag.html | 8 ++++---- .../src/main/web/tag/poll/Choices.tag.html | 8 ++++---- .../src/main/web/tag/poll/PollCard.tag.html | 4 ++-- .../src/main/web/tag/poll/Settings.tag.html | 4 ++-- .../src/main/web/tag/poll/Summary.tag.html | 2 +- 9 files changed, 39 insertions(+), 21 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 feature/april in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 3a312effea76a58b48316e19a8be1d0d238509fb Author: jcouteau <couteau@codelutin.com> Date: Wed Dec 26 11:32:04 2018 +0100 Fix typo --- pollen-ui-riot-js/src/main/web/tag/components/Draggable.tag.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/components/Draggable.tag.html b/pollen-ui-riot-js/src/main/web/tag/components/Draggable.tag.html index 6bb928d9..e8df5010 100644 --- a/pollen-ui-riot-js/src/main/web/tag/components/Draggable.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/components/Draggable.tag.html @@ -70,8 +70,8 @@ }; /*********************************** - ** Desktop Drage & Drop - *************************************/ + ** Desktop Drag & Drop + ************************************/ this.startDesktop = event => { this.startPosition(event.clientX, event.clientY); @@ -96,8 +96,8 @@ }; /*********************************** - ** Mobil Drage & Drop - *************************************/ + ** Mobil Drag & Drop + ************************************/ this.startModbil = event => { let touch = event.changedTouches[0]; -- 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 feature/april in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 0539cb96f834dda800b96bf551a12dcc05df56dd Author: jcouteau <couteau@codelutin.com> Date: Tue Jan 8 09:50:10 2019 +0100 Can now edit choices in UI --- pollen-ui-riot-js/src/main/web/tag/poll/Choices.tag.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Choices.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Choices.tag.html index 8b73225e..0b5e2f03 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Choices.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Choices.tag.html @@ -22,7 +22,7 @@ <Choices> <h4>{_t.title}</h4> <div class="choicesList" ref="choicesList"></div> - <Draggable each={choice, index in form.choices} + <Draggable each={choice, index in form.model.questions[0].choices} on-drop={dropChoice} ref="choicesDrag" class="choice-draggable"> @@ -149,7 +149,7 @@ let index = 0; choicesDrag.forEach(choice1 => { let choice1Y = choice1.getY(); - if (y > choice1Y) { // le choix est palcé strictement après + if (y > choice1Y) { // le choix est placé strictement après index = choice1.choice.choiceOrder + 1; } this.logger.log("drop :" + choice1Y + ", " + y + ", " + choice1.choice.choiceOrder + " ==> " + index); -- 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 feature/april in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit d0f398aba0a1745a99abb5be3dc905d8c5f34ebb Author: jcouteau <couteau@codelutin.com> Date: Tue Jan 8 10:53:31 2019 +0100 Can add and delete choices in UI. Poll can be saved --- pollen-ui-riot-js/src/main/web/js/PollForm.js | 4 ++-- pollen-ui-riot-js/src/main/web/js/PollService.js | 18 ++++++++++++++---- .../src/main/web/tag/poll/Choices.tag.html | 4 ++-- .../src/main/web/tag/poll/Settings.tag.html | 4 ++-- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/js/PollForm.js b/pollen-ui-riot-js/src/main/web/js/PollForm.js index f13c29b9..a64b24c7 100644 --- a/pollen-ui-riot-js/src/main/web/js/PollForm.js +++ b/pollen-ui-riot-js/src/main/web/js/PollForm.js @@ -207,7 +207,7 @@ class PollForm { addNewChoice(questionId) { this.model.questions.forEach((question) => { - if (question.id === questionId) { + if (question.id === questionId || question.id === null) { let choice; if (question.choices.length > 0) { let lastChoice = question.choices[question.choices.length - 1]; @@ -227,7 +227,7 @@ class PollForm { removeChoice(questionId, index) { this.model.questions.forEach((question) => { - if (question.id === questionId) { + if (question.id === questionId || question.id === null) { question.choices.splice(index, 1); } }); diff --git a/pollen-ui-riot-js/src/main/web/js/PollService.js b/pollen-ui-riot-js/src/main/web/js/PollService.js index 984a5202..c644cc8b 100644 --- a/pollen-ui-riot-js/src/main/web/js/PollService.js +++ b/pollen-ui-riot-js/src/main/web/js/PollService.js @@ -43,8 +43,13 @@ class PollService extends FetchService { let poll2 = Object.assign({}, poll); delete poll2.participant; delete poll2.votePeriod; - delete poll2.addChoices; - delete poll2.anonymousVote; + delete poll2.questions[0].addChoices; + delete poll2.questions[0].voteVisibility; + delete poll2.questions[0].anonymousVote; + delete poll2.questions[0].resultVisibility; + delete poll2.questions[0].continuousResults; + delete poll2.questions[0].commentVisibility; + delete poll2.voteCountingType; delete poll2.alreadyParticipants; delete poll2.limitChoices; let url = this._getUrlPrefix(); @@ -55,8 +60,13 @@ class PollService extends FetchService { let poll2 = Object.assign({}, poll); delete poll2.participant; delete poll2.votePeriod; - delete poll2.addChoices; - delete poll2.anonymousVote; + delete poll2.questions[0].addChoices; + delete poll2.questions[0].voteVisibility; + delete poll2.questions[0].anonymousVote; + delete poll2.questions[0].resultVisibility; + delete poll2.questions[0].continuousResults; + delete poll2.questions[0].commentVisibility; + delete poll2.voteCountingType; delete poll2.alreadyParticipants; delete poll2.limitChoices; let url = this._getUrlPrefix(poll.id); diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Choices.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Choices.tag.html index 0b5e2f03..642291b4 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Choices.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Choices.tag.html @@ -176,7 +176,7 @@ this.addOneChoice = () => { if (!this.form.hasVotes) { this.submit(); - this.form.addNewChoice(); + this.form.addNewChoice(0); this.update(); this.placeChoices(true); let choices = this.getChoicesDragTab() @@ -188,7 +188,7 @@ this.removeChoice = index => () => { if (!this.form.hasVotes) { - this.form.removeChoice(index); + this.form.removeChoice(0, index); this.compatChoiceOrders(); this.update(); this.placeChoices(true); 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 eace7e03..c8593bc2 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 @@ -194,12 +194,12 @@ import "../voteCountingType/MajorityJudgmentConfig.tag.html"; <MaxChoicesNumberConfig if={form.model.voteCountingType == 1 || form.model.voteCountingType == 4} ref="config" config={form.model.voteCountingConfig} - count-choices={form.choices.length} + count-choices={form.questions[0].choices.length} disabled={form.hasVotes || form.model.closed}/> <BordaConfig if={form.model.voteCountingType == 5} ref="config" config={form.model.voteCountingConfig} - count-choices={form.choices.length} + count-choices={form.questions[0].choices.length} disabled={form.hasVotes || form.model.closed}/> <CumulativeConfig if={form.model.voteCountingType == 2} ref="config" -- 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 feature/april in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit f6f55bf7cb50cd05bb537d9e90d59a6d7716836d Author: jcouteau <couteau@codelutin.com> Date: Tue Jan 8 11:06:48 2019 +0100 refs #233 : PollCard ok --- pollen-ui-riot-js/src/main/web/tag/poll/PollCard.tag.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/PollCard.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/PollCard.tag.html index 083ba258..3337c4ad 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/PollCard.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/PollCard.tag.html @@ -60,9 +60,9 @@ import "../components/Avatar.tag.html"; <span class="poll-votes"> <a href="#poll/{opts.poll.id}/vote/{opts.poll.permission}"> - {opts.poll.voteCount === 0 ? _t.noVote : (opts.poll.voteCount + " " + (count === 1 ? _t.vote : _t.votes))} + {opts.poll.questions[0].voteCount === 0 ? _t.noVote : (opts.poll.questions[0].voteCount + " " + (count === 1 ? _t.vote : _t.votes))} </a> - <a if={opts.poll.maxVoters > 0 &&opts.poll.voteCount > opts.poll.maxVoters} + <a if={opts.poll.maxVoters > 0 &&opts.poll.questions[0].voteCount > opts.poll.maxVoters} class="c-badge c-badge--rounded c-badge--warning" onclick={toggleMaxVoters}>{_l("maxVoters", opts.poll.maxVoters)} </a> -- 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 feature/april in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 8fd25d63f9f4375f6386d5c3dd1d252bea0785cd Author: jcouteau <couteau@codelutin.com> Date: Tue Jan 8 12:09:58 2019 +0100 refs #233 : Fix missing questions and choices when getting saved poll --- .../main/java/org/chorem/pollen/services/service/PollService.java | 7 +++++-- .../java/org/chorem/pollen/services/service/QuestionService.java | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) 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 d6e87458..d10e0b32 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 @@ -21,13 +21,11 @@ package org.chorem.pollen.services.service; * #L% */ -import com.google.common.base.Joiner; import com.google.common.collect.Lists; import com.google.common.collect.Sets; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateUtils; -import org.chorem.pollen.persistence.entity.Choice; import org.chorem.pollen.persistence.entity.ChoiceType; import org.chorem.pollen.persistence.entity.Poll; import org.chorem.pollen.persistence.entity.PollType; @@ -135,6 +133,11 @@ public class PollService extends PollenServiceSupport { } } + /** Questions and choices **/ + QuestionService questionService = getQuestionService(); + List<QuestionBean> questions = questionService.getQuestions(bean.getEntityId()); + bean.setQuestions(questions); + if (isNotPermitted(PollenPermissions.edit(entity))) { bean.setPermission(null); bean.setCreatorEmail(null); diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/service/QuestionService.java b/pollen-services/src/main/java/org/chorem/pollen/services/service/QuestionService.java index 2d4b6774..c19fca5a 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/service/QuestionService.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/service/QuestionService.java @@ -47,6 +47,11 @@ public class QuestionService extends PollenServiceSupport { bean.setCreateDate(entity.getTopiaCreateDate()); bean.setVoteCountingConfig(getVoteCountingService().getVoteCountingConfig(entity)); + /** Questions and choices **/ + ChoiceService choiceService = getChoiceService(); + List<ChoiceBean> choices = choiceService.getChoices(bean.getEntityId()); + bean.setChoices(choices); + if (isNotPermitted(PollenPermissions.edit(entity))) { bean.setPermission(null); -- 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 feature/april in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit d4f4c521af0a869e8e7768b4e0e2832e879f31ad Author: jcouteau <couteau@codelutin.com> Date: Tue Jan 8 12:17:00 2019 +0100 refs #233 : Summary Ok --- pollen-ui-riot-js/src/main/web/tag/poll/Summary.tag.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Summary.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Summary.tag.html index a933ad72..214fa7df 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Summary.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Summary.tag.html @@ -41,7 +41,7 @@ <div class="summary-part"> <h3>{_t.choices}</h3> - <div each={choice, index in opts.form.choices} class="{odd-row: index % 2 > 0}"> + <div each={choice, index in opts.form.model.questions[0].choices} class="{odd-row: index % 2 > 0}"> <ChoiceView choice={choice} showdescription="true" hidereport="true"/> </div> </div> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm