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
+2
-2
@@ -1,6 +1,6 @@
|
||||
/** Angular Imports */
|
||||
import { Component, Input, OnChanges } from '@angular/core';
|
||||
import { FormControl } from '@angular/forms';
|
||||
import { UntypedFormControl } from '@angular/forms';
|
||||
|
||||
/**
|
||||
* Campaign Message Step
|
||||
@@ -20,7 +20,7 @@ export class CampaignMessageStepComponent implements OnChanges {
|
||||
@Input() editCampaignMessage: any;
|
||||
|
||||
/** Camapaign Message */
|
||||
message = new FormControl('');
|
||||
message = new UntypedFormControl('');
|
||||
/** Column header names */
|
||||
parameterLabels: any[];
|
||||
|
||||
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnChanges, Input, Output, EventEmitter, OnInit } from '@angular/core';
|
||||
import { Validators, FormGroup, FormControl } from '@angular/forms';
|
||||
import { Validators, UntypedFormGroup, UntypedFormControl } from '@angular/forms';
|
||||
|
||||
/** Rxjs Imports */
|
||||
import { distinctUntilChanged } from 'rxjs/operators';
|
||||
@@ -32,7 +32,7 @@ export class EditBusinessRuleParametersComponent implements OnInit, OnChanges {
|
||||
@Output() templateParameters = new EventEmitter();
|
||||
|
||||
/** Initializes new form group ReportForm */
|
||||
ReportForm = new FormGroup({});
|
||||
ReportForm = new UntypedFormGroup({});
|
||||
/** Array of all parent parameters */
|
||||
parentParameters: any[] = [];
|
||||
/** Displayed user choices */
|
||||
@@ -56,7 +56,7 @@ export class EditBusinessRuleParametersComponent implements OnInit, OnChanges {
|
||||
|
||||
ngOnChanges() {
|
||||
if (this.paramData) {
|
||||
this.ReportForm = new FormGroup({});
|
||||
this.ReportForm = new UntypedFormGroup({});
|
||||
this.paramValue = JSON.parse(this.smsCampaign.paramValue);
|
||||
this.createRunReportForm();
|
||||
this.disableFormWhenValid();
|
||||
@@ -72,7 +72,7 @@ export class EditBusinessRuleParametersComponent implements OnInit, OnChanges {
|
||||
this.paramData.forEach(
|
||||
(param: any) => {
|
||||
if (!param.parentParameterName) { // Non Child Parameter
|
||||
this.ReportForm.addControl(param.name, new FormControl('', Validators.required));
|
||||
this.ReportForm.addControl(param.name, new UntypedFormControl('', Validators.required));
|
||||
const controlValue = this.paramValue[param.variable].toString();
|
||||
switch (param.displayType) {
|
||||
case 'text':
|
||||
@@ -119,9 +119,9 @@ export class EditBusinessRuleParametersComponent implements OnInit, OnChanges {
|
||||
this.ReportForm.get(param.name).valueChanges.subscribe((option: any) => {
|
||||
param.childParameters.forEach((child: ReportParameter) => {
|
||||
if (child.displayType === 'none') {
|
||||
this.ReportForm.addControl(child.name, new FormControl(child.defaultVal));
|
||||
this.ReportForm.addControl(child.name, new UntypedFormControl(child.defaultVal));
|
||||
} else {
|
||||
this.ReportForm.addControl(child.name, new FormControl('', Validators.required));
|
||||
this.ReportForm.addControl(child.name, new UntypedFormControl('', Validators.required));
|
||||
}
|
||||
if (child.displayType === 'select') {
|
||||
const inputstring = `${child.name}?${param.inputName}=${option.id}`;
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit, Output, Input, EventEmitter } from '@angular/core';
|
||||
import { FormGroup, Validators, FormBuilder, FormControl } from '@angular/forms';
|
||||
import { UntypedFormGroup, Validators, UntypedFormBuilder, UntypedFormControl } from '@angular/forms';
|
||||
|
||||
/** Custom Services */
|
||||
import { ReportsService } from 'app/reports/reports.service';
|
||||
@@ -25,7 +25,7 @@ export class EditSmsCampaignStepComponent implements OnInit {
|
||||
@Input() smsCampaign: any;
|
||||
|
||||
/** SMS Campaign Form */
|
||||
smsCampaignDetailsForm: FormGroup;
|
||||
smsCampaignDetailsForm: UntypedFormGroup;
|
||||
/** Data to be passed to sub component */
|
||||
paramData: any;
|
||||
/** Trigger types options */
|
||||
@@ -49,7 +49,7 @@ export class EditSmsCampaignStepComponent implements OnInit {
|
||||
* @param {ReportsService} reportService Reports Service
|
||||
* @param {SettingsService} settingsService Settings Service.
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private reportService: ReportsService,
|
||||
private settingsService: SettingsService) {
|
||||
this.createSMSCampaignDetailsForm();
|
||||
@@ -107,7 +107,7 @@ export class EditSmsCampaignStepComponent implements OnInit {
|
||||
'isNotification': this.smsCampaign.isNotification
|
||||
});
|
||||
if (this.smsCampaign.triggerType.value === 'Schedule') {
|
||||
this.smsCampaignDetailsForm.addControl('recurrenceStartDate', new FormControl(new Date(this.smsCampaign.recurrenceStartDate)));
|
||||
this.smsCampaignDetailsForm.addControl('recurrenceStartDate', new UntypedFormControl(new Date(this.smsCampaign.recurrenceStartDate)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnChanges, Input, Output, EventEmitter, OnInit } from '@angular/core';
|
||||
import { Validators, FormGroup, FormControl } from '@angular/forms';
|
||||
import { Validators, UntypedFormGroup, UntypedFormControl } from '@angular/forms';
|
||||
|
||||
/** Custom Services */
|
||||
import { ReportsService } from 'app/reports/reports.service';
|
||||
@@ -27,7 +27,7 @@ export class BusinessRuleParametersComponent implements OnInit, OnChanges {
|
||||
/** Report Name */
|
||||
reportName: string;
|
||||
/** Initializes new form group ReportForm */
|
||||
ReportForm = new FormGroup({});
|
||||
ReportForm = new UntypedFormGroup({});
|
||||
/** Array of all parent parameters */
|
||||
parentParameters: any[] = [];
|
||||
/** Minimum Date allowed. */
|
||||
@@ -53,7 +53,7 @@ export class BusinessRuleParametersComponent implements OnInit, OnChanges {
|
||||
|
||||
ngOnChanges() {
|
||||
if (this.paramData) {
|
||||
this.ReportForm = new FormGroup({});
|
||||
this.ReportForm = new UntypedFormGroup({});
|
||||
this.reportName = this.paramData.reportName;
|
||||
this.paramData = this.paramData.response;
|
||||
this.createRunReportForm();
|
||||
@@ -77,7 +77,7 @@ export class BusinessRuleParametersComponent implements OnInit, OnChanges {
|
||||
this.paramData.forEach(
|
||||
(param: any) => {
|
||||
if (!param.parentParameterName) { // Non-Child Parameter
|
||||
this.ReportForm.addControl(param.name, new FormControl('', Validators.required));
|
||||
this.ReportForm.addControl(param.name, new UntypedFormControl('', Validators.required));
|
||||
if (param.displayType === 'select') {
|
||||
this.fetchSelectOptions(param, param.name);
|
||||
}
|
||||
@@ -113,9 +113,9 @@ export class BusinessRuleParametersComponent implements OnInit, OnChanges {
|
||||
this.ReportForm.get(param.name).valueChanges.subscribe((option: any) => {
|
||||
param.childParameters.forEach((child: ReportParameter) => {
|
||||
if (child.displayType === 'none') {
|
||||
this.ReportForm.addControl(child.name, new FormControl(child.defaultVal));
|
||||
this.ReportForm.addControl(child.name, new UntypedFormControl(child.defaultVal));
|
||||
} else {
|
||||
this.ReportForm.addControl(child.name, new FormControl('', Validators.required));
|
||||
this.ReportForm.addControl(child.name, new UntypedFormControl('', Validators.required));
|
||||
}
|
||||
if (child.displayType === 'select') {
|
||||
const inputstring = `${child.name}?${param.inputName}=${option.id}`;
|
||||
|
||||
+11
-11
@@ -1,6 +1,6 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit, Input, ViewChild, EventEmitter, Output} from '@angular/core';
|
||||
import { FormGroup, FormBuilder, Validators, FormControl } from '@angular/forms';
|
||||
import { UntypedFormGroup, UntypedFormBuilder, Validators, UntypedFormControl } from '@angular/forms';
|
||||
|
||||
/** Custom Services */
|
||||
import { ReportsService } from 'app/reports/reports.service';
|
||||
@@ -32,7 +32,7 @@ export class SmsCampaignStepComponent implements OnInit {
|
||||
maxDate = new Date(new Date().setFullYear(new Date().getFullYear() + 10));
|
||||
|
||||
/** SMS Campaign Form */
|
||||
smsCampaignDetailsForm: FormGroup;
|
||||
smsCampaignDetailsForm: UntypedFormGroup;
|
||||
/** Data to be passed to sub component */
|
||||
paramData: any;
|
||||
/** Trigger types options */
|
||||
@@ -51,7 +51,7 @@ export class SmsCampaignStepComponent implements OnInit {
|
||||
* @param {FormBuilder} formBuilder Form Builder
|
||||
* @param {ReportsService} reportService Reports Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private reportService: ReportsService) {
|
||||
this.createSMSCampaignDetailsForm();
|
||||
this.buildDependencies();
|
||||
@@ -70,14 +70,14 @@ export class SmsCampaignStepComponent implements OnInit {
|
||||
* Else returns a cumulative form group.
|
||||
*/
|
||||
get smsCampaignFormGroup() {
|
||||
let smsCampaignFormGroup: FormGroup;
|
||||
let smsCampaignFormGroup: UntypedFormGroup;
|
||||
if (this.businessRuleParametersComponent) {
|
||||
smsCampaignFormGroup = new FormGroup({
|
||||
smsCampaignFormGroup = new UntypedFormGroup({
|
||||
smsCampaign: this.smsCampaignDetailsForm,
|
||||
businessRule: this.businessRuleParametersComponent.ReportForm
|
||||
});
|
||||
} else {
|
||||
smsCampaignFormGroup = new FormGroup({
|
||||
smsCampaignFormGroup = new UntypedFormGroup({
|
||||
smsCampaign: this.smsCampaignDetailsForm
|
||||
});
|
||||
}
|
||||
@@ -127,7 +127,7 @@ export class SmsCampaignStepComponent implements OnInit {
|
||||
buildDependencies() {
|
||||
this.smsCampaignDetailsForm.get('isNotification').valueChanges.subscribe((value: boolean) => {
|
||||
if (!value) {
|
||||
this.smsCampaignDetailsForm.addControl('providerId', new FormControl(null));
|
||||
this.smsCampaignDetailsForm.addControl('providerId', new UntypedFormControl(null));
|
||||
} else {
|
||||
this.smsCampaignDetailsForm.removeControl('providerId');
|
||||
}
|
||||
@@ -152,9 +152,9 @@ export class SmsCampaignStepComponent implements OnInit {
|
||||
this.businessRules = this.businessRules.filter((rule: any) => rule.reportSubType !== 'Triggered');
|
||||
}
|
||||
if (value === 2) {
|
||||
this.smsCampaignDetailsForm.addControl('recurrenceStartDate', new FormControl('', Validators.required));
|
||||
this.smsCampaignDetailsForm.addControl('frequency', new FormControl('', Validators.required));
|
||||
this.smsCampaignDetailsForm.addControl('interval', new FormControl('', Validators.required));
|
||||
this.smsCampaignDetailsForm.addControl('recurrenceStartDate', new UntypedFormControl('', Validators.required));
|
||||
this.smsCampaignDetailsForm.addControl('frequency', new UntypedFormControl('', Validators.required));
|
||||
this.smsCampaignDetailsForm.addControl('interval', new UntypedFormControl('', Validators.required));
|
||||
this.smsCampaignDetailsForm.get('frequency').valueChanges.subscribe((frequency: number) => {
|
||||
this.smsCampaignDetailsForm.removeControl('repeatsOnDay');
|
||||
switch (frequency) {
|
||||
@@ -163,7 +163,7 @@ export class SmsCampaignStepComponent implements OnInit {
|
||||
break;
|
||||
case 2: // Weekly
|
||||
this.repetitionIntervals = ['1', '2', '3'];
|
||||
this.smsCampaignDetailsForm.addControl('repeatsOnDay', new FormControl('', Validators.required));
|
||||
this.smsCampaignDetailsForm.addControl('repeatsOnDay', new UntypedFormControl('', Validators.required));
|
||||
break;
|
||||
case 3: // Monthly
|
||||
this.repetitionIntervals = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11'];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormGroup, FormBuilder } from '@angular/forms';
|
||||
import { UntypedFormGroup, UntypedFormBuilder } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { MatTableDataSource, MatTable } from '@angular/material/table';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
@@ -33,7 +33,7 @@ export class ViewCampaignComponent implements OnInit {
|
||||
/** Maximum date allowed. */
|
||||
maxDate = new Date();
|
||||
/** SMS form. */
|
||||
smsForm: FormGroup;
|
||||
smsForm: UntypedFormGroup;
|
||||
/** SMS Campaign data. */
|
||||
smsCampaignData: any;
|
||||
/** Message Status */
|
||||
@@ -83,7 +83,7 @@ export class ViewCampaignComponent implements OnInit {
|
||||
constructor(private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
public dialog: MatDialog,
|
||||
private formBuilder: FormBuilder,
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private dateUtils: Dates,
|
||||
private organizationService: OrganizationService,
|
||||
private settingsService: SettingsService) {
|
||||
|
||||
Reference in New Issue
Block a user