branch feature/pollen-riot-js updated (b91ed54 -> af80ddf)
This is an automated email from the git hooks/post-receive script. New change to branch feature/pollen-riot-js in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git from b91ed54 upgrade all poms to 3.0 + remove old js folders new 1b13441 Generate poll participants for restricted poll new af80ddf Add my participant polls and my invited polls The 2 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 af80ddf9b3e937f6a8cf1e3f7aea7a4f909f0343 Author: Tony CHEMIT <dev@tchemit.fr> Date: Thu Feb 23 10:43:03 2017 +0100 Add my participant polls and my invited polls commit 1b13441724ba41ded81b003031a015d4c466e84d Author: Tony CHEMIT <dev@tchemit.fr> Date: Thu Feb 23 10:42:44 2017 +0100 Generate poll participants for restricted poll Summary of changes: .../pollen/services/service/PollService.java | 27 ++++++++++++++++++++++ pollen-ui-riot-js/src/main/web/i18n.json | 8 +++++++ pollen-ui-riot-js/src/main/web/js/PollService.js | 8 +++++++ pollen-ui-riot-js/src/main/web/tag/Header.tag | 2 ++ pollen-ui-riot-js/src/main/web/tag/Pollen.tag | 16 +++++++++++++ 5 files changed, 61 insertions(+) -- 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/pollen-riot-js in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 1b13441724ba41ded81b003031a015d4c466e84d Author: Tony CHEMIT <dev@tchemit.fr> Date: Thu Feb 23 10:42:44 2017 +0100 Generate poll participants for restricted poll --- .../pollen/services/service/PollService.java | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) 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 c56e175..16a2259 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 @@ -22,10 +22,12 @@ package org.chorem.pollen.services.service; */ import com.google.common.base.Joiner; +import com.google.common.collect.Sets; import org.apache.commons.collections4.CollectionUtils; import org.chorem.pollen.persistence.entity.Choice; import org.chorem.pollen.persistence.entity.ChoiceType; import org.chorem.pollen.persistence.entity.Poll; +import org.chorem.pollen.persistence.entity.PollType; import org.chorem.pollen.persistence.entity.PollenPrincipal; import org.chorem.pollen.persistence.entity.PollenUser; import org.chorem.pollen.persistence.entity.VoterList; @@ -43,9 +45,13 @@ import org.nuiton.util.pagination.PaginationResult; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.Calendar; import java.util.Date; +import java.util.LinkedHashSet; +import java.util.LinkedList; import java.util.List; +import java.util.Set; import java.util.function.Function; import static org.nuiton.i18n.I18n.l; @@ -189,6 +195,25 @@ public class PollService extends PollenServiceSupport { errorMap.failIfNotEmpty(); Poll savedPoll = savePoll(poll, choices); + + if (poll.getPollType() == PollType.RESTRICTED) { + Set<String> emails = new LinkedHashSet<>(poll.getParticipants()); + if (poll.isWithMe()) { + emails.add(poll.getCreatorEmail()); + } + VoterListBean voterList = getVoterListService().newRestrictedVoterList(); + List<VoterListMemberBean> members = new LinkedList<>(); + for (String email : emails) { + VoterListMemberBean member = new VoterListMemberBean(); + member.setEmail(email); + //FIXME Try to get name from email + member.setName(email); + member.setWeight(1.0); + members.add(member); + } + getVoterListService().addVoterList(savedPoll.getTopiaId(), voterList, members); + + } commit(); getNotificationService().onPollCreated(savedPoll); @@ -247,6 +272,8 @@ public class PollService extends PollenServiceSupport { clonedPoll.setEndDate(null); clonedPoll.setBeginChoiceDate(null); clonedPoll.setEndChoiceDate(null); + clonedPoll.setParticipants(Sets.newLinkedHashSet(Arrays.asList(poll.getParticipants().split("\\s")))); + clonedPoll.setWithMe(poll.isWithMe()); clonedPoll.setTitle(clonedPoll.getTitle() + " (clone)"); -- 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/pollen-riot-js in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit af80ddf9b3e937f6a8cf1e3f7aea7a4f909f0343 Author: Tony CHEMIT <dev@tchemit.fr> Date: Thu Feb 23 10:43:03 2017 +0100 Add my participant polls and my invited polls --- pollen-ui-riot-js/src/main/web/i18n.json | 8 ++++++++ pollen-ui-riot-js/src/main/web/js/PollService.js | 8 ++++++++ pollen-ui-riot-js/src/main/web/tag/Header.tag | 2 ++ pollen-ui-riot-js/src/main/web/tag/Pollen.tag | 16 ++++++++++++++++ 4 files changed, 34 insertions(+) diff --git a/pollen-ui-riot-js/src/main/web/i18n.json b/pollen-ui-riot-js/src/main/web/i18n.json index 245084e..b515235 100644 --- a/pollen-ui-riot-js/src/main/web/i18n.json +++ b/pollen-ui-riot-js/src/main/web/i18n.json @@ -32,6 +32,8 @@ "comment_popup_authorPlaceholder": "Saisir votre nom", "comment_popup_textPlaceholder": "Saisir le commentaire", "polls_createdPolls": "Mes sondages", + "polls_invitedPolls": "Mes invitations", + "polls_participatedPolls": "Mes participations", "polls_polls": "Tous les sondages", "polls_name": "Nom", "polls_createDate": "Date de création", @@ -90,6 +92,8 @@ "header_i18n_lang": "Langue", "header_myProfile": "Mon profile", "header_myPolls": "Mes sondages", + "header_myInvitedPolls": "Mes invitations", + "header_myParticipatedPolls": "Mes participations", "header_polls": "Sondages", "header_users": "Utilisateurs", "header_myFavoriteLists": "Mes listes de favoris", @@ -256,6 +260,8 @@ "polls_voteDates": "Vote", "polls_status": "Status", "polls_createdPolls": "My polls", + "polls_invitedPolls": "My invitations", + "polls_participatedPolls": "My participations", "polls_polls": "All polls", "polls_CLOSED": "Closed", "polls_ADDING_CHOICES": "Adding choices", @@ -309,6 +315,8 @@ "header_i18n_lang": "Language", "header_myProfile": "My profile", "header_myPolls": "My polls", + "header_myInvitedPolls": "Invited polls", + "header_myParticipatedPolls": "Participated polls", "header_polls": "Polls", "header_users": "Users", "header_myFavoriteLists": "My favorite lists", 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 31b0a23..d82de44 100644 --- a/pollen-ui-riot-js/src/main/web/js/PollService.js +++ b/pollen-ui-riot-js/src/main/web/js/PollService.js @@ -39,6 +39,14 @@ class PollService extends FetchService { return this.getWithParams("/v1/polls/created", {paginationParameter: pagination}); } + invitedPolls(pagination) { + return this.getWithParams("/v1/polls/invited", {paginationParameter: pagination}); + } + + participatedPolls(pagination) { + return this.getWithParams("/v1/polls/participated", {paginationParameter: pagination}); + } + polls(pagination) { return this.getWithParams("/v1/polls", {paginationParameter: pagination}); } diff --git a/pollen-ui-riot-js/src/main/web/tag/Header.tag b/pollen-ui-riot-js/src/main/web/tag/Header.tag index 807861e..e6bad53 100644 --- a/pollen-ui-riot-js/src/main/web/tag/Header.tag +++ b/pollen-ui-riot-js/src/main/web/tag/Header.tag @@ -49,6 +49,8 @@ require("./HeaderI18n.tag"); <div class="dropdown-content"> <a href="#user/profile">{__.myProfile}</a> <a href="#poll/created">{__.myPolls}</a> + <a href="#poll/invited">{__.myInvitedPolls}</a> + <a href="#poll/participated">{__.myParticipatedPolls}</a> <a href="#user/favoriteLists">{__.myFavoriteLists}</a> <span role="separator" class="divider"></span> <a onclick="{signOut}">{__.signout}</a> diff --git a/pollen-ui-riot-js/src/main/web/tag/Pollen.tag b/pollen-ui-riot-js/src/main/web/tag/Pollen.tag index cac12cc..e5bc1ed 100644 --- a/pollen-ui-riot-js/src/main/web/tag/Pollen.tag +++ b/pollen-ui-riot-js/src/main/web/tag/Pollen.tag @@ -73,6 +73,22 @@ require("./Users.tag"); } }); + route("/poll/invited", () => { + if (!session.isConnected()) { + route("/signin?url=/poll/invited"); + } else { + riot.mount(this.refs.content, "polls", { method: "invitedPolls", session: session}); + } + }); + + route("/poll/participated", () => { + if (!session.isConnected()) { + route("/signin?url=/poll/participated"); + } else { + riot.mount(this.refs.content, "polls", { method: "participatedPolls", session: session}); + } + }); + route("/poll", () => { if (!session.isConnected()) { route("/signin?url=/poll"); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm