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,7 +1,7 @@
|
||||
/** Angular Imports. */
|
||||
import { SelectionModel } from '@angular/cdk/collections';
|
||||
import { Component, OnInit, ViewChild, Injectable } 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';
|
||||
import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree';
|
||||
@@ -26,7 +26,7 @@ import { CreateHoliday } from './create-holiday.service';
|
||||
export class CreateHolidayComponent implements OnInit {
|
||||
|
||||
/** Create Holiday form. */
|
||||
holidayForm: FormGroup;
|
||||
holidayForm: UntypedFormGroup;
|
||||
/** Repayment Scheduling data. */
|
||||
repaymentSchedulingTypes: any;
|
||||
/** Offices Data */
|
||||
@@ -73,7 +73,7 @@ export class CreateHolidayComponent implements OnInit {
|
||||
* @param {OrganizationService} organizationService Organization Service.
|
||||
* @param {Router} router Router.
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private dateUtils: Dates,
|
||||
private organizationService: OrganizationService,
|
||||
@@ -271,7 +271,7 @@ export class CreateHolidayComponent implements OnInit {
|
||||
buildDependencies() {
|
||||
this.holidayForm.get('reschedulingType').valueChanges.subscribe((option: any) => {
|
||||
if (option === 2) {
|
||||
this.holidayForm.addControl('repaymentsRescheduledTo', new FormControl('', Validators.required));
|
||||
this.holidayForm.addControl('repaymentsRescheduledTo', new UntypedFormControl('', Validators.required));
|
||||
} else {
|
||||
this.holidayForm.removeControl('repaymentsRescheduledTo');
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import { MatPaginator } from '@angular/material/paginator';
|
||||
import { MatSort } from '@angular/material/sort';
|
||||
import { MatTableDataSource } from '@angular/material/table';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { FormControl } from '@angular/forms';
|
||||
import { UntypedFormControl } from '@angular/forms';
|
||||
|
||||
/** rxjs Imports */
|
||||
import { of } from 'rxjs';
|
||||
@@ -25,7 +25,7 @@ import { ConfigurationWizardService } from '../../configuration-wizard/configura
|
||||
export class HolidaysComponent implements OnInit, AfterViewInit {
|
||||
|
||||
/** Office selector. */
|
||||
officeSelector = new FormControl();
|
||||
officeSelector = new UntypedFormControl();
|
||||
/** Holidays data. */
|
||||
holidaysData: any;
|
||||
/** Offices data. */
|
||||
|
||||
Reference in New Issue
Block a user