This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit c24f5e75cb8e47cfb5f404a1858aa509eea4bd7c Author: Kevin Morin <morin@codelutin.com> Date: Tue May 30 11:58:02 2017 +0200 display validation errors on poll edition --- pollen-ui-riot-js/src/main/web/js/Error.js | 7 +++++-- pollen-ui-riot-js/src/main/web/tag/poll/EditPoll.tag.html | 14 +++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/js/Error.js b/pollen-ui-riot-js/src/main/web/js/Error.js index 6adc197..a36072f 100644 --- a/pollen-ui-riot-js/src/main/web/js/Error.js +++ b/pollen-ui-riot-js/src/main/web/js/Error.js @@ -32,8 +32,11 @@ class Error { } else if (typeof e === "string" || e instanceof String) { this.message = e; } else { - this.message = Object.values(e) - .reduce((messages, messagesfield) => messages.concat(messagesfield), []); + if (e.message) { + this.message = e.message; + } else { + this.message = Object.values(e).reduce((messages, messagesfield) => messages.concat(messagesfield), []); + } } if (!this.timeout) { this.timeout = timeout; 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 9ff3119..7d3099b 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 @@ -134,13 +134,13 @@ require("./Created.tag.html"); promiseSave = this.form.save(); } promiseSave.then(() => { - let route = require("riot-route"); - route("poll/" + this.form.model.id + "/vote/" + this.form.model.permission); - }, errors => { - this.bus.trigger("error", errors); - this.update(); - } - ); + let route = require("riot-route"); + route("poll/" + this.form.model.id + "/vote/" + this.form.model.permission); + }, errors => { + this.bus.trigger("error", errors); + this.update(); + } + ); }; }; -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.