diff --git a/src/app/core/models/poll.DTO.model.ts b/src/app/core/models/poll.DTO.model.ts index e985b538..db9fdfb5 100644 --- a/src/app/core/models/poll.DTO.model.ts +++ b/src/app/core/models/poll.DTO.model.ts @@ -2,45 +2,44 @@ import { Choice, ChoiceGroup } from './choice.model'; import { DateChoice, TimeSlices } from './dateChoice.model'; export class PollDTO { - menuVisible = true; - expiracyDateDefaultInDays; - deletionDateAfterLastModification; - pollType: string = 'date'; // classic or dates - title; - description; - myName; - myComment = ''; - isAdmin; // when we create a poll; we are admin on it - myVoteStack; - myTempVoteStack; - myEmail; - myPolls; // list of retrieved polls from the backend api + adminKey; // key to change config of the poll allowSeveralHours; - visibility; // visible to one with the link: - voteChoices = 'yes; maybe; no'; // possible answers to a vote timeSlice: only "yes"; "yes; maybe; no" + answers; + canModifyAnswers; // bool for the frontend selector created_at; + currentPoll; // current poll selected with createPoll or getPoll of ConfigService + custom_url; // custom slug in the url; must be unique + customUrlIsUnique; // given by the backend + dateList; // sets of days as strings; config to set identical time for days in a special days poll + deletionDateAfterLastModification; + description; + displayConfirmVoteModalAdmin; + default_expiracy_days_from_now; expirationDate; // expiracy date - voteStackId; // id of the vote stack to update + isAdmin; // when we create a poll; we are admin on it + kind: string; + myComment = ''; + myEmail; + myName; + myPolls; // list of retrieved polls from the backend api + myTempVoteStack; + myVoteStack; + owner_modifier_token; // key to change a vote stack + password; + passwordAccess; pollId; // id of the current poll when created. data given by the backend api pollSlug; // id of the current poll when created. data given by the backend api - currentPoll; // current poll selected with createPoll or getPoll of ConfigService - passwordAccess; - password; - customUrl; // custom slug in the url; must be unique - customUrlIsUnique; // given by the backend - urlSlugPublic; - urlPublic; - urlAdmin; - adminKey; // key to change config of the poll - owner_modifier_token; // key to change a vote stack - canModifyAnswers; // bool for the frontend selector - whoModifiesAnswers; // everybody; self; nobody (: just admin) - whoCanChangeAnswers; // everybody; self; nobody (: just admin) - dateList; // sets of days as strings; config to set identical time for days in a special days poll + pollType: string = 'date'; // classic or dates timeList; // ranges of time expressed as strings - - answers; - displayConfirmVoteModalAdmin; + title; + urlAdmin; + urlPublic; + urlSlugPublic; + visibility; // visible to one with the link: + voteChoices = 'yes; maybe; no'; // possible answers to a vote timeSlice: only "yes"; "yes; maybe; no" + voteStackId; // id of the vote stack to update + whoCanChangeAnswers; // everybody; self; nobody (: just admin) + whoModifiesAnswers; // everybody; self; nobody (: just admin) constructor() {} } diff --git a/src/app/core/models/poll.model.ts b/src/app/core/models/poll.model.ts index d4be77a8..9c48f630 100644 --- a/src/app/core/models/poll.model.ts +++ b/src/app/core/models/poll.model.ts @@ -5,62 +5,41 @@ import { DateChoice, TimeSlices } from './dateChoice.model'; import { defaultTimeOfDay } from '../../../../mocks/old-stuff/config/defaultConfigs'; export class Poll { - public id = 0; - - public default_expiracy_days_from_now = 60; - public admin_key: string; - public kind = 'date'; - - public description?: string; - public password?: string; - - public expiracy_date?: string; - - public creation_date?: string = new Date().toISOString(); - - public creatorPseudo?: string; - - public creatorEmail?: string; - - public is_archived?: boolean; - public is_zero_knowledge?: boolean = false; public allow_comments?: boolean = true; public allowComments?: boolean = true; - + public allowed_answers = ['yes', 'maybe', 'no']; + public allowSeveralHours?: boolean; + public archiveNumberOfDays?: number; + public areResultsPublic?: boolean = true; + public choices: Choice[] = []; + public choices_grouped: ChoiceGroup[] = []; + public comments: Comment[] = []; + public creation_date?: string = new Date().toISOString(); + public creatorEmail?: string; + public creatorPseudo?: string; + public dateChoices: DateChoice[] = []; + public default_expiracy_days_from_now = 60; + public description?: string; + public expiracy_date?: string; public has_several_hours?: boolean = false; public hasSeveralHours?: boolean = false; - public isOwnerNotifiedByEmailOnNewVote?: boolean = true; - public isOwnerNotifiedByEmailOnNewComment?: boolean = true; + public id = 0; + public is_archived?: boolean; public isMaybeAnswerAvailable?: boolean = true; - public areResultsPublic?: boolean = true; - - public allowSeveralHours?: boolean; - - public archiveNumberOfDays?: number; - - public max_score?: number; - + public isOwnerNotifiedByEmailOnNewComment?: boolean = true; + public isOwnerNotifiedByEmailOnNewVote?: boolean = true; + public is_zero_knowledge?: boolean = false; + public kind = 'date'; + public hideResults = false; public max_count_of_answers?: number = 150; public maxCountOfAnswers?: number = 150; - - public comments: Comment[] = []; - - public choices: Choice[] = []; - - public choices_grouped: ChoiceGroup[] = []; - - public votes = []; - - public stacks = []; - - public allowed_answers = ['yes']; - + public max_score?: number; public modification_policy = 'everybody'; - - public dateChoices: DateChoice[] = []; - // sets of dateChoices as strings, config to set identical time for dateChoices in a special dateChoices poll + public password?: string; + public stacks = []; public timeSlices: TimeSlices[] = Object.create(defaultTimeOfDay); // ranges of time expressed as strings + public votes = []; constructor(public owner: Owner = new Owner(), public title = 'mon titre', public custom_url: string = '') {} } diff --git a/src/app/core/services/poll.service.ts b/src/app/core/services/poll.service.ts index f60e2e39..50594d80 100644 --- a/src/app/core/services/poll.service.ts +++ b/src/app/core/services/poll.service.ts @@ -141,6 +141,7 @@ export class PollService implements Resolve { useVoterUniqueLink: [false, [Validators.required]], voterEmailList: ['', []], hasSeveralHours: [false, []], + hideResults: [false, []], allowNewDateTime: [true, [Validators.required]], }); this.form = form; diff --git a/src/app/features/administration/form/advanced-config/advanced-config.component.html b/src/app/features/administration/form/advanced-config/advanced-config.component.html index dc568a4e..cd617b2a 100644 --- a/src/app/features/administration/form/advanced-config/advanced-config.component.html +++ b/src/app/features/administration/form/advanced-config/advanced-config.component.html @@ -112,6 +112,9 @@ Autoriser les commentaires + + Cacher les résultats au public +
Nombre de réponses limitées à ce nombre. Utile pour réserver des places à un évènement. diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 6fc4397a..92773481 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -22,6 +22,7 @@ export const environment = { autofill_creation: true, autofill_participation: false, advanced_options_display: false, + autofill_default_timeslices: false, autoSendNewPoll: false, interval_days_default: 7, showStepperShortcuts: true,