Upgrade/angular 14 (#1853)

* Fix Loan product Payment Allocation

* Upgrade to Angular 14

---------

Co-authored-by: Jose Alberto Hernandez <alberto@blue-daemon.local>
This commit is contained in:
José Alberto Hernández
2023-08-29 19:51:32 -06:00
committed by GitHub
co-authored by Jose Alberto Hernandez
parent 2dab3b70ca
commit 80936a3ea9
336 changed files with 6657 additions and 5698 deletions
@@ -1,6 +1,6 @@
/** Angular Imports. */
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormGroup, Validators, UntypedFormControl } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { Dates } from 'app/core/utils/dates';
@@ -19,7 +19,7 @@ import { SettingsService } from 'app/settings/settings.service';
export class EditHolidayComponent implements OnInit {
/** Edit Holiday form. */
holidayForm: FormGroup;
holidayForm: UntypedFormGroup;
/** Holiday data. */
holidayData: any;
/** Rescheduling Type. */
@@ -39,7 +39,7 @@ export class EditHolidayComponent implements OnInit {
* @param {OrganizationService} organizatioService Organization Service.
* @param {Router} router Router.
*/
constructor(private formBuilder: FormBuilder,
constructor(private formBuilder: UntypedFormBuilder,
private route: ActivatedRoute,
private dateUtils: Dates,
private organizatioService: OrganizationService,
@@ -74,11 +74,11 @@ export class EditHolidayComponent implements OnInit {
'description': [this.holidayData.description]
});
if (!this.isActiveHoliday) {
this.holidayForm.addControl('fromDate', new FormControl(this.holidayData.fromDate && new Date(this.holidayData.fromDate), Validators.required));
this.holidayForm.addControl('toDate', new FormControl(this.holidayData.toDate && new Date(this.holidayData.toDate), Validators.required));
this.holidayForm.addControl('reschedulingType', new FormControl(this.holidayData.reschedulingType, Validators.required));
this.holidayForm.addControl('fromDate', new UntypedFormControl(this.holidayData.fromDate && new Date(this.holidayData.fromDate), Validators.required));
this.holidayForm.addControl('toDate', new UntypedFormControl(this.holidayData.toDate && new Date(this.holidayData.toDate), Validators.required));
this.holidayForm.addControl('reschedulingType', new UntypedFormControl(this.holidayData.reschedulingType, Validators.required));
if (this.reSchedulingType === 2) {
this.holidayForm.addControl('repaymentsRescheduledTo', new FormControl(this.holidayData.repaymentsRescheduledTo && new Date(this.holidayData.repaymentsRescheduledTo), Validators.required));
this.holidayForm.addControl('repaymentsRescheduledTo', new UntypedFormControl(this.holidayData.repaymentsRescheduledTo && new Date(this.holidayData.repaymentsRescheduledTo), Validators.required));
}
}
}
@@ -90,7 +90,7 @@ export class EditHolidayComponent implements OnInit {
this.holidayForm.get('reschedulingType').valueChanges.subscribe( (option: any) => {
this.reSchedulingType = option;
if (option === 2) {
this.holidayForm.addControl('repaymentsRescheduledTo', new FormControl(new Date(), Validators.required));
this.holidayForm.addControl('repaymentsRescheduledTo', new UntypedFormControl(new Date(), Validators.required));
} else {
this.holidayForm.removeControl('repaymentsRescheduledTo');
}