branch develop updated (e946c174 -> 8cf89826)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git from e946c174 correction acceuille chorem new 8cf89826 correction flux RSS pour des sondage déja créé, titre et créateur d'un sondage non blanc The 1 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 8cf8982611ec85bf30b21d47d118e5409d517ddf Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Wed Jul 19 14:31:39 2017 +0200 correction flux RSS pour des sondage déja créé, titre et créateur d'un sondage non blanc Summary of changes: .../exceptionMappers/InvalidFormExceptionMapper.java | 2 +- .../chorem/pollen/services/service/FeedService.java | 6 ++++++ pollen-ui-riot-js/package.json | 14 +++++++------- pollen-ui-riot-js/src/main/web/i18n.json | 6 ++++++ .../src/main/web/tag/PollenMessageManager.tag.html | 4 ++-- .../src/main/web/tag/components/LetterAvatar.tag.html | 19 ++++++++++++------- .../src/main/web/tag/components/date-picker.tag.html | 7 ++++++- .../src/main/web/tag/poll/Choice.tag.html | 4 +++- .../src/main/web/tag/poll/Description.tag.html | 4 ++++ .../src/main/web/tag/poll/EditPoll.tag.html | 3 +-- 10 files changed, 48 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 develop in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 8cf8982611ec85bf30b21d47d118e5409d517ddf Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Wed Jul 19 14:31:39 2017 +0200 correction flux RSS pour des sondage déja créé, titre et créateur d'un sondage non blanc --- .../exceptionMappers/InvalidFormExceptionMapper.java | 2 +- .../chorem/pollen/services/service/FeedService.java | 6 ++++++ pollen-ui-riot-js/package.json | 14 +++++++------- pollen-ui-riot-js/src/main/web/i18n.json | 6 ++++++ .../src/main/web/tag/PollenMessageManager.tag.html | 4 ++-- .../src/main/web/tag/components/LetterAvatar.tag.html | 19 ++++++++++++------- .../src/main/web/tag/components/date-picker.tag.html | 7 ++++++- .../src/main/web/tag/poll/Choice.tag.html | 4 +++- .../src/main/web/tag/poll/Description.tag.html | 4 ++++ .../src/main/web/tag/poll/EditPoll.tag.html | 3 +-- 10 files changed, 48 insertions(+), 21 deletions(-) diff --git a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/exceptionMappers/InvalidFormExceptionMapper.java b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/exceptionMappers/InvalidFormExceptionMapper.java index a08254ec..d8f3a67b 100644 --- a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/exceptionMappers/InvalidFormExceptionMapper.java +++ b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/exceptionMappers/InvalidFormExceptionMapper.java @@ -15,6 +15,6 @@ public class InvalidFormExceptionMapper extends PollenAbstractExceptionMapper<In @Override protected Object getEntity(InvalidFormException exception) { - return exception.getErrors(); + return exception.getErrors().asMap(); } } diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/service/FeedService.java b/pollen-services/src/main/java/org/chorem/pollen/services/service/FeedService.java index 077db343..6dc0b560 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/service/FeedService.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/service/FeedService.java @@ -9,6 +9,7 @@ import com.rometools.rome.feed.synd.SyndFeedImpl; import com.rometools.rome.io.FeedException; import com.rometools.rome.io.SyndFeedInput; import com.rometools.rome.io.SyndFeedOutput; +import org.apache.commons.lang3.StringUtils; import org.chorem.pollen.persistence.entity.Choice; import org.chorem.pollen.persistence.entity.Comment; import org.chorem.pollen.persistence.entity.Poll; @@ -110,6 +111,11 @@ public class FeedService extends PollenServiceSupport { Poll poll = getPollService().getPoll0(pollId); + if (StringUtils.isBlank(poll.getFeedContent())) { + // uniquement pour les sondages créé avant la génération de flux RSS + onPollCreated(poll); + } + try { SyndFeedInput feedInput = new SyndFeedInput(true, getLocale()); return feedInput.build(new StringReader(poll.getFeedContent())); diff --git a/pollen-ui-riot-js/package.json b/pollen-ui-riot-js/package.json index a32ec03e..82231d23 100644 --- a/pollen-ui-riot-js/package.json +++ b/pollen-ui-riot-js/package.json @@ -30,25 +30,25 @@ "devDependencies": { "babel": "^6.5.2", "babel-cli": "^6.18.0", - "babel-core": "^6.17.0", + "babel-core": "^6.25.0", "babel-loader": "^6.2.5", "copy-webpack-plugin": "^4.0.1", "eslint": "^3.16.0", - "eslint-plugin-riot": "^0.1.6", + "eslint-plugin-riot": "^0.1.7", "json-loader": "^0.5.4", "loader-utils": "^0.2.6", - "riot-compiler": "^3.0.5", - "webpack": "^2.6.1", - "webpack-dev-server": "^2.4.5" + "riot-compiler": "^3.2.4", + "webpack": "^2.7.0", + "webpack-dev-server": "^2.5.1" }, "dependencies": { "font-awesome": "4.7.0", "moment": "^2.17.1", "nprogress": "^0.2.0", "object.values": "^1.0.4", - "qrcode-generator": "^1.2.0", + "qrcode-generator": "^1.3.0", "remarkable": "^1.7.1", - "riot": "^3.3.2", + "riot": "^3.6.1", "riot-route": "^2.5.0" } } diff --git a/pollen-ui-riot-js/src/main/web/i18n.json b/pollen-ui-riot-js/src/main/web/i18n.json index aeab8ab3..2aee07af 100644 --- a/pollen-ui-riot-js/src/main/web/i18n.json +++ b/pollen-ui-riot-js/src/main/web/i18n.json @@ -229,11 +229,13 @@ "poll_description_info": "Informations", "poll_description_title": "Titre", "poll_description_titlePlaceHolder": "Renseignez le titre du sondage", + "poll_description_titleNotBlank": "Le titre ne doit pas être blanc", "poll_description_description": "Description", "poll_description_descriptionPlaceHolder": "Renseignez la description du sondage", "poll_description_user": "Créateur", "poll_description_name": "Votre nom", "poll_description_namePlaceHolder": "Renseignez votre nom", + "poll_description_nameNotBlank": "Vote nom ne doit pas être blanc", "poll_description_email": "Votre courriel", "poll_description_emailPlaceHolder": "Renseignez votre courriel", "poll_settings_basic_usage": "Options par défaut", @@ -389,6 +391,7 @@ "time-picker_timeplaceholder": "Heure", "choice_text": "Renseignez un text", "choice_text_placeholder": "Renseignez un text ou sélectionnez un autre type", + "choice_text_notBlank": "Le text ne doit pas être blanc", "choice_ressource": "Utiliser une image", "choice_addFile": "Ajouter un fichier", "choice_date": "Renseignez une date", @@ -740,11 +743,13 @@ "poll_description_info": "Information", "poll_description_title": "Title", "poll_description_titlePlaceHolder": "Enter poll title", + "poll_description_titleNotBlank": "Title must be not blank", "poll_description_description": "Description", "poll_description_descriptionPlaceHolder": "Enter poll description", "poll_description_user": "Creator", "poll_description_name": "Your name", "poll_description_namePlaceHolder": "Enter your name", + "poll_description_nameNotBlank": "Name nust be not blank", "poll_description_email": "Your email", "poll_description_emailPlaceHolder": "Enter your email", "poll_settings_basic_usage": "For a basic poll, you can skip this step.", @@ -890,6 +895,7 @@ "date-picker_dateplaceholder": "Date", "time-picker_timeplaceholder": "Time", "choice_text": "Set a text", + "choice_text_notBlank": "text must be not blank", "choice_ressource": "Use image", "choice_addFile": "Add image", "choice_date": "Set a date", diff --git a/pollen-ui-riot-js/src/main/web/tag/PollenMessageManager.tag.html b/pollen-ui-riot-js/src/main/web/tag/PollenMessageManager.tag.html index 8464d4e6..6b3854fa 100644 --- a/pollen-ui-riot-js/src/main/web/tag/PollenMessageManager.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/PollenMessageManager.tag.html @@ -16,8 +16,8 @@ this.messageIndex = 0; this.messages = []; - this.handleMessages = (e) => { - var message = new Message(e); + this.handleMessages = (mess, type) => { + var message = new Message(mess, type); if (!message.timeout) { message.timeout = session.configuration.defaultMessageTimeout; } diff --git a/pollen-ui-riot-js/src/main/web/tag/components/LetterAvatar.tag.html b/pollen-ui-riot-js/src/main/web/tag/components/LetterAvatar.tag.html index 2edbe438..ffb5efc8 100644 --- a/pollen-ui-riot-js/src/main/web/tag/components/LetterAvatar.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/components/LetterAvatar.tag.html @@ -8,13 +8,18 @@ <script type="es6"> this.redraw = () => { - let nameSplit = this.opts.name.split(); - this.avatarLetter = nameSplit[0][0].toUpperCase(); - let secondLetter = (nameSplit.length > 1 ? nameSplit[1][0] : nameSplit[0][1]).toUpperCase(); - let letterIndex = this.avatarLetter.charCodeAt() - 64; - let secondIndex = secondLetter.charCodeAt() - 64; - let hue = (360 / (26 * 26)) * (secondIndex * 26 + letterIndex); - this.backgroundColor = "hsl(" + hue + ", 68%, 48%)"; + if (this.opts.name.trim().length > 0) { + let nameSplit = this.opts.name.split(); + this.avatarLetter = nameSplit[0][0].toUpperCase(); + let secondLetter = (nameSplit.length > 1 ? nameSplit[1][0] : nameSplit[0][1]).toUpperCase(); + let letterIndex = this.avatarLetter.charCodeAt() - 64; + let secondIndex = secondLetter.charCodeAt() - 64; + let hue = (360 / (26 * 26)) * (secondIndex * 26 + letterIndex); + this.backgroundColor = "hsl(" + hue + ", 68%, 48%)"; + } else { + this.avatarLetter = "?"; + this.backgroundColor = "#000000"; + } }; this.on("update", this.redraw); diff --git a/pollen-ui-riot-js/src/main/web/tag/components/date-picker.tag.html b/pollen-ui-riot-js/src/main/web/tag/components/date-picker.tag.html index f0d08c32..85594827 100644 --- a/pollen-ui-riot-js/src/main/web/tag/components/date-picker.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/components/date-picker.tag.html @@ -8,7 +8,8 @@ placeholder="{__.dateplaceholder}" readonly="{!session.dateInputSupported}" disabled={opts.disabled} - onchange={onDateChange}/> + onchange={onDateChange} + ref="date"/> <div class="c-calendar c-calendar--higher" if="{opts.date.isVisible && !session.dateInputSupported}"> <button type="button" class="c-calendar__control" disabled="{ opts.date.min && opts.date.min.isSame(opts.date.date, 'year') }" onclick="{ prevYear }">‹</button> <div class="c-calendar__header">{ opts.date.date ? opts.date.date.format(yearFormat) : moment().format(yearFormat) }</div> @@ -206,6 +207,10 @@ } }; + this.focus = () => { + this.refs.date.focus(); + }; + </script> <style scoped> diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Choice.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Choice.tag.html index dfcda103..e91c43f1 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Choice.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Choice.tag.html @@ -17,6 +17,8 @@ require("../components/time-picker.tag.html"); disabled={opts.disabled} value={valueText} required={opts.choice.choiceType === 'TEXT'} + pattern={opts.choice.choiceType === 'TEXT' ? ".*[^\s]+.*" : ""} + title={__.text_notBlank} onchange={onTextChange}/> <button type="button" class="choice-type-button colors-main-invers" @@ -228,7 +230,7 @@ require("../components/time-picker.tag.html"); if (this.opts.choice.choiceType === "TEXT") { this.refs.choiceText.focus(); } else if (this.opts.choice.choiceType === "RESOURCE") { - this.refs.choiceResource.focus(); + this.refs.choiceResource && this.refs.choiceResource.focus(); } else { this.refs.choiceDate.focus(); } 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 956c27ae..6e6aa306 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 @@ -29,6 +29,8 @@ type="text" class="c-field c-field--label" required + pattern=".*[^\s]+.*" + title={__.titleNotBlank} name="title" value="{form.model.title}" disabled={opts.form.model.isClosed} @@ -53,6 +55,8 @@ type="text" class="c-field c-field--label" required + pattern=".*[^\s]+.*" + title={__.nameNotBlank} name="name" value="{form.model.creatorName}" disabled={opts.form.model.isClosed} 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 f3609140..c5774bf9 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 @@ -135,7 +135,6 @@ require("../components/HumanInput.tag.html"); this.tags.voters.submit(); } if (this.callAfterSubmit) { - console.log("callAfterSubmit"); this.callAfterSubmit(); this.update(); } @@ -148,7 +147,7 @@ require("../components/HumanInput.tag.html"); this.savePoll = () => { this.callAfterSubmit = () => { let errorFn = errors => { - this.bus.trigger("message", errors); + this.bus.trigger("message", errors, "error"); this.update(); }; if (this.form.creation) { -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm