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,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { Datatables } from 'app/core/utils/datatables';
import { SettingsService } from 'app/settings/settings.service';
@@ -12,11 +12,11 @@ export class ClientDatatableStepComponent implements OnInit {
/** Input Fields Data */
@Input() datatableData: any;
/** Create Input Form */
datatableForm: FormGroup;
datatableForm: UntypedFormGroup;
datatableInputs: any = [];
constructor(private formBuilder: FormBuilder,
constructor(private formBuilder: UntypedFormBuilder,
private settingsService: SettingsService,
private datatableService: Datatables) { }
@@ -27,12 +27,12 @@ export class ClientDatatableStepComponent implements OnInit {
input.controlName = this.getInputName(input);
if (!input.isColumnNullable) {
if (this.isNumeric(input.columnDisplayType)) {
inputItems[input.controlName] = new FormControl(0, [Validators.required]);
inputItems[input.controlName] = new UntypedFormControl(0, [Validators.required]);
} else {
inputItems[input.controlName] = new FormControl('', [Validators.required]);
inputItems[input.controlName] = new UntypedFormControl('', [Validators.required]);
}
} else {
inputItems[input.controlName] = new FormControl('');
inputItems[input.controlName] = new UntypedFormControl('');
}
});
this.datatableForm = this.formBuilder.group(inputItems);
@@ -1,7 +1,7 @@
/** Angular Imports */
import { Component, OnInit, Inject } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
import { UntypedFormGroup, UntypedFormBuilder, Validators } from '@angular/forms';
/** Custom Services */
import { SettingsService } from 'app/settings/settings.service';
@@ -21,7 +21,7 @@ export class ClientFamilyMemberDialogComponent implements OnInit {
maxDate = new Date();
/** Add/Edit family member form. */
familyMemberForm: FormGroup;
familyMemberForm: UntypedFormGroup;
/**
* @param {MatDialogRef} dialogRef Client Family Member Dialog Reference
@@ -31,7 +31,7 @@ export class ClientFamilyMemberDialogComponent implements OnInit {
* @param {SettingsService} settingsService Setting service
*/
constructor(public dialogRef: MatDialogRef<ClientFamilyMemberDialogComponent>,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private dateUtils: Dates,
@Inject(MAT_DIALOG_DATA) public data: any,
private settingsService: SettingsService) { }
@@ -1,6 +1,6 @@
/** Angular Imports */
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormGroup, Validators, UntypedFormControl } from '@angular/forms';
import { ClientsService } from 'app/clients/clients.service';
import { Dates } from 'app/core/utils/dates';
@@ -27,7 +27,7 @@ export class ClientGeneralStepComponent implements OnInit {
/** Client Template */
@Input() clientTemplate: any;
/** Create Client Form */
createClientForm: FormGroup;
createClientForm: UntypedFormGroup;
/** Office Options */
officeOptions: any;
@@ -54,7 +54,7 @@ export class ClientGeneralStepComponent implements OnInit {
* @param {SettingsService} settingsService Setting service
* @param {ClientsService} clientService Client service
*/
constructor(private formBuilder: FormBuilder,
constructor(private formBuilder: UntypedFormBuilder,
private dateUtils: Dates,
private settingsService: SettingsService,
private clientService: ClientsService) {
@@ -114,14 +114,14 @@ export class ClientGeneralStepComponent implements OnInit {
if (legalFormId === 1) {
this.createClientForm.removeControl('fullname');
this.createClientForm.removeControl('clientNonPersonDetails');
this.createClientForm.addControl('firstname', new FormControl('', [Validators.required, Validators.pattern('(^[A-z]).*')]));
this.createClientForm.addControl('middlename', new FormControl('', Validators.pattern('(^[A-z]).*')));
this.createClientForm.addControl('lastname', new FormControl('', [Validators.required, Validators.pattern('(^[A-z]).*')]));
this.createClientForm.addControl('firstname', new UntypedFormControl('', [Validators.required, Validators.pattern('(^[A-z]).*')]));
this.createClientForm.addControl('middlename', new UntypedFormControl('', Validators.pattern('(^[A-z]).*')));
this.createClientForm.addControl('lastname', new UntypedFormControl('', [Validators.required, Validators.pattern('(^[A-z]).*')]));
} else {
this.createClientForm.removeControl('firstname');
this.createClientForm.removeControl('middlename');
this.createClientForm.removeControl('lastname');
this.createClientForm.addControl('fullname', new FormControl('', [Validators.required, Validators.pattern('(^[A-z]).*')]));
this.createClientForm.addControl('fullname', new UntypedFormControl('', [Validators.required, Validators.pattern('(^[A-z]).*')]));
this.createClientForm.addControl('clientNonPersonDetails', this.formBuilder.group({
'constitutionId': ['', Validators.required],
'incorpValidityTillDate': [''],
@@ -134,14 +134,14 @@ export class ClientGeneralStepComponent implements OnInit {
this.createClientForm.get('legalFormId').patchValue(1);
this.createClientForm.get('active').valueChanges.subscribe((active: boolean) => {
if (active) {
this.createClientForm.addControl('activationDate', new FormControl('', Validators.required));
this.createClientForm.addControl('activationDate', new UntypedFormControl('', Validators.required));
} else {
this.createClientForm.removeControl('activationDate');
}
});
this.createClientForm.get('addSavings').valueChanges.subscribe((active: boolean) => {
if (active) {
this.createClientForm.addControl('savingsProductId', new FormControl('', Validators.required));
this.createClientForm.addControl('savingsProductId', new UntypedFormControl('', Validators.required));
} else {
this.createClientForm.removeControl('savingsProductId');
}