Merge branch 'migrate-angular-9-to-15' into 'develop'

Migrate angular and npm packages to angular 15

See merge request framasoft/framadate/funky-framadate-front!78
This commit is contained in:
Marc Loyat 2023-03-17 19:44:18 +00:00
commit 533ea81301
39 changed files with 7248 additions and 6798 deletions

1
.gitignore vendored
View File

@ -35,6 +35,7 @@ speed-measure-plugin*.json
.idea .idea
# misc # misc
/.angular/cache
/.sass-cache /.sass-cache
/connect.lock /connect.lock
/coverage /coverage

View File

@ -22,11 +22,9 @@
"main": "src/main.ts", "main": "src/main.ts",
"polyfills": "src/polyfills.ts", "polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json", "tsConfig": "tsconfig.app.json",
"assets": [ "assets": ["src/favicon.ico", "src/assets"],
"src/favicon.ico",
"src/assets"
],
"styles": [ "styles": [
"node_modules/prismjs/themes/prism-okaidia.css",
"node_modules/fork-awesome/css/fork-awesome.min.css", "node_modules/fork-awesome/css/fork-awesome.min.css",
"node_modules/bulma-switch/dist/css/bulma-switch.min.css", "node_modules/bulma-switch/dist/css/bulma-switch.min.css",
"node_modules/primeicons/primeicons.css", "node_modules/primeicons/primeicons.css",
@ -35,11 +33,18 @@
"src/styles.scss" "src/styles.scss"
], ],
"scripts": [ "scripts": [
"node_modules/chart.js/dist/Chart.min.js", "node_modules/chart.js/dist/chart.umd.js",
"node_modules/marked/lib/marked.js", "node_modules/marked/marked.min.js",
"node_modules/prismjs/prism.js", "node_modules/prismjs/prism.js",
"node_modules/prismjs/components/prism-css.min.js" "node_modules/prismjs/components/prism-css.min.js"
] ],
"aot": false,
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
}, },
"configurations": { "configurations": {
"production": { "production": {
@ -52,7 +57,6 @@
"optimization": true, "optimization": true,
"outputHashing": "all", "outputHashing": "all",
"sourceMap": false, "sourceMap": false,
"extractCss": true,
"namedChunks": false, "namedChunks": false,
"aot": true, "aot": true,
"extractLicenses": true, "extractLicenses": true,
@ -72,7 +76,8 @@
} }
] ]
} }
} },
"defaultConfiguration": ""
}, },
"serve": { "serve": {
"builder": "@angular-devkit/build-angular:dev-server", "builder": "@angular-devkit/build-angular:dev-server",
@ -95,19 +100,6 @@
"builder": "@angular-builders/jest:run", "builder": "@angular-builders/jest:run",
"options": {} "options": {}
}, },
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"e2e": { "e2e": {
"builder": "@angular-devkit/build-angular:protractor", "builder": "@angular-devkit/build-angular:protractor",
"options": { "options": {
@ -123,7 +115,6 @@
} }
} }
}, },
"defaultProject": "framadate",
"cli": { "cli": {
"analytics": "0ba9c0a9-850f-4c5f-8124-cbe6f4c79ef1" "analytics": "0ba9c0a9-850f-4c5f-8124-cbe6f4c79ef1"
} }

View File

@ -3,7 +3,7 @@
"compilerOptions": { "compilerOptions": {
"outDir": "../out-tsc/e2e", "outDir": "../out-tsc/e2e",
"module": "commonjs", "module": "commonjs",
"target": "es5", "target": "es2018",
"types": ["jasmine", "jasminewd2", "node"] "types": ["jasmine", "jasminewd2", "node"]
} }
} }

View File

@ -3,16 +3,19 @@
"version": "0.6.0", "version": "0.6.0",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"engines": { "engines": {
"node": ">= 16.0.0" "node": ">= 16.13.0"
},
"resolutions": {
"webpack": "^5.0.0"
}, },
"scripts": { "scripts": {
"ng": "ng", "ng": "ng",
"start": "ng serve", "start": "ng serve",
"start_docker": "ng serve --host 0.0.0.0", "start_docker": "ng serve --host 0.0.0.0",
"build:prod": "ng build --prod", "build:prod": "ng build --configuration production",
"build:prod:stats": "ng build --prod --stats-json", "build:prod:stats": "ng build --configuration production --stats-json",
"build:prod:gitlabpage": "ng build --prod --baseHref=/framadate/funky-framadate-front/", "build:prod:gitlabpage": "ng build --configuration production --baseHref=/framadate/funky-framadate-front/",
"build:prod:demobliss": "ng build --prod --baseHref=https://framadate-api.cipherbliss.com --stats-json ", "build:prod:demobliss": "ng build --configuration production --baseHref=https://framadate-api.cipherbliss.com --stats-json ",
"test": "jest", "test": "jest",
"test:watch": "jest --watch", "test:watch": "jest --watch",
"test:ci": "jest --ci", "test:ci": "jest --ci",
@ -33,62 +36,65 @@
}, },
"private": false, "private": false,
"dependencies": { "dependencies": {
"@angular/animations": "^9.1.1", "@angular/animations": "^15.2.2",
"@angular/cdk": "^9.2.2", "@angular/cdk": "^15.2.2",
"@angular/common": "^9.0.7", "@angular/common": "^15.2.2",
"@angular/compiler": "^9.0.7", "@angular/compiler": "^15.2.2",
"@angular/core": "^9.0.7", "@angular/core": "^15.2.2",
"@angular/forms": "^9.0.7", "@angular/forms": "^15.2.2",
"@angular/localize": "^9.1.1", "@angular/localize": "^15.2.2",
"@angular/material": "^9.2.4", "@angular/material": "^15.2.2",
"@angular/platform-browser": "^9.0.7", "@angular/platform-browser": "^15.2.2",
"@angular/platform-browser-dynamic": "^9.0.7", "@angular/platform-browser-dynamic": "^15.2.2",
"@angular/router": "^9.0.7", "@angular/router": "^15.2.2",
"@biesbjerg/ngx-translate-extract": "^7.0.3", "@fullcalendar/core": "^6.1.4",
"@biesbjerg/ngx-translate-po-http-loader": "^3.1.0", "@ngx-translate/core": "^14.0.0",
"@fullcalendar/core": "^4.4.0", "@ngx-translate/http-loader": "^7.0.0",
"@ngx-translate/core": "^12.1.2", "angular-date-value-accessor": "^3.0.0",
"@ngx-translate/http-loader": "^5.0.0", "axios": "^1.3.4",
"angular-date-value-accessor": "^1.0.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": "^4.2.1",
"crypto": "^1.0.1", "crypto": "^1.0.1",
"crypto-js": "^4.0.0", "crypto-js": "^4.0.0",
"feather-icons": "^4.28.0", "feather-icons": "^4.28.0",
"fork-awesome": "^1.1.7", "fork-awesome": "^1.1.7",
"ng-keyboard-shortcuts": "^10.1.17", "marked": "^4.2.12",
"ng2-charts": "^2.3.0", "moment": "^2.29.4",
"ngx-clipboard": "^13.0.0", "ng-keyboard-shortcuts": "^13.0.8",
"ngx-markdown": "^9.0.0", "ng2-charts": "^4.1.1",
"ngx-webstorage": "^5.0.0", "ngx-clipboard": "^15.1.0",
"ngx-markdown": "^15.1.2",
"ngx-webstorage": "^11.1.1",
"node-forge": "^0.10.0", "node-forge": "^0.10.0",
"primeicons": "^5.0.0", "primeicons": "^6.0.1",
"primeng": "^11.0.0", "primeng": "^15.2.0",
"prismjs": "^1.29.0",
"quill": "^1.3.7", "quill": "^1.3.7",
"rxjs": "^6.5.5", "rxjs": "^6.5.5",
"rxjs-compat": "^6.5.5", "rxjs-compat": "^6.5.5",
"short-unique-id": "^3.0.3", "short-unique-id": "^3.0.3",
"stream": "^0.0.2", "stream": "^0.0.2",
"tslib": "<2.0.0", "tslib": "^2.0.0",
"zone.js": "^0.10.3" "zone.js": "~0.11.4"
}, },
"devDependencies": { "devDependencies": {
"@angular-builders/jest": "^9.0.1", "@angular-builders/jest": "^9.0.1",
"@angular-devkit/build-angular": "^0.901.2", "@angular-devkit/build-angular": "^15.2.3",
"@angular/cli": "^9.1.2", "@angular/cli": "^15.2.3",
"@angular/compiler-cli": "^9.1.1", "@angular/compiler-cli": "^15.2.2",
"@angular/language-service": "^9.0.7", "@angular/language-service": "^15.2.2",
"@babel/core": "^7.9.0", "@babel/core": "^7.9.0",
"@babel/preset-env": "^7.9.5", "@babel/preset-env": "^7.9.5",
"@babel/preset-typescript": "^7.9.0", "@babel/preset-typescript": "^7.9.0",
"@compodoc/compodoc": "^1.1.11", "@compodoc/compodoc": "^1.1.11",
"@types/crypto-js": "^4.0.0", "@types/crypto-js": "^4.0.0",
"@types/jest": "^26.0.0", "@types/jest": "^26.0.0",
"@types/marked": "^4.0.8",
"@types/node": "^14.0.1", "@types/node": "^14.0.1",
"@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",
"@vendure/ngx-translate-extract": "^8.1.0",
"babel-jest": "^26.0.0", "babel-jest": "^26.0.0",
"concurrently": "^5.2.0", "concurrently": "^5.2.0",
"eslint": "^7.0.0", "eslint": "^7.0.0",
@ -105,7 +111,7 @@
"ts-jest": "^26.0.0", "ts-jest": "^26.0.0",
"ts-mockito": "^2.5.0", "ts-mockito": "^2.5.0",
"ts-node": "^8.10.1", "ts-node": "^8.10.1",
"typescript": "<3.9.0" "typescript": "4.9.5"
}, },
"husky": { "husky": {
"hooks": { "hooks": {

View File

@ -68,7 +68,7 @@ export class DateUtilitiesService {
parseInputDateToDateObject(inputDate: Date): Date { parseInputDateToDateObject(inputDate: Date): Date {
const boom = inputDate.toISOString().substring(0, 10).split('-'); const boom = inputDate.toISOString().substring(0, 10).split('-');
const converted = new Date(boom['0'], boom['1'] - 1, boom['2']); const converted = new Date(+boom['0'], +boom['1'] - 1, +boom['2']);
console.log('converted', converted); console.log('converted', converted);
return converted; return converted;
} }

View File

@ -1,6 +1,9 @@
import { ComponentType } from '@angular/cdk/portal'; import { ComponentType } from '@angular/cdk/portal';
import { Injectable, TemplateRef } from '@angular/core'; import { Injectable, TemplateRef } from '@angular/core';
import { MatDialog, MatDialogConfig } from '@angular/material/dialog'; import {
MatLegacyDialog as MatDialog,
MatLegacyDialogConfig as MatDialogConfig,
} from '@angular/material/legacy-dialog';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',

View File

@ -13,7 +13,7 @@ import { HttpClient } from '@angular/common/http';
import { environment } from '../../../environments/environment'; import { environment } from '../../../environments/environment';
import { StorageService } from './storage.service'; import { StorageService } from './storage.service';
import { Title } from '@angular/platform-browser'; import { Title } from '@angular/platform-browser';
import { FormArray, FormBuilder, FormGroup, Validators } from '@angular/forms'; import { UntypedFormArray, UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
import { DOCUMENT } from '@angular/common'; import { DOCUMENT } from '@angular/common';
import { DateChoice, TimeSlices } from '../models/dateChoice.model'; import { DateChoice, TimeSlices } from '../models/dateChoice.model';
@ -31,7 +31,7 @@ import { CommentDTO } from '../models/comment.model';
export class PollService implements Resolve<Poll> { export class PollService implements Resolve<Poll> {
public _poll: BehaviorSubject<Poll | undefined> = new BehaviorSubject<Poll | undefined>(undefined); public _poll: BehaviorSubject<Poll | undefined> = new BehaviorSubject<Poll | undefined>(undefined);
public readonly poll: Observable<Poll | undefined> = this._poll.asObservable(); public readonly poll: Observable<Poll | undefined> = this._poll.asObservable();
public form: FormGroup; public form: UntypedFormGroup;
public startDateInterval: string; public startDateInterval: string;
public endDateInterval: string; public endDateInterval: string;
public intervalDays: number = 1; public intervalDays: number = 1;
@ -68,7 +68,7 @@ export class PollService implements Resolve<Poll> {
private _clipboardService: ClipboardService, private _clipboardService: ClipboardService,
private translate: TranslateService, private translate: TranslateService,
@Inject(DOCUMENT) private document: any, @Inject(DOCUMENT) private document: any,
private fb: FormBuilder private fb: UntypedFormBuilder
) { ) {
this.createFormGroup(); this.createFormGroup();
@ -180,7 +180,7 @@ export class PollService implements Resolve<Poll> {
description: ['', []], description: ['', []],
password: ['', []], password: ['', []],
password_repeat: ['', []], password_repeat: ['', []],
choices: new FormArray([]), choices: new UntypedFormArray([]),
whoModifiesAnswers: ['self', [Validators.required]], whoModifiesAnswers: ['self', [Validators.required]],
whoCanChangeAnswers: ['self', [Validators.required]], whoCanChangeAnswers: ['self', [Validators.required]],
isAboutDate: [false, [Validators.required]], isAboutDate: [false, [Validators.required]],
@ -518,8 +518,8 @@ export class PollService implements Resolve<Poll> {
} }
} }
get choices(): FormArray { get choices(): UntypedFormArray {
return this.form.get('choices') as FormArray; return this.form.get('choices') as UntypedFormArray;
} }
reinitChoices(): void { reinitChoices(): void {
@ -547,7 +547,7 @@ export class PollService implements Resolve<Poll> {
* make a uniq slug for the current poll creation * make a uniq slug for the current poll creation
* @param form * @param form
*/ */
makeSlug(form: FormGroup): string { makeSlug(form: UntypedFormGroup): string {
let str = ''; let str = '';
str = str =
form.value.created_at.getFullYear() + form.value.created_at.getFullYear() +

View File

@ -1,5 +1,8 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; import {
MatLegacySnackBar as MatSnackBar,
MatLegacySnackBarConfig as MatSnackBarConfig,
} from '@angular/material/legacy-snack-bar';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',

View File

@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { PollService } from '../../../core/services/poll.service'; import { PollService } from '../../../core/services/poll.service';
import { ActivatedRoute, ParamMap, Router } from '@angular/router'; import { ActivatedRoute, ParamMap, Router } from '@angular/router';
import { ApiService } from '../../../core/services/api.service'; import { ApiService } from '../../../core/services/api.service';
import { FormGroup } from '@angular/forms'; import { UntypedFormGroup } from '@angular/forms';
import { Poll } from '../../../core/models/poll.model'; import { Poll } from '../../../core/models/poll.model';
@Component({ @Component({
@ -12,7 +12,7 @@ import { Poll } from '../../../core/models/poll.model';
}) })
export class AdminConsultationComponent implements OnInit { export class AdminConsultationComponent implements OnInit {
private admin_key: string; private admin_key: string;
public form: FormGroup; public form: UntypedFormGroup;
public poll: any; public poll: any;
constructor( constructor(

View File

@ -1,6 +1,6 @@
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { Poll } from '../../../../core/models/poll.model'; import { Poll } from '../../../../core/models/poll.model';
import { FormGroup } from '@angular/forms'; import { UntypedFormGroup } from '@angular/forms';
import { environment } from 'src/environments/environment'; import { environment } from 'src/environments/environment';
import { PollService } from '../../../../core/services/poll.service'; import { PollService } from '../../../../core/services/poll.service';
@ -16,7 +16,7 @@ export class AdvancedConfigComponent implements OnInit {
@Input() @Input()
public poll?: Poll; public poll?: Poll;
@Input() @Input()
public form: FormGroup; public form: UntypedFormGroup;
domain_url: string; domain_url: string;
display_regen_slug: boolean = environment.display_regen_slug; display_regen_slug: boolean = environment.display_regen_slug;
display_password_clear_button: boolean = environment.display_password_clear_button; display_password_clear_button: boolean = environment.display_password_clear_button;

View File

@ -1,6 +1,6 @@
import { ChangeDetectorRef, Component, Inject, Input } from '@angular/core'; import { ChangeDetectorRef, Component, Inject, Input } from '@angular/core';
import { ToastService } from '../../../../core/services/toast.service'; import { ToastService } from '../../../../core/services/toast.service';
import { FormBuilder, FormGroup } from '@angular/forms'; import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
import { UuidService } from '../../../../core/services/uuid.service'; import { UuidService } from '../../../../core/services/uuid.service';
import { PollService } from '../../../../core/services/poll.service'; import { PollService } from '../../../../core/services/poll.service';
import { ApiService } from '../../../../core/services/api.service'; import { ApiService } from '../../../../core/services/api.service';
@ -19,10 +19,10 @@ export class BaseConfigComponent {
@Input() @Input()
public poll?: Poll; public poll?: Poll;
@Input() @Input()
public form: FormGroup; public form: UntypedFormGroup;
constructor( constructor(
private fb: FormBuilder, private fb: UntypedFormBuilder,
private cd: ChangeDetectorRef, private cd: ChangeDetectorRef,
private uuidService: UuidService, private uuidService: UuidService,
private toastService: ToastService, private toastService: ToastService,

View File

@ -1,5 +1,5 @@
import { ChangeDetectorRef, Component, Inject, Input, OnInit } from '@angular/core'; import { ChangeDetectorRef, Component, Inject, Input, OnInit } from '@angular/core';
import { FormArray, FormBuilder, FormGroup, Validators } from '@angular/forms'; import { FormArray, UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
import { UuidService } from '../../../../core/services/uuid.service'; import { UuidService } from '../../../../core/services/uuid.service';
import { ToastService } from '../../../../core/services/toast.service'; import { ToastService } from '../../../../core/services/toast.service';
import { PollService } from '../../../../core/services/poll.service'; import { PollService } from '../../../../core/services/poll.service';
@ -20,7 +20,7 @@ import { environment } from '../../../../../environments/environment';
}) })
export class DateSelectComponent implements OnInit { export class DateSelectComponent implements OnInit {
@Input() @Input()
form: FormGroup; form: UntypedFormGroup;
displaySeveralHoursChoice = true; displaySeveralHoursChoice = true;
allowSeveralHours = true; allowSeveralHours = true;
@ -35,7 +35,7 @@ export class DateSelectComponent implements OnInit {
display: any; display: any;
constructor( constructor(
private fb: FormBuilder, private fb: UntypedFormBuilder,
private cd: ChangeDetectorRef, private cd: ChangeDetectorRef,
private uuidService: UuidService, private uuidService: UuidService,
private toastService: ToastService, private toastService: ToastService,

View File

@ -1,7 +1,7 @@
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { environment } from '../../../../../../environments/environment'; import { environment } from '../../../../../../environments/environment';
import { DateUtilitiesService } from '../../../../../core/services/date.utilities.service'; import { DateUtilitiesService } from '../../../../../core/services/date.utilities.service';
import { FormArray, FormGroup } from '@angular/forms'; import { UntypedFormArray, UntypedFormGroup } from '@angular/forms';
import { ToastService } from '../../../../../core/services/toast.service'; import { ToastService } from '../../../../../core/services/toast.service';
import { DateChoice } from '../../../../../../../mocks/old-stuff/config/defaultConfigs'; import { DateChoice } from '../../../../../../../mocks/old-stuff/config/defaultConfigs';
@ -12,7 +12,7 @@ import { DateChoice } from '../../../../../../../mocks/old-stuff/config/defaultC
}) })
export class IntervalComponent implements OnInit { export class IntervalComponent implements OnInit {
@Input() @Input()
public form: FormGroup; public form: UntypedFormGroup;
showDateInterval = true; showDateInterval = true;
intervalDays: any; intervalDays: any;
intervalDaysDefault = environment.interval_days_default; intervalDaysDefault = environment.interval_days_default;
@ -89,7 +89,7 @@ export class IntervalComponent implements OnInit {
} }
get dateChoices() { get dateChoices() {
return this.form.get('dateChoices') as FormArray; return this.form.get('dateChoices') as UntypedFormArray;
} }
/** /**

View File

@ -1,11 +1,10 @@
import { ChangeDetectorRef, Component, Inject, Input } from '@angular/core'; import { ChangeDetectorRef, Component, Inject, Input } from '@angular/core';
import { moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop'; import { moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop';
import { DOCUMENT } from '@angular/common'; import { DOCUMENT } from '@angular/common';
import { FormGroup } from '@angular/forms'; import { UntypedFormGroup } from '@angular/forms';
import { ToastService } from '../../../../../../core/services/toast.service'; import { ToastService } from '../../../../../../core/services/toast.service';
import { StorageService } from '../../../../../../core/services/storage.service'; import { StorageService } from '../../../../../../core/services/storage.service';
import { MatDialog } from '@angular/material/dialog'; import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog';
import { ShortcutsHelpComponent } from '../../../../../shared/components/ui/shortcuts-help/shortcuts-help.component';
import { DateChoice } from '../../../../../../core/models/dateChoice.model'; import { DateChoice } from '../../../../../../core/models/dateChoice.model';
import { PollService } from '../../../../../../core/services/poll.service'; import { PollService } from '../../../../../../core/services/poll.service';
import { DateUtilitiesService } from '../../../../../../core/services/date.utilities.service'; import { DateUtilitiesService } from '../../../../../../core/services/date.utilities.service';
@ -16,11 +15,10 @@ import { TranslateService } from '@ngx-translate/core';
selector: 'app-day-list', selector: 'app-day-list',
templateUrl: './day-list.component.html', templateUrl: './day-list.component.html',
styleUrls: ['./day-list.component.scss'], styleUrls: ['./day-list.component.scss'],
entryComponents: [ShortcutsHelpComponent],
}) })
export class DayListComponent { export class DayListComponent {
@Input() @Input()
form: FormGroup; form: UntypedFormGroup;
public dateChoices: DateChoice[] = []; public dateChoices: DateChoice[] = [];
@Input() @Input()
public hasSeveralHours: boolean; public hasSeveralHours: boolean;

View File

@ -15,7 +15,7 @@ export class TimeListComponent implements OnInit {
@Input() @Input()
public timeSlices: TimeSlices[]; public timeSlices: TimeSlices[];
@Input() @Input()
public prefix_choice_id = ''; public prefix_choice_id: number;
constructor( constructor(
@Inject(DOCUMENT) private document: any, @Inject(DOCUMENT) private document: any,

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms'; import { UntypedFormGroup } from '@angular/forms';
@Component({ @Component({
selector: 'app-picker', selector: 'app-picker',
@ -8,7 +8,7 @@ import { FormGroup } from '@angular/forms';
}) })
export class PickerComponent implements OnInit { export class PickerComponent implements OnInit {
@Input() @Input()
public form: FormGroup; public form: UntypedFormGroup;
selectionKind = 'multiple'; selectionKind = 'multiple';
dateCalendarEnum: any[]; dateCalendarEnum: any[];
today: Date = new Date(); today: Date = new Date();

View File

@ -1,6 +1,6 @@
import { ChangeDetectorRef, Component, Inject, Input, OnInit } from '@angular/core'; import { ChangeDetectorRef, Component, Inject, Input, OnInit } from '@angular/core';
import { Poll } from '../../../core/models/poll.model'; import { Poll } from '../../../core/models/poll.model';
import { FormArray, FormBuilder, FormGroup, Validators } from '@angular/forms'; import { FormArray, UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
import { UuidService } from '../../../core/services/uuid.service'; import { UuidService } from '../../../core/services/uuid.service';
import { ApiService } from '../../../core/services/api.service'; import { ApiService } from '../../../core/services/api.service';
import { ToastService } from '../../../core/services/toast.service'; import { ToastService } from '../../../core/services/toast.service';
@ -17,10 +17,10 @@ import { environment } from '../../../../environments/environment';
export class FormComponent implements OnInit { export class FormComponent implements OnInit {
@Input() @Input()
public poll?: Poll; public poll?: Poll;
public form: FormGroup; public form: UntypedFormGroup;
constructor( constructor(
private fb: FormBuilder, private fb: UntypedFormBuilder,
private cd: ChangeDetectorRef, private cd: ChangeDetectorRef,
private uuidService: UuidService, private uuidService: UuidService,
private toastService: ToastService, private toastService: ToastService,

View File

@ -1,6 +1,6 @@
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { Poll } from '../../../../core/models/poll.model'; import { Poll } from '../../../../core/models/poll.model';
import { FormGroup } from '@angular/forms'; import { UntypedFormGroup } from '@angular/forms';
@Component({ @Component({
selector: 'app-kind-select', selector: 'app-kind-select',
@ -12,7 +12,7 @@ export class KindSelectComponent implements OnInit {
@Input() @Input()
public poll?: Poll; public poll?: Poll;
@Input() @Input()
public form: FormGroup; public form: UntypedFormGroup;
constructor() {} constructor() {}

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms'; import { UntypedFormGroup } from '@angular/forms';
import { PollService } from '../../../../../core/services/poll.service'; import { PollService } from '../../../../../core/services/poll.service';
import { environment } from '../../../../../../environments/environment'; import { environment } from '../../../../../../environments/environment';
@ -10,7 +10,7 @@ import { environment } from '../../../../../../environments/environment';
}) })
export class StepFiveComponent implements OnInit { export class StepFiveComponent implements OnInit {
@Input() step_max: any; @Input() step_max: any;
@Input() public form: FormGroup; @Input() public form: UntypedFormGroup;
poll: any; poll: any;
public environment = environment; public environment = environment;
advancedDisplayEnabled = environment.advanced_options_display; advancedDisplayEnabled = environment.advanced_options_display;

View File

@ -1,5 +1,5 @@
import { Component, Inject, Input, OnInit } from '@angular/core'; import { Component, Inject, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms'; import { UntypedFormGroup } from '@angular/forms';
import { PollService } from '../../../../../core/services/poll.service'; import { PollService } from '../../../../../core/services/poll.service';
import { DOCUMENT } from '@angular/common'; import { DOCUMENT } from '@angular/common';
import { ConfirmationService } from 'primeng/api'; import { ConfirmationService } from 'primeng/api';
@ -16,7 +16,7 @@ export class StepOneComponent implements OnInit {
@Input() @Input()
step_max: any; step_max: any;
@Input() @Input()
form: FormGroup; form: UntypedFormGroup;
public environment = environment; public environment = environment;
constructor( constructor(

View File

@ -30,7 +30,7 @@
<!-- [minDate]="minDate"--> <!-- [minDate]="minDate"-->
<p-calendar <p-calendar
[(ngModel)]="pollService.calendar" [(ngModel)]="pollService.calendar"
firstDayOfWeek="1" [firstDayOfWeek]="1"
selectionMode="multiple" selectionMode="multiple"
inputId="multiple" inputId="multiple"
[showButtonBar]="true" [showButtonBar]="true"

View File

@ -1,5 +1,5 @@
import { ChangeDetectorRef, Component, Inject, Input, OnInit } from '@angular/core'; import { ChangeDetectorRef, Component, Inject, Input, OnInit } from '@angular/core';
import { FormArray, FormBuilder } from '@angular/forms'; import { UntypedFormArray, UntypedFormBuilder } from '@angular/forms';
import { DOCUMENT } from '@angular/common'; import { DOCUMENT } from '@angular/common';
import { CdkDragDrop } from '@angular/cdk/drag-drop'; import { CdkDragDrop } from '@angular/cdk/drag-drop';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
@ -31,7 +31,7 @@ export class StepTwoComponent implements OnInit {
intervalDays: any; intervalDays: any;
constructor( constructor(
private fb: FormBuilder, private fb: UntypedFormBuilder,
private cd: ChangeDetectorRef, private cd: ChangeDetectorRef,
private uuidService: UuidService, private uuidService: UuidService,
private toastService: ToastService, private toastService: ToastService,
@ -48,8 +48,8 @@ export class StepTwoComponent implements OnInit {
this.step_max = this.pollService.step_max; this.step_max = this.pollService.step_max;
} }
get choices(): FormArray { get choices(): UntypedFormArray {
return this.form.get('choices') as FormArray; return this.form.get('choices') as UntypedFormArray;
} }
addTime() {} addTime() {}

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms'; import { UntypedFormGroup } from '@angular/forms';
@Component({ @Component({
selector: 'app-text-select', selector: 'app-text-select',
@ -8,7 +8,7 @@ import { FormGroup } from '@angular/forms';
}) })
export class TextSelectComponent implements OnInit { export class TextSelectComponent implements OnInit {
@Input() @Input()
public form: FormGroup; public form: UntypedFormGroup;
public choices = []; public choices = [];
constructor() {} constructor() {}

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { MatDialogConfig } from '@angular/material/dialog'; import { MatLegacyDialogConfig as MatDialogConfig } from '@angular/material/legacy-dialog';
import { Answer } from '../../../core/enums/answer.enum'; import { Answer } from '../../../core/enums/answer.enum';
import { Choice } from '../../../core/models/choice.model'; import { Choice } from '../../../core/models/choice.model';

View File

@ -1,15 +1,17 @@
<div class="text-choices rounded-block" *ngIf="poll.kind == 'text'"> <div class="text-choices rounded-block" *ngIf="poll.kind == 'text'">
<div class="text-choice" *ngFor="let choice of poll.choices_grouped; index as ii"> <div class="text-choice" *ngFor="let choice_groupe of poll.choices_grouped; index as ii">
<div class="choice-label"> <div class="choice-label">
{{ choice.date_string }} {{ choice_groupe.date_string }}
</div> </div>
<div *ngFor="let choice of choice_groupe.choices">
<app-choice-table [choice]="choice" [detailledDisplay]="detailledDisplay"></app-choice-table> <app-choice-table [choice]="choice" [detailledDisplay]="detailledDisplay"></app-choice-table>
</div> </div>
</div>
</div> </div>
<div class="date-choices" *ngIf="poll.kind == 'date'"> <div class="date-choices" *ngIf="poll.kind == 'date'">
<div class="rounded-block" *ngFor="let group of poll.choices_grouped"> <div class="rounded-block" *ngFor="let group of poll.choices_grouped">
<div class="date-label"> <div class="date-label">
{{ showAsDate(group.date_string) | date: 'fullDate':'Europe/Paris' }} {{ showAsDate(group.date_string) | date : 'fullDate' : 'Europe/Paris' }}
</div> </div>
<div class="list-of-choices"> <div class="list-of-choices">
<div class="date-choices"> <div class="date-choices">

View File

@ -1,5 +1,5 @@
import { Component, Inject, Input, OnInit } from '@angular/core'; import { Component, Inject, Input, OnInit } from '@angular/core';
import { FormGroup, ValidationErrors } from '@angular/forms'; import { UntypedFormGroup, ValidationErrors } from '@angular/forms';
import { DOCUMENT } from '@angular/common'; import { DOCUMENT } from '@angular/common';
import { environment } from '../../../../../../../environments/environment'; import { environment } from '../../../../../../../environments/environment';
@ -9,7 +9,7 @@ import { environment } from '../../../../../../../environments/environment';
styleUrls: ['./errors-list.component.scss'], styleUrls: ['./errors-list.component.scss'],
}) })
export class ErrorsListComponent implements OnInit { export class ErrorsListComponent implements OnInit {
@Input() form: FormGroup; @Input() form: UntypedFormGroup;
public totalErrors = 0; public totalErrors = 0;
public firstErrorId = ''; public firstErrorId = '';
public messages = []; public messages = [];

View File

@ -1,5 +1,8 @@
import { Component, Inject, OnInit } from '@angular/core'; import { Component, Inject, OnInit } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import {
MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA,
MatLegacyDialogRef as MatDialogRef,
} from '@angular/material/legacy-dialog';
import { Answer } from '../../../core/enums/answer.enum'; import { Answer } from '../../../core/enums/answer.enum';
import { Choice } from '../../../core/models/choice.model'; import { Choice } from '../../../core/models/choice.model';

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { MatDialogRef } from '@angular/material/dialog'; import { MatLegacyDialogRef as MatDialogRef } from '@angular/material/legacy-dialog';
import { Subscription } from 'rxjs'; import { Subscription } from 'rxjs';
import { Owner } from '../../../core/models/owner.model'; import { Owner } from '../../../core/models/owner.model';

View File

@ -1,19 +1,19 @@
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button'; import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatLegacyCheckboxModule as MatCheckboxModule } from '@angular/material/legacy-checkbox';
import { MatDatepickerModule } from '@angular/material/datepicker'; import { MatDatepickerModule } from '@angular/material/datepicker';
import { MatDialogModule } from '@angular/material/dialog'; import { MatLegacyDialogModule as MatDialogModule } from '@angular/material/legacy-dialog';
import { MatFormFieldModule } from '@angular/material/form-field'; import { MatLegacyFormFieldModule as MatFormFieldModule } from '@angular/material/legacy-form-field';
import { MatInputModule } from '@angular/material/input'; import { MatLegacyInputModule as MatInputModule } from '@angular/material/legacy-input';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatLegacyProgressSpinnerModule as MatProgressSpinnerModule } from '@angular/material/legacy-progress-spinner';
import { MatSidenavModule } from '@angular/material/sidenav'; import { MatSidenavModule } from '@angular/material/sidenav';
import { MatSlideToggleModule } from '@angular/material/slide-toggle'; import { MatLegacySlideToggleModule as MatSlideToggleModule } from '@angular/material/legacy-slide-toggle';
import { MatSnackBarModule } from '@angular/material/snack-bar'; import { MatLegacySnackBarModule as MatSnackBarModule } from '@angular/material/legacy-snack-bar';
import { MatStepperModule } from '@angular/material/stepper'; import { MatStepperModule } from '@angular/material/stepper';
import { TranslateModule } from '@ngx-translate/core'; import { TranslateModule } from '@ngx-translate/core';
import { ChartsModule } from 'ng2-charts'; import { NgChartsModule } from 'ng2-charts';
import { ChoiceDetailsComponent } from './components/choice-details/choice-details.component'; import { ChoiceDetailsComponent } from './components/choice-details/choice-details.component';
import { CommentsComponent } from './components/comments/comments.component'; import { CommentsComponent } from './components/comments/comments.component';
@ -58,7 +58,7 @@ const COMPONENTS = [
FooterComponent, FooterComponent,
]; ];
const ANGULAR_MODULES = [CommonModule, ChartsModule, FormsModule, TranslateModule]; const ANGULAR_MODULES = [CommonModule, NgChartsModule, FormsModule, TranslateModule];
const MATERIAL_MODULES = [ const MATERIAL_MODULES = [
MatButtonModule, MatButtonModule,

View File

@ -11,7 +11,7 @@ import { poll_conf } from './poll_conf';
* This import should be commented out in production mode because it will have a negative impact * This import should be commented out in production mode because it will have a negative impact
* on performance if an error is thrown. * on performance if an error is thrown.
*/ */
import 'zone.js/dist/zone-error'; import 'zone.js/plugins/zone-error';
endpoints.baseHref = apiV1.baseHref; endpoints.baseHref = apiV1.baseHref;

View File

@ -22,16 +22,6 @@ import '@angular/localize/init';
* BROWSER POLYFILLS * BROWSER POLYFILLS
*/ */
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`.
/**
* Web Animations `@angular/platform-browser/animations`
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
*/
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
/** /**
* By default, zone.js will patch all possible macroTask and DomEvents * By default, zone.js will patch all possible macroTask and DomEvents
* user can disable parts of macroTask/DomEvents patch by setting following flags * user can disable parts of macroTask/DomEvents patch by setting following flags
@ -59,7 +49,7 @@ import '@angular/localize/init';
/*************************************************************************************************** /***************************************************************************************************
* Zone JS is required by default for Angular itself. * Zone JS is required by default for Angular itself.
*/ */
import 'zone.js/dist/zone'; // Included with Angular CLI. import 'zone.js'; // Included with Angular CLI.
/*************************************************************************************************** /***************************************************************************************************
* APPLICATION IMPORTS * APPLICATION IMPORTS

View File

@ -1,12 +1,21 @@
// Custom Theming for Angular Material // Custom Theming for Angular Material
@use '@angular/material' as mat;
// For more information: https://material.angular.io/guide/theming // For more information: https://material.angular.io/guide/theming
@import '~@angular/material/theming';
// Plus imports for other components in your app. // Plus imports for other components in your app.
// Include the common styles for Angular Material. We include this here so that you only // Include the common styles for Angular Material. We include this here so that you only
// have to load a single css file for Angular Material in your app. // have to load a single css file for Angular Material in your app.
// Be sure that you only ever include this mixin once! // Be sure that you only ever include this mixin once!
@include mat-core(); // TODO(v15): As of v15 mat.legacy-core no longer includes default typography styles.
// The following line adds:
// 1. Default typography styles for all components
// 2. Styles for typography hierarchy classes (e.g. .mat-headline-1)
// If you specify typography styles for the components you use elsewhere, you should delete this line.
// If you don't need the default component typographies but still want the hierarchy styles,
// you can delete this line and instead use:
// `@include mat.legacy-typography-hierarchy(mat.define-legacy-typography-config());`
@include mat.all-legacy-component-typographies();
@include mat.legacy-core();
// import your custom themes // import your custom themes
@import 'theme-light.scss'; @import 'theme-light.scss';
@ -14,13 +23,13 @@
@import 'theme-contrast.scss'; @import 'theme-contrast.scss';
.theme-light { .theme-light {
@include angular-material-theme($theme-light); @include mat.all-legacy-component-themes($theme-light);
} }
.theme-dark { .theme-dark {
@include angular-material-theme($theme-dark); @include mat.all-legacy-component-themes($theme-dark);
} }
.theme-contrast { .theme-contrast {
@include angular-material-theme($theme-contrast); @include mat.all-legacy-component-themes($theme-contrast);
} }
/* /*

View File

@ -1,6 +1,4 @@
///** //__<<ngThemingMigrationEscapedComment0>>__
//aimed for visual impaired people
// */
//$main-theme-color: #00003b; //$main-theme-color: #00003b;
//#big_container { //#big_container {
// &.theme-high-contrast { // &.theme-high-contrast {

View File

@ -1,16 +1,17 @@
// Define the palettes for your theme using the Material Design palettes available in palette.scss // Define the palettes for your theme using the Material Design palettes available in palette.scss
@use '@angular/material' as mat;
// (imported above). For each palette, you can optionally specify a default, lighter, and darker // (imported above). For each palette, you can optionally specify a default, lighter, and darker
// hue. Available color palettes: https://material.io/design/color/ // hue. Available color palettes: https://material.io/design/color/
$theme-contrast-primary: mat-palette($mat-indigo); $theme-contrast-primary: mat.define-palette(mat.$indigo-palette);
$theme-contrast-accent: mat-palette($mat-pink, A200, A100, A400); $theme-contrast-accent: mat.define-palette(mat.$pink-palette, A200, A100, A400);
// The warn palette is optional (defaults to red). // The warn palette is optional (defaults to red).
$theme-contrast-warn: mat-palette($mat-red); $theme-contrast-warn: mat.define-palette(mat.$red-palette);
// Create the theme object (a Sass map containing all of the palettes). // Create the theme object (a Sass map containing all of the palettes).
$theme-contrast: mat-light-theme($theme-contrast-primary, $theme-contrast-accent, $theme-contrast-warn); $theme-contrast: mat.define-light-theme($theme-contrast-primary, $theme-contrast-accent, $theme-contrast-warn);
// Include theme styles for core and each component used in your app. // Include theme styles for core and each component used in your app.
// Alternatively, you can import and @include the theme mixins for each component // Alternatively, you can import and @include the theme mixins for each component
// that you are using. // that you are using.
@include angular-material-theme($theme-contrast); @include mat.all-legacy-component-themes($theme-contrast);

View File

@ -1,16 +1,17 @@
// Define the palettes for your theme using the Material Design palettes available in palette.scss // Define the palettes for your theme using the Material Design palettes available in palette.scss
@use '@angular/material' as mat;
// (imported above). For each palette, you can optionally specify a default, lighter, and darker // (imported above). For each palette, you can optionally specify a default, lighter, and darker
// hue. Available color palettes: https://material.io/design/color/ // hue. Available color palettes: https://material.io/design/color/
$theme-dark-primary: mat-palette($mat-indigo); $theme-dark-primary: mat.define-palette(mat.$indigo-palette);
$theme-dark-accent: mat-palette($mat-pink, A200, A100, A400); $theme-dark-accent: mat.define-palette(mat.$pink-palette, A200, A100, A400);
// The warn palette is optional (defaults to red). // The warn palette is optional (defaults to red).
$theme-dark-warn: mat-palette($mat-red); $theme-dark-warn: mat.define-palette(mat.$red-palette);
// Create the theme object (a Sass map containing all of the palettes). // Create the theme object (a Sass map containing all of the palettes).
$theme-dark: mat-dark-theme($theme-dark-primary, $theme-dark-accent, $theme-dark-warn); $theme-dark: mat.define-dark-theme($theme-dark-primary, $theme-dark-accent, $theme-dark-warn);
// Include theme styles for core and each component used in your app. // Include theme styles for core and each component used in your app.
// Alternatively, you can import and @include the theme mixins for each component // Alternatively, you can import and @include the theme mixins for each component
// that you are using. // that you are using.
@include angular-material-theme($theme-dark); @include mat.all-legacy-component-themes($theme-dark);

View File

@ -1,16 +1,17 @@
// Define the palettes for your theme using the Material Design palettes available in palette.scss // Define the palettes for your theme using the Material Design palettes available in palette.scss
@use '@angular/material' as mat;
// (imported above). For each palette, you can optionally specify a default, lighter, and darker // (imported above). For each palette, you can optionally specify a default, lighter, and darker
// hue. Available color palettes: https://material.io/design/color/ // hue. Available color palettes: https://material.io/design/color/
$theme-light-primary: mat-palette($mat-indigo); $theme-light-primary: mat.define-palette(mat.$indigo-palette);
$theme-light-accent: mat-palette($mat-pink, A200, A100, A400); $theme-light-accent: mat.define-palette(mat.$pink-palette, A200, A100, A400);
// The warn palette is optional (defaults to red). // The warn palette is optional (defaults to red).
$theme-light-warn: mat-palette($mat-red); $theme-light-warn: mat.define-palette(mat.$red-palette);
// Create the theme object (a Sass map containing all of the palettes). // Create the theme object (a Sass map containing all of the palettes).
$theme-light: mat-light-theme($theme-light-primary, $theme-light-accent, $theme-light-warn); $theme-light: mat.define-light-theme($theme-light-primary, $theme-light-accent, $theme-light-warn);
// Include theme styles for core and each component used in your app. // Include theme styles for core and each component used in your app.
// Alternatively, you can import and @include the theme mixins for each component // Alternatively, you can import and @include the theme mixins for each component
// that you are using. // that you are using.
@include angular-material-theme($theme-light); @include mat.all-legacy-component-themes($theme-light);

View File

@ -7,12 +7,18 @@
"declaration": false, "declaration": false,
"downlevelIteration": true, "downlevelIteration": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"module": "ESNext", "module": "es2020",
"moduleResolution": "node", "moduleResolution": "node",
"importHelpers": true, "importHelpers": true,
"target": "ES5", "target": "ES2022",
"types": ["node", "jest"], "types": [
"typeRoots": ["node_modules/@types"] "node",
"jest"
],
"typeRoots": [
"node_modules/@types"
],
"useDefineForClassFields": false
}, },
"angularCompilerOptions": { "angularCompilerOptions": {
"fullTemplateTypeCheck": true, "fullTemplateTypeCheck": true,

13485
yarn.lock

File diff suppressed because it is too large Load Diff