Compare commits
7 Commits
534ef03f6a
...
5798f6d24e
Author | SHA1 | Date |
---|---|---|
Tykayn | 5798f6d24e | |
Tykayn | 1bcd21317d | |
Tykayn | 6638ba1060 | |
Tykayn | 075d434c6f | |
Tykayn | adc7c255d8 | |
Tykayn | 13dbe0f89b | |
Tykayn | 06dbef8040 |
|
@ -45,12 +45,11 @@
|
||||||
"@fullcalendar/core": "^4.4.0",
|
"@fullcalendar/core": "^4.4.0",
|
||||||
"@ngx-translate/core": "^12.1.2",
|
"@ngx-translate/core": "^12.1.2",
|
||||||
"@ngx-translate/http-loader": "^5.0.0",
|
"@ngx-translate/http-loader": "^5.0.0",
|
||||||
"angular-date-value-accessor": "^1.0.2",
|
|
||||||
"axios": "^0.19.2",
|
"axios": "^0.19.2",
|
||||||
"bulma": "^0.9.0",
|
"bulma": "^0.9.0",
|
||||||
"bulma-switch": "^2.0.0",
|
"bulma-switch": "^2.0.0",
|
||||||
"chart.js": "^2.9.3",
|
"chart.js": "^2.9.3",
|
||||||
"crypto": "^1.0.1",
|
"crypto-js": "^4.0.0",
|
||||||
"fork-awesome": "^1.1.7",
|
"fork-awesome": "^1.1.7",
|
||||||
"ng-keyboard-shortcuts": "^10.1.17",
|
"ng-keyboard-shortcuts": "^10.1.17",
|
||||||
"ng2-charts": "^2.3.0",
|
"ng2-charts": "^2.3.0",
|
||||||
|
@ -78,6 +77,7 @@
|
||||||
"@compodoc/compodoc": "^1.1.11",
|
"@compodoc/compodoc": "^1.1.11",
|
||||||
"@types/jest": "^26.0.0",
|
"@types/jest": "^26.0.0",
|
||||||
"@types/node": "^14.0.1",
|
"@types/node": "^14.0.1",
|
||||||
|
"@types/crypto-js": "^4.0.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^3.0.0",
|
"@typescript-eslint/eslint-plugin": "^3.0.0",
|
||||||
"@typescript-eslint/parser": "^3.0.0",
|
"@typescript-eslint/parser": "^3.0.0",
|
||||||
"babel-jest": "^26.0.0",
|
"babel-jest": "^26.0.0",
|
||||||
|
|
|
@ -62,6 +62,7 @@
|
||||||
<div class="padded">
|
<div class="padded">
|
||||||
<div class="">
|
<div class="">
|
||||||
<a class="navbar-item" [routerLink]="['/poll/demo/consultation']" routerLinkActive="is-primary">
|
<a class="navbar-item" [routerLink]="['/poll/demo/consultation']" routerLinkActive="is-primary">
|
||||||
|
<i class="fa fa-file-epub"></i>
|
||||||
<em>
|
<em>
|
||||||
demo
|
demo
|
||||||
</em> </a
|
</em> </a
|
||||||
|
@ -70,6 +71,7 @@
|
||||||
[routerLink]="['/poll/dessin-anime/consultation']"
|
[routerLink]="['/poll/dessin-anime/consultation']"
|
||||||
routerLinkActive="is-primary"
|
routerLinkActive="is-primary"
|
||||||
>
|
>
|
||||||
|
<i class="fa fa-picture-o"></i>
|
||||||
<em>
|
<em>
|
||||||
dessin-anime
|
dessin-anime
|
||||||
</em>
|
</em>
|
||||||
|
@ -79,7 +81,7 @@
|
||||||
[routerLink]="['/poll/aujourdhui-ou-demain/consultation']"
|
[routerLink]="['/poll/aujourdhui-ou-demain/consultation']"
|
||||||
routerLinkActive="is-primary"
|
routerLinkActive="is-primary"
|
||||||
>
|
>
|
||||||
consulter le sondage
|
<i class="fa fa-clock-o"></i>
|
||||||
<em>
|
<em>
|
||||||
aujourdhui-ou-demain
|
aujourdhui-ou-demain
|
||||||
</em>
|
</em>
|
||||||
|
@ -96,6 +98,17 @@
|
||||||
aujourdhui-ou-demain
|
aujourdhui-ou-demain
|
||||||
</em>
|
</em>
|
||||||
</a>
|
</a>
|
||||||
|
<a
|
||||||
|
class="navbar-item"
|
||||||
|
[routerLink]="['/poll/citron/consultation/prompt']"
|
||||||
|
routerLinkActive="is-primary"
|
||||||
|
>
|
||||||
|
<i class="fa fa-key"></i>
|
||||||
|
<em>
|
||||||
|
citron
|
||||||
|
</em>
|
||||||
|
écran de saisie de mot de passe
|
||||||
|
</a>
|
||||||
<a
|
<a
|
||||||
class="navbar-item"
|
class="navbar-item"
|
||||||
[routerLink]="['/poll/citron/consultation/secure/1c01ed9c94fc640a1be864f197ff808c']"
|
[routerLink]="['/poll/citron/consultation/secure/1c01ed9c94fc640a1be864f197ff808c']"
|
||||||
|
@ -105,7 +118,7 @@
|
||||||
<em>
|
<em>
|
||||||
citron
|
citron
|
||||||
</em>
|
</em>
|
||||||
+ pass
|
+ pass intégré sans saisie
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -171,6 +171,8 @@ export class ApiService {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.response?.status === 404) {
|
if (error.response?.status === 404) {
|
||||||
return undefined;
|
return undefined;
|
||||||
|
} else if (error.response?.status === 403) {
|
||||||
|
return error;
|
||||||
} else {
|
} else {
|
||||||
ApiService.handleError(error);
|
ApiService.handleError(error);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ export class ToastService {
|
||||||
constructor(private _snackBar: MatSnackBar) {}
|
constructor(private _snackBar: MatSnackBar) {}
|
||||||
|
|
||||||
public display(message: string, action?: string): void {
|
public display(message: string, action?: string): void {
|
||||||
const config: MatSnackBarConfig = { duration: 2000 };
|
const config: MatSnackBarConfig = { duration: 4000, verticalPosition: 'top' };
|
||||||
this._snackBar.open(message, action, config);
|
this._snackBar.open(message, action, config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@ import { AdministrationComponent } from './administration.component';
|
||||||
import { StepperComponent } from './stepper/stepper.component';
|
import { StepperComponent } from './stepper/stepper.component';
|
||||||
import { NamingComponent } from './naming/naming.component';
|
import { NamingComponent } from './naming/naming.component';
|
||||||
import { FormComponent } from './form/form.component';
|
import { FormComponent } from './form/form.component';
|
||||||
import { DateValueAccessorModule } from 'angular-date-value-accessor';
|
|
||||||
import { SuccessComponent } from './success/success.component';
|
import { SuccessComponent } from './success/success.component';
|
||||||
import { DateSelectComponent } from './form/date-select/date-select.component';
|
import { DateSelectComponent } from './form/date-select/date-select.component';
|
||||||
import { TextSelectComponent } from './form/text-select/text-select.component';
|
import { TextSelectComponent } from './form/text-select/text-select.component';
|
||||||
|
@ -47,7 +46,6 @@ import { TimeListComponent } from './form/date/list/time/time-list.component';
|
||||||
SharedModule,
|
SharedModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
TranslateModule.forChild({ extend: true }),
|
TranslateModule.forChild({ extend: true }),
|
||||||
DateValueAccessorModule,
|
|
||||||
DragDropModule,
|
DragDropModule,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
{{ 'dates.add' | translate }}
|
{{ 'dates.add' | translate }}
|
||||||
|
|
||||||
<!-- interval-->
|
<!-- interval-->
|
||||||
<!-- <app-date-interval></app-date-interval>-->
|
<app-date-interval [form]="form"></app-date-interval>
|
||||||
</form>
|
</form>
|
||||||
<div class="dates-list">
|
<div class="dates-list">
|
||||||
<!-- différentes horaires-->
|
<!-- différentes horaires-->
|
||||||
|
|
|
@ -11,6 +11,7 @@ import { DateChoice, defaultTimeOfDay, TimeSlices } from '../../../../../../mock
|
||||||
|
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { StorageService } from '../../../../core/services/storage.service';
|
import { StorageService } from '../../../../core/services/storage.service';
|
||||||
|
import { environment } from '../../../../../environments/environment';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-date-select',
|
selector: 'app-date-select',
|
||||||
|
@ -26,7 +27,7 @@ export class DateSelectComponent implements OnInit {
|
||||||
today = new Date();
|
today = new Date();
|
||||||
endDateInterval: string;
|
endDateInterval: string;
|
||||||
|
|
||||||
intervalDaysDefault = 7;
|
intervalDaysDefault = environment.interval_days_default;
|
||||||
dateChoices: DateChoice[] = []; // sets of dateChoices as strings, config to set identical time for dateChoices in a special dateChoices poll
|
dateChoices: DateChoice[] = []; // sets of dateChoices as strings, config to set identical time for dateChoices in a special dateChoices poll
|
||||||
timeSlices: TimeSlices[] = []; // ranges of time expressed as strings
|
timeSlices: TimeSlices[] = []; // ranges of time expressed as strings
|
||||||
|
|
||||||
|
|
|
@ -13,11 +13,36 @@
|
||||||
<fieldset *ngIf="showDateInterval" class="date-interval form-row is-boxed">
|
<fieldset *ngIf="showDateInterval" class="date-interval form-row is-boxed">
|
||||||
<div class="columns">
|
<div class="columns">
|
||||||
<div class="column">
|
<div class="column">
|
||||||
|
<app-wip-todo></app-wip-todo>
|
||||||
{{ 'dates.interval_propose' | translate }}
|
{{ 'dates.interval_propose' | translate }}
|
||||||
|
<input type="text" formControlName="natural_lang_interval" />
|
||||||
|
<sub>
|
||||||
|
exemple "du 10 au 17", ou "lundi à samedi"
|
||||||
|
</sub>
|
||||||
|
<button (click)="addNaturalInstruction()" class="btn btn-block btn--primary">
|
||||||
|
interpréter
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="columns">
|
||||||
|
<div class="column">
|
||||||
|
<!-- <mat-form-field appearance="fill">-->
|
||||||
|
<!-- <mat-label>Enter a date range</mat-label>-->
|
||||||
|
<!-- <mat-date-range-input [formGroup]="form" [rangePicker]="picker">-->
|
||||||
|
<!-- <input matStartDate formControlName="startDateInterval" placeholder="Start date">-->
|
||||||
|
<!-- <input matEndDate formControlName="endDateInterval" placeholder="End date">-->
|
||||||
|
<!-- </mat-date-range-input>-->
|
||||||
|
<!-- <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>-->
|
||||||
|
<!-- <mat-date-range-picker #picker></mat-date-range-picker>-->
|
||||||
|
|
||||||
|
<!-- <mat-error *ngIf="form.controls.startDateInterval.hasError('matStartDateInvalid')">Invalid start date</mat-error>-->
|
||||||
|
<!-- <mat-error *ngIf="form.controls.endDateInterval.hasError('matEndDateInvalid')">Invalid end date</mat-error>-->
|
||||||
|
<!-- </mat-form-field>-->
|
||||||
</div>
|
</div>
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<label for="start_interval" class="hidden">start</label>
|
<label for="start_interval" class="hidden">start</label>
|
||||||
<input id="start_interval" (change)="countDays()" formControlName="startDateInterval" type="date" />
|
{{ form.value.startDateInterval }}
|
||||||
|
<input id="start_interval" formControlName="startDateInterval" type="date" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="columns">
|
<div class="columns">
|
||||||
|
@ -27,12 +52,19 @@
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<label for="end_interval" class="hidden">end</label>
|
<label for="end_interval" class="hidden">end</label>
|
||||||
<input id="end_interval" formControlName="endDateInterval" type="date" />
|
<input id="end_interval" formControlName="endDateInterval" type="date" />
|
||||||
<div class="well">
|
{{ form.value.endDateInterval }}
|
||||||
{{ form.value.endDateInterval }}
|
<div class="span resume">
|
||||||
|
<div class="well">
|
||||||
|
Du
|
||||||
|
{{ form.value.startDateInterval | date: 'EEEE d':'Europe/Paris':'fr_FR' }}
|
||||||
|
au
|
||||||
|
{{ form.value.endDateInterval | date: 'EEEE d':'Europe/Paris':'fr_FR' }}
|
||||||
|
, soit {{ intervalDays }} jours.
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="span resume">soit {{ intervalDays }} jours.</div>
|
|
||||||
<button (click)="addIntervalOfDates()" class="btn btn-block btn--primary">
|
<button (click)="addIntervalOfDates()" class="btn btn-block btn--primary">
|
||||||
<i class="fa fa-plus" aria-hidden="true"></i>
|
<i class="fa fa-plus" aria-hidden="true"></i>
|
||||||
{{ 'dates.interval_button' | translate }}
|
{{ 'dates.interval_button' | translate }}
|
||||||
|
|
|
@ -22,19 +22,42 @@ export class IntervalComponent implements OnInit {
|
||||||
endDateIntervalString: string;
|
endDateIntervalString: string;
|
||||||
dateList: DateChoice[]; // sets of dateChoices as strings, config to set identical time for dateChoices in a special dateChoices poll
|
dateList: DateChoice[]; // sets of dateChoices as strings, config to set identical time for dateChoices in a special dateChoices poll
|
||||||
dateCalendarEnum: Date[] = [new Date('02/09/2021')];
|
dateCalendarEnum: Date[] = [new Date('02/09/2021')];
|
||||||
|
natural_lang_interval: string;
|
||||||
|
|
||||||
constructor(public dateUtilities: DateUtilitiesService, private toastService: ToastService) {}
|
constructor(public dateUtilities: DateUtilitiesService, private toastService: ToastService) {}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
this.form.get('startDateInterval').valueChanges.subscribe((val) => {
|
||||||
|
console.log('val', val);
|
||||||
|
if (typeof val === typeof String) {
|
||||||
|
this.startDateIntervalString = val;
|
||||||
|
this.countDays();
|
||||||
|
} else {
|
||||||
|
this.startDateInterval = val;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.form.get('endDateInterval').valueChanges.subscribe((val) => {
|
||||||
|
console.log('val', val);
|
||||||
|
if (typeof val === typeof String) {
|
||||||
|
this.endDateIntervalString = val;
|
||||||
|
this.countDays();
|
||||||
|
}
|
||||||
|
// this.endDateInterval = val;
|
||||||
|
// this.countDays();
|
||||||
|
});
|
||||||
|
|
||||||
this.setDefaultDatesForInterval();
|
this.setDefaultDatesForInterval();
|
||||||
}
|
}
|
||||||
|
|
||||||
countDays(): void {
|
countDays(): void {
|
||||||
this.intervalDays = this.dateUtilities.countDays(
|
|
||||||
this.dateUtilities.parseInputDateToDateObject(this.startDateInterval),
|
|
||||||
this.dateUtilities.parseInputDateToDateObject(this.endDateInterval)
|
|
||||||
);
|
|
||||||
// this.cd.detectChanges();
|
// this.cd.detectChanges();
|
||||||
|
this.intervalDays = this.dateUtilities.countDays(
|
||||||
|
this.startDateInterval,
|
||||||
|
this.endDateInterval
|
||||||
|
// this.dateUtilities.parseInputDateToDateObject(this.startDateIntervalString),
|
||||||
|
// this.dateUtilities.parseInputDateToDateObject(this.endDateIntervalString)
|
||||||
|
);
|
||||||
|
console.log('this.intervalDays ', this.intervalDays);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -90,4 +113,9 @@ export class IntervalComponent implements OnInit {
|
||||||
this.countDays();
|
this.countDays();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addNaturalInstruction() {
|
||||||
|
this.toastService.display(`TODO addNaturalInstruction`);
|
||||||
|
console.log('TODO', this.natural_lang_interval);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ export class DayListComponent {
|
||||||
@Inject(DOCUMENT) private document: any,
|
@Inject(DOCUMENT) private document: any,
|
||||||
private storageService: StorageService
|
private storageService: StorageService
|
||||||
) {
|
) {
|
||||||
this.setDemoTextChoices();
|
// this.setDemoTextChoices();
|
||||||
}
|
}
|
||||||
|
|
||||||
reinitChoices(): void {
|
reinitChoices(): void {
|
||||||
|
@ -45,7 +45,6 @@ export class DayListComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
dropDayItem(event: any): void {
|
dropDayItem(event: any): void {
|
||||||
// moveItemInArray(this.timeSlices, event.previousIndex, event.currentIndex);
|
|
||||||
if (event.previousContainer === event.container) {
|
if (event.previousContainer === event.container) {
|
||||||
moveItemInArray(event.container.data, event.previousIndex, event.currentIndex);
|
moveItemInArray(event.container.data, event.previousIndex, event.currentIndex);
|
||||||
} else {
|
} else {
|
||||||
|
@ -134,8 +133,6 @@ export class DayListComponent {
|
||||||
date_object: new Date(),
|
date_object: new Date(),
|
||||||
});
|
});
|
||||||
|
|
||||||
// this.cd.detectChanges();
|
|
||||||
|
|
||||||
this.focusOnChoice(this.storageService.dateChoices.length - 1);
|
this.focusOnChoice(this.storageService.dateChoices.length - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ import { environment } from '../../../../environments/environment';
|
||||||
import { PollUtilitiesService } from '../../../core/services/poll.utilities.service';
|
import { PollUtilitiesService } from '../../../core/services/poll.utilities.service';
|
||||||
import { StorageService } from '../../../core/services/storage.service';
|
import { StorageService } from '../../../core/services/storage.service';
|
||||||
import { DateUtilitiesService } from '../../../core/services/date.utilities.service';
|
import { DateUtilitiesService } from '../../../core/services/date.utilities.service';
|
||||||
|
import { formatDate } from '@angular/common';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-admin-form',
|
selector: 'app-admin-form',
|
||||||
|
@ -87,6 +88,7 @@ export class FormComponent implements OnInit, AfterViewInit {
|
||||||
allowComments: [true, [Validators.required]],
|
allowComments: [true, [Validators.required]],
|
||||||
password: ['', []],
|
password: ['', []],
|
||||||
voterEmailList: ['', []],
|
voterEmailList: ['', []],
|
||||||
|
natural_lang_interval: ['', []],
|
||||||
dateCreated: [creationDate, [Validators.required]],
|
dateCreated: [creationDate, [Validators.required]],
|
||||||
hasSeveralHours: [false, [Validators.required]],
|
hasSeveralHours: [false, [Validators.required]],
|
||||||
hasMaxCountOfAnswers: [true, [Validators.required, Validators.min(1)]],
|
hasMaxCountOfAnswers: [true, [Validators.required, Validators.min(1)]],
|
||||||
|
@ -109,12 +111,9 @@ export class FormComponent implements OnInit, AfterViewInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
setDefaultFormValues(): void {
|
setDefaultFormValues(): void {
|
||||||
const dateStart = this.dateUtils.formateDateToInputStringNg(new Date());
|
|
||||||
const dateEnd = this.dateUtils.formateDateToInputStringNg(this.dateUtils.addDaysToDate(5, new Date()));
|
|
||||||
|
|
||||||
this.form.patchValue({
|
this.form.patchValue({
|
||||||
creatorPseudo: 'Anne Onyme',
|
creatorPseudo: 'Anne Onyme',
|
||||||
creatorEmail: '',
|
creatorEmail: 'anne_onyme@anonymous_email.com',
|
||||||
description: 'RSVP',
|
description: 'RSVP',
|
||||||
isAboutDate: true,
|
isAboutDate: true,
|
||||||
hasSeveralHours: false,
|
hasSeveralHours: false,
|
||||||
|
@ -130,12 +129,19 @@ export class FormComponent implements OnInit, AfterViewInit {
|
||||||
isZeroKnoledge: true,
|
isZeroKnoledge: true,
|
||||||
areResultsPublic: true,
|
areResultsPublic: true,
|
||||||
allowComments: true,
|
allowComments: true,
|
||||||
expiresDaysDelay: 60,
|
expiresDaysDelay: environment.expiresDaysDelay,
|
||||||
maxCountOfAnswers: 150,
|
maxCountOfAnswers: environment.maxCountOfAnswers,
|
||||||
allowNewDateTime: false,
|
allowNewDateTime: false,
|
||||||
startDateInterval: dateStart,
|
// startDateInterval: formatDate(new Date(), 'yyyy-MM-dd', 'fr_FR'),
|
||||||
endDateInterval: dateEnd,
|
endDateInterval: formatDate(
|
||||||
|
this.dateUtils.addDaysToDate(environment.interval_days_default, new Date()),
|
||||||
|
'yyyy-MM-dd',
|
||||||
|
'fr_FR'
|
||||||
|
),
|
||||||
});
|
});
|
||||||
|
console.log("this.form.controls['startDateInterval']", this.form.controls['startDateInterval']);
|
||||||
|
this.form.controls['startDateInterval'].setValue(formatDate(new Date(), 'yyyy-MM-dd', 'fr_FR'));
|
||||||
|
console.log("this.form.controls['startDateInterval']", this.form.controls['startDateInterval']);
|
||||||
this.automaticSlug();
|
this.automaticSlug();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,17 +153,12 @@ export class FormComponent implements OnInit, AfterViewInit {
|
||||||
|
|
||||||
this.form.patchValue({ creatorPseudo: 'Chuck Norris', creatorEmail: 'chucknorris@example.com' });
|
this.form.patchValue({ creatorPseudo: 'Chuck Norris', creatorEmail: 'chucknorris@example.com' });
|
||||||
|
|
||||||
const dateStart = this.dateUtils.formateDateToInputStringNg(new Date());
|
|
||||||
const dateEnd = this.dateUtils.formateDateToInputStringNg(this.dateUtils.addDaysToDate(5, new Date()));
|
|
||||||
|
|
||||||
this.form.patchValue({
|
this.form.patchValue({
|
||||||
title: title,
|
title: title,
|
||||||
custom_url: this.pollUtilitiesService.makeSlugFromString(title),
|
custom_url: this.pollUtilitiesService.makeSlugFromString(title),
|
||||||
description: 'répondez SVP <3 ! *-*',
|
description: 'répondez SVP <3 ! *-*',
|
||||||
creatorPseudo: 'Chuck Norris',
|
creatorPseudo: 'Chuck Norris',
|
||||||
creatorEmail: 'chucknorris@example.com',
|
creatorEmail: 'chucknorris@example.com',
|
||||||
dateStart,
|
|
||||||
dateEnd,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,16 +3,17 @@ import { RouterModule, Routes } from '@angular/router';
|
||||||
|
|
||||||
import { ConsultationComponent } from './consultation.component';
|
import { ConsultationComponent } from './consultation.component';
|
||||||
import { WipTodoComponent } from '../../shared/components/ui/wip-todo/wip-todo.component';
|
import { WipTodoComponent } from '../../shared/components/ui/wip-todo/wip-todo.component';
|
||||||
|
import { PasswordPromptComponent } from './password/password-prompt/password-prompt.component';
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{ path: 'secure/:pass_hash', component: ConsultationComponent },
|
{ path: 'secure/:pass_hash', component: ConsultationComponent },
|
||||||
|
{ path: 'prompt', component: PasswordPromptComponent },
|
||||||
|
{ path: 'simple', component: WipTodoComponent },
|
||||||
|
{ path: 'table', component: WipTodoComponent },
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: ConsultationComponent,
|
component: ConsultationComponent,
|
||||||
children: [
|
children: [],
|
||||||
{ path: 'simple', component: WipTodoComponent },
|
|
||||||
{ path: 'table', component: WipTodoComponent },
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@NgModule({
|
@NgModule({
|
||||||
|
|
|
@ -15,6 +15,7 @@ import { ToastService } from '../../core/services/toast.service';
|
||||||
styleUrls: ['./consultation.component.scss'],
|
styleUrls: ['./consultation.component.scss'],
|
||||||
})
|
})
|
||||||
export class ConsultationComponent implements OnInit, OnDestroy {
|
export class ConsultationComponent implements OnInit, OnDestroy {
|
||||||
|
// public isCompactMode = false;
|
||||||
public isCompactMode = true;
|
public isCompactMode = true;
|
||||||
public poll: Poll;
|
public poll: Poll;
|
||||||
public pollSlug: string;
|
public pollSlug: string;
|
||||||
|
|
|
@ -8,6 +8,7 @@ import { ConsultationComponent } from './consultation.component';
|
||||||
import { PollResultsCompactComponent } from './poll-results-compact/poll-results-compact.component';
|
import { PollResultsCompactComponent } from './poll-results-compact/poll-results-compact.component';
|
||||||
import { PollResultsDetailedComponent } from './poll-results-detailed/poll-results-detailed.component';
|
import { PollResultsDetailedComponent } from './poll-results-detailed/poll-results-detailed.component';
|
||||||
import { ChoiceButtonComponent } from '../../shared/components/choice-item/choice-button.component';
|
import { ChoiceButtonComponent } from '../../shared/components/choice-item/choice-button.component';
|
||||||
|
import { PasswordPromptComponent } from './password/password-prompt/password-prompt.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
|
@ -15,6 +16,7 @@ import { ChoiceButtonComponent } from '../../shared/components/choice-item/choic
|
||||||
PollResultsCompactComponent,
|
PollResultsCompactComponent,
|
||||||
PollResultsDetailedComponent,
|
PollResultsDetailedComponent,
|
||||||
ChoiceButtonComponent,
|
ChoiceButtonComponent,
|
||||||
|
PasswordPromptComponent,
|
||||||
],
|
],
|
||||||
imports: [CommonModule, ConsultationRoutingModule, SharedModule, TranslateModule.forChild({ extend: true })],
|
imports: [CommonModule, ConsultationRoutingModule, SharedModule, TranslateModule.forChild({ extend: true })],
|
||||||
})
|
})
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
<div class="padded">
|
||||||
|
<h1>
|
||||||
|
<i class="fa fa-key"></i>
|
||||||
|
Sondage protégé
|
||||||
|
</h1>
|
||||||
|
<p>Pour accéder au sondage {{ custom_url }} il vous faut saisir la phrase de passe.</p>
|
||||||
|
<input type="text" [(ngModel)]="password" *ngIf="display_pass" />
|
||||||
|
<input type="password" [(ngModel)]="password" *ngIf="!display_pass" />
|
||||||
|
<br />
|
||||||
|
<button (click)="display_pass = !display_pass">voir</button>
|
||||||
|
<br />
|
||||||
|
Méthode de chiffrement 1:
|
||||||
|
<select name="ciphering_method" id="ciphering_method">
|
||||||
|
<option value="MD5">MD5</option>
|
||||||
|
</select>
|
||||||
|
Méthode de chiffrement 2:
|
||||||
|
<select name="ciphering_method_2" id="ciphering_method_2">
|
||||||
|
<option value="MD5">MD5</option>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
steak haché:
|
||||||
|
{{ cipherPass() }}
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<button class="is-primary button is-large" (click)="redirectToConsultationPage()">
|
||||||
|
Allons-y
|
||||||
|
</button>
|
||||||
|
</div>
|
|
@ -0,0 +1,24 @@
|
||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { PasswordPromptComponent } from './password-prompt.component';
|
||||||
|
|
||||||
|
describe('PasswordPromptComponent', () => {
|
||||||
|
let component: PasswordPromptComponent;
|
||||||
|
let fixture: ComponentFixture<PasswordPromptComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [PasswordPromptComponent],
|
||||||
|
}).compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(PasswordPromptComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,34 @@
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { ActivatedRoute, ParamMap, Router } from '@angular/router';
|
||||||
|
import { MD5, enc } from 'crypto-js';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-password-prompt',
|
||||||
|
templateUrl: './password-prompt.component.html',
|
||||||
|
styleUrls: ['./password-prompt.component.scss'],
|
||||||
|
})
|
||||||
|
export class PasswordPromptComponent implements OnInit {
|
||||||
|
password = 'le pass woute woute';
|
||||||
|
method = 'md5';
|
||||||
|
display_pass = true;
|
||||||
|
custom_url = '';
|
||||||
|
password_ciphered: string;
|
||||||
|
|
||||||
|
constructor(private router: Router, private _Activatedroute: ActivatedRoute) {}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
this._Activatedroute.paramMap.subscribe((params: ParamMap) => {
|
||||||
|
this.custom_url = params.get('custom_url');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
cipherPass() {
|
||||||
|
this.password_ciphered = MD5(this.password).toString(enc.Hex);
|
||||||
|
this.password_ciphered = MD5(this.password_ciphered).toString(enc.Hex);
|
||||||
|
return this.password_ciphered;
|
||||||
|
}
|
||||||
|
|
||||||
|
redirectToConsultationPage() {
|
||||||
|
this.router.navigate(['/poll/' + this.custom_url + '/consultation/secure/' + this.password_ciphered]);
|
||||||
|
}
|
||||||
|
}
|
|
@ -6,7 +6,9 @@
|
||||||
</th>
|
</th>
|
||||||
<th *ngFor="let choice of poll.choices">
|
<th *ngFor="let choice of poll.choices">
|
||||||
<!-- {{choice.id}}-->
|
<!-- {{choice.id}}-->
|
||||||
<span class="label" *ngIf="poll.kind == 'text'">{{ choice.name }} </span>
|
<span class="label" *ngIf="poll.kind == 'text'">
|
||||||
|
{{ choice.name }}
|
||||||
|
</span>
|
||||||
<span class="label" *ngIf="poll.kind == 'date'">
|
<span class="label" *ngIf="poll.kind == 'date'">
|
||||||
{{ make_date(choice.name) | date: 'fullDate':'Europe/Paris':'fr_FR' }}
|
{{ make_date(choice.name) | date: 'fullDate':'Europe/Paris':'fr_FR' }}
|
||||||
</span>
|
</span>
|
||||||
|
@ -26,8 +28,11 @@
|
||||||
<td>
|
<td>
|
||||||
Favori
|
Favori
|
||||||
</td>
|
</td>
|
||||||
<td *ngFor="let choice of poll.choices">
|
<td
|
||||||
<span class="max_score" *ngIf="poll.max_score > 0 && choice.score == poll.max_score">
|
*ngFor="let choice of poll.choices"
|
||||||
|
[ngClass]="{ 'background-yes': poll.max_score > 0 && choice.score == poll.max_score }"
|
||||||
|
>
|
||||||
|
<span class="max_score background-yes" *ngIf="poll.max_score > 0 && choice.score == poll.max_score">
|
||||||
<i class="fa fa-star fa-2x"></i>
|
<i class="fa fa-star fa-2x"></i>
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
|
@ -47,13 +52,9 @@
|
||||||
<sub> le {{ stack.created_at | date: 'short':'Europe/Paris':'fr_FR' }} </sub>
|
<sub> le {{ stack.created_at | date: 'short':'Europe/Paris':'fr_FR' }} </sub>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<ng-container *ngFor="let item of poll.choices">
|
<ng-container *ngFor="let vote of stack.votes">
|
||||||
<td *ngIf="!stackHasVotesForChoice(stack, item.id)"></td>
|
<td class="stack-vote background-{{ vote.value }}">
|
||||||
<td
|
{{ vote.value }}
|
||||||
*ngIf="stackHasVotesForChoice(stack, item.id)"
|
|
||||||
class="stack-vote background-{{ getValue(stack, item.id) }}"
|
|
||||||
>
|
|
||||||
{{ getValue(stack, item.id) }}
|
|
||||||
</td>
|
</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -18,6 +18,9 @@ export const environment = {
|
||||||
showDemoWarning: true,
|
showDemoWarning: true,
|
||||||
autofill: false,
|
autofill: false,
|
||||||
autoSendNewPoll: false,
|
autoSendNewPoll: false,
|
||||||
|
interval_days_default: 7,
|
||||||
|
expiresDaysDelay: 60,
|
||||||
|
maxCountOfAnswers: 150,
|
||||||
appTitle: 'FramaDate Funky',
|
appTitle: 'FramaDate Funky',
|
||||||
appVersion: '2.1.0',
|
appVersion: '2.1.0',
|
||||||
appLogo: 'assets/img/logo.png',
|
appLogo: 'assets/img/logo.png',
|
||||||
|
@ -54,7 +57,6 @@ export const environment = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
interval_days_default: 7,
|
|
||||||
poll: {
|
poll: {
|
||||||
defaultConfig: {
|
defaultConfig: {
|
||||||
maxCountOfAnswers: 150,
|
maxCountOfAnswers: 150,
|
||||||
|
|
|
@ -11,11 +11,13 @@ export const environment = {
|
||||||
frontDomain: 'http://127.0.0.1:4200',
|
frontDomain: 'http://127.0.0.1:4200',
|
||||||
production: false,
|
production: false,
|
||||||
display_routes: true,
|
display_routes: true,
|
||||||
// autofill: true,
|
autofill: true,
|
||||||
autofill: false,
|
// autofill: false,
|
||||||
showDemoWarning: true,
|
showDemoWarning: true,
|
||||||
autoSendNewPoll: false,
|
autoSendNewPoll: false,
|
||||||
interval_days_default: 7,
|
interval_days_default: 7,
|
||||||
|
expiresDaysDelay: 60,
|
||||||
|
maxCountOfAnswers: 150,
|
||||||
appTitle: 'funky',
|
appTitle: 'funky',
|
||||||
appVersion: '0.6.0',
|
appVersion: '0.6.0',
|
||||||
appLogo: 'assets/img/logo.png',
|
appLogo: 'assets/img/logo.png',
|
||||||
|
|
15
yarn.lock
15
yarn.lock
|
@ -1678,6 +1678,11 @@
|
||||||
resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0"
|
resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0"
|
||||||
integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==
|
integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==
|
||||||
|
|
||||||
|
"@types/crypto-js@^4.0.0":
|
||||||
|
version "4.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/crypto-js/-/crypto-js-4.0.1.tgz#3a4bd24518b0e6c5940da4e2659eeb2ef0806963"
|
||||||
|
integrity sha512-6+OPzqhKX/cx5xh+yO8Cqg3u3alrkhoxhE5ZOdSEv0DOzJ13lwJ6laqGU0Kv6+XDMFmlnGId04LtY22PsFLQUw==
|
||||||
|
|
||||||
"@types/eslint-visitor-keys@^1.0.0":
|
"@types/eslint-visitor-keys@^1.0.0":
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d"
|
resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d"
|
||||||
|
@ -3745,16 +3750,16 @@ crypto-js@^3.1.9-1:
|
||||||
resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-3.3.0.tgz#846dd1cce2f68aacfa156c8578f926a609b7976b"
|
resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-3.3.0.tgz#846dd1cce2f68aacfa156c8578f926a609b7976b"
|
||||||
integrity sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q==
|
integrity sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q==
|
||||||
|
|
||||||
|
crypto-js@^4.0.0:
|
||||||
|
version "4.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.0.0.tgz#2904ab2677a9d042856a2ea2ef80de92e4a36dcc"
|
||||||
|
integrity sha512-bzHZN8Pn+gS7DQA6n+iUmBfl0hO5DJq++QP3U6uTucDtk/0iGpXd/Gg7CGR0p8tJhofJyaKoWBuJI4eAO00BBg==
|
||||||
|
|
||||||
crypto-random-string@^2.0.0:
|
crypto-random-string@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5"
|
resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5"
|
||||||
integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==
|
integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==
|
||||||
|
|
||||||
crypto@^1.0.1:
|
|
||||||
version "1.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/crypto/-/crypto-1.0.1.tgz#2af1b7cad8175d24c8a1b0778255794a21803037"
|
|
||||||
integrity sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig==
|
|
||||||
|
|
||||||
css-color-names@0.0.4, css-color-names@^0.0.4:
|
css-color-names@0.0.4, css-color-names@^0.0.4:
|
||||||
version "0.0.4"
|
version "0.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/css-color-names/-/css-color-names-0.0.4.tgz#808adc2e79cf84738069b646cb20ec27beb629e0"
|
resolved "https://registry.yarnpkg.com/css-color-names/-/css-color-names-0.0.4.tgz#808adc2e79cf84738069b646cb20ec27beb629e0"
|
||||||
|
|
Loading…
Reference in New Issue