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 9c1539d6d6951f3f3fdcf7b7ea830f5bdc94d240 Author: jcouteau <couteau@codelutin.com> Date: Wed Oct 23 09:54:28 2019 +0200 Modale de confirmation de suppression de question --- pollen-ui-riot-js/src/main/web/i18n/en.json | 1 + pollen-ui-riot-js/src/main/web/i18n/fr.json | 1 + .../src/main/web/tag/poll/EditQuestions.tag.html | 17 ++++++++++++----- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/i18n/en.json b/pollen-ui-riot-js/src/main/web/i18n/en.json index 0fce252c..3fc6d58c 100644 --- a/pollen-ui-riot-js/src/main/web/i18n/en.json +++ b/pollen-ui-riot-js/src/main/web/i18n/en.json @@ -309,6 +309,7 @@ "poll_editQuestions_titleNotBlank": "Title must be not blank", "poll_editQuestions_description": "Description", "poll_editQuestions_descriptionPlaceHolder": "Enter question description", + "poll_editQuestions_deleteQuestionMessage": "Are you sure you want to delete the question ?", "poll_settings_pollType": "Poll opening", "poll_settings_pollType_FREE": "Open to all", "poll_settings_pollType_FREE_help": "Anyone with the poll link can vote.", 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 ae65c8d6..a3e35f3b 100644 --- a/pollen-ui-riot-js/src/main/web/i18n/fr.json +++ b/pollen-ui-riot-js/src/main/web/i18n/fr.json @@ -309,6 +309,7 @@ "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_deleteQuestionMessage": "Êtes-vous sûr de vouloir supprimer la question ?", "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.", 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 996138d2..614c3f40 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 @@ -67,11 +67,18 @@ import "./EditQuestionsSettings.tag.html"; this.deleteQuestion = () => { if (!this.form.hasVotes) { - this.form.deleteQuestion(); - if (this.form.questionEdited >= this.form.model.questions.length) { - this.form.questionEdited = this.form.model.questions.length -1; - } - this.reloadQuestion(); + this.confirm(this._t.deleteQuestionMessage).then((confirm) => { + if (!confirm) { + return Promise.reject(); + } + }).then(() => { + this.form.deleteQuestion(); + if (this.form.questionEdited >= this.form.model.questions.length) { + this.form.questionEdited = this.form.model.questions.length -1; + } + this.reloadQuestion(); + }); + } }; -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.