diff --git a/src/app/features/administration/form/steps/step-one/step-one.component.ts b/src/app/features/administration/form/steps/step-one/step-one.component.ts index cb450807..0d47ab62 100644 --- a/src/app/features/administration/form/steps/step-one/step-one.component.ts +++ b/src/app/features/administration/form/steps/step-one/step-one.component.ts @@ -22,21 +22,21 @@ export class StepOneComponent implements OnInit { public pollService: PollService, @Inject(DOCUMENT) private document: any, private router: Router, - private titleService: Title, - private confirmationService: ConfirmationService + private titleService: Title ) { this.step_max = this.pollService.step_max; - this.titleService.setTitle(' Création de sondage - ' + environment.appTitle); + this.pollService.step_current = 1; + this.titleService.setTitle( + ' Création de sondage - Étape ' + + this.pollService.step_current + + ' sur ' + + this.pollService.step_max + + ' ' + + environment.appTitle + ); } - ngOnInit(): void { - this.pollService.step_current = 1; - const selector = '#title'; - const firstField = this.document.querySelector(selector); - if (firstField) { - firstField.focus(); - } - } + ngOnInit(): void {} leave(event: any) { console.log('event', event); diff --git a/src/app/features/administration/form/steps/step-three/step-three.component.ts b/src/app/features/administration/form/steps/step-three/step-three.component.ts index 490263f4..2725a0e0 100644 --- a/src/app/features/administration/form/steps/step-three/step-three.component.ts +++ b/src/app/features/administration/form/steps/step-three/step-three.component.ts @@ -1,6 +1,8 @@ import { Component, Input, OnInit } from '@angular/core'; import { PollService } from '../../../../../core/services/poll.service'; import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop'; +import { environment } from '../../../../../../environments/environment'; +import { Title } from '@angular/platform-browser'; @Component({ selector: 'app-step-three', @@ -13,8 +15,17 @@ export class StepThreeComponent implements OnInit { @Input() form: any; - constructor(public pollService: PollService) { + constructor(public pollService: PollService, private titleService: Title) { this.pollService.step_current = 3; + this.step_max = this.pollService.step_max; + this.titleService.setTitle( + ' Création de sondage - Étape ' + + this.pollService.step_current + + ' sur ' + + this.pollService.step_max + + ' ' + + environment.appTitle + ); } ngOnInit(): void {} diff --git a/src/app/features/administration/form/steps/step-two/step-two.component.ts b/src/app/features/administration/form/steps/step-two/step-two.component.ts index 4ee76c93..d971e87d 100644 --- a/src/app/features/administration/form/steps/step-two/step-two.component.ts +++ b/src/app/features/administration/form/steps/step-two/step-two.component.ts @@ -8,6 +8,8 @@ import { ToastService } from '../../../../../core/services/toast.service'; import { PollService } from '../../../../../core/services/poll.service'; import { DateUtilitiesService } from '../../../../../core/services/date.utilities.service'; import { ApiService } from '../../../../../core/services/api.service'; +import { environment } from '../../../../../../environments/environment'; +import { Title } from '@angular/platform-browser'; @Component({ selector: 'app-step-two', @@ -34,6 +36,7 @@ export class StepTwoComponent implements OnInit { private toastService: ToastService, public pollService: PollService, private router: Router, + private titleService: Title, public dateUtilities: DateUtilitiesService, private apiService: ApiService, @Inject(DOCUMENT) private document: any @@ -41,6 +44,14 @@ export class StepTwoComponent implements OnInit { this.form = this.pollService.form; this.pollService.step_current = 2; this.step_max = this.pollService.step_max; + this.titleService.setTitle( + ' Création de sondage - Étape ' + + this.pollService.step_current + + ' sur ' + + this.pollService.step_max + + ' ' + + environment.appTitle + ); } get choices(): FormArray {