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
# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage

View File

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

View File

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

View File

@ -1,138 +1,144 @@
{
"name": "framadate-funky-frontend",
"version": "0.6.0",
"license": "AGPL-3.0-or-later",
"engines": {
"node": ">= 16.0.0"
},
"scripts": {
"ng": "ng",
"start": "ng serve",
"start_docker": "ng serve --host 0.0.0.0",
"build:prod": "ng build --prod",
"build:prod:stats": "ng build --prod --stats-json",
"build:prod:gitlabpage": "ng build --prod --baseHref=/framadate/funky-framadate-front/",
"build:prod:demobliss": "ng build --prod --baseHref=https://framadate-api.cipherbliss.com --stats-json ",
"test": "jest",
"test:watch": "jest --watch",
"test:ci": "jest --ci",
"lint": "prettier --write \"src/**/*.{js,jsx,ts,tsx,md,html,css,scss}\"",
"e2e": "ng e2e",
"release:major": "changelog -M && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version major && git push origin && git push origin --tags",
"release:minor": "changelog -m && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version minor && git push origin && git push origin --tags",
"release:patch": "changelog -p && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version patch && git push origin && git push origin --tags",
"format:check": "prettier --list-different \"src/{app,environments,assets}/**/*{.ts,.js,.json,.css,.scss}\"",
"format:all": "prettier --write \"src/**/*.{js,jsx,ts,tsx,md,html,css,scss}\"",
"trans": "ng xi18n --output-path=src/locale --i18n-locale=fr",
"compodoc": "compodoc -p tsconfig.app.json",
"mock:server": "json-server --port 8000 --watch ./mocks/db.json --routes ./mocks/routes.json",
"start:proxy": "ng serve --proxy-config proxy.conf.json",
"start:proxymock": "concurrently --kill-others \"yarn mock:server\" \"yarn start:proxy\"",
"i18n:init": "ngx-translate-extract --input ./src --output ./src/assets/i18n/template.json --key-as-default-value --replace --format json",
"i18n:extract": "ngx-translate-extract --input ./src --output ./src/assets/i18n/{en,da,de,fi,nb,nl,sv}.json --clean --format json"
},
"private": false,
"dependencies": {
"@angular/animations": "^9.1.1",
"@angular/cdk": "^9.2.2",
"@angular/common": "^9.0.7",
"@angular/compiler": "^9.0.7",
"@angular/core": "^9.0.7",
"@angular/forms": "^9.0.7",
"@angular/localize": "^9.1.1",
"@angular/material": "^9.2.4",
"@angular/platform-browser": "^9.0.7",
"@angular/platform-browser-dynamic": "^9.0.7",
"@angular/router": "^9.0.7",
"@biesbjerg/ngx-translate-extract": "^7.0.3",
"@biesbjerg/ngx-translate-po-http-loader": "^3.1.0",
"@fullcalendar/core": "^4.4.0",
"@ngx-translate/core": "^12.1.2",
"@ngx-translate/http-loader": "^5.0.0",
"angular-date-value-accessor": "^1.0.2",
"axios": "^0.19.2",
"bulma": "^0.9.0",
"bulma-switch": "^2.0.0",
"chart.js": "^2.9.3",
"crypto": "^1.0.1",
"crypto-js": "^4.0.0",
"feather-icons": "^4.28.0",
"fork-awesome": "^1.1.7",
"ng-keyboard-shortcuts": "^10.1.17",
"ng2-charts": "^2.3.0",
"ngx-clipboard": "^13.0.0",
"ngx-markdown": "^9.0.0",
"ngx-webstorage": "^5.0.0",
"node-forge": "^0.10.0",
"primeicons": "^5.0.0",
"primeng": "^11.0.0",
"quill": "^1.3.7",
"rxjs": "^6.5.5",
"rxjs-compat": "^6.5.5",
"short-unique-id": "^3.0.3",
"stream": "^0.0.2",
"tslib": "<2.0.0",
"zone.js": "^0.10.3"
},
"devDependencies": {
"@angular-builders/jest": "^9.0.1",
"@angular-devkit/build-angular": "^0.901.2",
"@angular/cli": "^9.1.2",
"@angular/compiler-cli": "^9.1.1",
"@angular/language-service": "^9.0.7",
"@babel/core": "^7.9.0",
"@babel/preset-env": "^7.9.5",
"@babel/preset-typescript": "^7.9.0",
"@compodoc/compodoc": "^1.1.11",
"@types/crypto-js": "^4.0.0",
"@types/jest": "^26.0.0",
"@types/node": "^14.0.1",
"@typescript-eslint/eslint-plugin": "^3.0.0",
"@typescript-eslint/parser": "^3.0.0",
"babel-jest": "^26.0.0",
"concurrently": "^5.2.0",
"eslint": "^7.0.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.3",
"husky": "^4.2.5",
"jest": "^26.0.0",
"jest-environment-jsdom-sixteen": "^1.0.3",
"jest-preset-angular": "^8.1.3",
"json-server": "^0.16.1",
"lint-staged": "^10.1.7",
"prettier": "^2.0.5",
"protractor": "~7.0.0",
"ts-jest": "^26.0.0",
"ts-mockito": "^2.5.0",
"ts-node": "^8.10.1",
"typescript": "<3.9.0"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"src/**/*.{js,jsx,ts,tsx,md,html,css,scss}": [
"prettier --write",
"git add"
],
"*.js": [
"prettier --write"
]
},
"jest": {
"preset": "jest-preset-angular",
"setupFilesAfterEnv": [
"<rootDir>/src/jest.setup.ts"
],
"testEnvironment": "jest-environment-jsdom-sixteen",
"transform": {
"^.+\\.(ts|html)$": "ts-jest",
"^.+\\.jsx?$": "babel-jest"
}
},
"browser": {
"name": "framadate-funky-frontend",
"version": "0.6.0",
"license": "AGPL-3.0-or-later",
"engines": {
"node": ">= 16.13.0"
},
"resolutions": {
"webpack": "^5.0.0"
},
"scripts": {
"ng": "ng",
"start": "ng serve",
"start_docker": "ng serve --host 0.0.0.0",
"build:prod": "ng build --configuration production",
"build:prod:stats": "ng build --configuration production --stats-json",
"build:prod:gitlabpage": "ng build --configuration production --baseHref=/framadate/funky-framadate-front/",
"build:prod:demobliss": "ng build --configuration production --baseHref=https://framadate-api.cipherbliss.com --stats-json ",
"test": "jest",
"test:watch": "jest --watch",
"test:ci": "jest --ci",
"lint": "prettier --write \"src/**/*.{js,jsx,ts,tsx,md,html,css,scss}\"",
"e2e": "ng e2e",
"release:major": "changelog -M && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version major && git push origin && git push origin --tags",
"release:minor": "changelog -m && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version minor && git push origin && git push origin --tags",
"release:patch": "changelog -p && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version patch && git push origin && git push origin --tags",
"format:check": "prettier --list-different \"src/{app,environments,assets}/**/*{.ts,.js,.json,.css,.scss}\"",
"format:all": "prettier --write \"src/**/*.{js,jsx,ts,tsx,md,html,css,scss}\"",
"trans": "ng xi18n --output-path=src/locale --i18n-locale=fr",
"compodoc": "compodoc -p tsconfig.app.json",
"mock:server": "json-server --port 8000 --watch ./mocks/db.json --routes ./mocks/routes.json",
"start:proxy": "ng serve --proxy-config proxy.conf.json",
"start:proxymock": "concurrently --kill-others \"yarn mock:server\" \"yarn start:proxy\"",
"i18n:init": "ngx-translate-extract --input ./src --output ./src/assets/i18n/template.json --key-as-default-value --replace --format json",
"i18n:extract": "ngx-translate-extract --input ./src --output ./src/assets/i18n/{en,da,de,fi,nb,nl,sv}.json --clean --format json"
},
"private": false,
"dependencies": {
"@angular/animations": "^15.2.2",
"@angular/cdk": "^15.2.2",
"@angular/common": "^15.2.2",
"@angular/compiler": "^15.2.2",
"@angular/core": "^15.2.2",
"@angular/forms": "^15.2.2",
"@angular/localize": "^15.2.2",
"@angular/material": "^15.2.2",
"@angular/platform-browser": "^15.2.2",
"@angular/platform-browser-dynamic": "^15.2.2",
"@angular/router": "^15.2.2",
"@fullcalendar/core": "^6.1.4",
"@ngx-translate/core": "^14.0.0",
"@ngx-translate/http-loader": "^7.0.0",
"angular-date-value-accessor": "^3.0.0",
"axios": "^1.3.4",
"bulma": "^0.9.0",
"bulma-switch": "^2.0.0",
"chart.js": "^4.2.1",
"crypto": "^1.0.1",
"crypto-js": "^4.0.0",
"feather-icons": "^4.28.0",
"fork-awesome": "^1.1.7",
"marked": "^4.2.12",
"moment": "^2.29.4",
"ng-keyboard-shortcuts": "^13.0.8",
"ng2-charts": "^4.1.1",
"ngx-clipboard": "^15.1.0",
"ngx-markdown": "^15.1.2",
"ngx-webstorage": "^11.1.1",
"node-forge": "^0.10.0",
"primeicons": "^6.0.1",
"primeng": "^15.2.0",
"prismjs": "^1.29.0",
"quill": "^1.3.7",
"rxjs": "^6.5.5",
"rxjs-compat": "^6.5.5",
"short-unique-id": "^3.0.3",
"stream": "^0.0.2",
"tslib": "^2.0.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-builders/jest": "^9.0.1",
"@angular-devkit/build-angular": "^15.2.3",
"@angular/cli": "^15.2.3",
"@angular/compiler-cli": "^15.2.2",
"@angular/language-service": "^15.2.2",
"@babel/core": "^7.9.0",
"@babel/preset-env": "^7.9.5",
"@babel/preset-typescript": "^7.9.0",
"@compodoc/compodoc": "^1.1.11",
"@types/crypto-js": "^4.0.0",
"@types/jest": "^26.0.0",
"@types/marked": "^4.0.8",
"@types/node": "^14.0.1",
"@typescript-eslint/eslint-plugin": "^3.0.0",
"@typescript-eslint/parser": "^3.0.0",
"@vendure/ngx-translate-extract": "^8.1.0",
"babel-jest": "^26.0.0",
"concurrently": "^5.2.0",
"eslint": "^7.0.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.3",
"husky": "^4.2.5",
"jest": "^26.0.0",
"jest-environment-jsdom-sixteen": "^1.0.3",
"jest-preset-angular": "^8.1.3",
"json-server": "^0.16.1",
"lint-staged": "^10.1.7",
"prettier": "^2.0.5",
"protractor": "~7.0.0",
"ts-jest": "^26.0.0",
"ts-mockito": "^2.5.0",
"ts-node": "^8.10.1",
"typescript": "4.9.5"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"src/**/*.{js,jsx,ts,tsx,md,html,css,scss}": [
"prettier --write",
"git add"
],
"*.js": [
"prettier --write"
]
},
"jest": {
"preset": "jest-preset-angular",
"setupFilesAfterEnv": [
"<rootDir>/src/jest.setup.ts"
],
"testEnvironment": "jest-environment-jsdom-sixteen",
"transform": {
"^.+\\.(ts|html)$": "ts-jest",
"^.+\\.jsx?$": "babel-jest"
}
},
"browser": {
"crypto": false
}
}
}
}

View File

@ -68,7 +68,7 @@ export class DateUtilitiesService {
parseInputDateToDateObject(inputDate: Date): Date {
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);
return converted;
}

View File

@ -1,6 +1,9 @@
import { ComponentType } from '@angular/cdk/portal';
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({
providedIn: 'root',

View File

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

View File

@ -1,5 +1,8 @@
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({
providedIn: 'root',

View File

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

View File

@ -1,6 +1,6 @@
import { Component, Input, OnInit } from '@angular/core';
import { Poll } from '../../../../core/models/poll.model';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { environment } from 'src/environments/environment';
import { PollService } from '../../../../core/services/poll.service';
@ -16,7 +16,7 @@ export class AdvancedConfigComponent implements OnInit {
@Input()
public poll?: Poll;
@Input()
public form: FormGroup;
public form: UntypedFormGroup;
domain_url: string;
display_regen_slug: boolean = environment.display_regen_slug;
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 { 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 { PollService } from '../../../../core/services/poll.service';
import { ApiService } from '../../../../core/services/api.service';
@ -19,10 +19,10 @@ export class BaseConfigComponent {
@Input()
public poll?: Poll;
@Input()
public form: FormGroup;
public form: UntypedFormGroup;
constructor(
private fb: FormBuilder,
private fb: UntypedFormBuilder,
private cd: ChangeDetectorRef,
private uuidService: UuidService,
private toastService: ToastService,

View File

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

View File

@ -1,7 +1,7 @@
import { Component, Input, OnInit } from '@angular/core';
import { environment } from '../../../../../../environments/environment';
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 { DateChoice } from '../../../../../../../mocks/old-stuff/config/defaultConfigs';
@ -12,7 +12,7 @@ import { DateChoice } from '../../../../../../../mocks/old-stuff/config/defaultC
})
export class IntervalComponent implements OnInit {
@Input()
public form: FormGroup;
public form: UntypedFormGroup;
showDateInterval = true;
intervalDays: any;
intervalDaysDefault = environment.interval_days_default;
@ -89,7 +89,7 @@ export class IntervalComponent implements OnInit {
}
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 { moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop';
import { DOCUMENT } from '@angular/common';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { ToastService } from '../../../../../../core/services/toast.service';
import { StorageService } from '../../../../../../core/services/storage.service';
import { MatDialog } from '@angular/material/dialog';
import { ShortcutsHelpComponent } from '../../../../../shared/components/ui/shortcuts-help/shortcuts-help.component';
import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog';
import { DateChoice } from '../../../../../../core/models/dateChoice.model';
import { PollService } from '../../../../../../core/services/poll.service';
import { DateUtilitiesService } from '../../../../../../core/services/date.utilities.service';
@ -16,11 +15,10 @@ import { TranslateService } from '@ngx-translate/core';
selector: 'app-day-list',
templateUrl: './day-list.component.html',
styleUrls: ['./day-list.component.scss'],
entryComponents: [ShortcutsHelpComponent],
})
export class DayListComponent {
@Input()
form: FormGroup;
form: UntypedFormGroup;
public dateChoices: DateChoice[] = [];
@Input()
public hasSeveralHours: boolean;

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
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 { environment } from '../../../../../../environments/environment';
@ -10,7 +10,7 @@ import { environment } from '../../../../../../environments/environment';
})
export class StepFiveComponent implements OnInit {
@Input() step_max: any;
@Input() public form: FormGroup;
@Input() public form: UntypedFormGroup;
poll: any;
public environment = environment;
advancedDisplayEnabled = environment.advanced_options_display;

View File

@ -1,5 +1,5 @@
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 { DOCUMENT } from '@angular/common';
import { ConfirmationService } from 'primeng/api';
@ -16,7 +16,7 @@ export class StepOneComponent implements OnInit {
@Input()
step_max: any;
@Input()
form: FormGroup;
form: UntypedFormGroup;
public environment = environment;
constructor(

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
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 { 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-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">
{{ choice.date_string }}
{{ choice_groupe.date_string }}
</div>
<div *ngFor="let choice of choice_groupe.choices">
<app-choice-table [choice]="choice" [detailledDisplay]="detailledDisplay"></app-choice-table>
</div>
<app-choice-table [choice]="choice" [detailledDisplay]="detailledDisplay"></app-choice-table>
</div>
</div>
<div class="date-choices" *ngIf="poll.kind == 'date'">
<div class="rounded-block" *ngFor="let group of poll.choices_grouped">
<div class="date-label">
{{ showAsDate(group.date_string) | date: 'fullDate':'Europe/Paris' }}
{{ showAsDate(group.date_string) | date : 'fullDate' : 'Europe/Paris' }}
</div>
<div class="list-of-choices">
<div class="date-choices">

View File

@ -1,5 +1,5 @@
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 { environment } from '../../../../../../../environments/environment';
@ -9,7 +9,7 @@ import { environment } from '../../../../../../../environments/environment';
styleUrls: ['./errors-list.component.scss'],
})
export class ErrorsListComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
public totalErrors = 0;
public firstErrorId = '';
public messages = [];

View File

@ -1,5 +1,8 @@
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 { Choice } from '../../../core/models/choice.model';

View File

@ -1,5 +1,5 @@
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 { Owner } from '../../../core/models/owner.model';

View File

@ -1,19 +1,19 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MatCheckboxModule } from '@angular/material/checkbox';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatLegacyCheckboxModule as MatCheckboxModule } from '@angular/material/legacy-checkbox';
import { MatDatepickerModule } from '@angular/material/datepicker';
import { MatDialogModule } from '@angular/material/dialog';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import { MatLegacyDialogModule as MatDialogModule } from '@angular/material/legacy-dialog';
import { MatLegacyFormFieldModule as MatFormFieldModule } from '@angular/material/legacy-form-field';
import { MatLegacyInputModule as MatInputModule } from '@angular/material/legacy-input';
import { MatLegacyProgressSpinnerModule as MatProgressSpinnerModule } from '@angular/material/legacy-progress-spinner';
import { MatSidenavModule } from '@angular/material/sidenav';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { MatLegacySlideToggleModule as MatSlideToggleModule } from '@angular/material/legacy-slide-toggle';
import { MatLegacySnackBarModule as MatSnackBarModule } from '@angular/material/legacy-snack-bar';
import { MatStepperModule } from '@angular/material/stepper';
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 { CommentsComponent } from './components/comments/comments.component';
@ -58,7 +58,7 @@ const COMPONENTS = [
FooterComponent,
];
const ANGULAR_MODULES = [CommonModule, ChartsModule, FormsModule, TranslateModule];
const ANGULAR_MODULES = [CommonModule, NgChartsModule, FormsModule, TranslateModule];
const MATERIAL_MODULES = [
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
* on performance if an error is thrown.
*/
import 'zone.js/dist/zone-error';
import 'zone.js/plugins/zone-error';
endpoints.baseHref = apiV1.baseHref;

View File

@ -22,16 +22,6 @@ import '@angular/localize/init';
* 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
* 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.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.
import 'zone.js'; // Included with Angular CLI.
/***************************************************************************************************
* APPLICATION IMPORTS

View File

@ -1,12 +1,21 @@
// Custom Theming for Angular Material
@use '@angular/material' as mat;
// For more information: https://material.angular.io/guide/theming
@import '~@angular/material/theming';
// Plus imports for other components in your app.
// 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.
// 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 'theme-light.scss';
@ -14,13 +23,13 @@
@import 'theme-contrast.scss';
.theme-light {
@include angular-material-theme($theme-light);
@include mat.all-legacy-component-themes($theme-light);
}
.theme-dark {
@include angular-material-theme($theme-dark);
@include mat.all-legacy-component-themes($theme-dark);
}
.theme-contrast {
@include angular-material-theme($theme-contrast);
@include mat.all-legacy-component-themes($theme-contrast);
}
/*

View File

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

View File

@ -1,16 +1,17 @@
// 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
// hue. Available color palettes: https://material.io/design/color/
$theme-contrast-primary: mat-palette($mat-indigo);
$theme-contrast-accent: mat-palette($mat-pink, A200, A100, A400);
$theme-contrast-primary: mat.define-palette(mat.$indigo-palette);
$theme-contrast-accent: mat.define-palette(mat.$pink-palette, A200, A100, A400);
// 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).
$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.
// Alternatively, you can import and @include the theme mixins for each component
// 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
@use '@angular/material' as mat;
// (imported above). For each palette, you can optionally specify a default, lighter, and darker
// hue. Available color palettes: https://material.io/design/color/
$theme-dark-primary: mat-palette($mat-indigo);
$theme-dark-accent: mat-palette($mat-pink, A200, A100, A400);
$theme-dark-primary: mat.define-palette(mat.$indigo-palette);
$theme-dark-accent: mat.define-palette(mat.$pink-palette, A200, A100, A400);
// 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).
$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.
// Alternatively, you can import and @include the theme mixins for each component
// 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
@use '@angular/material' as mat;
// (imported above). For each palette, you can optionally specify a default, lighter, and darker
// hue. Available color palettes: https://material.io/design/color/
$theme-light-primary: mat-palette($mat-indigo);
$theme-light-accent: mat-palette($mat-pink, A200, A100, A400);
$theme-light-primary: mat.define-palette(mat.$indigo-palette);
$theme-light-accent: mat.define-palette(mat.$pink-palette, A200, A100, A400);
// 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).
$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.
// Alternatively, you can import and @include the theme mixins for each component
// that you are using.
@include angular-material-theme($theme-light);
@include mat.all-legacy-component-themes($theme-light);

View File

@ -1,19 +1,25 @@
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"module": "ESNext",
"moduleResolution": "node",
"importHelpers": true,
"target": "ES5",
"types": ["node", "jest"],
"typeRoots": ["node_modules/@types"]
},
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"module": "es2020",
"moduleResolution": "node",
"importHelpers": true,
"target": "ES2022",
"types": [
"node",
"jest"
],
"typeRoots": [
"node_modules/@types"
],
"useDefineForClassFields": false
},
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,

13485
yarn.lock

File diff suppressed because it is too large Load Diff