diff --git a/src/app/config/PollConfig.ts b/src/app/config/PollConfig.ts index 5d482934..a21725ab 100644 --- a/src/app/config/PollConfig.ts +++ b/src/app/config/PollConfig.ts @@ -2,7 +2,7 @@ * une option de date dans les sondages spéciaux */ import {environment} from "../../environments/environment"; -import {defaultAnswers} from "./defaultConfigs"; +import {defaultAnswers, defaultDates, defaultTimeOfDay} from "./defaultConfigs"; export interface DateOption { timeList: any; @@ -55,8 +55,8 @@ export class PollConfig { canModifyAnswers = 1;// everybody, self, nobody (= just admin) whoModifiesAnswers = "self";// everybody, self, nobody (= just admin) whoCanChangeAnswers = 'everybody';// everybody, self, nobody (= just admin) - dateList: DateOption[]; // sets of days as strings, config to set identical time for days in a special days poll - timeList: DateOption[]; // ranges of time expressed as strings + dateList: any = defaultDates; // sets of days as strings, config to set identical time for days in a special days poll + timeList: any = defaultTimeOfDay; // ranges of time expressed as strings answers: any = defaultAnswers; diff --git a/src/app/config/defaultConfigs.ts b/src/app/config/defaultConfigs.ts index 7b899dc6..54b0b7bd 100644 --- a/src/app/config/defaultConfigs.ts +++ b/src/app/config/defaultConfigs.ts @@ -1,4 +1,4 @@ -export const timeOfDay = [{ +export const defaultTimeOfDay = [{ timeList: [], literal: 'matin' }, diff --git a/src/app/pages/dates/dates.component.ts b/src/app/pages/dates/dates.component.ts index 0d5be8b2..a3a5ad23 100644 --- a/src/app/pages/dates/dates.component.ts +++ b/src/app/pages/dates/dates.component.ts @@ -3,7 +3,7 @@ import {ConfigService} from '../../services/config.service'; import {BaseComponent} from '../base-page/base.component'; import {DOCUMENT} from '@angular/common'; import {MessageService} from "primeng/api"; -import {timeOfDay} from "../../config/defaultConfigs"; +import {defaultTimeOfDay} from "../../config/defaultConfigs"; @Component({ selector: 'framadate-dates', @@ -67,7 +67,7 @@ export class DatesComponent extends BaseComponent implements OnInit { } resetTimes() { - this.config.timeList = timeOfDay; + this.config.timeList = defaultTimeOfDay; } /** diff --git a/src/app/services/config.service.ts b/src/app/services/config.service.ts index 9d48f27b..545e8289 100644 --- a/src/app/services/config.service.ts +++ b/src/app/services/config.service.ts @@ -5,7 +5,7 @@ import {environment} from "../../environments/environment"; import {ConfirmationService, MessageService} from 'primeng/api'; import {Router} from "@angular/router"; import {mockMyPolls} from "../config/mocks/mockmypolls"; -import {defaultAnswers, defaultDates, timeOfDay} from "../config/defaultConfigs"; +import {defaultAnswers, defaultDates, defaultTimeOfDay} from "../config/defaultConfigs"; import {mockPoll1} from "../config/mocks/mock1"; /** @@ -32,7 +32,7 @@ export class ConfigService extends PollConfig { this.currentPoll = mockPoll1; this.myPolls = mockMyPolls; this.dateList = defaultDates; - this.timeList = timeOfDay; + this.timeList = defaultTimeOfDay; this.answers = defaultAnswers; } }