From f42b0894491ec63eb1cb27c09a913b8a0668abf6 Mon Sep 17 00:00:00 2001 From: Adam Saghy Date: Thu, 26 May 2022 18:30:34 +0200 Subject: [PATCH] Unable to create new loan product or share product #1406 --- ...oduct-interest-rate-chart-step.component.html | 4 ++-- ...product-interest-rate-chart-step.component.ts | 16 +++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-interest-rate-chart-step/recurring-deposit-product-interest-rate-chart-step.component.html b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-interest-rate-chart-step/recurring-deposit-product-interest-rate-chart-step.component.html index 02e0d5ebd..f11f0f66c 100644 --- a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-interest-rate-chart-step/recurring-deposit-product-interest-rate-chart-step.component.html +++ b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-interest-rate-chart-step/recurring-deposit-product-interest-rate-chart-step.component.html @@ -25,7 +25,7 @@ Name - + @@ -47,7 +47,7 @@ Description - +
diff --git a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-interest-rate-chart-step/recurring-deposit-product-interest-rate-chart-step.component.ts b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-interest-rate-chart-step/recurring-deposit-product-interest-rate-chart-step.component.ts index fec49b5fb..23de818aa 100644 --- a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-interest-rate-chart-step/recurring-deposit-product-interest-rate-chart-step.component.ts +++ b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-interest-rate-chart-step/recurring-deposit-product-interest-rate-chart-step.component.ts @@ -80,7 +80,7 @@ export class RecurringDepositProductInterestRateChartStepComponent implements On this.clientClassificationData = this.recurringDepositProductsTemplate.chartTemplate.clientClassificationOptions; this.incentiveTypeData = this.recurringDepositProductsTemplate.chartTemplate.incentiveTypeOptions; - if (!(this.recurringDepositProductsTemplate === undefined) && this.recurringDepositProductsTemplate.id) { + if (!(this.recurringDepositProductsTemplate === undefined)) { this.assignFormData(); } } @@ -89,10 +89,12 @@ export class RecurringDepositProductInterestRateChartStepComponent implements On assignFormData() { this.addChart(); const isChartArray = Array.isArray(this.recurringDepositProductsTemplate.activeChart); - if (!isChartArray) { - this.chartDetailData.push(this.recurringDepositProductsTemplate.activeChart); - } else { - this.chartDetailData = this.recurringDepositProductsTemplate.activeChart; + if (this.fixedDepositProductsTemplate.activeChart) { + if (!isChartArray) { + this.chartDetailData.push(this.recurringDepositProductsTemplate.activeChart); + } else { + this.chartDetailData = this.recurringDepositProductsTemplate.activeChart; + } } // Build the array of Objects from the retrived value @@ -101,6 +103,10 @@ export class RecurringDepositProductInterestRateChartStepComponent implements On // Iterates for every chart in charts this.charts.controls.forEach((chartDetailControl: FormGroup, i: number) => { + if (!chartDetails[i]) { + return; + } + // Iterate for every chartSlab in chart this.chartsDetail[i].chartSlabs.forEach((chartSlabDetail: any, j: number) => {