From 60d0678cb785b1c722e0f46598b8f6fa08e0579d Mon Sep 17 00:00:00 2001 From: Tykayn Date: Mon, 29 Nov 2021 13:00:01 +0100 Subject: [PATCH] hide nav on creation, stepper bar color :art: --- src/app/app.component.html | 6 +++++- src/app/app.component.ts | 2 +- src/app/core/services/poll.service.ts | 6 +++--- src/app/features/administration/form/form.component.scss | 3 --- .../administration/stepper/stepper.component.html | 8 ++++---- .../administration/stepper/stepper.component.scss | 9 +++++++-- .../features/administration/stepper/stepper.component.ts | 1 + src/environments/environment.prod.ts | 5 +++-- src/environments/environment.ts | 5 +++-- src/styles/partials/_forms.scss | 6 ++++-- 10 files changed, 31 insertions(+), 20 deletions(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index 4af180cc..7bf64f74 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -5,7 +5,11 @@
- +
diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 969d776a..c8ed1498 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -72,7 +72,7 @@ export class AppComponent implements OnInit, OnDestroy, AfterViewInit { this.onHomePage = evt.url === '/'; - let mainelem = this.document.querySelector('#big_container main'); + let mainelem = this.document.querySelector('#big_container'); console.log('mainelem', mainelem); window.scrollTo(0, mainelem.offsetTop); }); diff --git a/src/app/core/services/poll.service.ts b/src/app/core/services/poll.service.ts index 50594d80..e17b1d6e 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: ['mon titre de sondage', [Validators.required, Validators.minLength(minlengthValidation)]], + title: ['', [Validators.required, Validators.minLength(minlengthValidation)]], creatorPseudo: ['', [Validators.required]], created_at: [new Date(), [Validators.required]], creatorEmail: ['', [Validators.required]], @@ -126,7 +126,6 @@ export class PollService implements Resolve { whoCanChangeAnswers: ['', [Validators.required]], isAboutDate: [true, [Validators.required]], expiresDaysDelay: [environment.expiresDaysDelay, []], - maxCountOfAnswers: [300, []], isZeroKnoledge: [false, [Validators.required]], isProtectedByPassword: [false, [Validators.required]], isOwnerNotifiedByEmailOnNewVote: [true, [Validators.required]], @@ -137,6 +136,7 @@ export class PollService implements Resolve { isMaybeAnswerAvailable: [true, [Validators.required]], isNoAnswerAvailable: [true, [Validators.required]], allowComments: [true, [Validators.required]], + maxCountOfAnswers: [300, []], hasMaxCountOfAnswers: [300, [Validators.required]], useVoterUniqueLink: [false, [Validators.required]], voterEmailList: ['', []], @@ -153,7 +153,7 @@ export class PollService implements Resolve { */ public patchFormDefaultValues() { this.form.patchValue({ - title: 'mon titre de sondage', + title: 'Mon titre de sondage', description: '', custom_url: this.uuidService.getUUID(), creatorPseudo: '', diff --git a/src/app/features/administration/form/form.component.scss b/src/app/features/administration/form/form.component.scss index 7974fca8..373ed9f0 100644 --- a/src/app/features/administration/form/form.component.scss +++ b/src/app/features/administration/form/form.component.scss @@ -1,7 +1,4 @@ @import '../../../../styles/variables'; -.admin-form { - padding: 1em; -} textarea { border: solid 1px $border-color; diff --git a/src/app/features/administration/stepper/stepper.component.html b/src/app/features/administration/stepper/stepper.component.html index d14416e7..12163683 100644 --- a/src/app/features/administration/stepper/stepper.component.html +++ b/src/app/features/administration/stepper/stepper.component.html @@ -1,5 +1,5 @@
-
+
-

+

{{ 'creation.title' | translate }}

-

+

{{ pollService.form.value.title }}

-

Étape {{ step_current }} sur {{ step_max }}

+

Étape {{ step_current }} sur {{ step_max }}

diff --git a/src/app/features/administration/stepper/stepper.component.scss b/src/app/features/administration/stepper/stepper.component.scss index 7e2ce7b8..35a2cd23 100644 --- a/src/app/features/administration/stepper/stepper.component.scss +++ b/src/app/features/administration/stepper/stepper.component.scss @@ -1,11 +1,16 @@ @import '../../../../styles/variables'; - +.step-info { + .title.step-title-poll { + font-size: 0.85rem; + color: $border-color; + } +} .step-bar-container { margin: 1em 0; height: 0.6em; display: inline-block; min-width: 1px; - background: $border-color !important; + background: $d-grey !important; width: 100%; } .step-bar-progress { diff --git a/src/app/features/administration/stepper/stepper.component.ts b/src/app/features/administration/stepper/stepper.component.ts index 646f0f9e..eadbc5a0 100644 --- a/src/app/features/administration/stepper/stepper.component.ts +++ b/src/app/features/administration/stepper/stepper.component.ts @@ -14,6 +14,7 @@ export class StepperComponent { public step_current: number = 1; @Input() public step_max: number = 5; + public environment = environment; public show_shortcuts = environment.showStepperShortcuts; constructor( public pollService: PollService, diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 92773481..6f223329 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -19,13 +19,14 @@ export const environment = { production: true, display_routes: false, showDemoWarning: false, - autofill_creation: true, + display_menu_creation: false, + autofill_creation: false, autofill_participation: false, advanced_options_display: false, autofill_default_timeslices: false, autoSendNewPoll: false, interval_days_default: 7, - showStepperShortcuts: true, + showStepperShortcuts: false, expiresDaysDelay: 60, maxCountOfAnswers: 300, appTitle: 'FramaDate', diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 62b408cc..a6ac8684 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -11,13 +11,14 @@ export const environment = { frontDomain: 'http://127.0.0.1:4200', production: false, display_routes: false, // demo paths to test polls - autofill_creation: true, + display_menu_creation: false, + autofill_creation: false, advanced_options_display: false, autofill_participation: false, autofill_default_timeslices: false, showDemoWarning: false, autoSendNewPoll: false, - showStepperShortcuts: true, + showStepperShortcuts: false, interval_days_default: 7, expiresDaysDelay: 60, maxCountOfAnswers: 300, diff --git a/src/styles/partials/_forms.scss b/src/styles/partials/_forms.scss index e21d0020..905404ff 100644 --- a/src/styles/partials/_forms.scss +++ b/src/styles/partials/_forms.scss @@ -176,8 +176,10 @@ mat-checkbox { } .admin-form { - max-width: 800px; - margin: 0 auto; + .step { + max-width: 800px; + margin: 0 auto; + } } .fa {