diff --git a/src/app/core/services/poll.service.ts b/src/app/core/services/poll.service.ts index 0238c141..8bdd49d3 100644 --- a/src/app/core/services/poll.service.ts +++ b/src/app/core/services/poll.service.ts @@ -114,7 +114,7 @@ export class PollService implements Resolve { public createFormGroup() { let minlengthValidation = environment.production ? 12 : 0; let form = this.fb.group({ - title: ['défault titre', [Validators.required, Validators.minLength(minlengthValidation)]], + title: ['', [Validators.required, Validators.minLength(minlengthValidation)]], creatorPseudo: ['', []], created_at: [new Date(), [Validators.required]], creatorEmail: ['', [environment.creation_email_is_required ? Validators.required : null]], @@ -176,7 +176,6 @@ export class PollService implements Resolve { * get a new slug from form title and creation date */ public updateSlug(): void { - console.log('this.form.value', this.form.value); this.form.patchValue({ custom_url: this.makeSlug(this.form) }); } @@ -713,7 +712,6 @@ export class PollService implements Resolve { */ newPollFromForm(): Poll { let form = this.form; - console.log('this.form.value', this.form.value); const newOwner = this.storageService.vote_stack.owner; const newpoll = new Poll(newOwner, form.value.custom_url, form.value.title); diff --git a/src/app/features/administration/administration.module.ts b/src/app/features/administration/administration.module.ts index 35affc5f..6b6126dc 100644 --- a/src/app/features/administration/administration.module.ts +++ b/src/app/features/administration/administration.module.ts @@ -36,6 +36,7 @@ import { TextListComponent } from './form/text-list/text-list.component'; import { HoursComponent } from './form/hours/hours.component'; import { ActionsMenuComponent } from './actions-menu/actions-menu.component'; import { NavStepsComponent } from './nav-steps/nav-steps.component'; +import { DialogModule } from 'primeng/dialog'; @NgModule({ declarations: [ @@ -78,6 +79,7 @@ import { NavStepsComponent } from './nav-steps/nav-steps.component'; TranslateModule.forChild({ extend: true }), DragDropModule, ConfirmDialogModule, + DialogModule, ], exports: [ActionsMenuComponent], }) diff --git a/src/app/features/administration/form/form.component.ts b/src/app/features/administration/form/form.component.ts index beb2298e..3a446f58 100644 --- a/src/app/features/administration/form/form.component.ts +++ b/src/app/features/administration/form/form.component.ts @@ -7,6 +7,7 @@ import { ToastService } from '../../../core/services/toast.service'; import { PollService } from '../../../core/services/poll.service'; import { DOCUMENT } from '@angular/common'; import { ActivatedRoute, Router } from '@angular/router'; +import { environment } from '../../../../environments/environment'; @Component({ selector: 'app-admin-form', @@ -33,7 +34,9 @@ export class FormComponent implements OnInit { } ngOnInit(): void { - this.pollService.askInitFormDefault(); + if (environment.autofill_creation) { + this.pollService.askInitFormDefault(); + } } goNextStep() {} diff --git a/src/app/features/administration/form/steps/step-one/step-one.component.html b/src/app/features/administration/form/steps/step-one/step-one.component.html index 8d39700d..442d4baa 100644 --- a/src/app/features/administration/form/steps/step-one/step-one.component.html +++ b/src/app/features/administration/form/steps/step-one/step-one.component.html @@ -42,7 +42,7 @@ maxlength="300" >
diff --git a/src/app/features/administration/stepper/stepper.component.html b/src/app/features/administration/stepper/stepper.component.html index 3eac65c1..ec06d507 100644 --- a/src/app/features/administration/stepper/stepper.component.html +++ b/src/app/features/administration/stepper/stepper.component.html @@ -74,4 +74,34 @@
+ + + +

Souhaitez-vous vraiment quitter le sondage ? Toutes les informations seront effacées.

+ +
+
+ +
+
+ +
+
+
+
diff --git a/src/app/features/administration/stepper/stepper.component.scss b/src/app/features/administration/stepper/stepper.component.scss index da5a821d..a12306ef 100644 --- a/src/app/features/administration/stepper/stepper.component.scss +++ b/src/app/features/administration/stepper/stepper.component.scss @@ -77,4 +77,10 @@ .step-counter-text { font-weight: 600; } + .cancel-button-reject, + .cancel-button-confirm { + display: block !important; + width: 100%; + color: white !important; + } } diff --git a/src/app/features/administration/stepper/stepper.component.ts b/src/app/features/administration/stepper/stepper.component.ts index cff61967..1db62cb6 100644 --- a/src/app/features/administration/stepper/stepper.component.ts +++ b/src/app/features/administration/stepper/stepper.component.ts @@ -19,6 +19,7 @@ export class StepperComponent { public step_max: number = 5; public environment = environment; public show_shortcuts = environment.showStepperShortcuts; + display_cancel_dialog: boolean; constructor( public pollService: PollService, private confirmationService: ConfirmationService, @@ -28,17 +29,10 @@ export class StepperComponent { } showCancelDialog() { - this.confirmationService.confirm({ - header: 'Quitter ?', - acceptLabel: 'Quitter', - rejectLabel: 'Rester', - message: 'Souhaitez-vous vraiment quitter le sondage ? Toutes les informations seront effacées.', - accept: () => this.goToHome(), - reject: () => console.log('rejected'), - }); + this.display_cancel_dialog = true; } goToHome() { - this.confirmationService.close(); + this.display_cancel_dialog = false; this.router.navigate(['/']); } } diff --git a/src/app/shared/components/selectors/language-selector/language-selector.component.scss b/src/app/shared/components/selectors/language-selector/language-selector.component.scss index e69de29b..e87a31a2 100644 --- a/src/app/shared/components/selectors/language-selector/language-selector.component.scss +++ b/src/app/shared/components/selectors/language-selector/language-selector.component.scss @@ -0,0 +1,3 @@ +#lang_selector { + background: white; +}