upgrade ng 13 to 14: update core packages

This commit is contained in:
bmartins 2023-03-15 15:48:10 +01:00
parent 9e82a9fbea
commit 283c278eac
19 changed files with 1148 additions and 1159 deletions

View File

@ -117,7 +117,6 @@
} }
} }
}, },
"defaultProject": "framadate",
"cli": { "cli": {
"analytics": "0ba9c0a9-850f-4c5f-8124-cbe6f4c79ef1" "analytics": "0ba9c0a9-850f-4c5f-8124-cbe6f4c79ef1"
} }

View File

@ -36,17 +36,17 @@
}, },
"private": false, "private": false,
"dependencies": { "dependencies": {
"@angular/animations": "^13.3.12", "@angular/animations": "^14.3.0",
"@angular/cdk": "^13.3.9", "@angular/cdk": "^13.3.9",
"@angular/common": "^13.3.12", "@angular/common": "^14.3.0",
"@angular/compiler": "^13.3.12", "@angular/compiler": "^14.3.0",
"@angular/core": "^13.3.12", "@angular/core": "^14.3.0",
"@angular/forms": "^13.3.12", "@angular/forms": "^14.3.0",
"@angular/localize": "^13.3.12", "@angular/localize": "^14.3.0",
"@angular/material": "^13.3.9", "@angular/material": "^13.3.9",
"@angular/platform-browser": "^13.3.12", "@angular/platform-browser": "^14.3.0",
"@angular/platform-browser-dynamic": "^13.3.12", "@angular/platform-browser-dynamic": "^14.3.0",
"@angular/router": "^13.3.12", "@angular/router": "^14.3.0",
"@biesbjerg/ngx-translate-extract": "^7.0.3", "@biesbjerg/ngx-translate-extract": "^7.0.3",
"@biesbjerg/ngx-translate-po-http-loader": "^3.1.0", "@biesbjerg/ngx-translate-po-http-loader": "^3.1.0",
"@fullcalendar/core": "^4.4.0", "@fullcalendar/core": "^4.4.0",
@ -79,10 +79,10 @@
}, },
"devDependencies": { "devDependencies": {
"@angular-builders/jest": "^9.0.1", "@angular-builders/jest": "^9.0.1",
"@angular-devkit/build-angular": "^13.3.10", "@angular-devkit/build-angular": "^14.2.10",
"@angular/cli": "^13.3.10", "@angular/cli": "^14.2.10",
"@angular/compiler-cli": "^13.3.12", "@angular/compiler-cli": "^14.3.0",
"@angular/language-service": "^13.3.12", "@angular/language-service": "^14.3.0",
"@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",

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

@ -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,7 +1,7 @@
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 { MatDialog } from '@angular/material/dialog';
@ -18,7 +18,7 @@ import { TranslateService } from '@ngx-translate/core';
}) })
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

@ -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

@ -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, 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

@ -10,7 +10,7 @@
"module": "es2020", "module": "es2020",
"moduleResolution": "node", "moduleResolution": "node",
"importHelpers": true, "importHelpers": true,
"target": "ES5", "target": "es2020",
"types": ["node", "jest"], "types": ["node", "jest"],
"typeRoots": ["node_modules/@types"] "typeRoots": ["node_modules/@types"]
}, },

2194
yarn.lock

File diff suppressed because it is too large Load Diff