branch feature/multi-ui updated (dc869a4f -> d00af65c)
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 dc869a4f Can now create a multi question poll (still ugly and not perfect, but it works \o/ ). Still need: - Good navigation between question at creation going back and forth - Per question options - Summary (after saving) - First summary renaming (before saving) new 0e4933f5 Multi question poll : - Good navigation between question at creation going back and forth new 2ec8b47c Lint new ab258472 Add lint script to npm and myself to contribs new e3b41f98 Multi question poll : - Participants new 96dea987 Multi question poll : - Simplification du composant question new 016ed225 Multi question poll : - Renommage de l'onglet résumé -> résumé des questions new cb931802 Multi question poll : - Libellé des boutons new d00af65c Multi question poll : - Persistence de la description multi The 8 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 d00af65c22a2a962fa68201fdde5aa17f87d37b8 Author: jcouteau <couteau@codelutin.com> Date: Mon Aug 19 17:01:40 2019 +0200 Multi question poll : - Persistence de la description multi commit cb9318020408243801967631ea5ecc9d169c425c Author: jcouteau <couteau@codelutin.com> Date: Mon Aug 19 16:53:53 2019 +0200 Multi question poll : - Libellé des boutons commit 016ed22545f01c236bf42300f3fffb68fd17cf34 Author: jcouteau <couteau@codelutin.com> Date: Mon Aug 19 16:29:38 2019 +0200 Multi question poll : - Renommage de l'onglet résumé -> résumé des questions commit 96dea9877f262eb09365c63e4d5955838d4b22d6 Author: jcouteau <couteau@codelutin.com> Date: Mon Aug 19 16:29:01 2019 +0200 Multi question poll : - Simplification du composant question commit e3b41f98937f6c19353b2dad7269276246d4e972 Author: jcouteau <couteau@codelutin.com> Date: Mon Aug 19 12:00:38 2019 +0200 Multi question poll : - Participants commit ab2584720ea908f08a15a554dfd60df316e55551 Author: jcouteau <couteau@codelutin.com> Date: Mon Aug 19 11:31:59 2019 +0200 Add lint script to npm and myself to contribs commit 2ec8b47cacb5a7b4f5acf7a23a515edbe415e620 Author: jcouteau <couteau@codelutin.com> Date: Mon Aug 19 11:25:59 2019 +0200 Lint commit 0e4933f514b86d1a952c4047f2517c69b0546714 Author: jcouteau <couteau@codelutin.com> Date: Mon Aug 19 11:06:27 2019 +0200 Multi question poll : - Good navigation between question at creation going back and forth Summary of changes: pollen-ui-riot-js/package.json | 7 +- pollen-ui-riot-js/src/main/web/i18n/fr.json | 6 +- pollen-ui-riot-js/src/main/web/js/PollForm.js | 14 ++-- pollen-ui-riot-js/src/main/web/js/PollService.js | 8 +-- .../src/main/web/tag/poll/Description.tag.html | 6 +- .../src/main/web/tag/poll/EditPoll.tag.html | 4 +- .../src/main/web/tag/poll/EditQuestions.tag.html | 8 ++- .../src/main/web/tag/poll/SummaryQuestion.tag.html | 74 ++-------------------- 8 files changed, 32 insertions(+), 95 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 0e4933f514b86d1a952c4047f2517c69b0546714 Author: jcouteau <couteau@codelutin.com> Date: Mon Aug 19 11:06:27 2019 +0200 Multi question poll : - Good navigation between question at creation going back and forth --- pollen-ui-riot-js/src/main/web/js/PollForm.js | 1 - pollen-ui-riot-js/src/main/web/tag/poll/EditQuestions.tag.html | 8 +++++++- 2 files changed, 7 insertions(+), 2 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 a0e074ed..06eff007 100644 --- a/pollen-ui-riot-js/src/main/web/js/PollForm.js +++ b/pollen-ui-riot-js/src/main/web/js/PollForm.js @@ -232,7 +232,6 @@ class PollForm { this.setQuestionDefaultSettings(newQuestion); this.questionEdited = this.questionEdited+1; this.model.questions.push(newQuestion); - bus.trigger("questionEditedChanged", this.questionEdited); } addNewChoice(questionId) { diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/EditQuestions.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/EditQuestions.tag.html index 6adc9c1e..22f3f88e 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/EditQuestions.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/EditQuestions.tag.html @@ -55,10 +55,16 @@ import "./Choices.tag.html"; //gérer le cas ou on navigue en avant et en arrière if (!this.form.hasVotes) { this.submit(); - this.form.addNewQuestion(); + + if (this.form.questionEdited === this.form.model.questions.length-1) { + this.form.addNewQuestion(); + } else { + this.form.questionEdited++; + } this.question = this.form.model.questions[this.form.questionEdited]; this.refs.title.value = this.question.title; this.refs.description.value = this.question.description; + this.bus.trigger("questionEditedChanged", this.form.questionEdited); 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 2ec8b47cacb5a7b4f5acf7a23a515edbe415e620 Author: jcouteau <couteau@codelutin.com> Date: Mon Aug 19 11:25:59 2019 +0200 Lint --- pollen-ui-riot-js/src/main/web/js/PollForm.js | 11 +++-------- pollen-ui-riot-js/src/main/web/js/PollService.js | 8 ++++---- 2 files changed, 7 insertions(+), 12 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 06eff007..58f8162c 100644 --- a/pollen-ui-riot-js/src/main/web/js/PollForm.js +++ b/pollen-ui-riot-js/src/main/web/js/PollForm.js @@ -66,7 +66,7 @@ class PollForm { return Promise.resolve(); } - getSteps(multi){ + getSteps(multi) { let steps; if (multi) { steps = this.stepsMulti; @@ -169,7 +169,7 @@ class PollForm { this.isInit = true; this._updateSteps(); this.setStep(0); - this.questionEdited=0; + this.questionEdited = 0; }); } @@ -230,7 +230,7 @@ class PollForm { addNewQuestion() { let newQuestion = new Question("", "", ""); this.setQuestionDefaultSettings(newQuestion); - this.questionEdited = this.questionEdited+1; + this.questionEdited = this.questionEdited + 1; this.model.questions.push(newQuestion); } @@ -310,11 +310,6 @@ class PollForm { } } - setMulti(multi) { - if (multi) { - } - } - _updateSteps() { let steps = ["general", "choices", "options"]; if (this.model.pollType === "RESTRICTED") { 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 cf6b3f44..644aa7b3 100644 --- a/pollen-ui-riot-js/src/main/web/js/PollService.js +++ b/pollen-ui-riot-js/src/main/web/js/PollService.js @@ -50,9 +50,9 @@ class PollService extends FetchService { delete question.resultVisibility; delete question.continuousResults; delete question.commentVisibility; - if (question.id==="") { + if (question.id === "") { delete question.id; - }; + } }); delete poll2.voteCountingType; delete poll2.alreadyParticipants; @@ -72,9 +72,9 @@ class PollService extends FetchService { delete question.resultVisibility; delete question.continuousResults; delete question.commentVisibility; - if (question.id==="") { + if (question.id === "") { delete question.id; - }; + } }); delete poll2.voteCountingType; delete poll2.alreadyParticipants; -- 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 ab2584720ea908f08a15a554dfd60df316e55551 Author: jcouteau <couteau@codelutin.com> Date: Mon Aug 19 11:31:59 2019 +0200 Add lint script to npm and myself to contribs --- pollen-ui-riot-js/package.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pollen-ui-riot-js/package.json b/pollen-ui-riot-js/package.json index 525a4c07..6cd3937f 100644 --- a/pollen-ui-riot-js/package.json +++ b/pollen-ui-riot-js/package.json @@ -21,11 +21,16 @@ { "name": "Kevin Morin", "email": "morin@codelutin.com" + }, + { + "name": "Jean Couteau", + "email": "couteau@codelutin.com" } ], "scripts": { "start": "webpack-dev-server --mode development --hot --inline --host 0.0.0.0 --public ${POLLEN_UI_CONTEXT:-localhost:8080}", - "package": "webpack --config webpack.config.js --mode production" + "package": "webpack --config webpack.config.js --mode production", + "lint": "eslint src" }, "devDependencies": { "@babel/core": "7.0.0-beta.46", -- 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 e3b41f98937f6c19353b2dad7269276246d4e972 Author: jcouteau <couteau@codelutin.com> Date: Mon Aug 19 12:00:38 2019 +0200 Multi question poll : - Participants --- pollen-ui-riot-js/src/main/web/js/PollForm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 58f8162c..48fa8e3e 100644 --- a/pollen-ui-riot-js/src/main/web/js/PollForm.js +++ b/pollen-ui-riot-js/src/main/web/js/PollForm.js @@ -73,7 +73,7 @@ class PollForm { } else { steps = this.stepsNoMulti; } - if (this.model.pollType === "RESTRICTED") { + if (this.model.pollType === "RESTRICTED" && !steps.includes("voters")) { steps.push("voters"); } this.steps = steps; -- 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 96dea9877f262eb09365c63e4d5955838d4b22d6 Author: jcouteau <couteau@codelutin.com> Date: Mon Aug 19 16:29:01 2019 +0200 Multi question poll : - Simplification du composant question --- .../src/main/web/tag/poll/SummaryQuestion.tag.html | 74 ++-------------------- 1 file changed, 5 insertions(+), 69 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/SummaryQuestion.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/SummaryQuestion.tag.html index 9026c828..22e746ab 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/SummaryQuestion.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/SummaryQuestion.tag.html @@ -10,6 +10,11 @@ label="{opts.question.description}"> </MultiLineLabel> </p> + + <div if="{opts.question.voteCountingTypeValue}"> + {_t.voteCountingType} : + <strong>{opts.question.voteCountingTypeValue.name}</strong> (<em>{opts.question.voteCountingTypeValue.helper}</em>) + </div> </div> <div class="summary-part"> @@ -29,75 +34,6 @@ this.installBundle(this.session, "summary"); this.showVoteCountingTypeHelper = false; - this.on("update", () => { - this.voteUrl = window.location.origin + window.location.pathname + "#poll/" + this.opts.form.model.id + "/vote"; - }); - - this.getMembersWarningLabel = () => { - let label; - if (this.opts.form.model.participantInvitedCount === 0) { - label = this._t.membersNoInvited_all; - } else { - let noInvited = this.opts.form.model.participantCount - this.opts.form.model.participantInvitedCount; - if (noInvited > 1) { - label = this._l("membersNoInvited_many", noInvited); - } else { - label = this._t.membersNoInvited_one; - } - } - return label; - }; - - this.getSendInvitationsLabel = () => { - let label; - let noInvited = this.opts.form.model.participantCount - this.opts.form.model.participantInvitedCount; - if (noInvited > 1) { - label = this._l("sendInvitations", noInvited); - } else { - label = this._t.sendInvitation; - } - return label; - }; - - this.copyUrl = (refInputUrl) => () => { - this.refs[refInputUrl].select(); - document.execCommand("copy"); - }; - - this.listen("successMessage", (successMessage) => { - this.successMessage = successMessage; - this.update(); - }); - - this.closePoll = (e) => { - e.preventDefault(); - e.stopPropagation(); - this.opts.form.close().then(() => { - this.update(); - }); - }; - - this.reopenPoll = (e) => { - e.preventDefault(); - e.stopPropagation(); - this.opts.form.reopen().then(() => { - this.update(); - }); - }; - - this.copy = (refInput) => () => { - this.refs[refInput].select(); - document.execCommand("copy"); - }; - - this.sendInvitations = () => { - this.opts.form.sendInvitations() - .then(nbInvitation => { - let message = nbInvitation > 1 ? this._l("sendInvitations_success", nbInvitation) : this._t.sendInvitation_success; - this.bus.trigger("message", message, "info"); - this.update(); - }); - }; </script> -- 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 016ed22545f01c236bf42300f3fffb68fd17cf34 Author: jcouteau <couteau@codelutin.com> Date: Mon Aug 19 16:29:38 2019 +0200 Multi question poll : - Renommage de l'onglet résumé -> résumé des questions --- pollen-ui-riot-js/src/main/web/i18n/fr.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pollen-ui-riot-js/src/main/web/i18n/fr.json b/pollen-ui-riot-js/src/main/web/i18n/fr.json index b5341a0c..682247cd 100644 --- a/pollen-ui-riot-js/src/main/web/i18n/fr.json +++ b/pollen-ui-riot-js/src/main/web/i18n/fr.json @@ -423,7 +423,7 @@ "poll_step_options": "Options", "poll_step_voters": "Participants", "poll_step_questions": "Questions", - "poll_step_summary": "Résumé", + "poll_step_summary": "Résumé des questions", "poll_voters_previous": "Précédent", "poll_voters_save": "Enregistrer", "poll_voters_freePoll": "Tout le monde peut voter (Sondage public)", -- 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 cb9318020408243801967631ea5ecc9d169c425c Author: jcouteau <couteau@codelutin.com> Date: Mon Aug 19 16:53:53 2019 +0200 Multi question poll : - Libellé des boutons --- pollen-ui-riot-js/src/main/web/i18n/fr.json | 4 ++-- pollen-ui-riot-js/src/main/web/tag/poll/EditPoll.tag.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/i18n/fr.json b/pollen-ui-riot-js/src/main/web/i18n/fr.json index 682247cd..8a41615b 100644 --- a/pollen-ui-riot-js/src/main/web/i18n/fr.json +++ b/pollen-ui-riot-js/src/main/web/i18n/fr.json @@ -305,8 +305,6 @@ "poll_editQuestions_titleNotBlank": "Le titre ne doit pas être blanc", "poll_editQuestions_description": "Description", "poll_editQuestions_descriptionPlaceHolder": "Renseignez la description de la question", - "poll_editQuestions_newQuestion": "Question suivante", - "poll_editQuestions_previousQuestion": "Question précédente", "poll_settings_pollType": "Ouverture du sondage", "poll_settings_pollType_FREE": "Ouvert à tous", "poll_settings_pollType_FREE_help": "Toutes les personnes ayant le lien du sondage peuvent voter.", @@ -413,7 +411,9 @@ "poll_choices_label": "Choix", "poll_choices_description": "Description", "poll_previous": "Précédent", + "poll_previousQuestion": "Question précédente", "poll_next": "Suivant", + "poll_nextQuestion": "Question suivante", "poll_save": "Enregistrer", "poll_choices_moreChoices": "Ajouter des choix", "poll_choices_moreChoice": "Ajouter un choix", diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/EditPoll.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/EditPoll.tag.html index cada45c7..23d602a1 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/EditPoll.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/EditPoll.tag.html @@ -95,7 +95,7 @@ import "./CheckEmails.tag.html"; tabindex="1" onclick={previousQuestion}> <i class="fa fa-chevron-left " aria-hidden="true"></i> - {_t.previousQuestion} BBB + {_t.previousQuestion} </button> <button if={form.step === 2 && form.multi} @@ -103,7 +103,7 @@ import "./CheckEmails.tag.html"; class="c-button c-button--info" tabindex="1" onclick={newQuestion}> - {_t.newQuestion} AAA + {_t.nextQuestion} <i class="fa fa-chevron-right " aria-hidden="true"></i> </button> -- 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 d00af65c22a2a962fa68201fdde5aa17f87d37b8 Author: jcouteau <couteau@codelutin.com> Date: Mon Aug 19 17:01:40 2019 +0200 Multi question poll : - Persistence de la description multi --- pollen-ui-riot-js/src/main/web/tag/poll/Description.tag.html | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Description.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Description.tag.html index ef257d72..ebdc283b 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Description.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Description.tag.html @@ -95,7 +95,7 @@ id="multi" tabindex="1" name="multi" - checked="{form.model.multi}" + checked="{form.multi}" disabled={opts.form.model.closed}/> <label class="c-label" for="multi">{_t.multiQuestion}</label> </div> @@ -113,10 +113,6 @@ this.form.model.creatorName = this.refs.name.value; this.form.model.creatorEmail = this.refs.email.value; this.form.multi = this.refs.multi.checked; - if (this.form.multi) { - //TODO ???? - this.form.model - } }; </script> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm