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:
co-authored by
Jose Alberto Hernandez
parent
2dab3b70ca
commit
80936a3ea9
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user