branch develop updated (45175c23 -> 14bc4e64)
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 45175c23 fixes #129 ajout d'un bouton "créer un sondage" dans l'entete new dcc5acf4 fixes #69 Poll creation - Split the notification option into comment notification, vote notification, new choice notification new 542ae9c6 ajout d'un timer sur le tooltip pour eviter de recalculer des positions inutilement new c4b6fe5e fixes #114 alignement des colonnes fixes #103 mauvaise gestion des valeurs de choix trop longues new 859d23bd fixes #105 navigation au clavier + blocage des boutons pendant l'attente de la réponse du serveur new 14bc4e64 resteasy ne supporte pas le body des requetes delete The 5 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 14bc4e646fbbe4dd869aac75ba58bdb248d0c496 Author: Kevin Morin <morin@codelutin.com> Date: Tue Aug 8 17:39:30 2017 +0200 resteasy ne supporte pas le body des requetes delete commit 859d23bd575d91569608acac087432f13b09df5a Author: Kevin Morin <morin@codelutin.com> Date: Tue Aug 8 17:07:11 2017 +0200 fixes #105 navigation au clavier + blocage des boutons pendant l'attente de la réponse du serveur commit c4b6fe5e82a3f0d6c3c1d3b1fe09dfeaf9e97565 Author: Kevin Morin <morin@codelutin.com> Date: Tue Aug 8 16:37:17 2017 +0200 fixes #114 alignement des colonnes fixes #103 mauvaise gestion des valeurs de choix trop longues commit 542ae9c6bf663bab28095a8ee0d9cd31b70d8313 Author: Kevin Morin <morin@codelutin.com> Date: Mon Aug 7 17:16:29 2017 +0200 ajout d'un timer sur le tooltip pour eviter de recalculer des positions inutilement commit dcc5acf416e3e249576087dabe74355afcfe14a2 Author: Kevin Morin <morin@codelutin.com> Date: Mon Aug 7 16:51:34 2017 +0200 fixes #69 Poll creation - Split the notification option into comment notification, vote notification, new choice notification Summary of changes: ...omment_and_new_choice_notifications_in_poll.sql | 6 + ...omment_and_new_choice_notifications_in_poll.sql | 6 + pollen-persistence/src/main/xmi/pollen.properties | 2 +- pollen-persistence/src/main/xmi/pollen.zargo | Bin 26817 -> 26949 bytes pollen-services/src/main/config/PollenServices.ini | 12 + .../org/chorem/pollen/services/bean/PollBean.java | 24 ++ .../services/config/PollenServicesConfig.java | 11 + .../services/service/NotificationService.java | 8 +- .../pollen/services/service/PollService.java | 17 +- .../i18n/pollen-services_en_GB.properties | 2 + .../i18n/pollen-services_fr_FR.properties | 2 + pollen-ui-riot-js/src/main/web/css/main.css | 4 + pollen-ui-riot-js/src/main/web/i18n.json | 18 +- pollen-ui-riot-js/src/main/web/js/FetchService.js | 4 +- .../src/main/web/tag/poll/ChoiceView.tag.html | 8 - .../src/main/web/tag/poll/Poll.tag.html | 10 +- .../src/main/web/tag/poll/Settings.tag.html | 36 +- .../src/main/web/tag/poll/Votes.tag.html | 428 ++++++++++++--------- 18 files changed, 366 insertions(+), 232 deletions(-) create mode 100644 pollen-persistence/src/main/resources/db/migration/h2/V3_0_0_7__add_comment_and_new_choice_notifications_in_poll.sql create mode 100644 pollen-persistence/src/main/resources/db/migration/postgresql/V3_0_0_7__add_comment_and_new_choice_notifications_in_poll.sql -- 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 dcc5acf416e3e249576087dabe74355afcfe14a2 Author: Kevin Morin <morin@codelutin.com> Date: Mon Aug 7 16:51:34 2017 +0200 fixes #69 Poll creation - Split the notification option into comment notification, vote notification, new choice notification --- ...omment_and_new_choice_notifications_in_poll.sql | 6 ++++ ...omment_and_new_choice_notifications_in_poll.sql | 6 ++++ pollen-persistence/src/main/xmi/pollen.properties | 2 +- pollen-persistence/src/main/xmi/pollen.zargo | Bin 26817 -> 26949 bytes pollen-services/src/main/config/PollenServices.ini | 12 +++++++ .../org/chorem/pollen/services/bean/PollBean.java | 24 ++++++++++++++ .../services/config/PollenServicesConfig.java | 11 +++++++ .../services/service/NotificationService.java | 8 ++--- .../pollen/services/service/PollService.java | 17 +++------- .../i18n/pollen-services_en_GB.properties | 2 ++ .../i18n/pollen-services_fr_FR.properties | 2 ++ pollen-ui-riot-js/src/main/web/i18n.json | 18 ++++++----- .../src/main/web/tag/poll/Settings.tag.html | 36 +++++++++++++++++---- 13 files changed, 111 insertions(+), 33 deletions(-) diff --git a/pollen-persistence/src/main/resources/db/migration/h2/V3_0_0_7__add_comment_and_new_choice_notifications_in_poll.sql b/pollen-persistence/src/main/resources/db/migration/h2/V3_0_0_7__add_comment_and_new_choice_notifications_in_poll.sql new file mode 100644 index 00000000..d029d391 --- /dev/null +++ b/pollen-persistence/src/main/resources/db/migration/h2/V3_0_0_7__add_comment_and_new_choice_notifications_in_poll.sql @@ -0,0 +1,6 @@ +-- add notification types in poll +alter table poll add commentNotification boolean; +alter table poll add newChoiceNotification boolean; + +update poll set commentNotification = true, newChoiceNotification = true where voteNotification; +update poll set commentNotification = false, newChoiceNotification = false where not voteNotification; \ No newline at end of file diff --git a/pollen-persistence/src/main/resources/db/migration/postgresql/V3_0_0_7__add_comment_and_new_choice_notifications_in_poll.sql b/pollen-persistence/src/main/resources/db/migration/postgresql/V3_0_0_7__add_comment_and_new_choice_notifications_in_poll.sql new file mode 100644 index 00000000..d029d391 --- /dev/null +++ b/pollen-persistence/src/main/resources/db/migration/postgresql/V3_0_0_7__add_comment_and_new_choice_notifications_in_poll.sql @@ -0,0 +1,6 @@ +-- add notification types in poll +alter table poll add commentNotification boolean; +alter table poll add newChoiceNotification boolean; + +update poll set commentNotification = true, newChoiceNotification = true where voteNotification; +update poll set commentNotification = false, newChoiceNotification = false where not voteNotification; \ No newline at end of file diff --git a/pollen-persistence/src/main/xmi/pollen.properties b/pollen-persistence/src/main/xmi/pollen.properties index c659a6ce..49cb0e8f 100644 --- a/pollen-persistence/src/main/xmi/pollen.properties +++ b/pollen-persistence/src/main/xmi/pollen.properties @@ -18,7 +18,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # #L% ###m -model.tagvalue.version=3.0.0.6 +model.tagvalue.version=3.0.0.7 #model.tagValue.notGenerateToString=true #model.tagValue.constantPrefix=PROPERTY_ #model.tagValue.useEnumerationName=true diff --git a/pollen-persistence/src/main/xmi/pollen.zargo b/pollen-persistence/src/main/xmi/pollen.zargo index 55e72c05..f967fa89 100644 Binary files a/pollen-persistence/src/main/xmi/pollen.zargo and b/pollen-persistence/src/main/xmi/pollen.zargo differ diff --git a/pollen-services/src/main/config/PollenServices.ini b/pollen-services/src/main/config/PollenServices.ini index 3e0eeb89..852fd00e 100644 --- a/pollen-services/src/main/config/PollenServices.ini +++ b/pollen-services/src/main/config/PollenServices.ini @@ -71,6 +71,18 @@ key = pollen.default.voteNotification type = Boolean defaultValue = false +[option defaultCommentNotification] +description = pollen.configuration.defaultCommentNotification +key = pollen.default.commentNotification +type = Boolean +defaultValue = false + +[option defaultNewChoiceNotification] +description = pollen.configuration.defaultNewChoiceNotification +key = pollen.default.newChoiceNotification +type = Boolean +defaultValue = false + [option defaultNotifyMeHoursBeforePollEnds] description = pollen.configuration.defaultNotifyMeHoursBeforePollEnds key = pollen.default.notifyMeHoursBeforePollEnds diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/bean/PollBean.java b/pollen-services/src/main/java/org/chorem/pollen/services/bean/PollBean.java index 09c7407b..d5104feb 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/bean/PollBean.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/bean/PollBean.java @@ -136,6 +136,10 @@ public class PollBean extends PollenBean<Poll> { protected boolean voteNotification; + protected boolean commentNotification; + + protected boolean newChoiceNotification; + protected String notificationLocale; protected ReportResumeBean report; @@ -183,6 +187,8 @@ public class PollBean extends PollenBean<Poll> { setChoiceType(entity.getChoiceType()); setNotifyMeHoursBeforePollEnds(entity.getNotifyMeHoursBeforePollEnds()); setVoteNotification(entity.isVoteNotification()); + setCommentNotification(entity.isCommentNotification()); + setNewChoiceNotification(entity.isNewChoiceNotification()); setNotificationLocale(entity.getNotificationLocale()); Date now = new Date(); @@ -244,6 +250,8 @@ public class PollBean extends PollenBean<Poll> { entity.setWithMe(isWithMe()); entity.setNotifyMeHoursBeforePollEnds(getNotifyMeHoursBeforePollEnds()); entity.setVoteNotification(isVoteNotification()); + entity.setCommentNotification(isCommentNotification()); + entity.setNewChoiceNotification(isNewChoiceNotification()); entity.setNotificationLocale(getNotificationLocale()); return entity; @@ -516,6 +524,22 @@ public class PollBean extends PollenBean<Poll> { this.voteNotification = voteNotification; } + public boolean isCommentNotification() { + return commentNotification; + } + + public void setCommentNotification(boolean commentNotification) { + this.commentNotification = commentNotification; + } + + public boolean isNewChoiceNotification() { + return newChoiceNotification; + } + + public void setNewChoiceNotification(boolean newChoiceNotification) { + this.newChoiceNotification = newChoiceNotification; + } + public String getNotificationLocale() { return notificationLocale; } diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/config/PollenServicesConfig.java b/pollen-services/src/main/java/org/chorem/pollen/services/config/PollenServicesConfig.java index bca8228d..37fc3d79 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/config/PollenServicesConfig.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/config/PollenServicesConfig.java @@ -140,6 +140,17 @@ public class PollenServicesConfig extends GeneratedPollenServicesConfig { return Boolean.valueOf(get().getOption(PollenServicesConfigOption.DEFAULT_VOTE_NOTIFICATION.getKey())); } + @Override + public Boolean getDefaultCommentNotification() { + return Boolean.valueOf(get().getOption(PollenServicesConfigOption.DEFAULT_COMMENT_NOTIFICATION.getKey())); + } + + + @Override + public Boolean getDefaultNewChoiceNotification() { + return Boolean.valueOf(get().getOption(PollenServicesConfigOption.DEFAULT_NEW_CHOICE_NOTIFICATION.getKey())); + } + public List<String> getMailsFeedbackList() { return Lists.newArrayList(get().getOption(PollenServicesConfigOption.MAILS_FEEDBACK.getKey()).split(",")); } diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/service/NotificationService.java b/pollen-services/src/main/java/org/chorem/pollen/services/service/NotificationService.java index ea9b86ac..035fb742 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/service/NotificationService.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/service/NotificationService.java @@ -210,7 +210,7 @@ public class NotificationService extends PollenServiceSupport { } public void onChoiceAdded(Poll poll, Choice choice) { - if (poll.isVoteNotification()) { + if (poll.isNewChoiceNotification()) { EmailService emailService = getEmailService(); ChoiceAddedEmail email = emailService.newChoiceAddedEmail(poll, choice); email.addTo(poll.getCreator().getEmail()); @@ -227,7 +227,7 @@ public class NotificationService extends PollenServiceSupport { } public void onCommentAdded(Poll poll, Comment comment) { - if (poll.isVoteNotification()) { + if (poll.isCommentNotification()) { EmailService emailService = getEmailService(); CommentAddedEmail email = emailService.newCommentAddedEmail(poll, comment); email.addTo(poll.getCreator().getEmail()); @@ -236,7 +236,7 @@ public class NotificationService extends PollenServiceSupport { } public void onCommentEdited(Poll poll, Comment comment) { - if (poll.isVoteNotification()) { + if (poll.isCommentNotification()) { EmailService emailService = getEmailService(); CommentEditedEmail email = emailService.newCommentEditedEmail(poll, comment); email.addTo(poll.getCreator().getEmail()); @@ -245,7 +245,7 @@ public class NotificationService extends PollenServiceSupport { } public void onCommentDeleted(Poll poll, Comment comment) { - if (poll.isVoteNotification()) { + if (poll.isCommentNotification()) { EmailService emailService = getEmailService(); CommentDeletedEmail email = emailService.newCommentDeletedEmail(poll, comment); email.addTo(poll.getCreator().getEmail()); diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/service/PollService.java b/pollen-services/src/main/java/org/chorem/pollen/services/service/PollService.java index 87d9bbf3..735c9901 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/service/PollService.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/service/PollService.java @@ -181,6 +181,8 @@ public class PollService extends PollenServiceSupport { pollBean.setResultVisibility(pollenServiceConfig.getDefaultResultVisibility()); pollBean.setContinuousResults(pollenServiceConfig.getDefaultContinuousResults()); pollBean.setVoteNotification(pollenServiceConfig.getDefaultVoteNotification()); + pollBean.setCommentNotification(pollenServiceConfig.getDefaultCommentNotification()); + pollBean.setNewChoiceNotification(pollenServiceConfig.getDefaultNewChoiceNotification()); pollBean.setNotifyMeHoursBeforePollEnds(pollenServiceConfig.getDefaultNotifyMeHoursBeforePollEnds()); // -- creator -- // @@ -309,19 +311,6 @@ public class PollService extends PollenServiceSupport { Poll savedPoll = savePoll(clonedPoll, clonedChoices); - //clone VoterList -// List<VoterListBean> clonedVoterList = toBeanList(VoterListBean.class, getVoterListService().getVoterLists0(poll)); -// for (VoterListBean voterList : clonedVoterList) { -// List<VoterListMemberBean> clonedVoterListMember = toBeanList(VoterListMemberBean.class, getVoterListService().getVoterListMembers0(voterList.toEntity())); -// -// voterList.setEntityId(null); -// VoterList savedVoterList = getVoterListService().saveVoterList(savedPoll, voterList); -// -// for (VoterListMemberBean member : clonedVoterListMember) { -// member.setEntityId(null); -// getVoterListService().saveVoterListMember(savedVoterList, member); -// } -// } commit(); getNotificationService().onPollCreated(savedPoll); @@ -467,6 +456,8 @@ public class PollService extends PollenServiceSupport { toSave.setChoiceType(poll.getChoiceType()); toSave.setWithMe(poll.isWithMe()); toSave.setVoteNotification(poll.isVoteNotification()); + toSave.setCommentNotification(poll.isCommentNotification()); + toSave.setNewChoiceNotification(poll.isNewChoiceNotification()); toSave.setNotifyMeHoursBeforePollEnds(poll.getNotifyMeHoursBeforePollEnds()); toSave.setNotificationLocale(poll.getNotificationLocale()); if (poll.withParticipants()) { diff --git a/pollen-services/src/main/resources/i18n/pollen-services_en_GB.properties b/pollen-services/src/main/resources/i18n/pollen-services_en_GB.properties index 3878bd2e..aeb42167 100644 --- a/pollen-services/src/main/resources/i18n/pollen-services_en_GB.properties +++ b/pollen-services/src/main/resources/i18n/pollen-services_en_GB.properties @@ -1,11 +1,13 @@ PollenServicesConfig.description=Pollen Backend configuration pollen.configuration.data.directory=Directory where Pollen stores his data pollen.configuration.defaultChoiceType=Default choice type +pollen.configuration.defaultCommentNotification=Default notification type for the comments of a poll pollen.configuration.defaultCommentPageSize=Default number of comments per page pollen.configuration.defaultCommentVisibility=Default comment visibility pollen.configuration.defaultContinuousResults=Défault continuous results pollen.configuration.defaultFavoriteListMemberPageSize=Default number of participants per page pollen.configuration.defaultFavoriteListPageSize=Default number of favorite lists per page +pollen.configuration.defaultNewChoiceNotification=Default notification type for the new choices of a poll pollen.configuration.defaultNotifyMeHoursBeforePollEnds=Default time before the end of the poll to send the reminder email pollen.configuration.defaultPollChoiceType=Default choice type used when creating a new poll pollen.configuration.defaultPollCommentVisibility=Default Poll comment visibility used when creating a new poll diff --git a/pollen-services/src/main/resources/i18n/pollen-services_fr_FR.properties b/pollen-services/src/main/resources/i18n/pollen-services_fr_FR.properties index cba4a21c..5cd63aff 100644 --- a/pollen-services/src/main/resources/i18n/pollen-services_fr_FR.properties +++ b/pollen-services/src/main/resources/i18n/pollen-services_fr_FR.properties @@ -1,11 +1,13 @@ PollenServicesConfig.description=Configuration du backend de Pollen pollen.configuration.data.directory=Répertoire de données de l'application pollen.configuration.defaultChoiceType=Type de choix par défaut +pollen.configuration.defaultCommentNotification=Type de notification par défaut pour les commentaires pollen.configuration.defaultCommentPageSize=Nombre de commentaires par page pollen.configuration.defaultCommentVisibility=Visibilité des commentaires par défaut pollen.configuration.defaultContinuousResults=Voire les résultats en continue par défaut pollen.configuration.defaultFavoriteListMemberPageSize=Nomnre de participants par page pollen.configuration.defaultFavoriteListPageSize=Nombre de liste de favoris par page +pollen.configuration.defaultNewChoiceNotification=Type de notification par défaut pour les nouveaux choix pollen.configuration.defaultNotifyMeHoursBeforePollEnds=Combien de temps par défaut avant la fin du sondage envoyer le rappel pollen.configuration.defaultPollChoiceType=Type de choix par défaut lors de la création d'un nouveau sondage pollen.configuration.defaultPollCommentVisibility=Visibilité des commentaires par défaut lors de la création d'un nouveau sondage diff --git a/pollen-ui-riot-js/src/main/web/i18n.json b/pollen-ui-riot-js/src/main/web/i18n.json index 6584374d..b4d34d79 100644 --- a/pollen-ui-riot-js/src/main/web/i18n.json +++ b/pollen-ui-riot-js/src/main/web/i18n.json @@ -318,10 +318,11 @@ "poll_settings_freePoll": "Tout le monde peut voter (Sondage public)", "poll_settings_restrictedPoll": "Seul les invités peuvent voter (Sondage privé)", "poll_settings_restrictedPoll_withMe": "Je participe au sondage", - "poll_settings_voteNotification": "Recevoir des notifications", - "poll_settings_voteNotification_disabled": "Pour activer les notifications, vous devez renseigner votre courriel dans la partie 'Description'.", - "poll_settings_voteNotification_never": "Jamais", - "poll_settings_voteNotification_everyVote": "À chaque vote", + "poll_settings_notification": "Recevoir des notifications :", + "poll_settings_notification_disabled": "Pour activer les notifications, vous devez renseigner votre courriel dans la partie 'Description'.", + "poll_settings_voteNotification": "À chaque action sur les votes", + "poll_settings_commentNotification": "À chaque action sur les commentaires", + "poll_settings_newChoiceNotification": "À chaque ajout de choix", "poll_settings_notifyMeBeforePollEnds": "Recevoir une notification avant la fin des votes", "poll_settings_notifyMeBeforePollEnds_disabled": "Pour activer le rappel de la fin du sondage, vous devez renseigner votre courriel dans la partie 'Description', et choisir une date de fin pour le sondage en activant la période d'ouverture des votes.", "poll_settings_notifyMeHoursBeforePollEnds": "Combien d'heures avant ?", @@ -846,10 +847,11 @@ "poll_settings_freePoll": "Everybody can vote (Public poll)", "poll_settings_restrictedPoll": "Only invited people can vote (Private poll)", "poll_settings_restrictedPoll_withMe": "I also want to participate", - "poll_settings_voteNotification": "Receive notifications", - "poll_settings_voteNotification_disabled": "To enable the notifications, you need to enter you email address in the 'Description' part.", - "poll_settings_voteNotification_never": "Never", - "poll_settings_voteNotification_everyVote": "For every vote", + "poll_settings_notification": "Receive notifications:", + "poll_settings_notification_disabled": "To enable the notifications, you need to enter you email address in the 'Description' part.", + "poll_settings_voteNotification": "For every action on the votes", + "poll_settings_commentNotification": "For every action on the comments", + "poll_settings_newChoiceNotification": "For every new choice added", "poll_settings_notifyMeBeforePollEnds": "Receive a notification before the end of the votes", "poll_settings_notifyMeBeforePollEnds_disabled": "To enable the notifications, you need to enter you email address in the 'Description' part, and select an end date for the poll by enabling the vote opening period.", "poll_settings_notifyMeHoursBeforePollEnds": "How many hours before?", diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Settings.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Settings.tag.html index cebb6f6e..3b04d5bf 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Settings.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Settings.tag.html @@ -297,8 +297,12 @@ require("../components/date-time-picker.tag.html"); <div class="form-section"> <h4><i class="fa fa-paper-plane"></i> {__.nav_notification}</h4> - <div class="o-form-element"> - <label class="c-toggle c-toggle--info"> + <fieldset class="o-fieldset"> + <legend class="o-fieldset__legend"> + {__.notification} + <i class="fa fa-question-circle cursor-help warning" if="{!form.model.creatorEmail}" title="{__.notification_disabled}"></i> + </legend> + <label class="c-field c-field--choice c-toggle c-toggle--info"> {__.voteNotification} <input type="checkbox" ref="voteNotification" @@ -307,9 +311,28 @@ require("../components/date-time-picker.tag.html"); <div class="c-toggle__track"> <div class="c-toggle__handle"></div> </div> - <i class="fa fa-question-circle cursor-help warning" if="{!form.model.creatorEmail}" title="{__.voteNotification_disabled}"></i> </label> - </div> + <label class="c-field c-field--choice c-toggle c-toggle--info"> + {__.commentNotification} + <input type="checkbox" + ref="commentNotification" + checked={form.model.commentNotification} + disabled={!form.model.creatorEmail || opts.form.model.closed}> + <div class="c-toggle__track"> + <div class="c-toggle__handle"></div> + </div> + </label> + <label class="c-field c-field--choice c-toggle c-toggle--info"> + {__.newChoiceNotification} + <input type="checkbox" + ref="newChoiceNotification" + checked={form.model.newChoiceNotification} + disabled={!form.model.creatorEmail || opts.form.model.closed}> + <div class="c-toggle__track"> + <div class="c-toggle__handle"></div> + </div> + </label> + </fieldset> <div class="o-form-element"> <label class="c-toggle c-toggle--info"> {__.notifyMeBeforePollEnds} @@ -358,9 +381,6 @@ require("../components/date-time-picker.tag.html"); this.on("mount", () => { this.refs["voteCountingType" + this.form.model.voteCountingType].checked = true; this.refs.voteCountingType.value = this.form.model.voteCountingType; - if (!this.form.model.creatorEmail) { - this.refs.voteNotification.value = "NEVER"; - } this.updateVoteCountingTypeHelp(); }); @@ -463,6 +483,8 @@ require("../components/date-time-picker.tag.html"); this.form.model.continuousResults = this.refs.continuousResults.checked; this.form.model.voteNotification = this.refs.voteNotification.checked; + this.form.model.commentNotification = this.refs.commentNotification.checked; + this.form.model.newChoiceNotification = this.refs.newChoiceNotification.checked; this.form.model.notificationLocale = this.session.locale; if (this.notifyMeBeforePollEnds) { this.form.model.notifyMeHoursBeforePollEnds = this.refs.notifyMeHoursBeforePollEnds.value; -- 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 542ae9c6bf663bab28095a8ee0d9cd31b70d8313 Author: Kevin Morin <morin@codelutin.com> Date: Mon Aug 7 17:16:29 2017 +0200 ajout d'un timer sur le tooltip pour eviter de recalculer des positions inutilement --- .../src/main/web/tag/poll/Votes.tag.html | 44 +++++++++++++--------- 1 file changed, 27 insertions(+), 17 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 caf6fb1b..9cc46858 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 @@ -394,31 +394,40 @@ require("../components/HumanInput.tag.html"); this.update(); }; + this.tooltipTimeout = null; + this.showTooltip = (vote, choice) => (e) => { e.preventDefault(); e.stopPropagation(); - this.voteTooltip = { - choice: choice, - vote: vote, - show: choice || !vote || !vote.anonymous - }; - this.update(); - if (this.voteTooltip.show) { - let voteTooltip = this.refs.voteTooltip; - voteTooltip.style.top = (e.target.offsetTop + e.target.offsetHeight + 10) + "px"; - voteTooltip.style.left = (e.target.offsetLeft + (e.target.offsetWidth - voteTooltip.offsetWidth) / 2) + "px"; - } + + this.tooltipTimeout = setTimeout(() => { + this.voteTooltip = { + choice: choice, + vote: vote, + show: choice || !vote || !vote.anonymous + }; + this.update(); + if (this.voteTooltip.show) { + let voteTooltip = this.refs.voteTooltip; + voteTooltip.style.top = (e.target.offsetTop + e.target.offsetHeight + 10) + "px"; + voteTooltip.style.left = (e.target.offsetLeft + (e.target.offsetWidth - voteTooltip.offsetWidth) / 2) + "px"; + } + }, 500); }; this.hideTooltip = (e) => { e.preventDefault(); e.stopPropagation(); - this.voteTooltip = { - choice: null, - vote: null, - show: false - }; - this.update(); + clearTimeout(this.tooltipTimeout); + this.tooltipTimeout = null; + if (this.voteTooltip.show) { + this.voteTooltip = { + choice: null, + vote: null, + show: false + }; + this.update(); + } }; </script> @@ -609,6 +618,7 @@ require("../components/HumanInput.tag.html"); box-shadow: 0px 0px 10px var(--shadow); opacity: 0.8; text-align: center; + z-index: 9999; } .voters .vote-tooltip:after { -- 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 c4b6fe5e82a3f0d6c3c1d3b1fe09dfeaf9e97565 Author: Kevin Morin <morin@codelutin.com> Date: Tue Aug 8 16:37:17 2017 +0200 fixes #114 alignement des colonnes fixes #103 mauvaise gestion des valeurs de choix trop longues --- pollen-ui-riot-js/src/main/web/css/main.css | 4 + .../src/main/web/tag/poll/ChoiceView.tag.html | 8 - .../src/main/web/tag/poll/Poll.tag.html | 10 +- .../src/main/web/tag/poll/Votes.tag.html | 335 +++++++++++---------- 4 files changed, 182 insertions(+), 175 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/css/main.css b/pollen-ui-riot-js/src/main/web/css/main.css index eb3a228b..04db9045 100644 --- a/pollen-ui-riot-js/src/main/web/css/main.css +++ b/pollen-ui-riot-js/src/main/web/css/main.css @@ -367,6 +367,10 @@ time-picker .next:hover { background-color: var(--dropdown-hover); } +.separator { + border: 1px solid var(--separator); +} + .separator-top { border-top: 1px solid var(--separator); } diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/ChoiceView.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/ChoiceView.tag.html index cc49a692..5389dadc 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/ChoiceView.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/ChoiceView.tag.html @@ -120,14 +120,6 @@ require("./Report.tag.html"); justify-content: center; } - .choice-view .choice-text, - .choice-view .choice-date, - .choice-view .choice-datetime { - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; - } - .choice-view.with-info { cursor: pointer; } diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag.html index 74a32ae8..7600dc3d 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag.html @@ -78,8 +78,14 @@ require("./Report.tag.html"); <div class="left-icon" if={poll.choiceAddAllowed}> <i class="fa fa-check-square"></i> <p>{__.dateAddChoices}</p> - <p>{poll.endDate ? __.dateFrom : __.dateFromNoEnd} <span class="brand">{formatDate(poll.beginChoiceDate)}</span></p> - <p if={poll.endDate}> {__.dateTo} <span class="brand">{formatDate(poll.endChoiceDate)}</span></p> + <p> + {poll.endChoiceDate || poll.endDate ? __.dateFrom : __.dateFromNoEnd} + <span class="brand">{formatDate(poll.beginChoiceDate ? poll.beginChoiceDate : poll.beginDate)}</span> + </p> + <p if={poll.endChoiceDate || poll.endDate}> + {__.dateTo} + <span class="brand">{formatDate(poll.endChoiceDate ? poll.endChoiceDate : poll.endDate)}</span> + </p> </div> <div class="cursor-pointer left-icon" if="{poll.voteCountingTypeValue}" onclick="{toggleHelp}"> 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 9cc46858..d481bafb 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 @@ -6,10 +6,11 @@ require("../components/HumanInput.tag.html"); <div class="container" show="{loaded}"> <!-- Form to vote --> - <div class="voter"> - <form id="voteForm" ref="formAddVote" class="fix separator-top separator-left separator-bottom"> - <HumanInput onsubmit="{voteInEdition ? updateVote : addVote}"></HumanInput> - <div class="current-voter"> + <div class="form-wrapper"> + <form id="voteForm" class="voter separator" ref="formAddVote"> + <HumanInput onsubmit="{voteInEdition ? updateVote : addVote}"></HumanInput> + <div class="header separator-bottom"> + <div class="current-voter separator-right"> <div class="o-field o-field--icon-left o-field--icon-right" if={poll.canVote || voteInEdition} > <i class="fa fa-fw fa-user c-icon"></i> @@ -27,7 +28,12 @@ require("../components/HumanInput.tag.html"); {__.choices} </div> </div> - <div each={choice in poll.choices} class="choice separator-top"> + <div if={poll.resultIsVisible} class="result-label"> + <strong>{__.results}</strong> + </div> + </div> + <div each={choice in poll.choices} class="choice separator-bottom"> + <div class="choice-vote separator-right"> <div class="choice-value"> <ChoiceView choice={choice} center="true"></ChoiceView> </div> @@ -48,59 +54,54 @@ require("../components/HumanInput.tag.html"); ref="{choice.id}_voteValue"> </div> </div> - <div class="current-voter-actions separator-top"> - <button if={poll.canVote && !voteInEdition} - class="c-button c-button--brand pull-right" - type="submit" - name="newVote" - disabled={tooManyChoicesSelected}> - <i class="fa fa-envelope"></i> - {__.toVote} - </button> - <button if="{voteInEdition}" - class="c-button c-button--error" - type="button" - onclick="{cancelEditVote}"> - <i class="fa fa-remove"></i> - {__.cancelEdition} - </button> - <button if="{voteInEdition}" - class="c-button c-button--success" - type="submit"> - <i class="fa fa-check"></i> - {__.validateEdition} - </button> - </div> - <div class="c-hint--static c-hint--error" if="{tooManyChoicesSelected}"> - {__.tooManyChoicesSelected} {poll.maxChoiceNumber} - </div> - <div class="c-hint--static c-hint--error" if="{error}"> - <div each={fields in error}> - {fields} - </div> + <div if={poll.resultIsVisible} class="score-choice"> + <span if={!choice.score}>{parent.__.noVote}</span> + <span if={choice.score}> + <i if="{choice.score.scoreOrder === 0}" class="fa fa-trophy fa-15x winner"></i> + {choice.score.scoreValue} + {parent.__["results_unit_" + poll.voteCountingType + "_" + (choice.score.scoreValue > 1 ? "many" : "one")]} + </span> </div> - </form> - - <div class="window separator-top separator-left separator-bottom separator-right"> - <div class="frame"> - <div if={poll.resultIsVisible} class="results"> - <div class="result-label"> - <strong>{__.results}</strong> - </div> - <div each={choice in poll.choices} class="score-choice separator-top"> - <span if={!choice.score}>{parent.__.noVote}</span> - <span if={choice.score}> - <i if="{choice.score.scoreOrder === 0}" class="fa fa-trophy fa-15x winner"></i> - {choice.score.scoreValue} - {parent.__["results_unit_" + poll.voteCountingType + "_" + (choice.score.scoreValue > 1 ? "many" : "one")]} - </span> - </div> - <div class="results-actions separator-top"> - + </div> + <div class="footer"> + <div class="current-voter-actions separator-right"> + <div class="current-voter-buttons"> + <button if={poll.canVote && !voteInEdition} + class="c-button c-button--brand pull-right" + type="submit" + name="newVote" + disabled={tooManyChoicesSelected}> + <i class="fa fa-envelope"></i> + {__.toVote} + </button> + <button if="{voteInEdition}" + class="c-button c-button--error" + type="button" + onclick="{cancelEditVote}"> + <i class="fa fa-remove"></i> + {__.cancelEdition} + </button> + <button if="{voteInEdition}" + class="c-button c-button--success" + type="submit"> + <i class="fa fa-check"></i> + {__.validateEdition} + </button> + </div> + <div class="c-hint--static c-hint--error" if="{tooManyChoicesSelected}"> + {__.tooManyChoicesSelected} {poll.maxChoiceNumber} + </div> + <div class="c-hint--static c-hint--error" if="{error}"> + <div each={fields in error}> + {fields} </div> </div> </div> + <div if={poll.resultIsVisible} class="results-actions"> + + </div> </div> + </form> </div> <!-- Show votes --> @@ -114,8 +115,8 @@ require("../components/HumanInput.tag.html"); </div> </div> </div> - <div each="{vote, index in poll.votes}" class="row separator-bottom"> - <div class="name separator-right separator-left"> + <div each="{vote, index in poll.votes}" class="row separator-bottom separator-right"> + <div class="name separator-left"> <div class="voter-name" onmouseenter="{parent.showTooltip(vote)}" onclick="{parent.showTooltip(vote)}" onmouseleave="{parent.hideTooltip}"> <i class="fa fa-user-circle c-icon"></i> <span if="{!vote.anonymous}">{vote.voterName}</span> @@ -136,7 +137,7 @@ require("../components/HumanInput.tag.html"); <i class="fa fa-trash"></i> </button> </div> - <div class="results" ref="results"> + <div class="results separator-left" ref="results{index}"> <div each="{choice in poll.choices}" class="result separator-right {'checkbox' : pollTypeCheckbox} {'selected' : pollTypeCheckbox && poll.getVoteValue(vote, choice) == 1}" onmouseenter="{parent.showTooltip(vote, choice)}" onclick="{parent.showTooltip(vote, choice)}" onmouseleave="{parent.hideTooltip}"> @@ -177,7 +178,7 @@ require("../components/HumanInput.tag.html"); </form> </div> - <script type="es6"> + <script type="es6"> const MIN_CHOICE_COLUMN_WIDTH = 100; this.loaded = false; let session = require("../../js/Session"); @@ -200,8 +201,8 @@ require("../components/HumanInput.tag.html"); this.choiceToAdd = this.poll.initChoice(); this.updateShowChoiceContainer = () => { - this.showChoiceHeader = this.refs.results && this.refs.results.length > 0 - && this.refs.results[0].offsetWidth / this.poll.choices.length >= MIN_CHOICE_COLUMN_WIDTH; + this.showChoiceHeader = this.refs.results0 + && this.refs.results0.offsetWidth / this.poll.choices.length >= MIN_CHOICE_COLUMN_WIDTH; }; this.onPollChange = poll => { @@ -431,105 +432,108 @@ require("../components/HumanInput.tag.html"); }; </script> - <style> - - .voter { - display: flex; - flex-direction: row; - flex-wrap: nowrap; - justify-content: center; - align-items: stretch; - margin-top: 20px; - } - - .voter .fix { - flex-grow: 0; - min-width: 200px; - } - - .voter .fix .choice { - display: flex; - flex-direction: row; - flex-wrap: nowrap; - justify-content: flex-start; - align-items: stretch; - } - - .voter .fix .choice .choice-value { - flex-grow: 1; - font-size: 1.5em; - min-width: 0; - } - - .voter .fix .choice .current-choice { - flex-grow: 0; - display: flex; - justify-content: center; - min-width: 50px; - } - - .voter .window { - overflow-x: auto; - overflow-y: hidden; - } - - .voter .window .frame { - display: flex; - flex-direction: row; - flex-wrap: nowrap; - justify-content: flex-start; - align-items: stretch; - height: 100%; - } - - .voter .window .frame .results { - min-width: 100px; - } - - .voter .window .frame .vote { - min-width: 100px; - } - - .voter .window .frame .expand, - .voter .window .frame .collapse { - padding: 0; - min-width: 6px; - } - - .current-voter, - .result-label { - height: 40px; - text-align: center; - padding: 3px; - line-height: 35px; - } - - .voter .fix .choice, - .voter .fix .current-voter-actions, - .voter .window .frame .vote .vote-choice, - .voter .window .frame .vote .vote-actions, - .voter .window .frame .results .score-choice, - .voter .window .frame .results .results-actions { - height: 40px; - display: flex; - align-items: center; - justify-content: center; - } - - .check { - width: 25px; - height: 25px; - } - - .text { - width: 60px; - height: 30px; - margin: 0 0 0 5px; - } - - .choice.c-field { - padding: 0 0 0 1px; - } + <style> + + .form-wrapper { + display: flex; + flex-direction: row; + justify-content: center; + align-items: stretch; + } + + .voter { + display: flex; + flex-direction: column; + flex-wrap: nowrap; + margin-top: 20px; + justify-content: center; + align-items: stretch; + } + + .voter > div { + flex-grow: 0; + display: flex; + flex-direction: row; + min-height: 40px; + } + + .voter .header > * { + height: 40px; + text-align: center; + padding: 3px; + line-height: 35px; + } + + .voter .header .current-voter { + flex-grow: 1; + min-width: 200px; + } + + .voter .result-label, .voter .score-choice, .voter .results-actions { + width: 120px; + min-width: 120px; + flex-grow: 0; + text-align: center; + padding: 3px; + align-self: center; + } + + .voter .choice { + flex-wrap: nowrap; + align-items: stretch; + justify-content: center; + } + + .voter .choice .choice-vote { + display: flex; + flex-direction: row; + flex-wrap: nowrap; + align-items: center; + justify-content: center; + flex-grow: 1; + } + + .voter .choice .choice-value { + flex-grow: 1; + font-size: 1.2em; + min-width: 0; + padding: 5px; + } + + .voter .choice .current-choice { + display: flex; + justify-content: center; + min-width: 50px; + } + + .voter .current-voter-actions { + display: flex; + flex-direction: column; + flex-grow: 1; + } + + .voter .current-voter-buttons { + display: flex; + flex-direction: row; + padding: 5px; + justify-content: center; + align-items: center; + } + + .check { + width: 25px; + height: 25px; + } + + .text { + width: 60px; + height: 30px; + margin: 0 0 0 5px; + } + + .choice.c-field { + padding: 0 0 0 1px; + } .voters { display: flex; @@ -546,7 +550,8 @@ require("../components/HumanInput.tag.html"); } .voters .row > :first-child { - width: 250px; + width: 200px; + min-width: 200px; display: flex; height: 2em; padding: 0 5px; @@ -556,14 +561,18 @@ require("../components/HumanInput.tag.html"); border-bottom-color: var(--brand); } - .voters .name { + .voters :not(.vote-tooltip) { overflow: hidden; } + .voters .choice-view * { + white-space: nowrap; + text-overflow: ellipsis; + } + .voters .voter-name { flex-grow: 1; padding: 5px; - overflow: hidden; white-space:nowrap; text-overflow:ellipsis; } @@ -589,10 +598,6 @@ require("../components/HumanInput.tag.html"); height: 2em; padding: 5px; text-align: center; - } - - .voters .choice { - overflow: hidden; white-space:nowrap; text-overflow:ellipsis; } -- 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 859d23bd575d91569608acac087432f13b09df5a Author: Kevin Morin <morin@codelutin.com> Date: Tue Aug 8 17:07:11 2017 +0200 fixes #105 navigation au clavier + blocage des boutons pendant l'attente de la réponse du serveur --- .../src/main/web/tag/poll/Votes.tag.html | 55 ++++++++++++++++++---- 1 file changed, 47 insertions(+), 8 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 d481bafb..a7c3cfb8 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 @@ -20,6 +20,7 @@ require("../components/HumanInput.tag.html"); name="voterName" required maxlength="255" + tabindex="1" placeholder={__.authorPlaceHolder} value={poll.voterName}> </div> @@ -32,7 +33,7 @@ require("../components/HumanInput.tag.html"); <strong>{__.results}</strong> </div> </div> - <div each={choice in poll.choices} class="choice separator-bottom"> + <div each={choice, index in poll.choices} class="choice separator-bottom"> <div class="choice-vote separator-right"> <div class="choice-value"> <ChoiceView choice={choice} center="true"></ChoiceView> @@ -43,7 +44,8 @@ require("../components/HumanInput.tag.html"); class="check" type="checkbox" onchange="{onVoteChanged}" - ref="{choice.id}_voteValue"> + ref="{choice.id}_voteValue" + tabindex="{10 * (index + 1)}"> <input if={!pollTypeCheckbox} class="text c-field {c-field--error: !voteInEdition && error && (error['vote.voteValue#' + choice.id] || error['vote.totalVoteValue'])}" type="number" @@ -51,7 +53,8 @@ require("../components/HumanInput.tag.html"); min="{poll.voteCountingTypeValue && poll.voteCountingTypeValue.minimumValue}" max="{poll.voteCountingTypeValue && poll.voteCountingTypeValue.maximumValue}" onchange="{onVoteChanged}" - ref="{choice.id}_voteValue"> + ref="{choice.id}_voteValue" + tabindex="{10 * (index + 1)}"> </div> </div> <div if={poll.resultIsVisible} class="score-choice"> @@ -70,19 +73,24 @@ require("../components/HumanInput.tag.html"); class="c-button c-button--brand pull-right" type="submit" name="newVote" - disabled={tooManyChoicesSelected}> + tabindex="{(poll.choices.length + 1) * 10}" + disabled={tooManyChoicesSelected || voting}> <i class="fa fa-envelope"></i> {__.toVote} </button> <button if="{voteInEdition}" class="c-button c-button--error" type="button" - onclick="{cancelEditVote}"> + tabindex="{(poll.choices.length + 2) * 10}" + onclick="{cancelEditVote}" + disabled={voting}> <i class="fa fa-remove"></i> {__.cancelEdition} </button> <button if="{voteInEdition}" class="c-button c-button--success" + tabindex="{(poll.choices.length + 1) * 10}" + disabled={tooManyChoicesSelected || voting} type="submit"> <i class="fa fa-check"></i> {__.validateEdition} @@ -125,14 +133,14 @@ require("../components/HumanInput.tag.html"); <button type="button" class="c-button c-button--rounded u-xsmall c-button--brand" if="{!poll.closed && vote.permission}" - disabled="{voteInEdition != null}" + disabled="{voteInEdition != null || voting}" onclick="{parent.onEditVote(vote)}"> <i class="fa fa-pencil-square-o"></i> </button> <button type="button" class="c-button c-button--rounded u-xsmall c-button--error" if="{poll.permission || !poll.closed && vote.permission}" - disabled="{voteInEdition != null}" + disabled="{voteInEdition != null || voting}" onclick="{parent.deleteVote(vote)}"> <i class="fa fa-trash"></i> </button> @@ -191,6 +199,7 @@ require("../components/HumanInput.tag.html"); choice: null, vote: null }; + this.voting = false; this.addingChoice = false; this.poll = require("../../js/Poll.js"); @@ -244,7 +253,7 @@ require("../components/HumanInput.tag.html"); input.checked = choice.voteValue === 1; } }); - this.refs.voterName.focus(); + this.refs[this.poll.choices[0].id + "_voteValue"].focus(); }; this.getChoiceVoteValue = ref => { @@ -292,6 +301,10 @@ require("../components/HumanInput.tag.html"); this.addVote = (e) => { e.preventDefault(); e.stopPropagation(); + + this.voting = true; + this.update(); + let vote = { id: null, voterName: this.refs.voterName.value, @@ -309,15 +322,21 @@ require("../components/HumanInput.tag.html"); this.resetPoll(); if (this.poll.resultIsVisible) { this.poll.loadResults().then(() => { + this.voting = false; this.updateShowChoiceContainer(); this.update(); + }, () => { + this.voting = false; + this.update(); }); } else { + this.voting = false; this.update(); } }, (error) => { this.error = error; + this.voting = false; this.update(); }); }; @@ -326,6 +345,9 @@ require("../components/HumanInput.tag.html"); e.preventDefault(); e.stopPropagation(); + this.voting = true; + this.update(); + let updateVote = Object.assign({}, this.voteInEdition); // don't modify original vote updateVote.voterName = this.refs.voterName.value; @@ -345,13 +367,19 @@ require("../components/HumanInput.tag.html"); this.resetPoll(); if (this.poll.resultIsVisible) { this.poll.loadResults().then(() => { + this.voting = false; + this.update(); + }, () => { + this.voting = false; this.update(); }); } else { + this.voting = false; this.update(); } }, (error) => { + this.voting = false; this.error = error; this.update(); }); @@ -360,11 +388,21 @@ require("../components/HumanInput.tag.html"); this.deleteVote = (vote) => (e) => { e.preventDefault(); e.stopPropagation(); + this.confirm(this.__.delete).then((confirm) => { if (confirm) { + this.voting = false; + this.update(); + this.poll.deleteVote(vote).then(() => { this.selectedChoiceNb = 0; this.updateShowChoiceContainer(); + this.voting = false; + this.update(); + }, + (error) => { + this.voting = false; + this.error = error; this.update(); }); } @@ -382,6 +420,7 @@ require("../components/HumanInput.tag.html"); this.poll.addChoice(this.choiceToAdd).then(() => { this.addingChoice = false; this.choiceToAdd = this.poll.initChoice(this.choiceToAdd); + this.updateShowChoiceContainer(); this.update(); }, errors => { this.addingChoice = false; -- 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 14bc4e646fbbe4dd869aac75ba58bdb248d0c496 Author: Kevin Morin <morin@codelutin.com> Date: Tue Aug 8 17:39:30 2017 +0200 resteasy ne supporte pas le body des requetes delete --- pollen-ui-riot-js/src/main/web/js/FetchService.js | 4 ++-- pollen-ui-riot-js/src/main/web/tag/poll/Votes.tag.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/js/FetchService.js b/pollen-ui-riot-js/src/main/web/js/FetchService.js index 0b99b29c..8966f29b 100644 --- a/pollen-ui-riot-js/src/main/web/js/FetchService.js +++ b/pollen-ui-riot-js/src/main/web/js/FetchService.js @@ -108,9 +108,9 @@ class FetchService { return this.fetch(url, "PUT", null, body); } - doDelete(url, body, params) { + doDelete(url, params) { url = this._addParamsToUrl(url, params); - return this.fetch(url, "DELETE", null, body); + return this.fetch(url, "DELETE"); } form(url, data, doNotStringify, params) { 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 a7c3cfb8..5bd35e44 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 @@ -391,7 +391,7 @@ require("../components/HumanInput.tag.html"); this.confirm(this.__.delete).then((confirm) => { if (confirm) { - this.voting = false; + this.voting = true; this.update(); this.poll.deleteVote(vote).then(() => { -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm