branch feature/multi-ui updated (2d4566d9 -> 219dfb99)
This is an automated email from the git hooks/post-receive script. New change to branch feature/multi-ui in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git from 2d4566d9 Tab index new 7a7033fb Fix votes lazy loading new 6c285d92 Fix undefined error new 364a9c90 Refs #235 - backport @bleny fix on multiquestion new c2737404 Update header showing new 008abb76 Show buttons only on multi new e51c8e35 Question description on multi new e700547a Fix label update bug on init new 6802c82a Fix VotesTable loading (still some hickups in some configurations) new 7c0fb4af GTU validation in multi/invited poll new 219dfb99 GTU validation and name keeping in multi poll The 10 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 219dfb99c86cf562ee8765907e80f68fbc14ab98 Author: jcouteau <couteau@codelutin.com> Date: Tue Oct 29 13:59:29 2019 +0100 GTU validation and name keeping in multi poll commit 7c0fb4af5d12887aa6327faea51dc00c00a053d7 Author: jcouteau <couteau@codelutin.com> Date: Tue Oct 29 11:35:00 2019 +0100 GTU validation in multi/invited poll commit 6802c82a567771fcefc256384311697e185f55ff Author: jcouteau <couteau@codelutin.com> Date: Tue Oct 29 11:14:09 2019 +0100 Fix VotesTable loading (still some hickups in some configurations) commit e700547a479112e6eb3dd0232331645c24c2321e Author: jcouteau <couteau@codelutin.com> Date: Mon Oct 28 10:42:17 2019 +0100 Fix label update bug on init commit e51c8e353ea9f6ff5fc432cf5f2975f35ffa50b1 Author: jcouteau <couteau@codelutin.com> Date: Mon Oct 28 10:41:45 2019 +0100 Question description on multi commit 008abb7645e49b4343e4b80d4173b1fbe86be08d Author: jcouteau <couteau@codelutin.com> Date: Mon Oct 28 10:07:29 2019 +0100 Show buttons only on multi commit c2737404919749604b4c3bdc3a6567c1da1c048d Author: jcouteau <couteau@codelutin.com> Date: Mon Oct 28 10:04:30 2019 +0100 Update header showing commit 364a9c90ba90f005455c1e0e601c50f0c83fbdfc Author: jcouteau <couteau@codelutin.com> Date: Fri Oct 25 11:34:05 2019 +0200 Refs #235 - backport @bleny fix on multiquestion commit 6c285d9223546101196edcedafe317d43de3ac89 Author: jcouteau <couteau@codelutin.com> Date: Wed Oct 23 14:47:07 2019 +0200 Fix undefined error commit 7a7033fb8ecf309cfbd1321cc2e3794ea38e93c0 Author: jcouteau <couteau@codelutin.com> Date: Wed Oct 23 12:07:24 2019 +0200 Fix votes lazy loading Summary of changes: pollen-ui-riot-js/src/main/web/js/Poll.js | 63 +++++++++++----------- pollen-ui-riot-js/src/main/web/js/PollService.js | 2 + .../web/tag/components/MultiLineLabel.tag.html | 7 ++- .../src/main/web/tag/poll/EditVote.tag.html | 43 +++++++++++++-- .../src/main/web/tag/poll/EditVoteOrder.tag.html | 10 +++- .../src/main/web/tag/poll/Vote.tag.html | 7 ++- .../src/main/web/tag/poll/Votes.tag.html | 9 ++-- .../src/main/web/tag/poll/VotesTable.tag.html | 24 ++++++++- 8 files changed, 117 insertions(+), 48 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/multi-ui in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 7a7033fb8ecf309cfbd1321cc2e3794ea38e93c0 Author: jcouteau <couteau@codelutin.com> Date: Wed Oct 23 12:07:24 2019 +0200 Fix votes lazy loading --- pollen-ui-riot-js/src/main/web/js/Poll.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 5cd74842..6d82ac6c 100644 --- a/pollen-ui-riot-js/src/main/web/js/Poll.js +++ b/pollen-ui-riot-js/src/main/web/js/Poll.js @@ -131,8 +131,11 @@ class Poll { if (this._initPromise) { return voteService.getVotes(this.id, questionId, pagination, this.getPermission()).then((result) => { if (this.voteIsVisible) { - //TODO JC190110-Should use questionId - this.questions[0].voteCount = result.pagination.count; + this.questions.forEach((question) => { + if (question.id === questionId) { + question.voteCount = result.pagination.count; + } + }); } return result; }); -- 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/multi-ui in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 6c285d9223546101196edcedafe317d43de3ac89 Author: jcouteau <couteau@codelutin.com> Date: Wed Oct 23 14:47:07 2019 +0200 Fix undefined error --- pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html index 9f397532..fd033f8b 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html @@ -280,10 +280,10 @@ if (!input) { return 0; } - if (this.question.voteCountingTypeValue.renderType === "text") { + if (this.question.voteCountingTypeValue && this.question.voteCountingTypeValue.renderType === "text") { return input.value; } - if (this.question.voteCountingTypeValue.renderType === "select") { + if (this.question.voteCountingTypeValue && this.question.voteCountingTypeValue.renderType === "select") { return input.find(option => option.selected).value; } return input.checked ? 1 : 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/multi-ui in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 364a9c90ba90f005455c1e0e601c50f0c83fbdfc Author: jcouteau <couteau@codelutin.com> Date: Fri Oct 25 11:34:05 2019 +0200 Refs #235 - backport @bleny fix on multiquestion --- pollen-ui-riot-js/src/main/web/js/PollService.js | 2 ++ 1 file changed, 2 insertions(+) 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 644aa7b3..b8a31693 100644 --- a/pollen-ui-riot-js/src/main/web/js/PollService.js +++ b/pollen-ui-riot-js/src/main/web/js/PollService.js @@ -50,6 +50,7 @@ class PollService extends FetchService { delete question.resultVisibility; delete question.continuousResults; delete question.commentVisibility; + delete question.voteCountingConfig.pointsByRankDefault; if (question.id === "") { delete question.id; } @@ -72,6 +73,7 @@ class PollService extends FetchService { delete question.resultVisibility; delete question.continuousResults; delete question.commentVisibility; + delete question.voteCountingConfig.pointsByRankDefault; if (question.id === "") { delete question.id; } -- 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/multi-ui in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit c2737404919749604b4c3bdc3a6567c1da1c048d Author: jcouteau <couteau@codelutin.com> Date: Mon Oct 28 10:04:30 2019 +0100 Update header showing --- pollen-ui-riot-js/src/main/web/tag/poll/VotesTable.tag.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 16ee6320..d09bdbb1 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 @@ -132,7 +132,7 @@ this.updateShowChoiceContainer = () => { let results0 = this.refs.lazyLoad && this.refs.lazyLoad.refs.results0; - this.showChoiceHeader = results0 && this.poll.choices && results0.offsetWidth / this.poll.choices.length >= MIN_CHOICE_COLUMN_WIDTH; + this.showChoiceHeader = results0 && this.question.choices && results0.offsetWidth / this.question.choices.length >= MIN_CHOICE_COLUMN_WIDTH; }; this.onQuestionChange = question2 => { -- 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/multi-ui in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 008abb7645e49b4343e4b80d4173b1fbe86be08d Author: jcouteau <couteau@codelutin.com> Date: Mon Oct 28 10:07:29 2019 +0100 Show buttons only on multi --- pollen-ui-riot-js/src/main/web/tag/poll/Votes.tag.html | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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 9a72258d..fd816e91 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 @@ -25,7 +25,8 @@ class="c-button c-button--info" tabindex="1" onclick={previousQuestion} - disabled={questionToVote === 0}> + disabled={questionToVote === 0} + show={this.poll.questions.length > 1}> <i class="fa fa-chevron-left " aria-hidden="true"></i> {_t.previousQuestion} </button> @@ -34,7 +35,8 @@ class="c-button c-button--info" tabindex="2" onclick={nextQuestion} - disabled={questionToVote === poll.questions.length - 1}> + disabled={questionToVote === poll.questions.length - 1} + show={this.poll.questions.length > 1}> {_t.nextQuestion} <i class="fa fa-chevron-right " aria-hidden="true"></i> </button> @@ -66,9 +68,6 @@ this.bus.trigger("multi", this.poll.questions.length > 1); } this.question = this.poll.questions[this.questionToVote]; - if (this.question) { - this.bus.trigger("question", this.question); - } this.update(); }; -- 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/multi-ui in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit e51c8e353ea9f6ff5fc432cf5f2975f35ffa50b1 Author: jcouteau <couteau@codelutin.com> Date: Mon Oct 28 10:41:45 2019 +0100 Question description on multi --- pollen-ui-riot-js/src/main/web/tag/poll/Vote.tag.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Vote.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Vote.tag.html index 58a3219a..27874f72 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Vote.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Vote.tag.html @@ -21,9 +21,14 @@ <Vote> <div class="container" show="{loaded}"> - <h2 class="align-center">Question {parent.questionToVote + 1}/{poll.questions.length} :</h2> + <h2 class="align-center" if={this.poll.questions.length > 1}>Question {parent.questionToVote + 1}/{poll.questions.length} :</h2> <h2 if="{question}" class="align-center">{question.title}</h2> + <div class="poll-description left-icon" if="{question && question.description}"> + <i class="fa fa-info-circle" aria-hidden="true"></i> + <p><MultiLineLabel label="{question.description}"></MultiLineLabel></p> + </div> + <span class="c-input-group actions-right" if={isVoteByOrder}> <button class="c-button c-button--info {c-button--ghost-info: !voteClickAndDrop, c-button--info: voteClickAndDrop}" -- 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/multi-ui in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit e700547a479112e6eb3dd0232331645c24c2321e Author: jcouteau <couteau@codelutin.com> Date: Mon Oct 28 10:42:17 2019 +0100 Fix label update bug on init --- .../src/main/web/tag/components/MultiLineLabel.tag.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/components/MultiLineLabel.tag.html b/pollen-ui-riot-js/src/main/web/tag/components/MultiLineLabel.tag.html index aab89abf..bc78d773 100644 --- a/pollen-ui-riot-js/src/main/web/tag/components/MultiLineLabel.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/components/MultiLineLabel.tag.html @@ -23,7 +23,7 @@ <span ref="label"></span> <script> - this.on("update", () => { + this.updateLabel = () => { let labelText; if (this.opts.label) { labelText = this.opts.label; @@ -31,7 +31,10 @@ labelText = ""; } this.refs.label.innerText = labelText; - }); + }; + + this.on("mount", this.updateLabel); + this.on("update", this.updateLabel); </script> </MultiLineLabel> -- 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/multi-ui in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 6802c82a567771fcefc256384311697e185f55ff Author: jcouteau <couteau@codelutin.com> Date: Tue Oct 29 11:14:09 2019 +0100 Fix VotesTable loading (still some hickups in some configurations) --- pollen-ui-riot-js/src/main/web/js/Poll.js | 56 +++++++++++----------- .../src/main/web/tag/poll/EditVote.tag.html | 27 ++++++++++- .../src/main/web/tag/poll/VotesTable.tag.html | 22 ++++++++- 3 files changed, 74 insertions(+), 31 deletions(-) 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 6d82ac6c..1c6b6abf 100644 --- a/pollen-ui-riot-js/src/main/web/js/Poll.js +++ b/pollen-ui-riot-js/src/main/web/js/Poll.js @@ -167,27 +167,34 @@ class Poll { promises.push(voteService.getNewVote(this.id, questionId, this.getPermission())); } return Promise.all(promises).then(resultsArray => { - let indexResult = 0; - this.choices = resultsArray[indexResult++]; - this.choiceCount = this.choices.length; - this.voteCountingTypeValue = resultsArray[indexResult++]; + this.questions.forEach(function(question) { + if (questionId === question.id) { + let indexResult = 0; + question.choices = resultsArray[indexResult++]; + question.choiceCount = this.choices.length; - if (this.resultIsVisible) { - this.results = resultsArray[indexResult++]; - this.choices.forEach(choice => { - choice.score = this.results.scores.find(score => score.choiceId === choice.id); - }); - } + question.voteCountingTypeValue = resultsArray[indexResult++]; - if (this.canVote) { - this.voterName = resultsArray[indexResult++].voterName; - } + if (this.resultIsVisible) { + question.results = resultsArray[indexResult++]; + question.choices.forEach(choice => { + choice.score = question.results.scores.find(score => score.choiceId === choice.id); + }); + } - pageTracker.trackPoll(); + if (this.canVote) { + this.voterName = resultsArray[indexResult++].voterName; + } + + pageTracker.trackPoll(); + + bus.trigger("question", question); + return Promise.resolve(this); + } + }); - bus.trigger("poll", this); - return Promise.resolve(this); + return Promise.reject(); }); } return Promise.reject("Init poll after load questions"); @@ -214,6 +221,7 @@ class Poll { let voteChoice = this.getVoteChoice(vote, choice); let value = voteChoice && voteChoice.voteValue; if (this.voteCountingType === 8) { + //TODO voteCountingConfig et voteCountingType sont sur la question et pas le poll value = this.voteCountingConfig.grades[value]; } return value; @@ -227,23 +235,20 @@ class Poll { choiceService.getChoices(this.id, questionId, this.getPermission()), resultService.getResults(this.id, questionId, this.getPermission())]) .then(resultsArray => { - this.choices = resultsArray[0]; - this.choiceCount = this.choices.length; - var _this = this; this.questions.forEach(function(question) { if (questionId === question.id) { + question.choices = resultsArray[0]; + question.choiceCount = question.choices.length; question.results = resultsArray[1]; question.choices.forEach(choice => { choice.score = question.results.scores.find(score => score.choiceId === choice.id); }); - - _this.question = question; + bus.trigger("question", question); } }); pageTracker.trackResults(); - bus.trigger("question", this.question); return Promise.resolve(this); }); } @@ -422,13 +427,6 @@ class Poll { return Promise.reject("Init poll after ignore report"); } - loadVoteCountingType() { - voteCountingTypeService.getVoteCountingType(this.questions[0].voteCountingType).then((voteCountingTypeValue) => { - this.questions[0].voteCountingTypeValue = voteCountingTypeValue; - bus.trigger("poll", this); - }); - } - getInvalidEmails() { if (this.id) { return pollService.getInvalidEmails(this.id, this.permission); diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html index fd033f8b..9a973a9e 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html @@ -229,6 +229,32 @@ this.multi = multi2; }; + this.onPollChange = poll2 => { + this.poll = poll2; + this.question = this.poll.questions[0]; + if (this.question) { + if (!this.question.voteCountingTypeValue) { + this.poll.reloadVoteCountingTypeValue(this.question).then(() => { + this.pollTypeCheckbox = this.question.voteCountingTypeValue && this.question.voteCountingTypeValue.renderType === "checkbox"; + this.pollTypeSelect = this.question.voteCountingTypeValue && this.question.voteCountingTypeValue.renderType === "select"; + this.pollTypeCoombs = this.question.voteCountingType && this.question.voteCountingType === 7; + }); + } else { + this.pollTypeCheckbox = this.question.voteCountingTypeValue && this.question.voteCountingTypeValue.renderType === "checkbox"; + this.pollTypeSelect = this.question.voteCountingTypeValue && this.question.voteCountingTypeValue.renderType === "select"; + this.pollTypeCoombs = this.question.voteCountingType && this.question.voteCountingType === 7; + } + this.resultsLoaded = this.question.results !== undefined; + if (!this.resultsLoaded) { + this.poll.loadResults(this.question.id).then(() => { + }); + } + this.onVoteChanged(); + } + this.update(); + }; + + this.listen("poll", this.onPollChange); this.listen("question", this.onQuestionChange); this.listen("multi", this.onMultiChange); this.listen("user", (user, oldUser) => { @@ -400,7 +426,6 @@ this.voteInEdition = null; this.resetVoteForm(); if (this.multi) { - this.update(); this.parent.parent.nextQuestion(); } else { this.update(); 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 d09bdbb1..8367e683 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 @@ -110,6 +110,18 @@ this.question = this.opts.question; + this.loadVoteCountingTypeValue = () => { + if (!this.question.voteCountingTypeValue) { + this.poll.reloadVoteCountingTypeValue(this.question).then(() => { + this.pollTypeCheckbox = this.question.voteCountingTypeValue && this.question.voteCountingTypeValue.renderType === "checkbox"; + this.update(); + }); + } else { + this.pollTypeCheckbox = this.question.voteCountingTypeValue && this.question.voteCountingTypeValue.renderType === "checkbox"; + } + }; + + this.pagination = { order: "topiaCreateDate", desc: true @@ -137,7 +149,8 @@ this.onQuestionChange = question2 => { this.question = question2; - this.pollTypeCheckbox = question2.voteCountingTypeValue && question2.voteCountingTypeValue.renderType === "checkbox"; + this.loadVoteCountingTypeValue(); + this.lazyLoad(this.pagination); this.refresh(); this.update(); }; @@ -228,6 +241,13 @@ } }; + this.on('mount', function() { + //first load + //FIXME JC191023 Ça semble pas être la bonne façon de faire :( mais ça marche ! + this.loadVoteCountingTypeValue(); + this.refresh(); + }) + </script> <style> -- 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/multi-ui in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 7c0fb4af5d12887aa6327faea51dc00c00a053d7 Author: jcouteau <couteau@codelutin.com> Date: Tue Oct 29 11:35:00 2019 +0100 GTU validation in multi/invited poll --- pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html | 3 ++- pollen-ui-riot-js/src/main/web/tag/poll/EditVoteOrder.tag.html | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html index 9a973a9e..1eaf428e 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html @@ -369,7 +369,8 @@ this.mustValidateGtuToVote = () => { let anonymousAlreadyVoted = this.voteInEdition; let voterIsRegistered = this.session.isConnected(); - let gtuAlreadyValidated = anonymousAlreadyVoted || voterIsRegistered; + let gtuValidatedInPoll = this.poll.gtuValidated; + let gtuAlreadyValidated = anonymousAlreadyVoted || voterIsRegistered || gtuValidatedInPoll; let mustValidateGtuToVote = !gtuAlreadyValidated; return mustValidateGtuToVote; }; diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/EditVoteOrder.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/EditVoteOrder.tag.html index 05a0684b..81ccc462 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/EditVoteOrder.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/EditVoteOrder.tag.html @@ -390,7 +390,8 @@ this.mustValidateGtuToVote = () => { let anonymousAlreadyVoted = this.voteInEdition; let voterIsRegistered = this.session.isConnected(); - let gtuAlreadyValidated = anonymousAlreadyVoted || voterIsRegistered; + let gtuValidatedInPoll = this.poll.gtuValidated; + let gtuAlreadyValidated = anonymousAlreadyVoted || voterIsRegistered || gtuValidatedInPoll; let mustValidateGtuToVote = !gtuAlreadyValidated; return mustValidateGtuToVote; }; -- 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/multi-ui in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 219dfb99c86cf562ee8765907e80f68fbc14ab98 Author: jcouteau <couteau@codelutin.com> Date: Tue Oct 29 13:59:29 2019 +0100 GTU validation and name keeping in multi poll --- pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html | 11 +++++++++-- .../src/main/web/tag/poll/EditVoteOrder.tag.html | 9 +++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html index 1eaf428e..ca4f8d67 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html @@ -345,6 +345,11 @@ this.resetVoteForm = () => { this.voteInEdition = null; + + if (this.poll.voterName) { + this.refs.voterName.value = this.poll.voterName; + } + if (this.question.canVote) { if (!this.multi) { this.refs.voterName.value = null; @@ -369,7 +374,7 @@ this.mustValidateGtuToVote = () => { let anonymousAlreadyVoted = this.voteInEdition; let voterIsRegistered = this.session.isConnected(); - let gtuValidatedInPoll = this.poll.gtuValidated; + let gtuValidatedInPoll = this.poll.voterValidatedGtu; let gtuAlreadyValidated = anonymousAlreadyVoted || voterIsRegistered || gtuValidatedInPoll; let mustValidateGtuToVote = !gtuAlreadyValidated; return mustValidateGtuToVote; @@ -425,10 +430,12 @@ this.opts.onSaveVote(vote).then(() => { this.voting = false; this.voteInEdition = null; - this.resetVoteForm(); if (this.multi) { + this.poll.voterValidatedGtu = true; + this.poll.voterName = this.refs.voterName.value; this.parent.parent.nextQuestion(); } else { + this.resetVoteForm(); this.update(); } }, diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/EditVoteOrder.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/EditVoteOrder.tag.html index 81ccc462..d0d478d3 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/EditVoteOrder.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/EditVoteOrder.tag.html @@ -350,6 +350,9 @@ }; this.resetVoteForm = () => { + if (this.poll.voterName) { + this.refs.voterName.value = this.poll.voterName; + } if (this.poll.canVote) { if (!this.multi) { this.refs.voterName.value = null; @@ -390,7 +393,7 @@ this.mustValidateGtuToVote = () => { let anonymousAlreadyVoted = this.voteInEdition; let voterIsRegistered = this.session.isConnected(); - let gtuValidatedInPoll = this.poll.gtuValidated; + let gtuValidatedInPoll = this.poll.voterValidatedGtu; let gtuAlreadyValidated = anonymousAlreadyVoted || voterIsRegistered || gtuValidatedInPoll; let mustValidateGtuToVote = !gtuAlreadyValidated; return mustValidateGtuToVote; @@ -445,10 +448,12 @@ this.opts.onSaveVote(vote).then(() => { this.voting = false; this.voteInEdition = null; - this.resetVoteForm(); if (this.multi) { + this.poll.voterValidatedGtu = true; + this.poll.voterName = this.refs.voterName.value; this.parent.parent.nextQuestion(); } else { + this.resetVoteForm(); this.update(); } }, -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm