framadate-responsive/documentation/injectables/ConfigService.html
2020-02-19 17:12:54 +01:00

4479 lines
169 KiB
HTML

<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>framadate-funky-frontend documentation</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../images/favicon.ico">
<link rel="stylesheet" href="../styles/style.css">
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top visible-xs">
<a href="../" class="navbar-brand">framadate-funky-frontend documentation</a>
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
</div>
<div class="xs-menu menu" id="mobile-menu">
<div id="book-search-input" role="search"><input type="text" placeholder="Type to search"></div> <compodoc-menu></compodoc-menu>
</div>
<div class="container-fluid main">
<div class="row main">
<div class="hidden-xs menu">
<compodoc-menu mode="normal"></compodoc-menu>
</div>
<!-- START CONTENT -->
<div class="content injectable">
<div class="content-data">
<ol class="breadcrumb">
<li>Injectables</li>
<li>ConfigService</li>
</ol>
<ul class="nav nav-tabs" role="tablist">
<li class="active">
<a href="#info" role="tab" id="info-tab" data-toggle="tab" data-link="info">Info</a>
</li>
<li >
<a href="#source" role="tab" id="source-tab" data-toggle="tab" data-link="source">Source</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane fade active in" id="c-info">
<p class="comment">
<h3>File</h3>
</p>
<p class="comment">
<code>src/app/services/config.service.ts</code>
</p>
<p class="comment">
<h3>Description</h3>
</p>
<p class="comment">
<p>le service transverse à chaque page qui permet de syncroniser la configuration de sondage souhaitée</p>
</p>
<p class="comment">
<h3>Extends</h3>
</p>
<p class="comment">
<code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</p>
<section>
<h3 id="index">Index</h3>
<table class="table table-sm table-bordered index-table">
<tbody>
<tr>
<td class="col-md-4">
<h6><b>Properties</b></h6>
</td>
</tr>
<tr>
<td class="col-md-4">
<ul class="index-list">
<li>
<a href="#baseHref">baseHref</a>
</li>
<li>
<a href="#loading">loading</a>
</li>
<li>
<a href="#adminKey">adminKey</a>
</li>
<li>
<a href="#allowSeveralHours">allowSeveralHours</a>
</li>
<li>
<a href="#answers">answers</a>
</li>
<li>
<a href="#canModifyAnswers">canModifyAnswers</a>
</li>
<li>
<a href="#creationDate">creationDate</a>
</li>
<li>
<a href="#currentPoll">currentPoll</a>
</li>
<li>
<a href="#customUrl">customUrl</a>
</li>
<li>
<a href="#customUrlIsUnique">customUrlIsUnique</a>
</li>
<li>
<a href="#dateList">dateList</a>
</li>
<li>
<a href="#deletionDateAfterLastModification">deletionDateAfterLastModification</a>
</li>
<li>
<a href="#description">description</a>
</li>
<li>
<a href="#expiracyDateDefaultInDays">expiracyDateDefaultInDays</a>
</li>
<li>
<a href="#expirationDate">expirationDate</a>
</li>
<li>
<a href="#isAdmin">isAdmin</a>
</li>
<li>
<a href="#myComment">myComment</a>
</li>
<li>
<a href="#myEmail">myEmail</a>
</li>
<li>
<a href="#myName">myName</a>
</li>
<li>
<a href="#myPolls">myPolls</a>
</li>
<li>
<a href="#myTempVoteStack">myTempVoteStack</a>
</li>
<li>
<a href="#myVoteStack">myVoteStack</a>
</li>
<li>
<a href="#owner_modifier_token">owner_modifier_token</a>
</li>
<li>
<a href="#password">password</a>
</li>
<li>
<a href="#passwordAccess">passwordAccess</a>
</li>
<li>
<a href="#pollId">pollId</a>
</li>
<li>
<a href="#pollSlug">pollSlug</a>
</li>
<li>
<a href="#pollType">pollType</a>
</li>
<li>
<a href="#step">step</a>
</li>
<li>
<a href="#stepMax">stepMax</a>
</li>
<li>
<a href="#timeList">timeList</a>
</li>
<li>
<a href="#title">title</a>
</li>
<li>
<a href="#urlAdmin">urlAdmin</a>
</li>
<li>
<a href="#urlPublic">urlPublic</a>
</li>
<li>
<a href="#urlSlugPublic">urlSlugPublic</a>
</li>
<li>
<a href="#visibility">visibility</a>
</li>
<li>
<a href="#voteChoices">voteChoices</a>
</li>
<li>
<a href="#voteStackId">voteStackId</a>
</li>
<li>
<a href="#whoCanChangeAnswers">whoCanChangeAnswers</a>
</li>
<li>
<a href="#whoModifiesAnswers">whoModifiesAnswers</a>
</li>
</ul>
</td>
</tr>
<tr>
<td class="col-md-4">
<h6><b>Methods</b></h6>
</td>
</tr>
<tr>
<td class="col-md-4">
<ul class="index-list">
<li>
<a href="#addComment">addComment</a>
</li>
<li>
<a href="#addDaysToDate">addDaysToDate</a>
</li>
<li>
<a href="#addVote">addVote</a>
</li>
<li>
<a href="#checkIfSlugIsUniqueInDatabase">checkIfSlugIsUniqueInDatabase</a>
</li>
<li>
<a href="#convertChoicesAnsweredToSend">convertChoicesAnsweredToSend</a>
</li>
<li>
<a href="#createPoll">createPoll</a>
</li>
<li>
<a href="#createPollFromConfig">createPollFromConfig</a>
</li>
<li>
<a href="#deleteComments">deleteComments</a>
</li>
<li>
<a href="#deletePoll">deletePoll</a>
</li>
<li>
<a href="#deleteVotes">deleteVotes</a>
</li>
<li>
<a href="#exportCSV">exportCSV</a>
</li>
<li>
<a href="#fetchPollFromRoute">fetchPollFromRoute</a>
</li>
<li>
<a href="#fillValuesOnDevEnv">fillValuesOnDevEnv</a>
</li>
<li>
<a href="#findLocalStorageData">findLocalStorageData</a>
</li>
<li>
<a href="#findPollsByEmail">findPollsByEmail</a>
</li>
<li>
<a href="#getMyPolls">getMyPolls</a>
</li>
<li>
<a href="#getPollById">getPollById</a>
</li>
<li>
<a href="#getPollByURL">getPollByURL</a>
</li>
<li>
<a href="#getPollConfig">getPollConfig</a>
</li>
<li>
<a href="#handleError">handleError</a>
</li>
<li>
<a href="#handleVoteAdded">handleVoteAdded</a>
</li>
<li>
<a href="#loadVoteStack">loadVoteStack</a>
</li>
<li>
<a href="#print">print</a>
</li>
<li>
<a href="#resetCurrentChoicesAnswers">resetCurrentChoicesAnswers</a>
</li>
<li>
<a href="#set">set</a>
</li>
<li>
<a href="#todo">todo</a>
</li>
<li>
<a href="#updateCurrentPollFromResponse">updateCurrentPollFromResponse</a>
</li>
<li>
<a href="#updatePoll">updatePoll</a>
</li>
<li>
<a href="#updateVote">updateVote</a>
</li>
<li>
<a href="#resetConfig">resetConfig</a>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
</section>
<section>
<h3 id="constructor">Constructor</h3>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<code>constructor(http: <a href="https://angular.io/api/common/http/HttpClient" target="_blank">HttpClient</a>, messageService: MessageService, router: <a href="https://angular.io/api/router/Router" target="_blank">Router</a>, utils: <a href="../injectables/PollUtilities.html">PollUtilities</a>, confirmationService: ConfirmationService)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="21" class="link-to-prism">src/app/services/config.service.ts:21</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div>
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>http</td>
<td>
<code><a href="https://angular.io/api/common/http/HttpClient" target="_blank" >HttpClient</a></code>
</td>
<td>
No
</td>
</tr>
<tr>
<td>messageService</td>
<td>
<code>MessageService</code>
</td>
<td>
No
</td>
</tr>
<tr>
<td>router</td>
<td>
<code><a href="https://angular.io/api/router/Router" target="_blank" >Router</a></code>
</td>
<td>
No
</td>
</tr>
<tr>
<td>utils</td>
<td>
<code><a href="../injectables/PollUtilities.html" target="_self" >PollUtilities</a></code>
</td>
<td>
No
</td>
</tr>
<tr>
<td>confirmationService</td>
<td>
<code>ConfirmationService</code>
</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
</section>
<section>
<h3 id="methods">
Methods
</h3>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="addComment"></a>
<span class="name">
<b>
addComment
</b>
<a href="#addComment"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>addComment(comment?: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="398"
class="link-to-prism">src/app/services/config.service.ts:398</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>POST
/api/v1/poll/{id}/comment</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>comment</td>
<td>
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</td>
<td>
Yes
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="addDaysToDate"></a>
<span class="name">
<b>
addDaysToDate
</b>
<a href="#addDaysToDate"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>addDaysToDate(days: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank">number</a>, date: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date" target="_blank">Date</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="53"
class="link-to-prism">src/app/services/config.service.ts:53</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>add some days to a date, to compute intervals</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>days</td>
<td>
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code>
</td>
<td>
No
</td>
</tr>
<tr>
<td>date</td>
<td>
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date" target="_blank" >Date</a></code>
</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="addVote"></a>
<span class="name">
<b>
addVote
</b>
<a href="#addVote"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>addVote(voteStack?: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="333"
class="link-to-prism">src/app/services/config.service.ts:333</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>POST
/api/v1/poll/{id}/vote</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>voteStack</td>
<td>
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</td>
<td>
Yes
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="checkIfSlugIsUniqueInDatabase"></a>
<span class="name">
<b>
checkIfSlugIsUniqueInDatabase
</b>
<a href="#checkIfSlugIsUniqueInDatabase"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>checkIfSlugIsUniqueInDatabase(slug: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="95"
class="link-to-prism">src/app/services/config.service.ts:95</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
<td>Default value</td>
</tr>
</thead>
<tbody>
<tr>
<td>slug</td>
<td>
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
</td>
<td>
No
</td>
<td>
<code>&#x27;&#x27;</code>
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="convertChoicesAnsweredToSend"></a>
<span class="name">
<b>
convertChoicesAnsweredToSend
</b>
<a href="#convertChoicesAnsweredToSend"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>convertChoicesAnsweredToSend(choiceList)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="314"
class="link-to-prism">src/app/services/config.service.ts:314</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>conversion to send to back</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>choiceList</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="createPoll"></a>
<span class="name">
<b>
createPoll
</b>
<a href="#createPoll"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>createPoll()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="218"
class="link-to-prism">src/app/services/config.service.ts:218</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>launch creation call to the api</p>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="createPollFromConfig"></a>
<span class="name">
<b>
createPollFromConfig
</b>
<a href="#createPollFromConfig"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>createPollFromConfig(config: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="283"
class="link-to-prism">src/app/services/config.service.ts:283</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>POST
/api/v1/poll/{id}/poll</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>config</td>
<td>
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="deleteComments"></a>
<span class="name">
<b>
deleteComments
</b>
<a href="#deleteComments"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>deleteComments()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="436"
class="link-to-prism">src/app/services/config.service.ts:436</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>administrator calls</p>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="deletePoll"></a>
<span class="name">
<b>
deletePoll
</b>
<a href="#deletePoll"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>deletePoll()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="482"
class="link-to-prism">src/app/services/config.service.ts:482</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="deleteVotes"></a>
<span class="name">
<b>
deleteVotes
</b>
<a href="#deleteVotes"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>deleteVotes()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="459"
class="link-to-prism">src/app/services/config.service.ts:459</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="exportCSV"></a>
<span class="name">
<b>
exportCSV
</b>
<a href="#exportCSV"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>exportCSV()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="542"
class="link-to-prism">src/app/services/config.service.ts:542</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>TODO
export all the poll data available to the public as a CSV single file</p>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="fetchPollFromRoute"></a>
<span class="name">
<b>
fetchPollFromRoute
</b>
<a href="#fetchPollFromRoute"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>fetchPollFromRoute(event)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="191"
class="link-to-prism">src/app/services/config.service.ts:191</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>event</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="fillValuesOnDevEnv"></a>
<span class="name">
<b>
fillValuesOnDevEnv
</b>
<a href="#fillValuesOnDevEnv"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>fillValuesOnDevEnv()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="39"
class="link-to-prism">src/app/services/config.service.ts:39</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="findLocalStorageData"></a>
<span class="name">
<b>
findLocalStorageData
</b>
<a href="#findLocalStorageData"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>findLocalStorageData()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="160"
class="link-to-prism">src/app/services/config.service.ts:160</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="findPollsByEmail"></a>
<span class="name">
<b>
findPollsByEmail
</b>
<a href="#findPollsByEmail"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>findPollsByEmail(email: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="120"
class="link-to-prism">src/app/services/config.service.ts:120</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>search in localstorage, fallback asking the backend to send an email to the owner if it exists</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>email</td>
<td>
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="getMyPolls"></a>
<span class="name">
<b>
getMyPolls
</b>
<a href="#getMyPolls"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>getMyPolls(ownerEmail: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="200"
class="link-to-prism">src/app/services/config.service.ts:200</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>GET
api/v1/my-polls</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>ownerEmail</td>
<td>
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="getPollById"></a>
<span class="name">
<b>
getPollById
</b>
<a href="#getPollById"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>getPollById(id: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, password?: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="184"
class="link-to-prism">src/app/services/config.service.ts:184</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>GET
api/v1/poll/{id}</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
</td>
<td>
No
</td>
</tr>
<tr>
<td>password</td>
<td>
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
</td>
<td>
Yes
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="getPollByURL"></a>
<span class="name">
<b>
getPollByURL
</b>
<a href="#getPollByURL"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>getPollByURL(url: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="173"
class="link-to-prism">src/app/services/config.service.ts:173</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>get one poll by its slug name</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>url</td>
<td>
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="getPollConfig"></a>
<span class="name">
<b>
getPollConfig
</b>
<a href="#getPollConfig"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>getPollConfig()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="67"
class="link-to-prism">src/app/services/config.service.ts:67</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>==================================</p>
<p>poll public calls to get non authenticated info</p>
<p>==================================/
/**
convert current poll config to a payload to send to the backend API</p>
</div>
<div class="io-description">
<b>Returns : </b> <code>{ owner: { email: any; pseudo: any; }; title: any; description: any; pollType: any; visibility: a...</code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="handleError"></a>
<span class="name">
<b>
handleError
</b>
<a href="#handleError"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>handleError(err: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="153"
class="link-to-prism">src/app/services/config.service.ts:153</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>display error message depending on the response of the backend</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>err</td>
<td>
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="handleVoteAdded"></a>
<span class="name">
<b>
handleVoteAdded
</b>
<a href="#handleVoteAdded"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>handleVoteAdded(res)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="360"
class="link-to-prism">src/app/services/config.service.ts:360</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>res</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="loadVoteStack"></a>
<span class="name">
<b>
loadVoteStack
</b>
<a href="#loadVoteStack"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>loadVoteStack(voteStack: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="250"
class="link-to-prism">src/app/services/config.service.ts:250</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>update current answers with a previous vote</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>voteStack</td>
<td>
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="print"></a>
<span class="name">
<b>
print
</b>
<a href="#print"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>print()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="612"
class="link-to-prism">src/app/services/config.service.ts:612</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="resetCurrentChoicesAnswers"></a>
<span class="name">
<b>
resetCurrentChoicesAnswers
</b>
<a href="#resetCurrentChoicesAnswers"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>resetCurrentChoicesAnswers()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="240"
class="link-to-prism">src/app/services/config.service.ts:240</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="set"></a>
<span class="name">
<b>
set
</b>
<a href="#set"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>set(key, val)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="34"
class="link-to-prism">src/app/services/config.service.ts:34</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>key</td>
<td>
No
</td>
</tr>
<tr>
<td>val</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="todo"></a>
<span class="name">
<b>
todo
</b>
<a href="#todo"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>todo(message: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="616"
class="link-to-prism">src/app/services/config.service.ts:616</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
<td>Default value</td>
</tr>
</thead>
<tbody>
<tr>
<td>message</td>
<td>
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
</td>
<td>
No
</td>
<td>
<code>&#x27;&#x27;</code>
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="updateCurrentPollFromResponse"></a>
<span class="name">
<b>
updateCurrentPollFromResponse
</b>
<a href="#updateCurrentPollFromResponse"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>updateCurrentPollFromResponse(res: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="223"
class="link-to-prism">src/app/services/config.service.ts:223</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>res</td>
<td>
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="updatePoll"></a>
<span class="name">
<b>
updatePoll
</b>
<a href="#updatePoll"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>updatePoll(voteStack: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="520"
class="link-to-prism">src/app/services/config.service.ts:520</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>UPDATE
/api/v1/poll/{id}/vote</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>voteStack</td>
<td>
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</td>
<td>
No
</td>
<td>
<p>TODO</p>
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="updateVote"></a>
<span class="name">
<b>
updateVote
</b>
<a href="#updateVote"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>updateVote(voteStack?: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="373"
class="link-to-prism">src/app/services/config.service.ts:373</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>UPDATE
/api/v1/poll/{id}/vote</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>voteStack</td>
<td>
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</td>
<td>
Yes
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="resetConfig"></a>
<span class="name">
<b>
resetConfig
</b>
<a href="#resetConfig"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>resetConfig()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:68</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
</td>
</tr>
</tbody>
</table>
</section>
<section>
<h3 id="inputs">
Properties
</h3>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="baseHref"></a>
<span class="name">
<b>
baseHref</b>
<a href="#baseHref"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>environment.baseApiHref</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="21" class="link-to-prism">src/app/services/config.service.ts:21</a></div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="loading"></a>
<span class="name">
<b>
loading</b>
<a href="#loading"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank" >boolean</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>false</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="20" class="link-to-prism">src/app/services/config.service.ts:20</a></div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="adminKey"></a>
<span class="name">
<b>
adminKey</b>
<a href="#adminKey"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>&#x27;&#x27;</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:58</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="allowSeveralHours"></a>
<span class="name">
<b>
allowSeveralHours</b>
<a href="#allowSeveralHours"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>&#x27;true&#x27;</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:41</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="answers"></a>
<span class="name">
<b>
answers</b>
<a href="#answers"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="../interfaces/PollAnswer.html" target="_self" >PollAnswer[]</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>defaultAnswers</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:66</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="canModifyAnswers"></a>
<span class="name">
<b>
canModifyAnswers</b>
<a href="#canModifyAnswers"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank" >boolean</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>true</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:60</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="creationDate"></a>
<span class="name">
<b>
creationDate</b>
<a href="#creationDate"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>new Date()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:45</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="currentPoll"></a>
<span class="name">
<b>
currentPoll</b>
<a href="#currentPoll"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:50</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="customUrl"></a>
<span class="name">
<b>
customUrl</b>
<a href="#customUrl"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>&#x27;&#x27;</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:53</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="customUrlIsUnique"></a>
<span class="name">
<b>
customUrlIsUnique</b>
<a href="#customUrlIsUnique"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code>null</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>null</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:54</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="dateList"></a>
<span class="name">
<b>
dateList</b>
<a href="#dateList"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>otherDefaultDates</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:63</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="deletionDateAfterLastModification"></a>
<span class="name">
<b>
deletionDateAfterLastModification</b>
<a href="#deletionDateAfterLastModification"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>180</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:27</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="description"></a>
<span class="name">
<b>
description</b>
<a href="#description"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>&#x27;ma description&#x27;</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:32</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="expiracyDateDefaultInDays"></a>
<span class="name">
<b>
expiracyDateDefaultInDays</b>
<a href="#expiracyDateDefaultInDays"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>60</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:26</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="expirationDate"></a>
<span class="name">
<b>
expirationDate</b>
<a href="#expirationDate"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>&#x27;&#x27;</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:46</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="isAdmin"></a>
<span class="name">
<b>
isAdmin</b>
<a href="#isAdmin"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank" >boolean</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>true</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:35</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="myComment"></a>
<span class="name">
<b>
myComment</b>
<a href="#myComment"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>&#x27;wouah trop bien framadate!&#x27;</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:34</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="myEmail"></a>
<span class="name">
<b>
myEmail</b>
<a href="#myEmail"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>&quot;tktest@tktest.com&quot;</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:38</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="myName"></a>
<span class="name">
<b>
myName</b>
<a href="#myName"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>&#x27;mon pseudo&#x27;</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:33</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="myPolls"></a>
<span class="name">
<b>
myPolls</b>
<a href="#myPolls"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>[]</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:39</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="myTempVoteStack"></a>
<span class="name">
<b>
myTempVoteStack</b>
<a href="#myTempVoteStack"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>0</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:37</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="myVoteStack"></a>
<span class="name">
<b>
myVoteStack</b>
<a href="#myVoteStack"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:36</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="owner_modifier_token"></a>
<span class="name">
<b>
owner_modifier_token</b>
<a href="#owner_modifier_token"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>&#x27;&#x27;</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:59</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="password"></a>
<span class="name">
<b>
password</b>
<a href="#password"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>&#x27;&#x27;</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:52</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="passwordAccess"></a>
<span class="name">
<b>
passwordAccess</b>
<a href="#passwordAccess"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>0</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:51</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="pollId"></a>
<span class="name">
<b>
pollId</b>
<a href="#pollId"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code>null</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>null</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:48</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="pollSlug"></a>
<span class="name">
<b>
pollSlug</b>
<a href="#pollSlug"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code>null</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>null</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:49</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="pollType"></a>
<span class="name">
<b>
pollType</b>
<a href="#pollType"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>&#x27;dates&#x27;</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:30</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="step"></a>
<span class="name">
<b>
step</b>
<a href="#step"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>0</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:28</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="stepMax"></a>
<span class="name">
<b>
stepMax</b>
<a href="#stepMax"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>3</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:29</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="timeList"></a>
<span class="name">
<b>
timeList</b>
<a href="#timeList"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="../interfaces/DateChoice.html" target="_self" >DateChoice[]</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>otherDefaultDates</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:64</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="title"></a>
<span class="name">
<b>
title</b>
<a href="#title"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>&#x27;titre&#x27;</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:31</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="urlAdmin"></a>
<span class="name">
<b>
urlAdmin</b>
<a href="#urlAdmin"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>environment.baseHref + &#x27;/#/admin/d65es45fd45sdf45sd345f312sdf31sgfd345&#x27;</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:57</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="urlPublic"></a>
<span class="name">
<b>
urlPublic</b>
<a href="#urlPublic"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>environment.baseHref + &#x27;/#/poll/id/4&#x27;</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:56</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="urlSlugPublic"></a>
<span class="name">
<b>
urlSlugPublic</b>
<a href="#urlSlugPublic"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code>null</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>null</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:55</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="visibility"></a>
<span class="name">
<b>
visibility</b>
<a href="#visibility"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>&#x27;link_only&#x27;</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:43</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="voteChoices"></a>
<span class="name">
<b>
voteChoices</b>
<a href="#voteChoices"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>&#x27;only_yes&#x27;</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:44</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="voteStackId"></a>
<span class="name">
<b>
voteStackId</b>
<a href="#voteStackId"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code>null</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>null</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:47</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="whoCanChangeAnswers"></a>
<span class="name">
<b>
whoCanChangeAnswers</b>
<a href="#whoCanChangeAnswers"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>&#x27;everybody&#x27;</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:62</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="whoModifiesAnswers"></a>
<span class="name">
<b>
whoModifiesAnswers</b>
<a href="#whoModifiesAnswers"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>&quot;everybody&quot;</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/PollConfig.html" target="_self" >PollConfig</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/PollConfig.html#source" target="_self" >PollConfig:61</a></code>
</div>
</td>
</tr>
</tbody>
</table>
</section>
</div>
<div class="tab-pane fade tab-source-code" id="c-source">
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {Injectable} from &#x27;@angular/core&#x27;;
import {PollConfig} from &#x27;../config/PollConfig&#x27;;
import {HttpClient} from &quot;@angular/common/http&quot;;
import {environment} from &quot;../../environments/environment&quot;;
import {ConfirmationService, MessageService} from &#x27;primeng/api&#x27;;
import {Router} from &quot;@angular/router&quot;;
import {mockMyPolls} from &quot;../config/mocks/mockmypolls&quot;;
import {mockPoll3} from &quot;../config/mocks/mock-poll3&quot;;
import {mockSuccessVote} from &quot;../config/mocks/mock-success-vote&quot;;
import {PollUtilities} from &quot;../config/PollUtilities&quot;;
/**
* le service transverse à chaque page qui permet de syncroniser la configuration de sondage souhaitée
*/
@Injectable({
providedIn: &#x27;root&#x27;
})
export class ConfigService extends PollConfig {
loading: boolean &#x3D; false;
baseHref: any &#x3D; environment.baseApiHref;
constructor(private http: HttpClient,
private messageService: MessageService,
private router: Router,
private utils: PollUtilities,
private confirmationService: ConfirmationService,
) {
super();
this.fillValuesOnDevEnv();
}
set(key, val) {
this[key] &#x3D; val;
}
// fill in mock values if we are not in production environment
fillValuesOnDevEnv() {
if (!environment.production) {
console.info(&#x27; ######### framadate ######### we are not in production env, filling with mock values&#x27;);
this.currentPoll &#x3D; mockPoll3;
this.myPolls &#x3D; mockMyPolls;
}
}
/**
* add some days to a date, to compute intervals
* @param days
* @param date
*/
addDaysToDate(days: number, date: Date) {
date &#x3D; new Date(date.valueOf());
date.setDate(date.getDate() + days);
return date;
};
/** &#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;
*
* poll public calls to get non authenticated info
*
* &#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;/
/**
* convert current poll config to a payload to send to the backend API
*/
getPollConfig() {
const jsonConfig &#x3D; {
owner: {
email: this.myEmail,
pseudo: this.myName,
},
title: this.title,
description: this.description,
pollType: this.pollType,
visibility: this.visibility,
voteChoices: this.voteChoices,
allowSeveralHours: this.allowSeveralHours,
expirationDate: this.expirationDate,
passwordAccess: this.passwordAccess,
password: this.password,
customUrl: this.customUrl,
canModifyAnswers: this.canModifyAnswers,
whoModifiesAnswers: this.whoModifiesAnswers,
dateList: this.dateList,
timeList: this.timeList,
answers: this.answers,
expiracyDateDefaultInDays: this.expiracyDateDefaultInDays,
deletionDateAfterLastModification: this.deletionDateAfterLastModification,
};
return jsonConfig
}
checkIfSlugIsUniqueInDatabase(slug: string &#x3D; &#x27;&#x27;) {
this.customUrlIsUnique &#x3D; null;
if (!slug) {
slug &#x3D; this.utils.makeSlug(this);
}
this.loading &#x3D; true;
// TODO
this.todo(&#x27;check slug is unique&#x27;);
this.http.get(&#x60;${this.baseHref}/check-slug-is-uniq/${slug}&#x60;,
this.utils.makeHeaders({slug: this.customUrl}),
)
.subscribe((res: any) &#x3D;&gt; {
this.customUrlIsUnique &#x3D; res.poll.isUnique;
this.loading &#x3D; false;
},
(e) &#x3D;&gt; this.handleError(e))
;
}
/**
* search in localstorage, fallback asking the backend to send an email to the owner if it exists
* @param email
*/
findPollsByEmail(email: string) {
this.findLocalStorageData();
// If no key is found in the localstorage, ask the backend to send an email to the user
this.myEmail &#x3D; email;
this.todo(&#x27;send email for real : TODO&#x27;);
this.loading &#x3D; true;
this.http.get(&#x60;${this.baseHref}/send-polls-to-user/${this.myEmail}&#x60;,
this.utils.makeHeaders(),
)
.subscribe(res &#x3D;&gt; {
// message: &#x27;Trouvé! Allez voir votre boite email&#x27;,
this.myPolls &#x3D; res;
this.loading &#x3D; false;
this.messageService.add({
severity: &#x27;success&#x27;,
summary: &#x27;Succès&#x27;,
detail: &#x60;Vos infos de sondages vous ont été transmises. Allez voir votre boite email ${this.myEmail}&#x60;
});
}, (e) &#x3D;&gt; {
this.handleError(e)
}
)
}
/**
* display error message depending on the response of the backend
* @param err
*/
handleError(err: any) {
console.error(&#x27;err&#x27;, err);
this.loading &#x3D; false;
this.messageService.add({severity: &#x27;warning&#x27;, summary: &quot;Erreur lors de l&#x27;appel &quot;, detail: err.message});
}
findLocalStorageData() {
// TODO check if the person has a key to retrieve her polls
console.log(&#x27;localStorage&#x27;, localStorage);
if (localStorage) {
console.log(&#x27;localStorage&#x27;, localStorage)
}
}
/**
* get one poll by its slug name
* @param url
*/
getPollByURL(url: string) {
this.todo();
return this.http.get(&#x60;${this.baseHref}/poll/slug/${url}&#x60;, this.utils.makeHeaders())
}
/**
* GET
* api/v1/poll/{id}
* @param id
*/
getPollById(id: string, password?: string) {
return this.http
.get(&#x60;${this.baseHref}/poll/${id}&#x60;,
this.utils.makeHeaders({body: password}))
}
fetchPollFromRoute(event) {
console.log(&#x27;time to fetch poll&#x27;, event)
}
/**
* GET
* api/v1/my-polls
* @param ownerEmail
*/
getMyPolls(ownerEmail: string) {
this.http
.get(&#x60;${this.baseHref}/my-polls&#x60;,
this.utils.makeHeaders({ownerEmail: ownerEmail})
)
.subscribe(
(res: any) &#x3D;&gt; {
// this.myPolls &#x3D; res.poll;
}, (e) &#x3D;&gt; {
this.handleError(e)
}
);
}
/**
* launch creation call to the api
*/
createPoll() {
this.loading &#x3D; true;
this.createPollFromConfig(this.getPollConfig())
}
updateCurrentPollFromResponse(res: any) {
console.log(&#x27;update res&#x27;, res);
this.currentPoll &#x3D; res;
this.pollId &#x3D; res.poll.id;
this.owner_modifier_token &#x3D; res.owner_modifier_token;
this.urlPublic &#x3D; this.baseHref + &#x27;#/vote/poll/id/&#x27; + res.poll.id;
this.urlSlugPublic &#x3D; this.baseHref + &#x27;#/vote/poll/slug/&#x27; + res.poll.id;
if (res.poll.customUrl) {
this.urlSlugPublic &#x3D; this.baseHref + &#x27;#/vote/poll/id/&#x27; + res.poll.customUrl;
}
if (res.voteStack) {
this.loadVoteStack(res.voteStack);
}
this.adminKey &#x3D; res.admin_key;
this.urlAdmin &#x3D; this.baseHref + &#x27;#/admin/&#x27; + res.admin_key;
}
resetCurrentChoicesAnswers() {
this.currentPoll.choices.map(choice &#x3D;&gt; {
choice.answer &#x3D; null;
})
}
/**
* update current answers with a previous vote
* @param voteStack
*/
loadVoteStack(voteStack: any) {
// load the pseudo and email
this.myName &#x3D; voteStack.pseudo;
this.myEmail &#x3D; voteStack.email;
this.voteStackId &#x3D; voteStack.id;
this.myVoteStack &#x3D; voteStack;
let keys &#x3D; Object.keys(voteStack.votes);
console.log(&#x27;voteStack&#x27;, voteStack);
this.resetCurrentChoicesAnswers();
keys.forEach((id: any) &#x3D;&gt; {
let voteItem &#x3D; voteStack.votes[id];
/**
* the display of the poll uses the choices data, so we update the choices answers of the current poll to reflect the vote stack we have taken
*/
if (voteItem.choice_id &amp;&amp; voteItem.value) {
let foundChoiceToModify &#x3D; this.currentPoll.choices.find(choicesItem &#x3D;&gt; {
return voteItem.choice_id &#x3D;&#x3D; choicesItem.id
});
console.log(&#x27;foundChoiceToModify&#x27;, foundChoiceToModify);
if (foundChoiceToModify) {
foundChoiceToModify.answer &#x3D; voteItem.value;
}
}
})
}
/**
* POST
* /api/v1/poll/{id}/poll
* @param config
*/
createPollFromConfig(config: any) {
this.loading &#x3D; true;
console.log(&#x27;config&#x27;, config);
return this.http.post(&#x60;${this.baseHref}/poll&#x60;,
config,
this.utils.makeHeaders())
.subscribe((res: any) &#x3D;&gt; {
// redirect to the page to administrate the new poll
this.messageService.add({severity: &#x27;success&#x27;, summary: &#x27;Sondage Créé&#x27;,});
this.updateCurrentPollFromResponse(res);
this.loading &#x3D; false;
if (!this.myPolls) {
this.myPolls &#x3D; [];
}
this.myPolls.push(res);
this.router.navigate([&#x27;step/end&#x27;]);
// TODO save new poll to localstorage
// reset all fields in current config
this.resetConfig();
}, (e) &#x3D;&gt; {
this.handleError(e)
}
);
}
/**
* conversion to send to back
* @param choiceList
*/
convertChoicesAnsweredToSend(choiceList) {
choiceList &#x3D; choiceList.filter(c &#x3D;&gt; c.answer ? c : null); // remove choices where we did not answer
const converted &#x3D; choiceList.map(elem &#x3D;&gt; {
if (elem.answer) {
return {
choice_id: elem.id,
value: elem.answer
}
}
});
console.log(&#x27;converted&#x27;, converted);
return converted;
}
/**
* POST
* /api/v1/poll/{id}/vote
* @param voteStack
*/
addVote(voteStack?: any) {
if (!voteStack) {
voteStack &#x3D; {
pseudo: this.myName,
email: this.myEmail,
votes: this.convertChoicesAnsweredToSend(this.currentPoll.choices),
}
}
this.myVoteStack &#x3D; voteStack;
if (!environment.production) {
this.handleVoteAdded(mockSuccessVote);
return;
}
this.http.post(
&#x60;${this.baseHref}/poll/${this.pollId}/vote&#x60;,
voteStack,
this.utils.makeHeaders())
.subscribe((res: any) &#x3D;&gt; {
this.handleVoteAdded(res);
}, (e) &#x3D;&gt; {
this.handleError(e)
}
);
}
handleVoteAdded(res) {
this.messageService.add({severity: &#x27;success&#x27;, summary: &#x27;Vote ajouté&#x27;});
// save modifier token
this.myVoteStack[&#x27;modifier_token&#x27;] &#x3D; res.modifier_token;
this.myVoteStack[&#x27;id&#x27;] &#x3D; res.vote_stack.id;
this.updateCurrentPollFromResponse(res);
}
/**
* UPDATE
* /api/v1/poll/{id}/vote
* @param voteStack
*/
updateVote(voteStack?: any) {
if (!this.myVoteStack) {
return;
} else {
voteStack &#x3D; this.myVoteStack;
}
this.http.patch(
&#x60;${this.baseHref}/vote-stack/${voteStack.id}/token/${this.owner_modifier_token}&#x60;,
voteStack,
this.utils.makeHeaders())
.subscribe((res: any) &#x3D;&gt; {
this.messageService.add({severity: &#x27;success&#x27;, summary: &#x27;Vote mis à jour&#x27;});
this.updateCurrentPollFromResponse(res);
}, (e) &#x3D;&gt; {
this.handleError(e)
}
);
}
/**
* POST
* /api/v1/poll/{id}/comment
* @param comment
*/
addComment(comment?: any) {
if (!comment &amp;&amp; this.myComment) {
comment &#x3D; {
name: this.myName,
pseudo: this.myName,
email: this.myEmail,
date: new Date(),
text: this.myComment,
}
}
console.log(&#x27;comment&#x27;, comment);
this.http.post(
&#x60;${this.baseHref}/poll/${this.pollId}/comment&#x60;,
comment,
this.utils.makeHeaders())
.subscribe((res: any) &#x3D;&gt; {
this.messageService.add({
severity: &#x27;success&#x27;,
summary: &#x27;Commentaire Créé&#x27;,
detail: comment.text
});
// empty comment after success
this.myComment &#x3D; &#x27;&#x27;;
comment.date &#x3D; {
date: comment.date
};
this.currentPoll.comments.push(comment);
}, (e) &#x3D;&gt; {
this.handleError(e);
}
);
}
/**
* administrator calls
*/
deleteComments() {
// prompt for confirmation
this.confirmationService.confirm({
message: &#x27;Are you sure that you want to completely delete the comments of this poll (&#x27; + this.title + &#x27;) permanentely?&#x27;,
accept: () &#x3D;&gt; {
this.http.delete(
&#x60;${this.baseHref}/poll/${this.pollId}/comments&#x60;,
this.utils.makeHeaders())
.subscribe((res: any) &#x3D;&gt; {
this.messageService.add({
severity: &#x27;success&#x27;,
summary: &#x27;Commentaires bien supprimés&#x27;,
detail: &#x27;Commentaires du sondage &quot;&#x27; + this.title + &#x27;&quot; supprimé&#x27;
});
}, (e) &#x3D;&gt; {
this.handleError(e)
}
);
}
});
}
deleteVotes() {
// prompt for confirmation
this.confirmationService.confirm({
message: &#x27;Are you sure that you want to completely delete the votes of this poll (&#x27; + this.title + &#x27;) permanentely?&#x27;,
accept: () &#x3D;&gt; {
this.http.delete(
&#x60;${this.baseHref}/poll/${this.pollId}/votes&#x60;,
this.utils.makeHeaders())
.subscribe((res: any) &#x3D;&gt; {
this.messageService.add({
severity: &#x27;success&#x27;,
summary: &#x27;Votes bien supprimés&#x27;,
detail: &#x27;Votes du sondage &quot;&#x27; + this.title + &#x27;&quot; supprimé&#x27;
});
}, (e) &#x3D;&gt; {
this.handleError(e)
}
);
}
});
}
deletePoll() {
if (!this.pollId) {
this.messageService.add({
summary: &#x27;this poll is not administrable, it has no ID&#x27;,
severity: &#x27;warning&#x27;
});
return;
}
let self &#x3D; this;
// prompt for confirmation
this.confirmationService.confirm({
message: &#x27;Are you sure that you want to completely delete this poll (&#x27; + self.title + &#x27;) and all is data permanentely?&#x27;,
accept: () &#x3D;&gt; {
this.http.delete(
&#x60;${this.baseHref}/poll/${this.pollId}&#x60;,
this.utils.makeHeaders())
.subscribe((res: any) &#x3D;&gt; {
this.messageService.add({
severity: &#x27;success&#x27;,
summary: &#x27;Sondage bien supprimé&#x27;,
detail: &#x27;sondage &quot;&#x27; + this.title + &#x27;&quot; supprimé&#x27;
});
this.router.navigate([&#x27;home&#x27;]);
}, (e) &#x3D;&gt; {
this.handleError(e)
}
);
}
});
}
/**
* UPDATE
* /api/v1/poll/{id}/vote
* @param voteStack
* TODO
*/
updatePoll(voteStack: any) {
this.http.put(
&#x60;${this.baseHref}/poll/${this.pollId}&#x60;,
voteStack,
this.utils.makeHeaders()
)
.subscribe((res: any) &#x3D;&gt; {
this.messageService.add({
severity: &#x27;success&#x27;,
summary: &#x27;Sondage mis à jour&#x27;,
});
this.updateCurrentPollFromResponse(res);
}, (e) &#x3D;&gt; {
this.handleError(e)
}
);
}
/**
* TODO
* export all the poll data available to the public as a CSV single file
*/
exportCSV() {
let rows &#x3D; [];
let now &#x3D; new Date();
const headers &#x3D; [
[&#x27;export de sondage Framadate &#x27;, this.customUrl],
[&#x27;le&#x27;, now.toISOString()],
[this.currentPoll.pollId, this.currentPoll.title, this.customUrl, this.creationDate],
[&#x27;pseudo&#x27;]];
let listOfChoices &#x3D; [&#x27;choices : &#x27;];
this.currentPoll.choices.map(choice &#x3D;&gt; {
listOfChoices.push(choice.text)
});
listOfChoices.push(&#x27;pseudo&#x27;);
this.currentPoll.stacks.map(voteStack &#x3D;&gt; {
let voteStackInArray &#x3D; [voteStack.pseudo];
let keysVotes &#x3D; Object.keys(voteStack.votes);
keysVotes.map(id &#x3D;&gt; {
voteStackInArray.push(voteStack.votes[id].value ? voteStack.votes[id].value : &quot;&quot;)
});
rows.push(
voteStackInArray
);
});
const headersComments &#x3D; [
[&#x27;comments&#x27;],
[&#x27;pseudo&#x27;, &#x27;text&#x27;, &#x27;creation_date&#x27;],
];
const comments &#x3D; [];
this.currentPoll.comments.map(item &#x3D;&gt; {
comments.push(
[item.pseudo,
item.text,
item.date.date,
&#x27;\n&#x27;]
)
});
headers.push(listOfChoices);
rows &#x3D; [headers, listOfChoices, rows, headersComments, comments];
let convertedCsv &#x3D; rows.map(elem &#x3D;&gt; {
console.log(&#x27;elem&#x27;, elem);
return elem.map(item &#x3D;&gt; {
console.log(&#x27;item&#x27;, item);
if (typeof item &#x3D;&#x3D;&#x3D; typeof Array) {
return item.join(&#x27;\n&#x27;)
}
return item;
}).join(&#x27;\n&#x27;)
}).join(&#x27;\n&#x27;);
console.log(&#x27;rows&#x27;, rows);
console.log(&#x27;convertedCsv&#x27;, convertedCsv);
let csvContent &#x3D; &quot;data:text/csv;charset&#x3D;utf-8,&quot;
+ convertedCsv;
console.log(&#x27;csvContent&#x27;, csvContent);
var encodedUri &#x3D; encodeURI(csvContent);
var link &#x3D; document.createElement(&quot;a&quot;);
link.setAttribute(&quot;href&quot;, encodedUri);
let exportFileName &#x3D; (this.urlPublic ? this.urlPublic : this.utils.makeSlug(this)) + &quot;_export_&quot; + new Date() + &quot;.csv&quot;;
link.setAttribute(&quot;download&quot;, exportFileName);
document.body.appendChild(link); // Required for FF
link.click(); // This will download the data file named &quot;my_data.csv&quot;.
}
print() {
alert(&#x27;TODO&#x27;);
}
todo(message &#x3D; &#x27;&#x27;) {
this.messageService.add({
severity: &#x27;info&#x27; + message,
detail: &quot;cette fonctionnalité n&#x27;est pas encore disponible. Venez en discuter sur framateam.org / Ux et design libre / Framasoft&quot;,
summary: &quot;Work in progress&quot;,
});
}
}
</code></pre>
</div>
</div>
</div><div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> result-matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
<!-- END CONTENT -->
</div>
</div>
<script>
var COMPODOC_CURRENT_PAGE_DEPTH = 1;
var COMPODOC_CURRENT_PAGE_CONTEXT = 'injectable';
var COMPODOC_CURRENT_PAGE_URL = 'ConfigService.html';
</script>
<script src="../js/libs/custom-elements.min.js"></script>
<script src="../js/libs/lit-html.js"></script>
<!-- Required to polyfill modern browsers as code is ES5 for IE... -->
<script src="../js/libs/custom-elements-es5-adapter.js" charset="utf-8" defer></script>
<script src="../js/menu-wc.js" defer></script>
<script src="../js/libs/bootstrap-native.js"></script>
<script src="../js/libs/es6-shim.min.js"></script>
<script src="../js/libs/EventDispatcher.js"></script>
<script src="../js/libs/promise.min.js"></script>
<script src="../js/libs/zepto.min.js"></script>
<script src="../js/compodoc.js"></script>
<script src="../js/tabs.js"></script>
<script src="../js/menu.js"></script>
<script src="../js/libs/clipboard.min.js"></script>
<script src="../js/libs/prism.js"></script>
<script src="../js/sourceCode.js"></script>
<script src="../js/search/search.js"></script>
<script src="../js/search/lunr.min.js"></script>
<script src="../js/search/search-lunr.js"></script>
<script src="../js/search/search_index.js"></script>
<script src="../js/lazy-load-graphs.js"></script>
</body>
</html>