branch develop updated (a6c6d634 -> e05d92c3)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git from a6c6d634 Fix purgeOldVotes cron new f01fcc0c Prevent error on loading pollen while disconnected new e05d92c3 Indent component The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit e05d92c311fa4673d940aa13fc2a69aa089625f7 Author: Brendan Le Ny <bleny@codelutin.com> Date: Fri Oct 18 11:18:47 2019 +0200 Indent component commit f01fcc0c53748358392ffdb658c659746d1846a2 Author: Brendan Le Ny <bleny@codelutin.com> Date: Fri Oct 18 10:20:58 2019 +0200 Prevent error on loading pollen while disconnected Summary of changes: pollen-ui-riot-js/src/main/web/js/Session.js | 3 +- .../web/tag/voteCountingType/BordaConfig.tag.html | 136 ++++++++++----------- 2 files changed, 70 insertions(+), 69 deletions(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit f01fcc0c53748358392ffdb658c659746d1846a2 Author: Brendan Le Ny <bleny@codelutin.com> Date: Fri Oct 18 10:20:58 2019 +0200 Prevent error on loading pollen while disconnected --- pollen-ui-riot-js/src/main/web/js/Session.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pollen-ui-riot-js/src/main/web/js/Session.js b/pollen-ui-riot-js/src/main/web/js/Session.js index 9385ac5e..ec5b8a95 100644 --- a/pollen-ui-riot-js/src/main/web/js/Session.js +++ b/pollen-ui-riot-js/src/main/web/js/Session.js @@ -99,6 +99,7 @@ class Session { start() { this.updateConfigurationServer(); this.updateUser(); + this.userPromise.catch(() => { /* prevent uncatched promise */ }); this.updateGtu(); } @@ -121,7 +122,7 @@ class Session { bus.trigger("userNoMoreConnected"); }); } else { - this.userPromise = Promise.reject(); + this.userPromise = Promise.resolve("user not connected"); } } -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit e05d92c311fa4673d940aa13fc2a69aa089625f7 Author: Brendan Le Ny <bleny@codelutin.com> Date: Fri Oct 18 11:18:47 2019 +0200 Indent component --- .../web/tag/voteCountingType/BordaConfig.tag.html | 136 ++++++++++----------- 1 file changed, 68 insertions(+), 68 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/voteCountingType/BordaConfig.tag.html b/pollen-ui-riot-js/src/main/web/tag/voteCountingType/BordaConfig.tag.html index 7fb14de0..7935f918 100644 --- a/pollen-ui-riot-js/src/main/web/tag/voteCountingType/BordaConfig.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/voteCountingType/BordaConfig.tag.html @@ -33,83 +33,83 @@ import "./MaxChoicesNumberConfig.tag.html"; name="bordaDefault" id="bordaDefault" ref="bordaDefault" - disabled={opts.disabled} - checkboxchecked={opts.config.pointsByRankDefault} - ontogglecheckbox={toggleBordaDefault}/> + disabled="{opts.disabled}" + checkboxchecked="{opts.config.pointsByRankDefault}" + ontogglecheckbox="{toggleBordaDefault}" /> </div> <div class="o-form-element"> - <label class="c-label" for="maxChoiceNumber"> - {_t.pointsByRank} - </label> - <div class="c-input-group c-input-group--stacked c-field--label"> - <div class="o-field ranks" - each={value, index in opts.config.pointsByRank || []}> - <em class="rank">{parent._t.rank} {index + 1} :</em> - <input name="points-{index}" - tabindex="1" - id="points-{index}" - ref="points" - class="c-field" - disabled={parent.opts.disabled || parent.opts.config.pointsByRankDefault} - value={value} - min="{index + 1 === parent.opts.config.pointsByRank.length ? 1 : parent.opts.config.pointsByRank[index + 1]}" - max="{index === 0 ? undefined : parent.opts.config.pointsByRank[index - 1]}" - onChange={parent.pointsChange(index)} - type="number"> - <em class="points">{parent._t.points}</em> - </div> - </div> - </div> - - <script type="es6"> - import session from "../../js/Session"; - this.installBundle(session, "poll_settings_voteCountingConfig"); - - if (this.opts.config.pointsByRankDefault === undefined) { - this.opts.config.pointsByRankDefault = this.opts.config.pointsByRank === undefined || this.opts.config.pointsByRank === null; - } - - - this.toggleBordaDefault = () => { - this.opts.config.pointsByRankDefault = !this.opts.config.pointsByRankDefault; - if (this.opts.config.pointsByRankDefault) { - this.updatePointsByRank(); - } - this.update(); - }; + <label class="c-label" for="maxChoiceNumber"> + {_t.pointsByRank} + </label> + <div class="c-input-group c-input-group--stacked c-field--label"> + <div class="o-field ranks" + each={value, index in opts.config.pointsByRank || []}> + <em class="rank">{parent._t.rank} {index + 1} :</em> + <input name="points-{index}" + tabindex="1" + id="points-{index}" + ref="points" + class="c-field" + disabled={parent.opts.disabled || parent.opts.config.pointsByRankDefault} + value={value} + min="{index + 1 === parent.opts.config.pointsByRank.length ? 1 : parent.opts.config.pointsByRank[index + 1]}" + max="{index === 0 ? undefined : parent.opts.config.pointsByRank[index - 1]}" + onChange={parent.pointsChange(index)} + type="number"> + <em class="points">{parent._t.points}</em> + </div> + </div> + </div> - this.updatePointsByRank = () => { - let length = this.opts.config.maxChoiceNumber || this.opts.countChoices; - this.opts.config.pointsByRank = Array.from(Array(length).keys(), x => length - x); - }; + <script type="es6"> + import session from "../../js/Session"; + this.installBundle(session, "poll_settings_voteCountingConfig"); - this.pointsChange = index => () => { - this.opts.config.pointsByRank[index] = this.refs.points[index].valueAsNumber; - }; + if (this.opts.config.pointsByRankDefault === undefined) { + this.opts.config.pointsByRankDefault = this.opts.config.pointsByRank === undefined || this.opts.config.pointsByRank === null; + } - this.getConfig = () => { - let config = this.refs.maxChoiceNumber.getConfig(); - config.pointsByRank = this.opts.config.pointsByRankDefault ? null : this.refs.points.map(input => input.valueAsNumber); - return config; - }; - if (!this.opts.config.pointsByRank) { + this.toggleBordaDefault = () => { + this.opts.config.pointsByRankDefault = !this.opts.config.pointsByRankDefault; + if (this.opts.config.pointsByRankDefault) { this.updatePointsByRank(); - } else { - let length = this.opts.config.maxChoiceNumber || this.opts.countChoices; - if (this.opts.config.pointsByRank.length < length) { - let nbRankToAdd = length - this.opts.config.pointsByRank.length; - let nextRanks = new Array(nbRankToAdd).fill(0); - this.opts.config.pointsByRank = this.opts.config.pointsByRank.concat(nextRanks); - } else if (this.opts.config.pointsByRank.length > length) { - let nbRankToRemove = this.opts.config.pointsByRank.length - length; - this.opts.config.pointsByRank.splice(length, nbRankToRemove); - } } + this.update(); + }; + + this.updatePointsByRank = () => { + let length = this.opts.config.maxChoiceNumber || this.opts.countChoices; + this.opts.config.pointsByRank = Array.from(Array(length).keys(), x => length - x); + }; + + this.pointsChange = index => () => { + this.opts.config.pointsByRank[index] = this.refs.points[index].valueAsNumber; + }; + + this.getConfig = () => { + let config = this.refs.maxChoiceNumber.getConfig(); + config.pointsByRank = this.opts.config.pointsByRankDefault ? null : this.refs.points.map(input => input.valueAsNumber); + return config; + }; + + if (!this.opts.config.pointsByRank) { + this.updatePointsByRank(); + } else { + let length = this.opts.config.maxChoiceNumber || this.opts.countChoices; + if (this.opts.config.pointsByRank.length < length) { + let nbRankToAdd = length - this.opts.config.pointsByRank.length; + let nextRanks = new Array(nbRankToAdd).fill(0); + this.opts.config.pointsByRank = this.opts.config.pointsByRank.concat(nextRanks); + } else if (this.opts.config.pointsByRank.length > length) { + let nbRankToRemove = this.opts.config.pointsByRank.length - length; + this.opts.config.pointsByRank.splice(length, nbRankToRemove); + } + } - </script> + </script> - <style> + <style> .ranks .rank { left: .5em; @@ -131,6 +131,6 @@ import "./MaxChoicesNumberConfig.tag.html"; padding-left: 5em; padding-right: 4em; } - </stryle> + </style> </BordaConfig> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm