branch feature/refonte-ui updated (2376d098 -> 5d7948ff)
This is an automated email from the git hooks/post-receive script. New change to branch feature/refonte-ui in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git from 2376d098 Ajout d'un nouvel attribut au sondage (image d'illustration) new 347a8728 Hack to fix #332 : Really not clean, but working new d553060d fixes #333 - Cannot create poll : Unrecognized field 'choiceAddAllowed' new acd2b46b Lint new 10ac4d81 release 3.3.7 success [skip ci] new 2a3d401b fixes #334 - How this feature could have been so badly tested new 9926ec38 fixes #335 : Wrong poll displayed - There was a useless refresh too soon messing up new 4934720f Better debugging new 6fc6f8b3 Next development version new 6ae6aa23 Fix tests if no questions in poll coming from services (should happen only during tests) new a46ce552 release 3.3.8 success [skip ci] new bde4bdc0 Next development version new 31025a5d fixes #339 : Vote restreint - impossible de voter authentifié new b7d4ef37 refs #339 fix tests new 99ba5626 Add some rest api tests new a7936eb8 fixes #337 : La liste des participants n'a pas d'ordre déterministe : Ordre sur les noms (mais É... se retrouve après Y...)... Ordre déterministe après enregistrement. Pas avant par contre (odre de saisie) new 5d7948ff Corrections suite à revue The 16 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 5d7948ff5e36b3b303333c37a517889bef765728 Author: Cécilia Bossard <bossard@codelutin.com> Date: Thu Jul 2 10:21:19 2020 +0200 Corrections suite à revue commit a7936eb88c80edfcc9dcb25eb47aeb0f43acec70 Author: jcouteau <couteau@codelutin.com> Date: Wed May 27 10:18:00 2020 +0200 fixes #337 : La liste des participants n'a pas d'ordre déterministe : Ordre sur les noms (mais É... se retrouve après Y...)... Ordre déterministe après enregistrement. Pas avant par contre (odre de saisie) commit 99ba56268224be03a1e964d6c245c3f299507d21 Author: jcouteau <couteau@codelutin.com> Date: Wed May 27 08:26:04 2020 +0200 Add some rest api tests commit b7d4ef37f76282fdfc81221d393d659f45da929e Author: jcouteau <couteau@codelutin.com> Date: Wed May 27 08:22:31 2020 +0200 refs #339 fix tests commit 31025a5d5d5ced40b274b16b30c4f5710e956177 Author: jcouteau <couteau@codelutin.com> Date: Wed May 27 07:36:21 2020 +0200 fixes #339 : Vote restreint - impossible de voter authentifié commit bde4bdc0e5390dcab3de253e8046c567e5428f24 Author: jcouteau <couteau@codelutin.com> Date: Wed May 13 11:39:11 2020 +0200 Next development version commit a46ce55226afbb574a2213ba0c6602cc3d3beb32 Author: Maven Release <maven-release@codelutin.com> Date: Wed May 13 08:17:19 2020 +0000 release 3.3.8 success [skip ci] commit 6ae6aa2383b0d76ce4af130b40603213940ae449 Author: jcouteau <couteau@codelutin.com> Date: Wed May 13 10:03:05 2020 +0200 Fix tests if no questions in poll coming from services (should happen only during tests) commit 6fc6f8b34ad90694ae034bfc31171821bdfe4643 Author: jcouteau <couteau@codelutin.com> Date: Wed May 13 09:26:03 2020 +0200 Next development version commit 4934720f9747a48f03ec1eb0cac6a2c75eaccf2e Author: jcouteau <couteau@codelutin.com> Date: Wed May 13 09:15:01 2020 +0200 Better debugging commit 9926ec381f05fdbc56ec69fbb1d185227ecf8164 Author: jcouteau <couteau@codelutin.com> Date: Wed May 13 09:14:30 2020 +0200 fixes #335 : Wrong poll displayed - There was a useless refresh too soon messing up commit 2a3d401b93a04a1b203ae8bed639674068471fc9 Author: jcouteau <couteau@codelutin.com> Date: Wed May 13 09:02:37 2020 +0200 fixes #334 - How this feature could have been so badly tested commit 10ac4d81d7af1fc0c4483cf51024f74eca2a8040 Author: Maven Release <maven-release@codelutin.com> Date: Tue May 12 08:17:11 2020 +0000 release 3.3.7 success [skip ci] commit acd2b46b2ae4970bfda789a0a53a17fbcfad8d15 Author: jcouteau <couteau@codelutin.com> Date: Tue May 12 10:04:22 2020 +0200 Lint commit d553060dae2a8194efbdd28725989a7ac326dc7e Author: jcouteau <couteau@codelutin.com> Date: Tue May 12 09:40:50 2020 +0200 fixes #333 - Cannot create poll : Unrecognized field 'choiceAddAllowed' commit 347a87280a2bab916b9138ae7eee985f46de1272 Author: jcouteau <couteau@codelutin.com> Date: Tue May 12 08:59:09 2020 +0200 Hack to fix #332 : Really not clean, but working Summary of changes: CHANGELOG | 13 ++ pollen-persistence/pom.xml | 2 +- .../pollen/persistence/entity/PollTopiaDao.java | 20 +++ pollen-rest-api/pom.xml | 2 +- .../org/chorem/pollen/rest/api/v1/PollApi.java | 3 +- .../pollen/rest/api/AbstractPollenRestApiTest.java | 49 ++++++- .../org/chorem/pollen/rest/api/AuthApiTest.java | 2 +- .../org/chorem/pollen/rest/api/PollApiTest.java | 5 +- .../chorem/pollen/rest/api/PollenUserApiTest.java | 52 +------ .../chorem/pollen/rest/api/RestApiFixtures.java | 5 + pollen-services/pom.xml | 2 +- .../pollen/services/service/FixturesService.java | 87 +++++++----- .../pollen/services/service/PollService.java | 58 ++++++-- .../pollen/services/service/QuestionService.java | 13 +- .../pollen/services/service/VoteService.java | 24 ++-- .../pollen/services/service/VoterListService.java | 7 +- .../test/FakePollenApplicationContext.java | 21 +-- pollen-services/src/main/resources/fixtures.yaml | 59 -------- .../src/main/resources/restricted-fixtures.yaml | 55 ++++++++ .../src/main/resources/user-fixtures.yaml | 58 ++++++++ .../services/service/FavoriteListServiceTest.java | 4 +- .../pollen/services/service/PollServiceTest.java | 4 +- .../services/service/PollenUserServiceTest.java | 4 +- .../services/service/VoteCountingServiceTest.java | 4 +- .../pollen/services/service/VoteServiceTest.java | 153 +++++++++++++++++++-- .../services/service/VoterListServiceTest.java | 4 +- pollen-ui-riot-js/package-lock.json | 2 +- pollen-ui-riot-js/package.json | 2 +- pollen-ui-riot-js/pom.xml | 2 +- .../src/main/web/tag/poll/Poll.tag.html | 59 +++++--- .../src/main/web/tag/poll/Settings.tag.html | 2 +- .../src/main/web/tag/poll/Summary.tag.html | 6 +- .../src/main/web/tag/poll/Votes.tag.html | 2 +- pollen-ui-riot-js/webpack.config.js | 5 +- pollen-votecounting-aggregator/pom.xml | 2 +- pollen-votecounting-api/pom.xml | 2 +- pollen-votecounting-borda/pom.xml | 2 +- pollen-votecounting-condorcet/pom.xml | 2 +- pollen-votecounting-coombs/pom.xml | 2 +- pollen-votecounting-cumulative/pom.xml | 2 +- pollen-votecounting-instant-runoff/pom.xml | 2 +- pollen-votecounting-majority-judgment/pom.xml | 2 +- pollen-votecounting-normal/pom.xml | 2 +- pollen-votecounting-number/pom.xml | 2 +- pom.xml | 2 +- 45 files changed, 576 insertions(+), 236 deletions(-) create mode 100644 pollen-services/src/main/resources/restricted-fixtures.yaml create mode 100644 pollen-services/src/main/resources/user-fixtures.yaml -- 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/refonte-ui in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 347a87280a2bab916b9138ae7eee985f46de1272 Author: jcouteau <couteau@codelutin.com> Date: Tue May 12 08:59:09 2020 +0200 Hack to fix #332 : Really not clean, but working --- .../src/main/web/tag/poll/Poll.tag.html | 52 ++++++++++++++++------ 1 file changed, 39 insertions(+), 13 deletions(-) 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 6a15b619..781a6bbc 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 @@ -195,24 +195,50 @@ } }); - this.refresh = function() { - window.setInterval(function() { - if (this.poll) { - this.poll.reload(); - } - - //this.refresh(); - }, 1000); - }; - - this.refresh(); - this.refresh = () => { if (this.poll && this.poll.questions[0] && this.poll.questions[0].canVote) { + this.tempVoteValues = {}; + if(this.tags.votes) { + //Store temporary vote values + let refs = this.tags.votes.tags.editvote.refs; + this.poll.questions[0].choices.forEach(choice => { + let input = refs[choice.id + "_voteValue"]; + if (input && this.poll.questions[0].voteCountingTypeValue && this.poll.questions[0].voteCountingTypeValue.renderType === "text") { + this.tempVoteValues[choice.id] = input.value; + } else if (input && this.poll.questions[0].voteCountingTypeValue && this.poll.questions[0].voteCountingTypeValue.renderType === "select") { + if (input.find(option => option.selected)) { + this.tempVoteValues[choice.id] = input.find(option => option.selected).value; + } + } else { + this.tempVoteValues[choice.id] = input.checked; + } + }); + } + let promise = this.poll.reloadPoll(); promise.then(poll2 => { this.poll = poll2; - this.update(); + + this.poll.reloadVoteCountingTypeValue(this.poll.questions[0]).then(() => { + this.update(); + //Set back temporary stored values + if(this.tags.votes) { + let refs = this.tags.votes.tags.editvote.refs; + this.poll.questions[0].choices.forEach(choice => { + let input = refs[choice.id + "_voteValue"]; + if (input && this.poll.questions[0].voteCountingTypeValue && this.poll.questions[0].voteCountingTypeValue.renderType === "text") { + if (this.tempVoteValues[choice.id]) { + input.value = this.tempVoteValues[choice.id]; + } + } else if (input && this.poll.questions[0].voteCountingTypeValue && this.poll.questions[0].voteCountingTypeValue.renderType === "select") { + input.forEach(option => {option.selected = option.value === this.tempVoteValues[choice.id];}); + } else { + input.checked = this.tempVoteValues[choice.id]; + } + }); + } + this.tempVoteValues = {}; + }); }, () => {}); } }; -- 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/refonte-ui in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit d553060dae2a8194efbdd28725989a7ac326dc7e Author: jcouteau <couteau@codelutin.com> Date: Tue May 12 09:40:50 2020 +0200 fixes #333 - Cannot create poll : Unrecognized field 'choiceAddAllowed' --- pollen-ui-riot-js/src/main/web/tag/poll/Settings.tag.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 f1c149d4..bb650f52 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 @@ -435,7 +435,7 @@ import "../voteCountingType/MajorityJudgmentConfig.tag.html"; }; this.toggleChoiceAddAllowed = () => { - this.form.model.choiceAddAllowed = !this.form.model.choiceAddAllowed; + this.form.model.questions[0].choiceAddAllowed = !this.form.model.questions[0].choiceAddAllowed; this.update(); }; -- 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/refonte-ui in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 10ac4d81d7af1fc0c4483cf51024f74eca2a8040 Author: Maven Release <maven-release@codelutin.com> Date: Tue May 12 08:17:11 2020 +0000 release 3.3.7 success [skip ci] --- CHANGELOG | 6 ++++++ pollen-persistence/pom.xml | 2 +- pollen-rest-api/pom.xml | 2 +- pollen-services/pom.xml | 2 +- pollen-ui-riot-js/package-lock.json | 2 +- pollen-ui-riot-js/package.json | 2 +- pollen-ui-riot-js/pom.xml | 2 +- pollen-votecounting-aggregator/pom.xml | 2 +- pollen-votecounting-api/pom.xml | 2 +- pollen-votecounting-borda/pom.xml | 2 +- pollen-votecounting-condorcet/pom.xml | 2 +- pollen-votecounting-coombs/pom.xml | 2 +- pollen-votecounting-cumulative/pom.xml | 2 +- pollen-votecounting-instant-runoff/pom.xml | 2 +- pollen-votecounting-majority-judgment/pom.xml | 2 +- pollen-votecounting-normal/pom.xml | 2 +- pollen-votecounting-number/pom.xml | 2 +- pom.xml | 2 +- 18 files changed, 23 insertions(+), 17 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 701f32cc..4264e5bd 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -161,3 +161,9 @@ PROJECT : 13 - Cannot display comments +PROJECT : 13 +3.3.7 (2020/05/12) + + - Cannot create poll : Unrecognized field "choiceAddAllowed" + - Reset automatique des choix + diff --git a/pollen-persistence/pom.xml b/pollen-persistence/pom.xml index 60ca2289..2afb7ab4 100644 --- a/pollen-persistence/pom.xml +++ b/pollen-persistence/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>3.3.7-SNAPSHOT</version> + <version>3.3.7</version> </parent> <groupId>org.chorem.pollen</groupId> diff --git a/pollen-rest-api/pom.xml b/pollen-rest-api/pom.xml index ed248aee..a9a3011a 100644 --- a/pollen-rest-api/pom.xml +++ b/pollen-rest-api/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>3.3.7-SNAPSHOT</version> + <version>3.3.7</version> </parent> <groupId>org.chorem.pollen</groupId> diff --git a/pollen-services/pom.xml b/pollen-services/pom.xml index 578040f5..fc3067ae 100644 --- a/pollen-services/pom.xml +++ b/pollen-services/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>3.3.7-SNAPSHOT</version> + <version>3.3.7</version> </parent> <groupId>org.chorem.pollen</groupId> diff --git a/pollen-ui-riot-js/package-lock.json b/pollen-ui-riot-js/package-lock.json index 0223bb36..ce62a0d4 100644 --- a/pollen-ui-riot-js/package-lock.json +++ b/pollen-ui-riot-js/package-lock.json @@ -1,6 +1,6 @@ { "name": "Pollen", - "version": "3.3.6", + "version": "3.3.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/pollen-ui-riot-js/package.json b/pollen-ui-riot-js/package.json index 76699997..645ff9b9 100644 --- a/pollen-ui-riot-js/package.json +++ b/pollen-ui-riot-js/package.json @@ -1,6 +1,6 @@ { "name": "Pollen", - "version": "3.3.6", + "version": "3.3.7", "description": "Pollen UI", "main": "index.html", "repository": { diff --git a/pollen-ui-riot-js/pom.xml b/pollen-ui-riot-js/pom.xml index f40e69ca..7584e796 100644 --- a/pollen-ui-riot-js/pom.xml +++ b/pollen-ui-riot-js/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>3.3.7-SNAPSHOT</version> + <version>3.3.7</version> </parent> <groupId>org.chorem.pollen</groupId> diff --git a/pollen-votecounting-aggregator/pom.xml b/pollen-votecounting-aggregator/pom.xml index 3aef28ec..520fa6da 100644 --- a/pollen-votecounting-aggregator/pom.xml +++ b/pollen-votecounting-aggregator/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>3.3.7-SNAPSHOT</version> + <version>3.3.7</version> </parent> <groupId>org.chorem.pollen</groupId> diff --git a/pollen-votecounting-api/pom.xml b/pollen-votecounting-api/pom.xml index 18e56b50..00380aea 100644 --- a/pollen-votecounting-api/pom.xml +++ b/pollen-votecounting-api/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>3.3.7-SNAPSHOT</version> + <version>3.3.7</version> </parent> <groupId>org.chorem.pollen</groupId> diff --git a/pollen-votecounting-borda/pom.xml b/pollen-votecounting-borda/pom.xml index e70928c7..b8184752 100644 --- a/pollen-votecounting-borda/pom.xml +++ b/pollen-votecounting-borda/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>3.3.7-SNAPSHOT</version> + <version>3.3.7</version> </parent> <groupId>org.chorem.pollen</groupId> diff --git a/pollen-votecounting-condorcet/pom.xml b/pollen-votecounting-condorcet/pom.xml index 066e4dcb..35df1b09 100644 --- a/pollen-votecounting-condorcet/pom.xml +++ b/pollen-votecounting-condorcet/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>3.3.7-SNAPSHOT</version> + <version>3.3.7</version> </parent> <groupId>org.chorem.pollen</groupId> diff --git a/pollen-votecounting-coombs/pom.xml b/pollen-votecounting-coombs/pom.xml index e502030c..9ebc0646 100644 --- a/pollen-votecounting-coombs/pom.xml +++ b/pollen-votecounting-coombs/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>3.3.7-SNAPSHOT</version> + <version>3.3.7</version> </parent> <groupId>org.chorem.pollen</groupId> diff --git a/pollen-votecounting-cumulative/pom.xml b/pollen-votecounting-cumulative/pom.xml index 0ff82f03..fe49aa36 100644 --- a/pollen-votecounting-cumulative/pom.xml +++ b/pollen-votecounting-cumulative/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>3.3.7-SNAPSHOT</version> + <version>3.3.7</version> </parent> <groupId>org.chorem.pollen</groupId> diff --git a/pollen-votecounting-instant-runoff/pom.xml b/pollen-votecounting-instant-runoff/pom.xml index 333cdd34..cbb3d2c5 100644 --- a/pollen-votecounting-instant-runoff/pom.xml +++ b/pollen-votecounting-instant-runoff/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>3.3.7-SNAPSHOT</version> + <version>3.3.7</version> </parent> <groupId>org.chorem.pollen</groupId> diff --git a/pollen-votecounting-majority-judgment/pom.xml b/pollen-votecounting-majority-judgment/pom.xml index 7cd86577..3077579f 100644 --- a/pollen-votecounting-majority-judgment/pom.xml +++ b/pollen-votecounting-majority-judgment/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>3.3.7-SNAPSHOT</version> + <version>3.3.7</version> </parent> <groupId>org.chorem.pollen</groupId> diff --git a/pollen-votecounting-normal/pom.xml b/pollen-votecounting-normal/pom.xml index 107ea9d6..145b0ee9 100644 --- a/pollen-votecounting-normal/pom.xml +++ b/pollen-votecounting-normal/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>3.3.7-SNAPSHOT</version> + <version>3.3.7</version> </parent> <groupId>org.chorem.pollen</groupId> diff --git a/pollen-votecounting-number/pom.xml b/pollen-votecounting-number/pom.xml index b39fc091..db5174be 100644 --- a/pollen-votecounting-number/pom.xml +++ b/pollen-votecounting-number/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>3.3.7-SNAPSHOT</version> + <version>3.3.7</version> </parent> <groupId>org.chorem.pollen</groupId> diff --git a/pom.xml b/pom.xml index 78a4b6db..acaf66e6 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>3.3.7-SNAPSHOT</version> + <version>3.3.7</version> <packaging>pom</packaging> <name>Pollen</name> -- 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/refonte-ui in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 31025a5d5d5ced40b274b16b30c4f5710e956177 Author: jcouteau <couteau@codelutin.com> Date: Wed May 27 07:36:21 2020 +0200 fixes #339 : Vote restreint - impossible de voter authentifié --- .../pollen/services/service/FixturesService.java | 87 +++++++----- .../pollen/services/service/PollService.java | 10 +- .../pollen/services/service/QuestionService.java | 10 +- .../pollen/services/service/VoteService.java | 24 ++-- .../pollen/services/service/VoterListService.java | 2 +- .../test/FakePollenApplicationContext.java | 21 +-- pollen-services/src/main/resources/fixtures.yaml | 99 ++++++-------- .../src/main/resources/user-fixtures.yaml | 58 ++++++++ .../pollen/services/service/VoteServiceTest.java | 151 +++++++++++++++++++-- 9 files changed, 336 insertions(+), 126 deletions(-) diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/service/FixturesService.java b/pollen-services/src/main/java/org/chorem/pollen/services/service/FixturesService.java index 3ad5c124..79c3077b 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/service/FixturesService.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/service/FixturesService.java @@ -77,7 +77,7 @@ public class FixturesService extends PollenServiceSupport { fixtureSets.put(fixturesSetName, fixtures); if (log.isInfoEnabled()) { - log.info("will restore database with fixture set"); + log.info("will restore database with fixture set " + fixturesSetName); } PollenPersistenceContext persistenceContext = serviceContext.getPersistenceContext(); @@ -100,52 +100,73 @@ public class FixturesService extends PollenServiceSupport { Collection<PollenUser> users = fixtures.fixture("users"); - for (PollenUser user : users) { - for (PollenUserEmailAddress emailAddress : user.getEmailAddresses()) { - PollenUserEmailAddress createdEmailAddress = emailAddressDao.create(emailAddress); - emailAddress.setTopiaId(createdEmailAddress.getTopiaId()); - emailAddress.setValidated(true); + if (users != null) { + for (PollenUser user : users) { + for (PollenUserEmailAddress emailAddress : user.getEmailAddresses()) { + PollenUserEmailAddress createdEmailAddress = emailAddressDao.create(emailAddress); + emailAddress.setTopiaId(createdEmailAddress.getTopiaId()); + emailAddress.setValidated(true); + } + + securityService.setUserPassword(user, user.getPassword()); + PollenUser createdUser = userDao.create(user); + user.setTopiaId(createdUser.getTopiaId()); } - - securityService.setUserPassword(user, user.getPassword()); - PollenUser createdUser = userDao.create(user); - user.setTopiaId(createdUser.getTopiaId()); } PollService pollService = newService(PollService.class); - //FIXME JC181003 - APRIL - Add questions in fixtures Collection<Poll> polls = fixtures.fixture("polls"); List<Question> questions = fixtures.fixture("questions"); - List<QuestionBean> questionsBean = questions.stream() - .map(getQuestionService()::toQuestionBean) - .collect(Collectors.toList()); List<Choice> choices = fixtures.fixture("choices"); - List<ChoiceBean> choicesBean = choices.stream() - .map(getChoiceService()::toChoiceBean) - .collect(Collectors.toList()); - questionsBean.get(0).setChoices(choicesBean); - - - for (Poll poll : polls) { - try { - PollBean pollBean = getPollService().toPollBean(poll); - pollBean.setQuestions(questionsBean); - PollenEntityRef<Poll> createdPoll = pollService.createPoll(pollBean, Collections.emptyList(), Collections.emptyList()); - poll.setTopiaId(createdPoll.getEntityId()); - - PollenPrincipal principal = securityService.getPollenPrincipalByPermissionToken(createdPoll.getPermission()); - poll.setCreator(principal); -// poll.setChoice(createdPoll.getChoice()); - } catch (InvalidFormException e) { - throw new PollenTechnicalException(e); + if (polls != null) { + for (Poll poll : polls) { + try { + PollBean pollBean = getPollService().toPollBean(poll); + + pollBean.setQuestions( + questions.stream() + .filter(question -> question.getPoll().equals(poll)) + .map(getQuestionService()::toQuestionBean) + .collect(Collectors.toList()) + ); + + for (QuestionBean question : pollBean.getQuestions()) { + question.setChoices( + choices.stream() + .filter(choice -> choice.getQuestion().getTitle().equals(question.getTitle())) + .map(getChoiceService()::toChoiceBean) + .collect(Collectors.toList()) + ); + } + + PollenEntityRef<Poll> createdPoll = pollService.createPoll(pollBean, Collections.emptyList(), Collections.emptyList()); + poll.setTopiaId(createdPoll.getEntityId()); + + //Set Questions and choices topiaId + PollBean createdPollBean = pollService.toPollBean(pollService.getPoll0(createdPoll.getEntityId())); + for (QuestionBean questionBean : createdPollBean.getQuestions()) { + questions.stream() + .filter(question -> question.getTitle().equals(questionBean.getTitle())) + .peek(question -> question.setTopiaId(questionBean.getEntityId())); + for (ChoiceBean choiceBean:questionBean.getChoices()) { + choices.stream() + .filter(choice -> choice.getChoiceValue().equals(choiceBean.getChoiceValue())) + .peek(choice -> choice.setTopiaId(choiceBean.getEntityId())); + } + } + + PollenPrincipal principal = securityService.getPollenPrincipalByPermissionToken(createdPoll.getPermission()); + poll.setCreator(principal); + } catch (InvalidFormException e) { + throw new PollenTechnicalException(e); + } } } persistenceContext.commit(); - } return fixtures; 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 fc4114e8..28a70a5c 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 @@ -175,19 +175,19 @@ public class PollService extends PollenServiceSupport { bean.setReport(report); } - boolean commentIsVisible = isPermitted(PollenPermissions.readComments(entity)); + boolean commentIsVisible = entity.getTopiaId() != null && isPermitted(PollenPermissions.readComments(entity)); bean.setCommentIsVisible(commentIsVisible); - bean.setVoteIsVisible(isPermitted(PollenPermissions.readVotes(entity))); + bean.setVoteIsVisible(entity.getTopiaId() != null && isPermitted(PollenPermissions.readVotes(entity))); - boolean resultIsVisible = isPermitted(PollenPermissions.readResult(entity)); + boolean resultIsVisible = entity.getTopiaId() != null && isPermitted(PollenPermissions.readResult(entity)); bean.setResultIsVisible(resultIsVisible); - boolean canReadParticipants = isPermitted(PollenPermissions.readParticipants(entity)); + boolean canReadParticipants = entity.getTopiaId() != null && isPermitted(PollenPermissions.readParticipants(entity)); bean.setParticipantsIsVisible(canReadParticipants); - boolean canVote = isPermitted(PollenPermissions.addVote(entity)); + boolean canVote = entity.getTopiaId() != null && isPermitted(PollenPermissions.addVote(entity)); bean.setCanVote(canVote); if (entity.isPersisted()) { diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/service/QuestionService.java b/pollen-services/src/main/java/org/chorem/pollen/services/service/QuestionService.java index f72dbdd0..7ef97217 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/service/QuestionService.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/service/QuestionService.java @@ -86,19 +86,19 @@ public class QuestionService extends PollenServiceSupport { bean.setReport(report); } - boolean commentIsVisible = isPermitted(PollenPermissions.readComments(entity)); + boolean commentIsVisible = entity.isPersisted() && isPermitted(PollenPermissions.readComments(entity)); bean.setCommentIsVisible(commentIsVisible); - bean.setVoteIsVisible(isPermitted(PollenPermissions.readVotes(entity))); + bean.setVoteIsVisible(entity.isPersisted() && isPermitted(PollenPermissions.readVotes(entity))); - boolean resultIsVisible = isPermitted(PollenPermissions.readResult(entity)); + boolean resultIsVisible = entity.isPersisted() && isPermitted(PollenPermissions.readResult(entity)); bean.setResultIsVisible(resultIsVisible); - boolean canReadParticipants = isPermitted(PollenPermissions.readParticipants(entity)); + boolean canReadParticipants = entity.isPersisted() && isPermitted(PollenPermissions.readParticipants(entity)); bean.setParticipantsIsVisible(canReadParticipants); - boolean canVote = isPermitted(PollenPermissions.addVote(entity)); + boolean canVote = entity.isPersisted() && isPermitted(PollenPermissions.addVote(entity)); bean.setCanVote(canVote); if (entity.isPersisted()) { diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/service/VoteService.java b/pollen-services/src/main/java/org/chorem/pollen/services/service/VoteService.java index a9ab5730..85aed539 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/service/VoteService.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/service/VoteService.java @@ -163,11 +163,15 @@ public class VoteService extends PollenServiceSupport { PollenUser connectedUser = getConnectedUser(); if (question.getPoll().getPollType() == PollType.RESTRICTED) { + + List<VoterListMember> voterListMembers = new ArrayList<>(); // si si le mainPrincipal a voté - List<VoterListMember> voterListMembers = getVoterListMemberDao() - .forEquals(VoterListMember.PROPERTY_MEMBER + "." + PollenPrincipal.PROPERTY_EMAIL, mainPrincipal.getEmail()) - .addEquals(VoterListMember.PROPERTY_VOTER_LIST + "." + VoterList.PROPERTY_POLL + "." + Poll.PROPERTY_TOPIA_ID, question.getPoll().getTopiaId()) - .findAll(); + if (mainPrincipal != null) { + voterListMembers = getVoterListMemberDao() + .forEquals(VoterListMember.PROPERTY_MEMBER + "." + PollenPrincipal.PROPERTY_EMAIL, mainPrincipal.getEmail()) + .addEquals(VoterListMember.PROPERTY_VOTER_LIST + "." + VoterList.PROPERTY_POLL + "." + Poll.PROPERTY_TOPIA_ID, question.getPoll().getTopiaId()) + .findAll(); + } if (CollectionUtils.isNotEmpty(voterListMembers) && !getVoteDao().forQuestionEquals(question).addEquals(Vote.PROPERTY_VOTER, mainPrincipal).exists()) { @@ -425,11 +429,15 @@ public class VoteService extends PollenServiceSupport { if (Polls.isPollRestricted(question.getPoll())) { + List<VoterListMember> voterListMembers = new ArrayList<>(); + // si si le mainPrincipal a voté - List<VoterListMember> voterListMembers = getVoterListMemberDao() - .forEquals(VoterListMember.PROPERTY_MEMBER + "." + PollenPrincipal.PROPERTY_EMAIL, mainPrincipal.getEmail()) - .addEquals(VoterListMember.PROPERTY_VOTER_LIST + "." + VoterList.PROPERTY_POLL + "." + TopiaEntity.PROPERTY_TOPIA_ID, question.getPoll().getTopiaId()) - .findAll(); + if (mainPrincipal != null) { + voterListMembers = getVoterListMemberDao() + .forEquals(VoterListMember.PROPERTY_MEMBER + "." + PollenPrincipal.PROPERTY_EMAIL, mainPrincipal.getEmail()) + .addEquals(VoterListMember.PROPERTY_VOTER_LIST + "." + VoterList.PROPERTY_POLL + "." + TopiaEntity.PROPERTY_TOPIA_ID, question.getPoll().getTopiaId()) + .findAll(); + } if (CollectionUtils.isNotEmpty(voterListMembers) && !getVoteDao().forQuestionEquals(question).addEquals(Vote.PROPERTY_VOTER, mainPrincipal).exists()) { diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/service/VoterListService.java b/pollen-services/src/main/java/org/chorem/pollen/services/service/VoterListService.java index ae877276..78ac776e 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/service/VoterListService.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/service/VoterListService.java @@ -521,7 +521,7 @@ public class VoterListService extends PollenServiceSupport { protected PollenPrincipal searchOrCreatePrincipal(Poll poll, String email, String name) { PollenPrincipal principal; - if (poll.getCreator().getEmail().equals(email)) { + if (poll.getCreator().getEmail() != null && poll.getCreator().getEmail().equals(email)) { principal = poll.getCreator(); } else { principal = getVoterListMemberDao().forProperties(VoterListMember.PROPERTY_VOTER_LIST + "." + VoterList.PROPERTY_POLL, poll) diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/test/FakePollenApplicationContext.java b/pollen-services/src/main/java/org/chorem/pollen/services/test/FakePollenApplicationContext.java index bf39e898..c0d11afd 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/test/FakePollenApplicationContext.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/test/FakePollenApplicationContext.java @@ -48,12 +48,9 @@ import org.nuiton.util.FileUtil; import java.io.File; import java.io.IOException; +import java.lang.reflect.Array; import java.net.ServerSocket; -import java.util.LinkedList; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Properties; +import java.util.*; import java.util.concurrent.atomic.AtomicInteger; /** @@ -75,7 +72,7 @@ public class FakePollenApplicationContext extends TestWatcher implements PollenA protected PollenServicesConfig configuration; - protected PollenFixtures fixtures; + protected List<PollenFixtures> fixtures; protected VoteCountingFactory voteCountingFactory; @@ -254,14 +251,22 @@ public class FakePollenApplicationContext extends TestWatcher implements PollenA public void loadFixtures(PollenServiceContext serviceContext, String fixturesSetName) { FixturesService fixturesService = serviceContext.newService(FixturesService.class); + if (fixtures == null) { + fixtures = new ArrayList<>(); + } - fixtures = fixturesService.loadFixtures(fixturesSetName); + fixtures.add(fixturesService.loadFixtures(fixturesSetName)); } public <E> E fixture(String id) { + for (PollenFixtures fixture: fixtures) { + if (fixture.fixture(id) != null) { + return fixture.fixture(id); + } + } - return fixtures.fixture(id); + return null; } diff --git a/pollen-services/src/main/resources/fixtures.yaml b/pollen-services/src/main/resources/fixtures.yaml index 68c3523a..a911b157 100644 --- a/pollen-services/src/main/resources/fixtures.yaml +++ b/pollen-services/src/main/resources/fixtures.yaml @@ -1,56 +1,4 @@ -email_address_tony_default: - &email_address_tony1 !email-address - emailAddress: tony@pollen.org -email_address_tony_2: - &email_address_tony2 !email-address - emailAddress: tony2@pollen.org - -user_tony: - &tony !user - password: fake - name: T - emailAddresses: !array-list - - *email_address_tony1 - - *email_address_tony2 - defaultEmailAddress: *email_address_tony1 - administrator: false - -email_address_jean_default: - &email_address_jean1 !email-address - emailAddress: jean@pollen.org - -email_address_jean_2: - &email_address_jean2 !email-address - emailAddress: jean2@pollen.org - -email_address_jean_3: - &email_address_jean3 !email-address - emailAddress: jean3@pollen.org - -user_jean: - &jean !user - password: fake - name: J - emailAddresses: !array-list - - *email_address_jean1 - - *email_address_jean2 - - *email_address_jean3 - defaultEmailAddress: *email_address_jean1 - administrator: true - -email_address_julien_default: - &email_address_julien !email-address - emailAddress: julien@pollen.org - -user_julien: - &julien !user - password: fake - name: J - emailAddresses: !array-list - - *email_address_julien - defaultEmailAddress: *email_address_julien - administrator: true poll_normal: &normal !poll @@ -69,6 +17,22 @@ poll_normal: name: poll creator email: poll_creator@pollen.chorem.org +poll_restricted: + &restricted !poll + title: Sondage restricted + description: Sondage restricted de type normal + beginDate: 1/1/2014 + endDate: 1/2/2014 + anonymousVoteAllowed: false + continuousResults: false + pollType: RESTRICTED + voteVisibility: EVERYBODY + commentVisibility: EVERYBODY + resultVisibility: EVERYBODY + creator: !pollen-principal + name: poll creator + email: jean@pollen.org + questionA: &normal_questionA !question poll: *normal @@ -77,6 +41,14 @@ questionA: #choiceType: TEXT choiceAddAllowed: false +questionB: + &restricted_questionB !question + poll: *restricted + title: Question B + voteCountingType: 1 + #choiceType: TEXT + choiceAddAllowed: false + choiceA: &normal_questionA_choixA !choice question: *normal_questionA @@ -91,24 +63,37 @@ choiceB: description: choixB description choiceType: TEXT +choiceC: + &restricted_questionB_choixC !choice + question: *restricted_questionB + choiceValue: choixC + description: choixC description + choiceType: TEXT + +choiceD: + &restricted_questionB_choixD !choice + question: *restricted_questionB + choiceValue: choixD + description: choixD description + choiceType: TEXT + choices: - *normal_questionA_choixA - *normal_questionA_choixB + - *restricted_questionB_choixC + - *restricted_questionB_choixD questions: - *normal_questionA + - *restricted_questionB votes: - normal_vote1 - normal_vote2 -users: - - *tony - - *jean - - *julien - polls: - *normal + - *restricted pollenUIContext_chorem: &chorem !pollenUIContext diff --git a/pollen-services/src/main/resources/user-fixtures.yaml b/pollen-services/src/main/resources/user-fixtures.yaml new file mode 100644 index 00000000..a0e052d5 --- /dev/null +++ b/pollen-services/src/main/resources/user-fixtures.yaml @@ -0,0 +1,58 @@ +email_address_tony_default: + &email_address_tony1 !email-address + emailAddress: tony@pollen.org + +email_address_tony_2: + &email_address_tony2 !email-address + emailAddress: tony2@pollen.org + +user_tony: + &tony !user + password: fake + name: T + emailAddresses: !array-list + - *email_address_tony1 + - *email_address_tony2 + defaultEmailAddress: *email_address_tony1 + administrator: false + +email_address_jean_default: + &email_address_jean1 !email-address + emailAddress: jean@pollen.org + +email_address_jean_2: + &email_address_jean2 !email-address + emailAddress: jean2@pollen.org + +email_address_jean_3: + &email_address_jean3 !email-address + emailAddress: jean3@pollen.org + +user_jean: + &jean !user + password: fake + name: J + emailAddresses: !array-list + - *email_address_jean1 + - *email_address_jean2 + - *email_address_jean3 + defaultEmailAddress: *email_address_jean1 + administrator: true + +email_address_julien_default: + &email_address_julien !email-address + emailAddress: julien@pollen.org + +user_julien: + &julien !user + password: fake + name: J + emailAddresses: !array-list + - *email_address_julien + defaultEmailAddress: *email_address_julien + administrator: true + +users: + - *tony + - *jean + - *julien diff --git a/pollen-services/src/test/java/org/chorem/pollen/services/service/VoteServiceTest.java b/pollen-services/src/test/java/org/chorem/pollen/services/service/VoteServiceTest.java index 4631ad55..9a1c2bcd 100644 --- a/pollen-services/src/test/java/org/chorem/pollen/services/service/VoteServiceTest.java +++ b/pollen-services/src/test/java/org/chorem/pollen/services/service/VoteServiceTest.java @@ -21,32 +21,50 @@ package org.chorem.pollen.services.service; * #L% */ -import org.chorem.pollen.persistence.entity.Choice; +import org.chorem.pollen.persistence.entity.*; import org.chorem.pollen.services.AbstractPollenServiceTest; -import org.chorem.pollen.services.bean.PaginationParameterBean; -import org.chorem.pollen.services.bean.PollBean; -import org.chorem.pollen.services.bean.VoteBean; -import org.chorem.pollen.services.bean.VoteToChoiceBean; -import org.chorem.pollen.services.bean.PollenEntityId; +import org.chorem.pollen.services.bean.*; +import org.chorem.pollen.services.service.security.PollenInvalidPermissionException; +import org.chorem.pollen.services.service.security.SecurityService; import org.chorem.pollen.services.test.FakePollenSecurityContext; import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.stream.Collectors; public class VoteServiceTest extends AbstractPollenServiceTest { protected VoteService service; + protected VoterListService voterListService; + + protected PollService pollService; + + protected SecurityService securityService; + + protected PaginationParameterBean pagination = PaginationParameterBean.of(0,-1); + @Before - public void setUp() { + public void setUp() throws Exception { + + loadFixtures("user-fixtures"); + + login("jean@pollen.org", "fake"); loadFixtures("fixtures"); service = newService(VoteService.class); + voterListService = newService(VoterListService.class); + + pollService = newService(PollService.class); + + securityService = newService(SecurityService.class); + getServiceContext().setSecurityContext(new FakePollenSecurityContext()); } @@ -68,8 +86,11 @@ public class VoteServiceTest extends AbstractPollenServiceTest { login("jean@pollen.org", "fake"); //Get poll - PollService pollService = newService(PollService.class); - PollBean poll = pollService.getPolls(pagination,"").getElements().get(0); + PollBean poll = pollService.getPolls(pagination,"").getElements() + .stream() + .filter(pollFilter -> pollFilter.getTitle().equals("Sondage normal")) + .collect(Collectors.toList()) + .get(0); String pollId = poll.getEntityId(); String questionId = poll.getQuestions().get(0).getEntityId(); PollenEntityId<Choice> choice1Id = poll.getQuestions().get(0).getChoices().get(0).getId(); @@ -122,4 +143,116 @@ public class VoteServiceTest extends AbstractPollenServiceTest { Assert.assertEquals("test3", votes3.get(0).getVoterName()); Assert.assertEquals(1, votes3.get(0).getChoice().size()); } + + @Test + public void testInvitedVote() throws Exception { + getServiceContext().setDate(new Date(1389744000000L)); + + login("jean@pollen.org", "fake"); + + //Get poll + PollBean poll = pollService.getPolls(pagination,"").getElements() + .stream() + .filter(pollFilter -> pollFilter.getTitle().equals("Sondage restricted")) + .collect(Collectors.toList()) + .get(0); + String pollId = poll.getEntityId(); + String questionId = poll.getQuestions().get(0).getEntityId(); + PollenEntityId<Choice> choice1Id = poll.getQuestions().get(0).getChoices().get(0).getId(); + + PollenPrincipal userPrincipal = securityService.generatePollenPrincipal(); + userPrincipal.setPollenUser(securityService.getSecurityContext().getPollenUser()); + + securityService.getSecurityContext().setMainPrincipal(userPrincipal); + + //Voters + VoterListBean voterList = new VoterListBean(); + voterList.setWeight(1); + voterList.setName("voterList1"); + List<VoterListMemberBean> listMember = new ArrayList<>(); + VoterListMemberBean member1 = new VoterListMemberBean(); + member1.setName("member1"); + member1.setEmail("member1@pollen.org"); + member1.setWeight(1); + listMember.add(member1); + VoterListMemberBean member2 = new VoterListMemberBean(); + member2.setName("member2"); + member2.setEmail("jean@pollen.org"); + member2.setWeight(1); + listMember.add(member2); + VoterListMemberBean member3 = new VoterListMemberBean(); + member3.setName("member3"); + member3.setEmail("member3@pollen.org"); + member3.setWeight(1); + listMember.add(member3); + voterList.setCountMembers(3); + PollenEntityRef<VoterList> voterListId = voterListService.addVoterList(pollId, voterList, listMember); + + VoterList list = voterListService.getVoterList0(poll.getEntityId(), voterListId.getEntityId()); + List<VoterListMember> members = voterListService.getVoterListMembers0(list.getTopiaId()); + PollenPrincipal member1Token = null; + for (VoterListMember member:members) { + if (member.getMember().getName().equals(member1.getName())) { + member1Token = member.getMember(); + } + } + + //The vote used for all tests + VoteBean vote = new VoteBean(); + VoteToChoiceBean bean1 = new VoteToChoiceBean(); + bean1.setChoiceId(choice1Id); + bean1.setVoteValue(1.0); + vote.addChoice(bean1); + vote.setVoterName("test1"); + + //Cannot vote as wrongly logged in user + login("tony@pollen.org", "fake"); + try { + vote.setVoterName("tony@pollen.org"); + service.addVote(pollId, questionId, vote); + Assert.fail("Exception should have been thrown"); + } catch (PollenInvalidPermissionException eee) { + //Normal exception thrown + } + + //should be able to vote with token + securityService.getSecurityContext().setMainPrincipal(member1Token); + vote.setVoterName("member1@pollen.org"); + vote.setPermission(member1Token.getPermission().getToken()); + service.addVote(pollId, questionId, vote); + + //cannot vote twice with token + try { + service.addVote(pollId, questionId, vote); + Assert.fail("Exception should have been thrown"); + } catch (PollenInvalidPermissionException eee) { + //Normal exception thrown + } + + //should be able to vote as logged in user + login("jean@pollen.org", "fake"); + securityService.getSecurityContext().setMainPrincipal(userPrincipal); + vote.setPermission(null); + vote.setVoterName("jean@pollen.org"); + service.addVote(pollId, questionId, vote); + + //cannot vote twice as logged in user + try { + service.addVote(pollId, questionId, vote); + Assert.fail("Exception should have been thrown"); + } catch (PollenInvalidPermissionException eee) { + //Normal exception thrown + } + + //properly listed as voted in voterslist + PaginationResultBean<VoterListMemberBean> voters = voterListService.getAllVoterListMembers(poll.getEntityId(), pagination); + for (VoterListMemberBean voter:voters.getElements()) { + if (voter.getName().equals("jean@pollen.org") || voter.getName().equals("member1@pollen.org")) { + Assert.assertTrue(voter.isVoting()); + } else { + Assert.assertFalse(voter.isVoting()); + } + } + + } } -- 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/refonte-ui in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit b7d4ef37f76282fdfc81221d393d659f45da929e Author: jcouteau <couteau@codelutin.com> Date: Wed May 27 08:22:31 2020 +0200 refs #339 fix tests --- pollen-services/src/main/resources/fixtures.yaml | 44 ------------------- .../{fixtures.yaml => restricted-fixtures.yaml} | 49 ---------------------- .../services/service/FavoriteListServiceTest.java | 4 +- .../pollen/services/service/PollServiceTest.java | 4 +- .../services/service/PollenUserServiceTest.java | 4 +- .../services/service/VoteCountingServiceTest.java | 4 +- .../pollen/services/service/VoteServiceTest.java | 2 + .../services/service/VoterListServiceTest.java | 4 +- 8 files changed, 17 insertions(+), 98 deletions(-) diff --git a/pollen-services/src/main/resources/fixtures.yaml b/pollen-services/src/main/resources/fixtures.yaml index a911b157..dd58c3f1 100644 --- a/pollen-services/src/main/resources/fixtures.yaml +++ b/pollen-services/src/main/resources/fixtures.yaml @@ -1,5 +1,3 @@ - - poll_normal: &normal !poll title: Sondage normal @@ -17,22 +15,6 @@ poll_normal: name: poll creator email: poll_creator@pollen.chorem.org -poll_restricted: - &restricted !poll - title: Sondage restricted - description: Sondage restricted de type normal - beginDate: 1/1/2014 - endDate: 1/2/2014 - anonymousVoteAllowed: false - continuousResults: false - pollType: RESTRICTED - voteVisibility: EVERYBODY - commentVisibility: EVERYBODY - resultVisibility: EVERYBODY - creator: !pollen-principal - name: poll creator - email: jean@pollen.org - questionA: &normal_questionA !question poll: *normal @@ -41,14 +23,6 @@ questionA: #choiceType: TEXT choiceAddAllowed: false -questionB: - &restricted_questionB !question - poll: *restricted - title: Question B - voteCountingType: 1 - #choiceType: TEXT - choiceAddAllowed: false - choiceA: &normal_questionA_choixA !choice question: *normal_questionA @@ -63,29 +37,12 @@ choiceB: description: choixB description choiceType: TEXT -choiceC: - &restricted_questionB_choixC !choice - question: *restricted_questionB - choiceValue: choixC - description: choixC description - choiceType: TEXT - -choiceD: - &restricted_questionB_choixD !choice - question: *restricted_questionB - choiceValue: choixD - description: choixD description - choiceType: TEXT - choices: - *normal_questionA_choixA - *normal_questionA_choixB - - *restricted_questionB_choixC - - *restricted_questionB_choixD questions: - *normal_questionA - - *restricted_questionB votes: - normal_vote1 @@ -93,7 +50,6 @@ votes: polls: - *normal - - *restricted pollenUIContext_chorem: &chorem !pollenUIContext diff --git a/pollen-services/src/main/resources/fixtures.yaml b/pollen-services/src/main/resources/restricted-fixtures.yaml similarity index 58% copy from pollen-services/src/main/resources/fixtures.yaml copy to pollen-services/src/main/resources/restricted-fixtures.yaml index a911b157..e8d13df1 100644 --- a/pollen-services/src/main/resources/fixtures.yaml +++ b/pollen-services/src/main/resources/restricted-fixtures.yaml @@ -1,22 +1,3 @@ - - -poll_normal: - &normal !poll - title: Sondage normal - description: Sondage de type 'normal' - beginDate: 1/1/2014 - endDate: 1/2/2014 - #maxChoiceNumber: 2 - anonymousVoteAllowed: false - continuousResults: false - pollType: FREE - voteVisibility: EVERYBODY - commentVisibility: EVERYBODY - resultVisibility: EVERYBODY - creator: !pollen-principal - name: poll creator - email: poll_creator@pollen.chorem.org - poll_restricted: &restricted !poll title: Sondage restricted @@ -33,14 +14,6 @@ poll_restricted: name: poll creator email: jean@pollen.org -questionA: - &normal_questionA !question - poll: *normal - title: Question A - voteCountingType: 1 - #choiceType: TEXT - choiceAddAllowed: false - questionB: &restricted_questionB !question poll: *restricted @@ -49,20 +22,6 @@ questionB: #choiceType: TEXT choiceAddAllowed: false -choiceA: - &normal_questionA_choixA !choice - question: *normal_questionA - choiceValue: choixA - description: choixA description - choiceType: TEXT - -choiceB: - &normal_questionA_choixB !choice - question: *normal_questionA - choiceValue: choixB - description: choixB description - choiceType: TEXT - choiceC: &restricted_questionB_choixC !choice question: *restricted_questionB @@ -78,21 +37,13 @@ choiceD: choiceType: TEXT choices: - - *normal_questionA_choixA - - *normal_questionA_choixB - *restricted_questionB_choixC - *restricted_questionB_choixD questions: - - *normal_questionA - *restricted_questionB -votes: - - normal_vote1 - - normal_vote2 - polls: - - *normal - *restricted pollenUIContext_chorem: diff --git a/pollen-services/src/test/java/org/chorem/pollen/services/service/FavoriteListServiceTest.java b/pollen-services/src/test/java/org/chorem/pollen/services/service/FavoriteListServiceTest.java index 93feed56..5e0ba1e3 100644 --- a/pollen-services/src/test/java/org/chorem/pollen/services/service/FavoriteListServiceTest.java +++ b/pollen-services/src/test/java/org/chorem/pollen/services/service/FavoriteListServiceTest.java @@ -61,7 +61,9 @@ public class FavoriteListServiceTest extends AbstractPollenServiceTest { protected PollenUser user; @Before - public void setUp() throws ParseException { + public void setUp() throws Exception { + + loadFixtures("user-fixtures"); loadFixtures("fixtures"); diff --git a/pollen-services/src/test/java/org/chorem/pollen/services/service/PollServiceTest.java b/pollen-services/src/test/java/org/chorem/pollen/services/service/PollServiceTest.java index 125af8f3..1894c4d9 100644 --- a/pollen-services/src/test/java/org/chorem/pollen/services/service/PollServiceTest.java +++ b/pollen-services/src/test/java/org/chorem/pollen/services/service/PollServiceTest.java @@ -67,7 +67,9 @@ public class PollServiceTest extends AbstractPollenServiceTest { protected SecurityService securityService; @Before - public void setUp() throws ParseException { + public void setUp() throws Exception { + + loadFixtures("user-fixtures"); loadFixtures("fixtures"); diff --git a/pollen-services/src/test/java/org/chorem/pollen/services/service/PollenUserServiceTest.java b/pollen-services/src/test/java/org/chorem/pollen/services/service/PollenUserServiceTest.java index 80c4d071..2c88f2a4 100644 --- a/pollen-services/src/test/java/org/chorem/pollen/services/service/PollenUserServiceTest.java +++ b/pollen-services/src/test/java/org/chorem/pollen/services/service/PollenUserServiceTest.java @@ -60,7 +60,9 @@ public class PollenUserServiceTest extends AbstractPollenServiceTest { protected PollenUser user; @Before - public void setUp() throws ParseException { + public void setUp() throws Exception { + + loadFixtures("user-fixtures"); loadFixtures("fixtures"); diff --git a/pollen-services/src/test/java/org/chorem/pollen/services/service/VoteCountingServiceTest.java b/pollen-services/src/test/java/org/chorem/pollen/services/service/VoteCountingServiceTest.java index 3615f3c9..0501101d 100644 --- a/pollen-services/src/test/java/org/chorem/pollen/services/service/VoteCountingServiceTest.java +++ b/pollen-services/src/test/java/org/chorem/pollen/services/service/VoteCountingServiceTest.java @@ -60,7 +60,9 @@ public class VoteCountingServiceTest extends AbstractPollenServiceTest { private VoteCountingService service; @Before - public void setUp() throws ParseException { + public void setUp() throws Exception { + + loadFixtures("user-fixtures"); loadFixtures("fixtures"); diff --git a/pollen-services/src/test/java/org/chorem/pollen/services/service/VoteServiceTest.java b/pollen-services/src/test/java/org/chorem/pollen/services/service/VoteServiceTest.java index 9a1c2bcd..64e2b7d9 100644 --- a/pollen-services/src/test/java/org/chorem/pollen/services/service/VoteServiceTest.java +++ b/pollen-services/src/test/java/org/chorem/pollen/services/service/VoteServiceTest.java @@ -57,6 +57,8 @@ public class VoteServiceTest extends AbstractPollenServiceTest { loadFixtures("fixtures"); + loadFixtures("restricted-fixtures"); + service = newService(VoteService.class); voterListService = newService(VoterListService.class); diff --git a/pollen-services/src/test/java/org/chorem/pollen/services/service/VoterListServiceTest.java b/pollen-services/src/test/java/org/chorem/pollen/services/service/VoterListServiceTest.java index 59af0d6d..9b75ee12 100644 --- a/pollen-services/src/test/java/org/chorem/pollen/services/service/VoterListServiceTest.java +++ b/pollen-services/src/test/java/org/chorem/pollen/services/service/VoterListServiceTest.java @@ -69,7 +69,9 @@ public class VoterListServiceTest extends AbstractPollenServiceTest { protected PollenUser user; @Before - public void setUp() throws ParseException { + public void setUp() throws Exception { + + loadFixtures("user-fixtures"); loadFixtures("fixtures"); -- 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/refonte-ui in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 99ba56268224be03a1e964d6c245c3f299507d21 Author: jcouteau <couteau@codelutin.com> Date: Wed May 27 08:26:04 2020 +0200 Add some rest api tests --- .../pollen/rest/api/AbstractPollenRestApiTest.java | 49 +++++++++++++++++++- .../org/chorem/pollen/rest/api/AuthApiTest.java | 2 +- .../org/chorem/pollen/rest/api/PollApiTest.java | 5 ++- .../chorem/pollen/rest/api/PollenUserApiTest.java | 52 +++------------------- .../chorem/pollen/rest/api/RestApiFixtures.java | 5 +++ 5 files changed, 64 insertions(+), 49 deletions(-) diff --git a/pollen-rest-api/src/test/java/org/chorem/pollen/rest/api/AbstractPollenRestApiTest.java b/pollen-rest-api/src/test/java/org/chorem/pollen/rest/api/AbstractPollenRestApiTest.java index 0b98651e..b95dd883 100644 --- a/pollen-rest-api/src/test/java/org/chorem/pollen/rest/api/AbstractPollenRestApiTest.java +++ b/pollen-rest-api/src/test/java/org/chorem/pollen/rest/api/AbstractPollenRestApiTest.java @@ -27,9 +27,13 @@ import org.apache.catalina.Globals; import org.apache.catalina.startup.Tomcat; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.http.HeaderElement; +import org.apache.http.HeaderElementIterator; import org.apache.http.HttpResponse; +import org.apache.http.client.fluent.Request; import org.apache.http.client.fluent.Response; import org.apache.http.client.utils.URIBuilder; +import org.apache.http.message.BasicHeaderElementIterator; import org.apache.http.util.EntityUtils; import org.chorem.pollen.persistence.PollenPersistenceContext; import org.chorem.pollen.persistence.PollenTopiaPersistenceContext; @@ -51,8 +55,11 @@ import org.junit.Rule; import org.nuiton.topia.persistence.TopiaIdFactory; import org.nuiton.util.DateUtil; +import javax.ws.rs.core.HttpHeaders; import java.io.File; import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; import java.util.Locale; import java.util.concurrent.atomic.AtomicBoolean; @@ -198,6 +205,13 @@ public class AbstractPollenRestApiTest { return content; } + protected void assertEmptyResponse(Response response) throws IOException { + HttpResponse httpResponse = response.returnResponse(); + int statusCode = httpResponse.getStatusLine().getStatusCode(); + Assert.assertEquals(204, statusCode); + Assert.assertNull(httpResponse.getEntity()); + } + protected void showTestResult(String content) { String testName = application.getMethodName(); @@ -230,8 +244,41 @@ public class AbstractPollenRestApiTest { .setScheme("http") .setHost("localhost") .setPort(application.getPort()) - .setPath(path); + .setPath(path) + .setParameter("order", "topiaCreateDate") + .setParameter("desc", "true") + .setParameter("pageSize","-1"); return builder; } + protected String login() throws URISyntaxException, IOException { + + URI uri = createRequest(RestApiFixtures.login()) + .addParameter("login", "admin@chorem.org") + .addParameter("password", "admin") + .build(); + Request request = Request.Post(uri); + + Response response = request.execute(); + HttpResponse httpResponse = response.returnResponse(); + int statusCode = httpResponse.getStatusLine().getStatusCode(); + Assert.assertEquals(200, statusCode); + String content = EntityUtils.toString(httpResponse.getEntity()); + showTestResult(content); + Assert.assertNotNull(content); + + String token = ""; + + HeaderElementIterator it = new BasicHeaderElementIterator(httpResponse.headerIterator(HttpHeaders.SET_COOKIE)); + while (it.hasNext()) { + HeaderElement elem = it.nextElement(); + if (elem.getName().equals(PollenRestApiRequestFilter.COOKIE_POLLEN_AUTH)) { + token = elem.getValue(); + } + } + + return token; + + } + } diff --git a/pollen-rest-api/src/test/java/org/chorem/pollen/rest/api/AuthApiTest.java b/pollen-rest-api/src/test/java/org/chorem/pollen/rest/api/AuthApiTest.java index 95d64e54..bba42d24 100644 --- a/pollen-rest-api/src/test/java/org/chorem/pollen/rest/api/AuthApiTest.java +++ b/pollen-rest-api/src/test/java/org/chorem/pollen/rest/api/AuthApiTest.java @@ -43,7 +43,7 @@ import java.net.URISyntaxException; public class AuthApiTest extends AbstractPollenRestApiTest { @Test - public void login() throws URISyntaxException, IOException { + public void loginTest() throws URISyntaxException, IOException { URI uri = createRequest(RestApiFixtures.login()) diff --git a/pollen-rest-api/src/test/java/org/chorem/pollen/rest/api/PollApiTest.java b/pollen-rest-api/src/test/java/org/chorem/pollen/rest/api/PollApiTest.java index bbbecdc2..91f41f69 100644 --- a/pollen-rest-api/src/test/java/org/chorem/pollen/rest/api/PollApiTest.java +++ b/pollen-rest-api/src/test/java/org/chorem/pollen/rest/api/PollApiTest.java @@ -70,13 +70,14 @@ public class PollApiTest extends AbstractPollenRestApiTest { assertResponse(response); } - @Ignore @Test public void getPolls() throws URISyntaxException, IOException { - //TODO Login as admin before + String sessionToken = login(); + URI uri = createRequest(RestApiFixtures.polls(null, null)).build(); Request request = Request.Get(uri); + request.addHeader(PollenRestApiRequestFilter.REQUEST_HEADER_SESSION_TOKEN, sessionToken); Response response = request.execute(); assertResponse(response); } diff --git a/pollen-rest-api/src/test/java/org/chorem/pollen/rest/api/PollenUserApiTest.java b/pollen-rest-api/src/test/java/org/chorem/pollen/rest/api/PollenUserApiTest.java index b655f8a7..1fa52368 100644 --- a/pollen-rest-api/src/test/java/org/chorem/pollen/rest/api/PollenUserApiTest.java +++ b/pollen-rest-api/src/test/java/org/chorem/pollen/rest/api/PollenUserApiTest.java @@ -21,23 +21,14 @@ package org.chorem.pollen.rest.api; * #L% */ -import org.apache.http.HeaderElement; -import org.apache.http.HeaderElementIterator; -import org.apache.http.HttpResponse; import org.apache.http.client.fluent.Request; import org.apache.http.client.fluent.Response; -import org.apache.http.message.BasicHeaderElementIterator; -import org.apache.http.util.EntityUtils; import org.chorem.pollen.persistence.entity.PollenUser; -import org.junit.Assert; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; -import javax.ws.rs.core.HttpHeaders; -import java.io.IOException; import java.net.URI; -import java.net.URISyntaxException; import static org.junit.Assert.assertTrue; @@ -50,8 +41,9 @@ import static org.junit.Assert.assertTrue; public class PollenUserApiTest extends AbstractPollenRestApiTest { @Before - public void setUp() throws Exception { + public void setUp() { + loadFixtures("user-fixtures"); loadFixtures("fixtures"); } @@ -115,18 +107,18 @@ public class PollenUserApiTest extends AbstractPollenRestApiTest { } - @Ignore @Test - public void deleteUser() throws Exception { + public void deleteUserAsAdmin() throws Exception { + + String sessionToken = login(); PollenUser pollenUser = fixture("user_jean"); String userId = encodeId(pollenUser.getTopiaId()); URI uri = createRequest(RestApiFixtures.users(userId, null)).build(); Request request = Request.Delete(uri); + request.addHeader(PollenRestApiRequestFilter.REQUEST_HEADER_SESSION_TOKEN, sessionToken); Response response = request.execute(); - String content = assertResponse(response); - assertTrue(content.contains("OK!")); - + assertEmptyResponse(response); } @Ignore @@ -142,34 +134,4 @@ public class PollenUserApiTest extends AbstractPollenRestApiTest { String content = assertResponse(response); assertTrue(content.contains("OK!")); } - - private String login() throws URISyntaxException, IOException { - - URI uri = createRequest(RestApiFixtures.login()) - .addParameter("login", "admin@chorem.org") - .addParameter("password", "admin") - .build(); - Request request = Request.Post(uri); - - Response response = request.execute(); - HttpResponse httpResponse = response.returnResponse(); - int statusCode = httpResponse.getStatusLine().getStatusCode(); - Assert.assertEquals(200, statusCode); - String content = EntityUtils.toString(httpResponse.getEntity()); - showTestResult(content); - Assert.assertNotNull(content); - - String token = ""; - - HeaderElementIterator it = new BasicHeaderElementIterator(httpResponse.headerIterator(HttpHeaders.SET_COOKIE)); - while (it.hasNext()) { - HeaderElement elem = it.nextElement(); - if (elem.getName().equals(PollenRestApiRequestFilter.COOKIE_POLLEN_AUTH)) { - token = elem.getValue(); - } - } - - return token; - - } } diff --git a/pollen-rest-api/src/test/java/org/chorem/pollen/rest/api/RestApiFixtures.java b/pollen-rest-api/src/test/java/org/chorem/pollen/rest/api/RestApiFixtures.java index e21cd9a8..346b9185 100644 --- a/pollen-rest-api/src/test/java/org/chorem/pollen/rest/api/RestApiFixtures.java +++ b/pollen-rest-api/src/test/java/org/chorem/pollen/rest/api/RestApiFixtures.java @@ -33,6 +33,7 @@ public class RestApiFixtures { protected static final String LOGOUT_API = "/logout"; protected static final String USERS_API = "/users"; protected static final String POLLS_API = "/polls"; + protected static final String VOTES_API = "/polls"; public static String login() { return LOGIN_API; @@ -46,6 +47,10 @@ public class RestApiFixtures { return api(POLLS_API, pollId, "/", token); } + public static String votes(String pollId, String questionId, String voteId, String token) { + return api("/polls/" + pollId + "/questions/" + questionId + "/votes", voteId, "/", token); + } + public static String logout() { return LOGOUT_API; -- 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/refonte-ui in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit a7936eb88c80edfcc9dcb25eb47aeb0f43acec70 Author: jcouteau <couteau@codelutin.com> Date: Wed May 27 10:18:00 2020 +0200 fixes #337 : La liste des participants n'a pas d'ordre déterministe : Ordre sur les noms (mais É... se retrouve après Y...)... Ordre déterministe après enregistrement. Pas avant par contre (odre de saisie) --- .../java/org/chorem/pollen/services/service/VoterListService.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/service/VoterListService.java b/pollen-services/src/main/java/org/chorem/pollen/services/service/VoterListService.java index 78ac776e..0e0e7156 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/service/VoterListService.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/service/VoterListService.java @@ -424,7 +424,10 @@ public class VoterListService extends PollenServiceSupport { protected List<VoterListMember> getVoterListMembers0(VoterList voterList) { - return getVoterListMemberDao().forVoterListEquals(voterList).findAll(); + return getVoterListMemberDao() + .forVoterListEquals(voterList) + .setOrderByArguments(VoterListMember.PROPERTY_MEMBER + "." + PollenPrincipal.PROPERTY_NAME) + .findAll(); } -- 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/refonte-ui in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 5d7948ff5e36b3b303333c37a517889bef765728 Author: Cécilia Bossard <bossard@codelutin.com> Date: Thu Jul 2 10:21:19 2020 +0200 Corrections suite à revue --- .../pollen/persistence/entity/PollTopiaDao.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pollen-persistence/src/main/java/org/chorem/pollen/persistence/entity/PollTopiaDao.java b/pollen-persistence/src/main/java/org/chorem/pollen/persistence/entity/PollTopiaDao.java index 54e218af..48cdf14a 100644 --- a/pollen-persistence/src/main/java/org/chorem/pollen/persistence/entity/PollTopiaDao.java +++ b/pollen-persistence/src/main/java/org/chorem/pollen/persistence/entity/PollTopiaDao.java @@ -64,7 +64,11 @@ public class PollTopiaDao extends AbstractPollTopiaDao<Poll> { parameters.put("user", user); String hqlCondition = ""; +<<<<<<< HEAD + if (StringUtils.isNotBlank(filter)) { +======= if (StringUtils.isNotEmpty(filter)) { +>>>>>>> 2376d098bf3444420202e9150234c6ea44fa06e0 hqlCondition += filterCondition(filter, parameters); } @@ -82,7 +86,11 @@ public class PollTopiaDao extends AbstractPollTopiaDao<Poll> { hql += " AND " + DaoUtils.getSearchClause("poll", parameters, Poll.PROPERTY_TITLE, search); } +<<<<<<< HEAD + if (StringUtils.isNotBlank(filter)) { +======= if (StringUtils.isNotEmpty(filter)) { +>>>>>>> 2376d098bf3444420202e9150234c6ea44fa06e0 hql +=" AND " + filterCondition(filter, parameters); } @@ -101,7 +109,11 @@ public class PollTopiaDao extends AbstractPollTopiaDao<Poll> { hql += " AND " + DaoUtils.getSearchClause("poll", parameters, Poll.PROPERTY_TITLE, search); } +<<<<<<< HEAD + if (StringUtils.isNotBlank(filter)) { +======= if (StringUtils.isNotEmpty(filter)) { +>>>>>>> 2376d098bf3444420202e9150234c6ea44fa06e0 hql +=" AND " + filterCondition(filter, parameters); } @@ -128,7 +140,11 @@ public class PollTopiaDao extends AbstractPollTopiaDao<Poll> { hql += " AND " + DaoUtils.getSearchClause("poll", parameters, Poll.PROPERTY_TITLE, search); } +<<<<<<< HEAD + if (StringUtils.isNotBlank(filter)) { +======= if (StringUtils.isNotEmpty(filter)) { +>>>>>>> 2376d098bf3444420202e9150234c6ea44fa06e0 hql +=" AND " + filterCondition(filter, parameters); } @@ -142,7 +158,11 @@ public class PollTopiaDao extends AbstractPollTopiaDao<Poll> { } private String filterCondition(String filter, Map<String, Object> parameters) { +<<<<<<< HEAD + switch (filter.toUpperCase()) { +======= switch (filter) { +>>>>>>> 2376d098bf3444420202e9150234c6ea44fa06e0 case "PAST": parameters.put("today", new Date()); return "poll." + Poll.PROPERTY_END_DATE + " IS NOT NULL " -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm