This is an automated email from the git hooks/post-receive script. New commit to branch feature/253-tuiles in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 5858dd0a6cfbdfce35f6d814c922ca7365b7dd34 Author: Cécilia Bossard <bossard@codelutin.com> Date: Wed Mar 11 14:48:53 2020 +0100 ref #253 Vue en liste (WIP) --- .../src/main/web/tag/poll/ListView.tag.html | 214 +++++++++++++++ .../src/main/web/tag/poll/MosaicView.tag.html | 107 ++++++++ .../src/main/web/tag/poll/PollLine.tag.html | 288 +++++++++++++++++++++ .../src/main/web/tag/poll/Polls.tag.html | 194 +------------- pollen-ui-riot-js/stories/Line.stories.js | 211 +++++++++++++++ 5 files changed, 826 insertions(+), 188 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/ListView.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/ListView.tag.html new file mode 100644 index 00000000..a2ef4fa5 --- /dev/null +++ b/pollen-ui-riot-js/src/main/web/tag/poll/ListView.tag.html @@ -0,0 +1,214 @@ +<!-- + #%L + Pollen :: UI RiotJs + %% + Copyright (C) 2009 - 2017 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> +import "./PollLine.tag.html"; +import "../components/LazyLoad.tag.html"; +import "../components/LoadingCard.tag.html"; +import "./NoPoll.tag.html"; + +<ListView> + <div class="table-content" > + <!-- Header --> + <div class="table-row header"> + <div class="column index"><span></span></div> + <div class="column checkbox"> + <CheckboxReboot class="checkbox-footer" ontogglecheckbox="{ontogglecheckbox}"></CheckboxReboot> + </div> + <div class="wrapper attributes"> + <div class="column title"><span>Name</span></div> + <div class="column status"><span>Status</span></div> + <div class="column votes"><span>Votes</span></div> + <div class="column author"><span>Author</span></div> + <div class="column description"><span>Description</span></div> + <div class="column creation"><span>Creation date</span></div> + <div class="column end"><span>End date</span></div> + </div> + </div> + + + <!-- Lines --> + <LazyLoad pagination={pagination} onload={lazyLoad} load-size="20" ref="lazyLoad" class="elements" > + <yield to="element"> + <PollLine poll={element} on-poll-list-change={parent.parent.parent.refresh} ontogglecheckbox="{parent.parent.parent.ontogglecheckbox}"/> + </yield> + <yield to="loading"> + <LoadingCard loading={nbNextGroup}> + {parent.parent._l("loading", nbNext)} + </LoadingCard> + </yield> + <yield to="noResult"> + <NoPoll method="{this.opts.method}"></NoPoll> + </yield> + </LazyLoad> + </div> + + + <script type="es6"> + import session from "../../js/Session"; + import pollService from "../../js/PollService"; + + + + this.installBundle(session, "polls"); + + this.pagination = { + order: "topiaCreateDate", + desc: true, + pageSize: -1, + pageNumber: 0 + }; + this.count = 0; + this.checkedBoxes = []; + + + this.refresh = () => { + this.parent.boxChecked = []; + this.refs.lazyLoad.reload(); + }; + + this.lazyLoad = pagination => { + + return pollService[this.parent.currentPage](pagination, this.parent.search.value).then((result) => { + this.count = result.pagination.count; + this.parent.currentState = this.parent.pageStates.DISPLAY_POLLS; + + if (this.count === 0) { + this.parent.currentState = this.parent.pageStates.NO_POLL; + } + + this.update(); + +console.log("RESULT") +console.log(result); + + return result; + }); + }; + + + + </script> + + <style> + + .container { + background: #F7F7F7; + } + + .attributes { + flex-grow: 1; + } + + .table-row .header { + display: flex; + flex-direction: row; + flex-wrap: no-wrap; + width: 100%; + padding-left: 15px; + padding-right: 15px; + } + + .table-row .header { + height: 39px; + } + + .header, .header .title { + font-family: Open Sans; + font-style: normal; + font-weight: bold; + font-size: 12px; + display: flex; + padding-bottom: 5px; + } + + .selected { + background: var(--White); + } + + .wrapper { + display: flex; + flex-direction: row; + } + .column { + flex-grow: 0; + flex-shrink: 0; + vertical-align: top; + display: flex; + justify-content: start; + } + + .checkbox { + width: 20px; + } + + .index { + width: 50px; + justify-content: center; + } + + .title { + width: 320px; + font-style: normal; + font-weight: 600; + font-size: 16px; + line-height: 22px; + + padding-left: 20px; + + flex-grow: 1; + padding-right: 4px; + } + + .status { + width: 60px; + justify-content: center; + padding-left: 20px; + } + + .votes{ + width: 80px; + justify-content: center; + } + + .author { + width: 200px; + padding-left: 20px; + } + + .description { + width: 250px; + padding-left: 5px; + flex-grow: 1; + } + + .creation, .end { + width: 140px; + padding-left: 5px; + } + + .checkmark { + position: absolute; + height: 20px; + width: 20px; + } + + + </style> +</ListView> diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/MosaicView.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/MosaicView.tag.html new file mode 100644 index 00000000..a2b2b69c --- /dev/null +++ b/pollen-ui-riot-js/src/main/web/tag/poll/MosaicView.tag.html @@ -0,0 +1,107 @@ +<!-- + #%L + Pollen :: UI RiotJs + %% + Copyright (C) 2009 - 2017 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> +import "./PollCard.tag.html"; +import "./PollCardReboot.tag.html"; +import "../components/LazyLoad.tag.html"; +import "../components/LoadingCard.tag.html"; +import "./NoPoll.tag.html"; + +<MosaicView> + + <div class="mosaic-view"> + <!-- Affichage de la mosaïque --> + <LazyLoad pagination={pagination} onload={lazyLoad} load-size="20" ref="lazyLoad" class="elements" > + <yield to="element"> + <PollCardReboot poll={element} on-poll-list-change={parent.parent.parent.refresh} ontogglecheckbox="{parent.parent.parent.ontogglecheckbox}"/> + </yield> + <yield to="loading"> + <LoadingCard loading={nbNextGroup}> + {parent.parent._l("loading", nbNext)} + </LoadingCard> + </yield> + <yield to="noResult"> + <NoPoll method="{this.opts.method}"></NoPoll> + </yield> + </LazyLoad> + </div> + + <script type="es6"> + import session from "../../js/Session"; + import pollService from "../../js/PollService"; + + + + this.installBundle(session, "polls"); + + this.pagination = { + order: "topiaCreateDate", + desc: true, + pageSize: -1, + pageNumber: 0 + }; + this.count = 0; + this.checkedBoxes = []; + + + this.refresh = () => { + this.parent.boxChecked = []; + this.refs.lazyLoad.reload(); + }; + + this.lazyLoad = pagination => { + + return pollService[this.parent.currentPage](pagination, this.parent.search.value).then((result) => { + this.count = result.pagination.count; + this.parent.currentState = this.parent.pageStates.DISPLAY_POLLS; + + if (this.count === 0) { + this.parent.currentState = this.parent.pageStates.NO_POLL; + } + + this.update(); + + return result; + }); + }; + + + + </script> + + <style> + + .mosaic-view { + padding: 20px 2%; + } + + .container { + background: #F7F7F7; + } + + .elements { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + width: 100%; + } + + </style> +</MosaicView> diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/PollLine.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/PollLine.tag.html new file mode 100644 index 00000000..92576178 --- /dev/null +++ b/pollen-ui-riot-js/src/main/web/tag/poll/PollLine.tag.html @@ -0,0 +1,288 @@ +import "../components/CheckboxReboot.tag.html"; +import "../components/Tooltip.tag.html"; +import "../components/Popover.tag.html"; +import "../components/Avatar.tag.html"; + +<PollLine> + <div class="table-row {opts.poll.status.toLowerCase()}"> + <div class="column index"> + <Tooltip position="top" content="Menu"> + <i class="menu icon-burger"></i> + </Tooltip> + </div> + <div class="column checkbox"> + <CheckboxReboot ontogglecheckbox="{ontogglecheckbox}"></CheckboxReboot> + </div> + <div class="wrapper attributes"> + <div class="column title"> + <div class="poll-title">{opts.poll.title}</div> + </div> + <div class="column status"> + <Tooltip if="{opts.poll.status === 'VOTING'}" position="top" content="Current"> + <i class="icon icon-current"></i> + </Tooltip> + + <Tooltip if="{opts.poll.status === 'CLOSED'}" position="top" content="Finished"> + <i class="icon icon-past"></i> + </Tooltip> + + <Tooltip if="{opts.poll.status === 'CREATED'}" position="top" content="Upcoming"> + <i class="icon icon-upcoming"></i> + </Tooltip> + </div> + <div class="column votes"> + <Tooltip position="top" content="{parent.opts.poll.questions[0].voteCount === 0 ? 0 : (parent.opts.poll.questions[0].voteCount)} votes"> + <div class="voters"><span class="votesNb">{parent.opts.poll.questions[0].voteCount === 0 ? "-" : (parent.opts.poll.questions[0].voteCount)}</span></div></Tooltip> + </Tooltip> + </div> + <div class="column author"> + <Tooltip position="top" content="{opts.poll.creatorName}"> + <Avatar class="avatar" avatar={parent.opts.poll.creatorAvatar} name={parent.opts.poll.creatorName} rounded="true"/> + </Tooltip> + <span class="author-name">{opts.poll.creatorName}</span> + </div> + <div class="column description"> + <div class="poll-description" if="{opts.poll.description}">{opts.poll.description}</div> + <div class="poll-no-description" if="{!opts.poll.description}">{_t.noDescription}</div> + </div> + <div class="column creation"> + <span class="timing">{startDate}</span> + </div> + <div class="column end"> + <span class="timing"><span if="{ended}">{_t.finished}</span><span if="{!ended}">{endDate}</span></span> + </div> + </div> + + </div> + + <script type="es6"> + import "../../css/icons.css"; + import session from "../../js/Session"; + import pollService from "../../js/PollService"; + + this.installBundle(session, "poll"); + + var moment = require("moment"); + this.startDate = moment(this.opts.poll.beginDate).format("DD - MM - YYYY"); + if (this.opts.poll.endDate) { + this.endDate = moment(this.opts.poll.endDate).format("DD - MM - YYYY"); + } else { + this.endDate = this._t.noEndDate; + } + + var now = new Date(); + this.ended = this.opts.poll.endDate && this.opts.poll.endDate < now; + this.running = this.opts.poll.beginDate < now && this.opts.poll.endDate > now; + this.started = this.opts.poll.beginDate < now && !this.opts.poll.endDate; + this.starting = this.opts.poll.beginDate > now; + + // si le sondage est non terminé, on redirige vers la liste des votes + // si le sondage est terminé, on redirige vers les résultats + if (this.ended) { + this.redirectToPoll = "#poll/" + this.opts.poll.id + "/result/" + this.opts.poll.permission; + } else { + this.redirectToPoll = "#poll/" + this.opts.poll.id + "/vote/" + this.opts.poll.permission; + } + + this.deletePoll = (e) => { + e.preventDefault(); + e.stopPropagation(); + this.confirmReboot(this._t.deletePoll).then((confirm) => { + if (confirm) { + pollService.deletePoll(this.opts.poll.id, this.opts.poll.permission).then(() => { + this.opts.onPollListChange(); + }); + } + }); + }; + + this.ontogglecheckbox = (checkbox) => { + if (this.opts.ontogglecheckbox) { + this.opts.ontogglecheckbox(checkbox); + } + }; + + </script> + + + <style> + + pollline { + width: 100% + } + + + .table-row { + height: 70px; + display: flex; + align-items: center; + border: 1px solid #D7D7D7; + + } + + .selected { + background: var(--White); + } + + .wrapper { + display: flex; + flex-direction: row; + align-items: center; + } + .column { + flex-grow: 0; + flex-shrink: 0; + vertical-align: top; + } + .index, .checkbox { + font-size: 20px; + } + + .title { + display: flex; + align-items: center; + + } + + .poll-title { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + + font-style: normal; + font-weight: 600; + font-size: 16px; + line-height: 22px; + } + + .author { + font-size: 12px; + display: flex; + align-items: center; + } + + .author-name { + padding-left: 10px; + } + + .description { + font-family: Open Sans; + font-style: normal; + font-weight: normal; + font-size: 12px; + line-height: 16px; + display: flex; + align-items: center; + padding-right: 20px; + } + + + .poll-description { + /* hide text if it more than N lines */ + overflow: hidden; + /* for set '...' in absolute position */ + position: relative; + /* use this value to count block height */ + line-height: 16px; + /* max-height = line-height (1.2) * lines max number (3) */ + max-height: 48px; + /* fix problem when last visible word doesn't adjoin right side */ + text-align: justify; + /* place for '...' */ + margin-right: -10px; + padding-right: 15px + } + + .poll-description::before { + /* points in the end */ + content: '...'; + /* absolute position */ + position: absolute; + /* set position to right bottom corner of block */ + right: 0; + bottom: 0; + } + + .poll-description::after { + /* points in the end */ + content: ''; + /* absolute position */ + position: absolute; + /* set position to right bottom corner of text */ + right: 0; + /* set width and height */ + width: 1em; + height: 1em; + margin-top: 0.2em; + /* bg color = bg color under block */ + background: white; + } + + .timing { + font-weight: normal; + font-size: 12px; + line-height: 16px; + } + + .icon { + display: flex; + align-items:center; + justify-content:center; + width : 30px; + height : 30px; + border-radius:15px; + font-size: 28px; + } + + .created .icon { + color: var(--Mountain-Meadow); + } + + .closed .icon { + color: var(--Purple); + } + + .voting .icon { + color: var(--Pizazz); + } + + .icon-burger { + color: #14A39F; + } + + .votes div { + width : 30px; + height : 30px; + border-radius:15px; + color: var(--White); + font-weight: bold; + font-size: 16px; + line-height: 22px; + } + + .created .votes div{ + background: var(--Mountain-Meadow); + } + + + .closed .votes div{ + background: var(--Purple); + } + + .voting .votes div{ + background: var(--Pizazz); + } + + .voters { + display: flex; + justify-content: center; + align-items: center; + } + + .checkbox { + padding-bottom: 10px; + } + + </style> + +</PollLine> \ No newline at end of file diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Polls.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Polls.tag.html index e4ceaec4..600212bf 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Polls.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Polls.tag.html @@ -18,122 +18,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #L% --> -import "./PollCard.tag.html"; -import "./PollCardReboot.tag.html"; -import "../components/LazyLoad.tag.html"; -import "../components/LoadingCard.tag.html"; import "./MyPollsHeader.tag.html"; -import "./NoPoll.tag.html"; +import "./MosaicView.tag.html"; +import "./ListView.tag.html"; <Polls> <div class="container" > <MyPollsHeader search="{search}" ref="pollsHeader" currentPage="{currentPage}"/> - <div class="main-content"> - + <div> <!-- Affichage de la mosaïque --> - <LazyLoad pagination={pagination} onload={lazyLoad} load-size="20" ref="lazyLoad" class="elements" if="{currentView === pageView.MOSAIC}"> - <yield to="element"> - <PollCardReboot poll={element} on-poll-list-change={parent.parent.refresh} ontogglecheckbox="{parent.parent.ontogglecheckbox}"/> - </yield> - <yield to="loading"> - <LoadingCard loading={nbNextGroup}> - {parent.parent._l("loading", nbNext)} - </LoadingCard> - </yield> - <yield to="noResult"> - <NoPoll method="{this.opts.method}"></NoPoll> - </yield> - </LazyLoad> + <MosaicView ref="lazyLoad" if="{currentView === pageView.MOSAIC}" /> <!-- Affichage en liste --> - <div if="{currentView === pageView.LIST}" class="tableView"> - - - <!-- Header --> -<!-- <div class="table-row header"> - <div class="column index"><span></span></div> - <div class="column checkbox"> - <CheckboxReboot class="checkbox-footer" ontogglecheckbox="{ontogglecheckbox}"></CheckboxReboot> - </div> - <div class="wrapper attributes"> - <div class="column title"><span>Name</span></div> - <div class="column status"><span>Status</span></div> - <div class="column votes"><span>Votes</span></div> - <div class="column author"><span>Author</span></div> - <div class="column description"><span>Description</span></div> - <div class="column creation"><span>Creation date</span></div> - <div class="column end"><span>End date</span></div> - </div> - </div>--> - - <!-- Lines --> - <LazyLoad pagination={pagination} onload={lazyLoad} load-size="20" ref="lazyLoad" class="elements" > - <yield to="element"> - <!-- <div class="table-row"> - - <div class="column index"> - <Tooltip position="top" content="Menu"> - <i class="menu icon-burger"></i> - </Tooltip> - </div> - <div class="column checkbox"> - <CheckboxReboot class="checkbox-footer" ontogglecheckbox="{ontogglecheckbox}"></CheckboxReboot> - </div> - <div class="wrapper attributes"> - <div class="column title"><span>{element.title}</span></div> - <div class="column status"> - <Tooltip if="{element.status === 'VOTING'}" position="top" content="Current"> - <i class="icon icon-current"></i> - </Tooltip> - - <Tooltip if="{element.status === 'CLOSED'}" position="top" content="Finished"> - <i class="icon icon-past"></i> - </Tooltip> - - <Tooltip if="{element.status === 'CREATED'}" position="top" content="Upcoming"> - <i class="icon icon-upcoming"></i> - </Tooltip> - </div> - <div class="column votes"> - <Tooltip position="top" content="{element.questions[0].voteCount === 0 ? 0 : (element.questions[0].voteCount)} votes"> - <div class="voters">{parent.element.questions[0].voteCount === 0 ? "-" : (parent.element.questions[0].voteCount)}</div></Tooltip> - </Tooltip></div> - <div class="column author"> - <Tooltip position="top" content="{element.creatorName}"> - <Avatar class="avatar" avatar={parent.element.creatorAvatar} name={parent.element.creatorName} rounded="true"/><span>{parent.element.creatorName}</span> - </Tooltip> - </div> - <div class="column description"> - <div class="poll-description" if="{element.description}">{element.description}</div> - <div class="poll-no-description" if="{!element.description}">{_t.noDescription}</div> - </div> - <div class="column creation"> - <span class="timing">{element.beginDate}</span> - </div> - <div class="column end"> - <span class="timing">{element.endDate}</span> - </div> - </div> - - </div>--> - - - </yield> - <yield to="loading"> - <LoadingCard loading={nbNextGroup}> - {parent.parent._l("loading", nbNext)} - </LoadingCard> - </yield> - <yield to="noResult"> - <NoPoll method="{this.opts.method}"></NoPoll> - </yield> - </LazyLoad> - - </div> - - + <ListView ref="lazyLoad" if="{currentView === pageView.LIST}" /> </div> </div> @@ -187,7 +86,7 @@ import "./NoPoll.tag.html"; this.refresh = () => { this.boxChecked = []; - this.refs.lazyLoad.reload(); + this.refs.lazyLoad.refs.lazyLoad.reload(); }; this.lazyLoad = pagination => { @@ -240,87 +139,6 @@ import "./NoPoll.tag.html"; justify-content: space-between; width: 100%; } -<!-- - .table-row { - display: flex; - display: -webkit-flex; - flex-direction: row; - -webkit-flex-direction: row; - flex-wrap: no-wrap; - -webkit-flex-wrap: no-wrap; - width: 100%; - padding-left: 15px; - padding-right: 15px; - - height: 70px; - - } - - .selected { - background: var(--White); - } - - .wrapper { - display: flex; - display: -webkit-flex; - flex-direction: row; - -webkit-flex-direction: row; - } - .column { - flex-grow: 0; - -webkit-flex-grow: 0; - flex-shrink: 0; - -webkit-flex-shrink: 0; - vertical-align: top; - } - .index, .checkbox { - width: 50px; - } - .title { - width: 320px; - font-style: normal; - font-weight: 600; - font-size: 16px; - line-height: 22px; - - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - - .status, .votes{ - width: 50px; - } - - .author { - width: 150px; - } - - .description { - width: 200px; - } - - .creation, .end { - width: 100px; - } - - .icon { - display: flex; - align-items:center; - justify-content:center; - width : 30px; - height : 30px; - border-radius:15px; - } - - .closed div { - color: var(--Purple); - } - - .voting div { - color: var(--Pizazz); - }--> - </style> </Polls> diff --git a/pollen-ui-riot-js/stories/Line.stories.js b/pollen-ui-riot-js/stories/Line.stories.js new file mode 100644 index 00000000..418463c1 --- /dev/null +++ b/pollen-ui-riot-js/stories/Line.stories.js @@ -0,0 +1,211 @@ +import {tag, mount, storiesOf, asCompiledCode} from "@storybook/riot"; + +import i18nHelper from "../src/main/web/js/I18nHelper"; +import uiHelper from "../src/main/web/js/UIHelper"; +import riot from "riot"; + +import "../src/main/web/css/custom.css"; +import "../src/main/web/tag/poll/PollLine.tag.html"; + +export default {title: "PollLine"}; + +const endedPoll = {title: "Poll title", + description: "Lorem ipsum description", + startDate: new Date("December 25, 1995"), + endDate: new Date("December 25, 1996"), + status: "CLOSED", + votes: 12}; + +const startedPoll = {title: "Poll title", + description: "Lorem ipsum description", + startDate: new Date("December 25, 1995"), + endDate: new Date("December 25, 2100"), + status: "VOTING", + votes: 12}; + +const noDescPoll = {title: "Poll title", + startDate: new Date("December 25, 1995"), + endDate: new Date("December 25, 2100"), + status: "VOTING", + votes: 12}; + +const emptyDescPoll = {title: "Poll title", + description: "", + startDate: new Date("December 25, 1995"), + endDate: new Date("December 25, 2100"), + status: "VOTING", + votes: 12}; + +const startedPollNoEnd = {title: "Poll title", + description: "Lorem ipsum description", + startDate: new Date("December 25, 1995"), + endDate: null, + status: "VOTING", + votes: 12}; + +const startingPoll = {title: "Poll title", + description: "Lorem ipsum description", + startDate: new Date("December 25, 2100"), + status: "CREATED"}; + +const pollLongDescription = {title: "Poll title", + description: "Etape 1\nPréchauffer le four à thermostat 7 (210°C).\n Peler les navets puis les faire cuire 5 min à feu doux à couvert avec un peu de sel et de l'eau à hauteur, puis les égoutter.\nEtape 2\nFaire réduire le vin de moitié (à feu vif).\nEtape 3\nCaraméliser le sucre avec une goutte d'eau dans une sauteuse.\nEtape 4\nHors du feu, ajouter le vinaigre et le jus d'orange. Remmettre sur le feu, ajouter le vin, 50 g de beurre, du sel et du poivre.\nEtape 5\nPlonger les navets [...] + startDate: new Date("December 25, 1995"), + endDate: new Date("December 25, 2100"), + status: "VOTING", + votes: 12}; + +const pollLongTitle = {title: "Tatin d'endives aux marrons et Pain au chocolat à la poêle", + description: "Lorem ipsum description", + startDate: new Date("December 25, 1995"), + endDate: new Date("December 25, 2100"), + status: "VOTING", + votes: 12}; + +const pollLongTitleDesc = { + title: "Tatin d'endives aux marrons et Pain au chocolat à la poêle", + description: "Etape 1\nPréchauffer le four à thermostat 7 (210°C).\n Peler les navets puis les faire cuire 5 min à feu doux à couvert avec un peu de sel et de l'eau à hauteur, puis les égoutter.\nEtape 2\nFaire réduire le vin de moitié (à feu vif).\nEtape 3\nCaraméliser le sucre avec une goutte d'eau dans une sauteuse.\nEtape 4\nHors du feu, ajouter le vinaigre et le jus d'orange. Remmettre sur le feu, ajouter le vin, 50 g de beurre, du sel et du poivre.\nEtape 5\nPlonger les navets [...] + startDate: new Date("December 25, 1995"), + endDate: new Date("December 25, 2100"), + status: "VOTING", + votes: 12}; + +const realPoll = { + id: "Rl_xHxGpQpqDqOsRQI3A6A", + permission: "PG3kqLH4SGKLSm01xSTReg", + creatorName: "Admin", + creatorEmail: "admin@chorem.org", + title: "rtu", + description: "", + createDate: 1578911600568, + beginDate: 1578911600572, + endDate: null, + anonymousVoteAllowed: false, + continuousResults: true, + pollType: "FREE", + voteVisibility: "EVERYBODY", + commentVisibility: "EVERYBODY", + resultVisibility: "EVERYBODY", + closed: false, + resultIsVisible: true, + commentIsVisible: true, + voteIsVisible: true, + participantsIsVisible: false, + canVote: true, + commentCount: 0, + invalidEmails: null, + participantCount: 0, + participantInvitedCount: 0, + status: "VOTING", + notifyMeHoursBeforePollEnds: 0, + voteNotification: false, + commentNotification: false, + newChoiceNotification: false, + notificationLocale: null, + report: null, + gtuValidated: true, + maxVoters: 0, + creatorAvatar: null, + emailAddressSuffixes: null, + questions: [{ + id: "a0njM3a_S0aB5tUEvPJxXQ", + permission: "PG3kqLH4SGKLSm01xSTReg", + createDate: 1578911600572, + title: null, + description: null, + beginChoiceDate: null, + endChoiceDate: null, + choiceAddAllowed: false, + voteCountingType: 1, + voteCountingConfig: { + maxChoiceNumber: 0, + minChoiceNumber: 0}, + poll: null, + resultIsVisible: true, + commentIsVisible: true, + voteIsVisible: true, + participantsIsVisible: false, + choices: [{ + id: "cQnQ5pJHROaMfVfJ6wHKXw", + permission: "PG3kqLH4SGKLSm01xSTReg", + choiceOrder: 0, + choiceValue: "f", + choiceType: "TEXT", + description: "", + choiceIsDeletable: true, + report: null}, + {id: "Swl0nteoTHO5r3VtF1qjJQ", + permission: "PG3kqLH4SGKLSm01xSTReg", + choiceOrder: 1, + choiceValue: "ff", + choiceType: "TEXT", + description: "", + choiceIsDeletable: true, + report: null}, + {id: "EJWHCUt8TTy1IOXTvlWJJQ", + permission: "PG3kqLH4SGKLSm01xSTReg", + choiceOrder: 2, + choiceValue: "fff", + choiceType: "TEXT", + description: "", + choiceIsDeletable: true, + report: null}], + choiceCount: 3, + voteCount: 1, + commentCount: 0, + questionOrder: 0, + canVote: true, + report: null}]}; + + + +export const finishedPoll = () => { + riot.mixin(uiHelper); + riot.mixin(i18nHelper); + return mount("pollline", {poll: endedPoll}); +}; +export const startedPollWithEndDate = () => { + riot.mixin(uiHelper); + riot.mixin(i18nHelper); + return mount("pollline", {poll: startedPoll}); +}; +export const startedPollWithNoEndDate = () => { + riot.mixin(uiHelper); + riot.mixin(i18nHelper); + return mount("pollline", {poll: startedPollNoEnd}); +}; +export const pollStartingInFuture = () => { + riot.mixin(uiHelper); + riot.mixin(i18nHelper); + return mount("pollline", {poll: startingPoll}); +}; +export const pollWithLongDescription = () => { + riot.mixin(uiHelper); + riot.mixin(i18nHelper); + return mount("pollline", {poll: pollLongDescription}); +}; +export const pollWithLongTitle = () => { + riot.mixin(uiHelper); + riot.mixin(i18nHelper); + return mount("pollline", {poll: pollLongTitle}); +}; +export const pollWithLongTitleAndDescription = () => { + riot.mixin(uiHelper); + riot.mixin(i18nHelper); + return mount("pollline", {poll: pollLongTitleDesc}); +}; +export const pollReal = () => { + riot.mixin(uiHelper); + riot.mixin(i18nHelper); + return mount("pollline", {poll: realPoll}); +}; +export const pollNoDescription = () => { + riot.mixin(uiHelper); + riot.mixin(i18nHelper); + return mount("pollline", {poll: noDescPoll}); +}; +export const pollEmptyDescription = () => { + riot.mixin(uiHelper); + riot.mixin(i18nHelper); + return mount("pollline", {poll: emptyDescPoll}); +}; -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.