add env creation_display_proposals_time_slices

This commit is contained in:
Tykayn 2021-11-30 18:14:07 +01:00 committed by tykayn
parent f1403fe2a0
commit dbecfe6195
8 changed files with 50 additions and 61 deletions

View File

@ -117,7 +117,7 @@ export class PollService implements Resolve<Poll> {
title: ['défault titre', [Validators.required, Validators.minLength(minlengthValidation)]],
creatorPseudo: ['', []],
created_at: [new Date(), [Validators.required]],
creatorEmail: ['', [Validators.required]],
creatorEmail: ['', [environment.creation_email_is_required ? Validators.required : null]],
custom_url: [this.uuidService.getUUID(), [Validators.required]],
description: ['', []],
password: ['', []],

View File

@ -4,21 +4,7 @@
<app-stepper [step_current]="5" [step_max]="pollService.step_max"></app-stepper>
<app-errors-list [form]="pollService.form"></app-errors-list>
<fieldset class="advanced-config">
<div class="has-background-danger" *ngIf="!pollService.form.valid">
le formulaire est invalide
<pre> {{ pollService.form.errors | json }}</pre>
</div>
<button
class="button is-unchecked-info"
[ngClass]="{ 'is-info': !advancedDisplayEnabled, 'is-primary': advancedDisplayEnabled }"
(click)="advancedDisplayEnabled = !advancedDisplayEnabled"
>
<i class="fa fa-chevron-circle-down" *ngIf="!advancedDisplayEnabled"></i>
<i class="fa fa-chevron-circle-up" *ngIf="advancedDisplayEnabled"></i>
{{ 'creation.advanced' | translate }}
</button>
<fieldset class="complete well" *ngIf="advancedDisplayEnabled">
<fieldset class="complete well" *ngIf="environment.advanced_options_display">
<app-advanced-config [form]="pollService.form"></app-advanced-config>
</fieldset>
</fieldset>
@ -34,10 +20,6 @@
</button>
</div>
</div>
<!-- <button class="btn btn&#45;&#45;warning" (click)="askInitFormDefault()">-->
<!-- <i class="fa fa-refresh"></i>-->
<!-- Tout réinitialiser-->
<!-- </button>-->
</section>
</div>
</div>

View File

@ -1,7 +1,6 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { PollService } from '../../../../../core/services/poll.service';
import { ApiService } from '../../../../../core/services/api.service';
import { environment } from '../../../../../../environments/environment';
@Component({
@ -13,10 +12,13 @@ export class StepFiveComponent implements OnInit {
@Input() step_max: any;
@Input() public form: FormGroup;
poll: any;
public environment = environment;
advancedDisplayEnabled = environment.advanced_options_display;
constructor(public pollService: PollService) {
this.pollService.step_current = 5;
}
ngOnInit(): void {}
askInitFormDefault() {

View File

@ -16,7 +16,6 @@ import { ToastService } from '../../../../../core/services/toast.service';
export class StepFourComponent implements OnInit {
public urlPrefix: any;
public environment = environment;
public advancedDisplayEnabled: boolean = environment.advanced_options_display;
@Input()
step_max: any;
@Input()

View File

@ -10,7 +10,10 @@
</label>
<input class="input" type="text" id="name" formControlName="creatorPseudo" />
<label for="email">
Votre adresse e-mail (obligatoire)
Votre adresse e-mail
<span class="required-label" *ngIf="environment.creation_email_is_required">
(obligatoire)
</span>
</label>
<input class="input" type="text" id="email" formControlName="creatorEmail" />
</form>

View File

@ -1,5 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { PollService } from '../../../../../core/services/poll.service';
import { environment } from 'src/environments/environment';
@Component({
selector: 'app-step-six',
@ -7,6 +8,7 @@ import { PollService } from '../../../../../core/services/poll.service';
styleUrls: ['./step-six.component.scss'],
})
export class StepSixComponent implements OnInit {
public environment = environment;
constructor(public pollService: PollService) {
this.pollService.step_current = 6;
}

View File

@ -15,27 +15,28 @@ const apiV1 = {
};
export const environment = {
frontDomain: productionBaseUrl,
production: true,
display_routes: false,
showDemoWarning: false,
// creation form
display_menu_creation: false,
autofill_creation: false,
autofill_participation: false,
advanced_options_display: false,
autofill_default_timeslices: false,
creation_email_is_required: true,
creation_display_admin_url: false,
creation_display_hour_per_day: false, // display or not the ability to choose time slices different per day
autoSendNewPoll: false,
interval_days_default: 7,
showStepperShortcuts: false,
expiresDaysDelay: 60,
maxCountOfAnswers: 300,
appLogo: 'assets/img/logo.png',
appTitle: 'FramaDate',
appVersion: '2.2.1',
appLogo: 'assets/img/logo.png',
autofill_creation: false,
autofill_default_timeslices: false,
autofill_participation: false,
autoSendNewPoll: false,
creation_display_admin_url: false,
creation_display_hour_per_day: false, // display or not the ability to choose time slices different per day
creation_display_proposals_time_slices: false,
creation_email_is_required: true,
display_menu_creation: false,
display_routes: false,
expiresDaysDelay: 60,
frontDomain: productionBaseUrl,
interval_days_default: 7,
maxCountOfAnswers: 300,
production: true,
showDemoWarning: false,
showStepperShortcuts: false,
api: {
versionToUse: 'apiV1',
version: {
@ -82,6 +83,5 @@ export const environment = {
localStorage: {
key: 'FramaSondage',
},
display_validation_errors: false,
};

View File

@ -16,27 +16,28 @@ import 'zone.js/dist/zone-error';
endpoints.baseHref = apiV1.baseHref;
export const environment = {
frontDomain: 'http://127.0.0.1:4200',
production: false,
display_routes: false, // demo paths to test polls
display_menu_creation: false,
autofill_creation: false,
advanced_options_display: false,
autofill_participation: false,
autofill_default_timeslices: false,
creation_email_is_required: true,
creation_display_proposals_time_slices: false,
creation_display_admin_url: false,
creation_display_hour_per_day: false, // display or not the ability to choose time slices different per day
showDemoWarning: false,
autoSendNewPoll: false,
showStepperShortcuts: false,
interval_days_default: 7,
expiresDaysDelay: 60,
maxCountOfAnswers: 300,
advanced_options_display: true,
appLogo: 'assets/img/logo.png',
appTitle: 'FramaDate',
appVersion: '2.2.1',
appLogo: 'assets/img/logo.png',
autofill_creation: false,
autofill_default_timeslices: false,
autofill_participation: false,
autoSendNewPoll: false,
creation_display_admin_url: false,
creation_display_hour_per_day: false, // display or not the ability to choose time slices different per day
creation_display_proposals_time_slices: false,
creation_email_is_required: true,
display_menu_creation: false,
display_routes: false, // demo paths to test polls
expiresDaysDelay: 60,
frontDomain: 'http://127.0.0.1:4200',
interval_days_default: 7,
maxCountOfAnswers: 300,
production: false,
showDemoWarning: false,
showStepperShortcuts: false,
api: endpoints,
poll: poll_conf,
localStorage: {