Format date fields without patch form
This commit is contained in:
committed by
Arnold Gálovics
parent
9d43181cea
commit
6ea3d97538
+1
-1
@@ -44,7 +44,7 @@ export class CreateFixedDepositAccountComponent {
|
||||
* Fetches FD account template from `resolve`
|
||||
* @param {ActivatedRoute} route Activated Route
|
||||
* @param {Router} router Router
|
||||
* @param {DatePipe} datePipe Date Pipe
|
||||
* @param {DatePipe} datePipe Date Utils
|
||||
* @param {FixedDepositsService} fixedDepositsService Fixed Deposits Service
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ export class EditFixedDepositAccountComponent {
|
||||
* Fetches FD account template from `resolve`
|
||||
* @param {ActivatedRoute} route Activated Route
|
||||
* @param {Router} router Router
|
||||
* @param {DatePipe} datePipe Date Pipe
|
||||
* @param {DatePipe} datePipe Date Utils
|
||||
* @param {FixedDepositsService} fixedDepositsService Fixed Deposits Service
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ export class FixedDepositAccountChargesStepComponent implements OnInit, OnChange
|
||||
|
||||
/**
|
||||
* @param {MatDialog} dialog Mat Dialog
|
||||
* @param {DatePipe} datePipe Date Pipe
|
||||
* @param {DatePipe} datePipe Date Utils
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(public dialog: MatDialog,
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ export class MultiRowComponent implements OnInit, OnChanges {
|
||||
/**
|
||||
* Fetches savings account Id from parent route params.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {DatePipe} datePipe Date Pipe.
|
||||
* @param {DatePipe} datePipe Date Utils.
|
||||
* @param {SavingsService} savingsService Savingss Service.
|
||||
* @param {MatDialog} dialog Mat Dialog.
|
||||
* @param {SettingsService} settingsService Settings Service.
|
||||
|
||||
+2
-2
@@ -41,7 +41,7 @@ export class SingleRowComponent implements OnInit {
|
||||
/**
|
||||
* Fetches savings account Id from parent route params.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {DatePipe} datePipe Date Pipe.
|
||||
* @param {DatePipe} datePipe Date Utils.
|
||||
* @param {SavingsService} savingsService Savingss Service.
|
||||
* @param {MatDialog} dialog Mat Dialog.
|
||||
* @param {SettingsService} settingsService Settings Service.
|
||||
@@ -151,7 +151,7 @@ export class SingleRowComponent implements OnInit {
|
||||
/**
|
||||
* Maps API response to data table form fields.
|
||||
* @param {any} columns Data Table Columns.
|
||||
* @param {string[]} dateTransformColumns Columns transformed with date pipe.
|
||||
* @param {string[]} dateTransformColumns Columns transformed with Date Utils.
|
||||
* @param {any} dataTableEntryObject Additional data table details.
|
||||
*/
|
||||
getFormfields(columns: any, dateTransformColumns: string[], dataTableEntryObject: any) {
|
||||
|
||||
+8
-8
@@ -1,8 +1,8 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
/** Custom Services */
|
||||
import { SavingsService } from 'app/savings/savings.service';
|
||||
@@ -31,14 +31,14 @@ export class ActivateFixedDepositsAccountComponent implements OnInit {
|
||||
* Fixed deposits endpoint is not supported so using Savings endpoint.
|
||||
* @param {FormBuilder} formBuilder Form Builder
|
||||
* @param {SavingsService} savingsService Savings Service
|
||||
* @param {DatePipe} datePipe Date Pipe
|
||||
* @param {Dates} dateUtils Date Utils
|
||||
* @param {ActivatedRoute} route Activated Route
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private savingsService: SavingsService,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
@@ -66,15 +66,15 @@ export class ActivateFixedDepositsAccountComponent implements OnInit {
|
||||
* if successful redirects to the fixed deposit account.
|
||||
*/
|
||||
submit() {
|
||||
// TODO: Update once language and date settings are setup
|
||||
const activateFixedDepositsAccountFormData = this.activateFixedDepositsAccountForm.value;
|
||||
const locale = this.settingsService.language.code;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const prevActivatedOnDate: Date = this.activateFixedDepositsAccountForm.value.activatedOnDate;
|
||||
this.activateFixedDepositsAccountForm.patchValue({
|
||||
activatedOnDate: this.datePipe.transform(prevActivatedOnDate, dateFormat),
|
||||
});
|
||||
if (activateFixedDepositsAccountFormData.activatedOnDate instanceof Date) {
|
||||
activateFixedDepositsAccountFormData.activatedOnDate = this.dateUtils.formatDate(prevActivatedOnDate, dateFormat);
|
||||
}
|
||||
const data = {
|
||||
...this.activateFixedDepositsAccountForm.value,
|
||||
...activateFixedDepositsAccountFormData,
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Amount</mat-label>
|
||||
<input type=number required matInput formControlName="amount" />
|
||||
<input type="number" required matInput formControlName="amount" />
|
||||
<mat-error *ngIf="fixedDepositsChargeForm.controls.amount.hasError('required')">
|
||||
Amount is <strong>required</strong>
|
||||
</mat-error>
|
||||
|
||||
+5
-5
@@ -2,7 +2,7 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormGroup, FormBuilder, Validators, FormControl } from '@angular/forms';
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
/** Custom Services */
|
||||
import { SavingsService } from 'app/savings/savings.service';
|
||||
@@ -37,7 +37,7 @@ export class AddChargeFixedDepositsAccountComponent implements OnInit {
|
||||
* @param {FormBuilder} formBuilder Form Builder
|
||||
* @param {ActivatedRoute} route Activated Route
|
||||
* @param {Router} router Router
|
||||
* @param {DatePipe} datePipe Date Pipe
|
||||
* @param {Dates} dateUtils Date Utils
|
||||
* @param {SavingsService} savingsService Savings Service
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
@@ -45,7 +45,7 @@ export class AddChargeFixedDepositsAccountComponent implements OnInit {
|
||||
private formBuilder: FormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private savingsService: SavingsService,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
@@ -125,14 +125,14 @@ export class AddChargeFixedDepositsAccountComponent implements OnInit {
|
||||
savingsCharge.monthDayFormat = monthDayFormat;
|
||||
if (savingsCharge.feeOnMonthDay) {
|
||||
const prevDate = this.fixedDepositsChargeForm.value.feeOnMonthDay;
|
||||
savingsCharge.feeOnMonthDay = this.datePipe.transform(prevDate, monthDayFormat);
|
||||
savingsCharge.feeOnMonthDay = this.dateUtils.formatDate(prevDate, monthDayFormat);
|
||||
}
|
||||
} else {
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
savingsCharge.dateFormat = dateFormat;
|
||||
if (savingsCharge.dueDate) {
|
||||
const prevDate = this.fixedDepositsChargeForm.value.dueDate;
|
||||
savingsCharge.dueDate = this.datePipe.transform(prevDate, dateFormat);
|
||||
savingsCharge.dueDate = this.dateUtils.formatDate(prevDate, dateFormat);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+8
-7
@@ -1,8 +1,8 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
/** Custom Services */
|
||||
import { FixedDepositsService } from 'app/deposits/fixed-deposits/fixed-deposits.service';
|
||||
@@ -30,14 +30,14 @@ export class ApproveFixedDepositsAccountComponent implements OnInit {
|
||||
/**
|
||||
* @param {FormBuilder} formBuilder Form Builder
|
||||
* @param {FixedDepositsService} fixedDepositsService Fixed Deposits Service
|
||||
* @param {DatePipe} datePipe Date Pipe
|
||||
* @param {Dates} dateUtils Date Utils
|
||||
* @param {ActivatedRoute} route Activated Route
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private fixedDepositsService: FixedDepositsService,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
@@ -66,14 +66,15 @@ export class ApproveFixedDepositsAccountComponent implements OnInit {
|
||||
* if successful redirects to the fixed deposit account.
|
||||
*/
|
||||
submit() {
|
||||
const approveFixedDepositsAccountFormData = this.approveFixedDepositsAccountForm.value;
|
||||
const locale = this.settingsService.language.code;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const prevApprovedOnDate: Date = this.approveFixedDepositsAccountForm.value.approvedOnDate;
|
||||
this.approveFixedDepositsAccountForm.patchValue({
|
||||
approvedOnDate: this.datePipe.transform(prevApprovedOnDate, dateFormat),
|
||||
});
|
||||
if (approveFixedDepositsAccountFormData.approvedOnDate instanceof Date) {
|
||||
approveFixedDepositsAccountFormData.approvedOnDate = this.dateUtils.formatDate(prevApprovedOnDate, dateFormat);
|
||||
}
|
||||
const data = {
|
||||
...this.approveFixedDepositsAccountForm.value,
|
||||
...approveFixedDepositsAccountFormData,
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Maturity Amount</mat-label>
|
||||
<input type=number matInput formControlName="maturityAmount"/>
|
||||
<input type="number" matInput formControlName="maturityAmount"/>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
|
||||
+8
-7
@@ -1,12 +1,12 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormGroup, FormBuilder, Validators, FormControl } from '@angular/forms';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
/** Custom Services */
|
||||
import { FixedDepositsService } from '../../fixed-deposits.service';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
/**
|
||||
* Close On Maturity Fixed Deposits Account Component
|
||||
@@ -37,14 +37,14 @@ export class CloseFixedDepositsAccountComponent implements OnInit {
|
||||
* Fetches close action data from `resolve`
|
||||
* @param {FormBuilder} formBuilder Form Builder
|
||||
* @param {FixedDepositsService} fixedDepositsService Fixed Deposits Service
|
||||
* @param {DatePipe} datePipe Date Pipe
|
||||
* @param {Dates} dateUtils Date Utils
|
||||
* @param {ActivatedRoute} route Activated Route
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private fixedDepositsService: FixedDepositsService,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
@@ -96,14 +96,15 @@ export class CloseFixedDepositsAccountComponent implements OnInit {
|
||||
* if successful redirects to the fd account.
|
||||
*/
|
||||
submit() {
|
||||
const closeOnMaturityAccountFormData = this.closeOnMaturityAccountForm.value;
|
||||
const locale = this.settingsService.language.code;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const prevClosedDate: Date = this.closeOnMaturityAccountForm.value.closedOnDate;
|
||||
this.closeOnMaturityAccountForm.patchValue({
|
||||
closedOnDate: this.datePipe.transform(prevClosedDate, dateFormat),
|
||||
});
|
||||
if (closeOnMaturityAccountFormData.closedOnDate instanceof Date) {
|
||||
closeOnMaturityAccountFormData.closedOnDate = this.dateUtils.formatDate(prevClosedDate, dateFormat);
|
||||
}
|
||||
const data = {
|
||||
...this.closeOnMaturityAccountForm.value,
|
||||
...closeOnMaturityAccountFormData,
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
|
||||
<mat-form-field *ngIf="prematureCloseAccountForm.controls.maturityAmount">
|
||||
<mat-label>Maturity Amount</mat-label>
|
||||
<input type=number matInput formControlName="maturityAmount"/>
|
||||
<input type="number" matInput formControlName="maturityAmount"/>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field *ngIf="prematureCloseAccountForm.contains('onAccountClosureId')">
|
||||
|
||||
+9
-8
@@ -1,12 +1,12 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormGroup, FormBuilder, Validators, FormControl } from '@angular/forms';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
/** Custom Services */
|
||||
import { FixedDepositsService } from '../../fixed-deposits.service';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
/**
|
||||
* Premature Close Fixed Deposits Account Component
|
||||
@@ -37,14 +37,14 @@ export class PrematureCloseFixedDepositsAccountComponent implements OnInit {
|
||||
/**
|
||||
* @param {FormBuilder} formBuilder Form Builder
|
||||
* @param {FixedDepositsService} fixedDepositsService Fixed Deposits Service
|
||||
* @param {DatePipe} datePipe Date Pipe
|
||||
* @param {Dates} dateUtils Date Utils
|
||||
* @param {ActivatedRoute} route Activated Route
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private fixedDepositsService: FixedDepositsService,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
@@ -87,7 +87,7 @@ export class PrematureCloseFixedDepositsAccountComponent implements OnInit {
|
||||
const locale = this.settingsService.language.code;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const data = {
|
||||
closedOnDate: this.datePipe.transform(date, dateFormat),
|
||||
closedOnDate: this.dateUtils.formatDate(date, dateFormat),
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
@@ -124,15 +124,16 @@ export class PrematureCloseFixedDepositsAccountComponent implements OnInit {
|
||||
* if successful redirects to the fd account.
|
||||
*/
|
||||
submit() {
|
||||
const prematureCloseAccountFormData = this.prematureCloseAccountForm.value;
|
||||
this.isSubmitted = true;
|
||||
const locale = this.settingsService.language.code;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const prevClosedDate: Date = this.prematureCloseAccountForm.value.closedOnDate;
|
||||
this.prematureCloseAccountForm.patchValue({
|
||||
closedOnDate: this.datePipe.transform(prevClosedDate, dateFormat),
|
||||
});
|
||||
if (prematureCloseAccountFormData.closedOnDate instanceof Date) {
|
||||
prematureCloseAccountFormData.closedOnDate = this.dateUtils.formatDate(prevClosedDate, dateFormat);
|
||||
}
|
||||
const data = {
|
||||
...this.prematureCloseAccountForm.value,
|
||||
...prematureCloseAccountFormData,
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
|
||||
+8
-7
@@ -1,8 +1,8 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
/** Custom Services */
|
||||
import { FixedDepositsService } from 'app/deposits/fixed-deposits/fixed-deposits.service';
|
||||
@@ -30,14 +30,14 @@ export class RejectFixedDepositsAccountComponent implements OnInit {
|
||||
/**
|
||||
* @param {FormBuilder} formBuilder Form Builder
|
||||
* @param {FixedDepositsService} fixedDepositsService Fixed Deposits Service
|
||||
* @param {DatePipe} datePipe Date Pipe
|
||||
* @param {Dates} dateUtils Date Utils
|
||||
* @param {ActivatedRoute} route Activated Route
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private fixedDepositsService: FixedDepositsService,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
@@ -66,14 +66,15 @@ export class RejectFixedDepositsAccountComponent implements OnInit {
|
||||
* if successful redirects to the fixed deposit account.
|
||||
*/
|
||||
submit() {
|
||||
const rejectFixedDepositsAccountFormData = this.rejectFixedDepositsAccountForm.value;
|
||||
const locale = this.settingsService.language.code;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const prevRejectedOnDate: Date = this.rejectFixedDepositsAccountForm.value.rejectedOnDate;
|
||||
this.rejectFixedDepositsAccountForm.patchValue({
|
||||
rejectedOnDate: this.datePipe.transform(prevRejectedOnDate, dateFormat),
|
||||
});
|
||||
if (rejectFixedDepositsAccountFormData.rejectedOnDate instanceof Date) {
|
||||
rejectFixedDepositsAccountFormData.rejectedOnDate = this.dateUtils.formatDate(prevRejectedOnDate, dateFormat);
|
||||
}
|
||||
const data = {
|
||||
...this.rejectFixedDepositsAccountForm.value,
|
||||
...rejectFixedDepositsAccountFormData,
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
|
||||
+8
-7
@@ -1,8 +1,8 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
/** Custom Services */
|
||||
import { FixedDepositsService } from 'app/deposits/fixed-deposits/fixed-deposits.service';
|
||||
@@ -30,14 +30,14 @@ export class WithdrawByClientFixedDepositsAccountComponent implements OnInit {
|
||||
/**
|
||||
* @param {FormBuilder} formBuilder Form Builder
|
||||
* @param {FixedDepositsService} fixedDepositsService Fixed Deposits Service
|
||||
* @param {DatePipe} datePipe Date Pipe
|
||||
* @param {Dates} dateUtils Date Utils
|
||||
* @param {ActivatedRoute} route Activated Route
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private fixedDepositsService: FixedDepositsService,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
@@ -66,14 +66,15 @@ export class WithdrawByClientFixedDepositsAccountComponent implements OnInit {
|
||||
* if successful redirects to the fixed deposit account.
|
||||
*/
|
||||
submit() {
|
||||
const withdrawFixedDepositsAccountFormData = this.withdrawFixedDepositsAccountForm.value;
|
||||
const locale = this.settingsService.language.code;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const prevWithdrawnOnDate: Date = this.withdrawFixedDepositsAccountForm.value.withdrawnOnDate;
|
||||
this.withdrawFixedDepositsAccountForm.patchValue({
|
||||
withdrawnOnDate: this.datePipe.transform(prevWithdrawnOnDate, dateFormat),
|
||||
});
|
||||
if (withdrawFixedDepositsAccountFormData.withdrawnOnDate instanceof Date) {
|
||||
withdrawFixedDepositsAccountFormData.withdrawnOnDate = this.dateUtils.formatDate(prevWithdrawnOnDate, dateFormat);
|
||||
}
|
||||
const data = {
|
||||
...this.withdrawFixedDepositsAccountForm.value,
|
||||
...withdrawFixedDepositsAccountFormData,
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
|
||||
+8
-8
@@ -1,12 +1,12 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
/** Custom Services */
|
||||
import { RecurringDepositsService } from '../../recurring-deposits.service';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
/**
|
||||
* Activate Recurring Deposits Account Component
|
||||
@@ -30,14 +30,14 @@ export class ActivateRecurringDepositsAccountComponent implements OnInit {
|
||||
/**
|
||||
* @param {FormBuilder} formBuilder Form Builder
|
||||
* @param {recurringDepositsService} recurringDepositsService Recurring Deposits Service
|
||||
* @param {DatePipe} datePipe Date Pipe
|
||||
* @param {Dates} dateUtils Date Utils
|
||||
* @param {ActivatedRoute} route Activated Route
|
||||
* @param {Router} router Router
|
||||
* @param {SavingsService} savingsService Savings Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private recurringDepositsService: RecurringDepositsService,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
@@ -65,15 +65,15 @@ export class ActivateRecurringDepositsAccountComponent implements OnInit {
|
||||
* if successful redirects to the recurring deposit account.
|
||||
*/
|
||||
submit() {
|
||||
// TODO: Update once language and date settings are setup
|
||||
const activateRecurringDepositsAccountFormData = this.activateRecurringDepositsAccountForm.value;
|
||||
const locale = this.settingsService.language.code;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const prevActivatedOnDate: Date = this.activateRecurringDepositsAccountForm.value.activatedOnDate;
|
||||
this.activateRecurringDepositsAccountForm.patchValue({
|
||||
activatedOnDate: this.datePipe.transform(prevActivatedOnDate, dateFormat),
|
||||
});
|
||||
if (activateRecurringDepositsAccountFormData.activatedOnDate instanceof Date) {
|
||||
activateRecurringDepositsAccountFormData.activatedOnDate = this.dateUtils.formatDate(prevActivatedOnDate, dateFormat);
|
||||
}
|
||||
const data = {
|
||||
...this.activateRecurringDepositsAccountForm.value,
|
||||
...activateRecurringDepositsAccountFormData,
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Amount</mat-label>
|
||||
<input type=number required matInput formControlName="amount" />
|
||||
<input type="number" required matInput formControlName="amount" />
|
||||
<mat-error *ngIf="recurringDepositsChargeForm.controls.amount.hasError('required')">
|
||||
Amount is <strong>required</strong>
|
||||
</mat-error>
|
||||
|
||||
+5
-5
@@ -2,7 +2,7 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormGroup, FormBuilder, Validators, FormControl } from '@angular/forms';
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
/** Custom Services */
|
||||
import { SavingsService } from 'app/savings/savings.service';
|
||||
@@ -37,14 +37,14 @@ export class AddChargeRecurringDepositsAccountComponent implements OnInit {
|
||||
* @param {FormBuilder} formBuilder Form Builder
|
||||
* @param {ActivatedRoute} route Activated Route
|
||||
* @param {Router} router Router
|
||||
* @param {DatePipe} datePipe Date Pipe
|
||||
* @param {Dates} dateUtils Date Utils
|
||||
* @param {SavingsService} savingsService Savings Service
|
||||
*/
|
||||
constructor(
|
||||
private formBuilder: FormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private savingsService: SavingsService,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
@@ -124,14 +124,14 @@ export class AddChargeRecurringDepositsAccountComponent implements OnInit {
|
||||
savingsCharge.monthDayFormat = monthDayFormat;
|
||||
if (savingsCharge.feeOnMonthDay) {
|
||||
const prevDate = this.recurringDepositsChargeForm.value.feeOnMonthDay;
|
||||
savingsCharge.feeOnMonthDay = this.datePipe.transform(prevDate, monthDayFormat);
|
||||
savingsCharge.feeOnMonthDay = this.dateUtils.formatDate(prevDate, monthDayFormat);
|
||||
}
|
||||
} else {
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
savingsCharge.dateFormat = dateFormat;
|
||||
if (savingsCharge.dueDate) {
|
||||
const prevDate = this.recurringDepositsChargeForm.value.dueDate;
|
||||
savingsCharge.dueDate = this.datePipe.transform(prevDate, dateFormat);
|
||||
savingsCharge.dueDate = this.dateUtils.formatDate(prevDate, dateFormat);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+8
-8
@@ -1,12 +1,12 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
/** Custom Services */
|
||||
import { RecurringDepositsService } from '../../recurring-deposits.service';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
/**
|
||||
* Approve Recurring Deposits Account Component
|
||||
@@ -30,14 +30,14 @@ export class ApproveRecurringDepositsAccountComponent implements OnInit {
|
||||
/**
|
||||
* @param {FormBuilder} formBuilder Form Builder
|
||||
* @param {RecurringDepositsService} recurringDepositsService Recurring Deposits Service
|
||||
* @param {DatePipe} datePipe Date Pipe
|
||||
* @param {Dates} dateUtils Date Utils
|
||||
* @param {ActivatedRoute} route Activated Route
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private recurringDepositsService: RecurringDepositsService,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
@@ -66,15 +66,15 @@ export class ApproveRecurringDepositsAccountComponent implements OnInit {
|
||||
* if successful redirects to the recurring deposit account.
|
||||
*/
|
||||
submit() {
|
||||
// TODO: Update once language and date settings are setup
|
||||
const approveRecurringDepositsAccountFormData = this.approveRecurringDepositsAccountForm.value;
|
||||
const locale = this.settingsService.language.code;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const prevApprovedOnDate: Date = this.approveRecurringDepositsAccountForm.value.approvedOnDate;
|
||||
this.approveRecurringDepositsAccountForm.patchValue({
|
||||
approvedOnDate: this.datePipe.transform(prevApprovedOnDate, dateFormat),
|
||||
});
|
||||
if (approveRecurringDepositsAccountFormData.approvedOnDate instanceof Date) {
|
||||
approveRecurringDepositsAccountFormData.approvedOnDate = this.dateUtils.formatDate(prevApprovedOnDate, dateFormat);
|
||||
}
|
||||
const data = {
|
||||
...this.approveRecurringDepositsAccountForm.value,
|
||||
...approveRecurringDepositsAccountFormData,
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@
|
||||
|
||||
<div fxFlexFill>
|
||||
<span fxFlex="25%">Show Payment Details</span>
|
||||
<span fxFlex="75%" class="expandCollapsebutton" (click)="toggleDisplay()">
|
||||
<span fxFlex="75%" class="expandcollapsebutton" (click)="toggleDisplay()">
|
||||
<button mat-raised-button color="primary" *ngIf="showPaymentDetails">
|
||||
<i class="fa fa-minus"></i>
|
||||
</button>
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
max-width: 37rem;
|
||||
}
|
||||
|
||||
.expandCollapsebutton {
|
||||
.expandcollapsebutton {
|
||||
margin-top: -7px;
|
||||
margin-left: 2%;
|
||||
}
|
||||
|
||||
+8
-7
@@ -1,12 +1,12 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
/** Custom Services */
|
||||
import { RecurringDepositsService } from '../../recurring-deposits.service';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
/**
|
||||
* Close Recurring Deposits Account Component
|
||||
@@ -42,14 +42,14 @@ export class CloseRecurringDepositsAccountComponent implements OnInit {
|
||||
* @param {FormBuilder} formBuilder Form Builder
|
||||
* @param {ActivatedRoute} route Activated Route
|
||||
* @param {Router} router Router
|
||||
* @param {DatePipe} datePipe Date Pipe
|
||||
* @param {Dates} dateUtils Date Utils
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(
|
||||
private formBuilder: FormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private recurringDepositsService: RecurringDepositsService,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
@@ -99,14 +99,15 @@ export class CloseRecurringDepositsAccountComponent implements OnInit {
|
||||
* Submits the close recurring deposit form
|
||||
*/
|
||||
submit() {
|
||||
const closeRecurringDepositFormData = this.closeRecurringDepositForm.value;
|
||||
const closedOnDate = this.closeRecurringDepositForm.value.closedOnDate;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const locale = this.settingsService.language.code;
|
||||
this.closeRecurringDepositForm.patchValue({
|
||||
closedOnDate: this.datePipe.transform(closedOnDate, dateFormat)
|
||||
});
|
||||
if (closeRecurringDepositFormData.closedOnDate instanceof Date) {
|
||||
closeRecurringDepositFormData.closedOnDate = this.dateUtils.formatDate(closedOnDate, dateFormat);
|
||||
}
|
||||
const data = {
|
||||
...this.closeRecurringDepositForm.value,
|
||||
...closeRecurringDepositFormData,
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
|
||||
+2
-2
@@ -41,7 +41,7 @@
|
||||
|
||||
<div fxFlexFill>
|
||||
<span fxFlex="25%">Show Payment Details</span>
|
||||
<span fxFlex="75%" class="expandCollapsebutton" (click)="toggleDisplay()">
|
||||
<span fxFlex="75%" class="expandcollapsebutton" (click)="toggleDisplay()">
|
||||
<button mat-raised-button color="primary" *ngIf="showPaymentDetails">
|
||||
<i class="fa fa-minus"></i>
|
||||
</button>
|
||||
@@ -96,4 +96,4 @@
|
||||
|
||||
</mat-card>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
max-width: 37rem;
|
||||
}
|
||||
|
||||
.expandCollapsebutton {
|
||||
.expandcollapsebutton {
|
||||
margin-top: -7px;
|
||||
margin-left: 2%;
|
||||
}
|
||||
|
||||
+9
-8
@@ -1,12 +1,12 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
/** Custom Services */
|
||||
import { RecurringDepositsService } from '../../recurring-deposits.service';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
/**
|
||||
* Deposits Recurring Deposits Account Component
|
||||
@@ -40,14 +40,14 @@ export class DepositRecurringDepositsAccountComponent implements OnInit {
|
||||
* @param {FormBuilder} formBuilder Form Builder
|
||||
* @param {ActivatedRoute} route Activated Route
|
||||
* @param {Router} router Router
|
||||
* @param {DatePipe} datePipe Date Pipe
|
||||
* @param {Dates} dateUtils Date Utils
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(
|
||||
private formBuilder: FormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private recurringDepositsService: RecurringDepositsService,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
@@ -94,14 +94,15 @@ export class DepositRecurringDepositsAccountComponent implements OnInit {
|
||||
* Submits the deposits recurring deposit form
|
||||
*/
|
||||
submit() {
|
||||
const transactionDate = this.depositRecurringDepositForm.value.transactionDate;
|
||||
const depositRecurringDepositFormData = this.depositRecurringDepositForm.value;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const locale = this.settingsService.language.code;
|
||||
this.depositRecurringDepositForm.patchValue({
|
||||
transactionDate: this.datePipe.transform(transactionDate, dateFormat)
|
||||
});
|
||||
const prevTransactionDate = this.depositRecurringDepositForm.value.transactionDate;
|
||||
if (depositRecurringDepositFormData.transactionDate instanceof Date) {
|
||||
depositRecurringDepositFormData.transactionDate = this.dateUtils.formatDate(prevTransactionDate, dateFormat);
|
||||
}
|
||||
const data = {
|
||||
...this.depositRecurringDepositForm.value,
|
||||
...depositRecurringDepositFormData,
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
|
||||
+8
-8
@@ -1,12 +1,12 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
/** Custom Services */
|
||||
import { RecurringDepositsService } from '../../recurring-deposits.service';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
/**
|
||||
* Premature Close Recurring Deposits Account Component
|
||||
@@ -31,14 +31,14 @@ export class PrematureCloseRecurringDepositAccountComponent implements OnInit {
|
||||
/**
|
||||
* @param {FormBuilder} formBuilder Form Builder
|
||||
* @param {RecurringDepositsService} recurringDepositsService Recurring Deposits Service
|
||||
* @param {DatePipe} datePipe Date Pipe
|
||||
* @param {Dates} dateUtils Date Utils
|
||||
* @param {ActivatedRoute} route Activated Route
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private recurringDepositsService: RecurringDepositsService,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService, ) {
|
||||
@@ -66,15 +66,15 @@ export class PrematureCloseRecurringDepositAccountComponent implements OnInit {
|
||||
* if successful redirects to the recurring deposit account.
|
||||
*/
|
||||
submit() {
|
||||
// TODO: Update once language and date settings are setup
|
||||
const prematureCloseRecurringDepositsAccountFormData = this.prematureCloseRecurringDepositsAccountForm.value;
|
||||
const locale = this.settingsService.language.code;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const prevClosedOnDate: Date = this.prematureCloseRecurringDepositsAccountForm.value.closedOnDate;
|
||||
this.prematureCloseRecurringDepositsAccountForm.patchValue({
|
||||
closedOnDate: this.datePipe.transform(prevClosedOnDate, dateFormat),
|
||||
});
|
||||
if (prematureCloseRecurringDepositsAccountFormData.closedOnDate instanceof Date) {
|
||||
prematureCloseRecurringDepositsAccountFormData.closedOnDate = this.dateUtils.formatDate(prevClosedOnDate, dateFormat);
|
||||
}
|
||||
const data = {
|
||||
...this.prematureCloseRecurringDepositsAccountForm.value,
|
||||
...prematureCloseRecurringDepositsAccountFormData,
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
|
||||
+8
-8
@@ -1,12 +1,12 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
/** Custom Services */
|
||||
import { RecurringDepositsService } from '../../recurring-deposits.service';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
|
||||
/**
|
||||
@@ -31,14 +31,14 @@ export class RejectRecurringDepositsAccountComponent implements OnInit {
|
||||
/**
|
||||
* @param {FormBuilder} formBuilder Form Builder
|
||||
* @param {RecurringDepositsService} recurringDepositsService Recurring Deposits Service
|
||||
* @param {DatePipe} datePipe Date Pipe
|
||||
* @param {Dates} dateUtils Date Utils
|
||||
* @param {ActivatedRoute} route Activated Route
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private recurringDepositsService: RecurringDepositsService,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
@@ -67,15 +67,15 @@ export class RejectRecurringDepositsAccountComponent implements OnInit {
|
||||
* if successful redirects to the recurring deposit account.
|
||||
*/
|
||||
submit() {
|
||||
// TODO: Update once language and date settings are setup
|
||||
const rejectRecurringDepositsAccountFormData = this.rejectRecurringDepositsAccountForm.value;
|
||||
const locale = this.settingsService.language.code;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const prevRejectedOnDate: Date = this.rejectRecurringDepositsAccountForm.value.rejectedOnDate;
|
||||
this.rejectRecurringDepositsAccountForm.patchValue({
|
||||
rejectedOnDate: this.datePipe.transform(prevRejectedOnDate, dateFormat),
|
||||
});
|
||||
if (rejectRecurringDepositsAccountFormData.rejectedOnDate instanceof Date) {
|
||||
rejectRecurringDepositsAccountFormData.rejectedOnDate = this.dateUtils.formatDate(prevRejectedOnDate, dateFormat);
|
||||
}
|
||||
const data = {
|
||||
...this.rejectRecurringDepositsAccountForm.value,
|
||||
...rejectRecurringDepositsAccountFormData,
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
|
||||
+8
-8
@@ -1,8 +1,8 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
/** Custom Services */
|
||||
import { RecurringDepositsService } from 'app/deposits/recurring-deposits/recurring-deposits.service';
|
||||
@@ -29,14 +29,14 @@ export class WithdrawByClientRecurringDepositsAccountComponent implements OnInit
|
||||
/**
|
||||
* @param {FormBuilder} formBuilder Form Builder
|
||||
* @param {RecurringDepositsService} recurringDepositsService Recurring Deposits Service
|
||||
* @param {DatePipe} datePipe Date Pipe
|
||||
* @param {Dates} dateUtils Date Utils
|
||||
* @param {ActivatedRoute} route Activated Route
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private recurringDepositsService: RecurringDepositsService,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService, ) {
|
||||
@@ -65,15 +65,15 @@ export class WithdrawByClientRecurringDepositsAccountComponent implements OnInit
|
||||
* if successful redirects to the recurring deposit account.
|
||||
*/
|
||||
submit() {
|
||||
// TODO: Update once language and date settings are setup
|
||||
const withdrawRecurringDepositsAccountFormData = this.withdrawRecurringDepositsAccountForm.value;
|
||||
const locale = this.settingsService.language.code;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const prevWithdrawnOnDate: Date = this.withdrawRecurringDepositsAccountForm.value.withdrawnOnDate;
|
||||
this.withdrawRecurringDepositsAccountForm.patchValue({
|
||||
withdrawnOnDate: this.datePipe.transform(prevWithdrawnOnDate, dateFormat),
|
||||
});
|
||||
if (withdrawRecurringDepositsAccountFormData.withdrawnOnDate instanceof Date) {
|
||||
withdrawRecurringDepositsAccountFormData.withdrawnOnDate = this.dateUtils.formatDate(prevWithdrawnOnDate, dateFormat);
|
||||
}
|
||||
const data = {
|
||||
...this.withdrawRecurringDepositsAccountForm.value,
|
||||
...withdrawRecurringDepositsAccountFormData,
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
|
||||
+1
-3
@@ -4,7 +4,6 @@ import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||
|
||||
/** Custom Services */
|
||||
import { RecurringDepositsService } from '../../recurring-deposits.service';
|
||||
import { DatePipe } from '@angular/common';
|
||||
|
||||
/**
|
||||
* Recurring Deposits Account Details Step
|
||||
@@ -41,8 +40,7 @@ export class RecurringDepositsAccountDetailsStepComponent implements OnInit {
|
||||
* @param {RecurringDepositsService} recurringDepositsService Recurring Deposits Service.
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private recurringDepositsService: RecurringDepositsService,
|
||||
private datePipe: DatePipe) {
|
||||
private recurringDepositsService: RecurringDepositsService) {
|
||||
this.createRecurringDepositsAccountDetailsForm();
|
||||
}
|
||||
|
||||
|
||||
+1
-3
@@ -3,7 +3,6 @@ import { Component, OnInit, Input, OnChanges } from '@angular/core';
|
||||
import { FormGroup, FormBuilder, Validators, FormControl } from '@angular/forms';
|
||||
|
||||
/** Custom Services */
|
||||
import { DatePipe } from '@angular/common';
|
||||
|
||||
/**
|
||||
* Recurring Deposits Account Settings Step
|
||||
@@ -36,8 +35,7 @@ export class RecurringDepositsAccountSettingsStepComponent implements OnInit, On
|
||||
/**
|
||||
* @param {FormBuilder} formBuilder Form Builder
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private datePipe: DatePipe) {
|
||||
constructor(private formBuilder: FormBuilder) {
|
||||
this.createRecurringDepositAccountSettingsForm();
|
||||
this.buildDependencies();
|
||||
}
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ export class MultiRowComponent implements OnInit, OnChanges {
|
||||
/**
|
||||
* Fetches savings account Id from parent route params.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {DatePipe} datePipe Date Pipe.
|
||||
* @param {DatePipe} datePipe Date Utils.
|
||||
* @param {SavingsService} savingsService Savingss Service.
|
||||
* @param {MatDialog} dialog Mat Dialog.
|
||||
*/
|
||||
|
||||
+2
-2
@@ -41,7 +41,7 @@ export class SingleRowComponent implements OnInit {
|
||||
/**
|
||||
* Fetches savings account Id from parent route params.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {DatePipe} datePipe Date Pipe.
|
||||
* @param {DatePipe} datePipe Date Utils.
|
||||
* @param {SavingsService} savingsService Savingss Service.
|
||||
* @param {MatDialog} dialog Mat Dialog.
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
@@ -151,7 +151,7 @@ export class SingleRowComponent implements OnInit {
|
||||
/**
|
||||
* Maps API response to data table form fields.
|
||||
* @param {any} columns Data Table Columns.
|
||||
* @param {string[]} dateTransformColumns Columns transformed with date pipe.
|
||||
* @param {string[]} dateTransformColumns Columns transformed with Date Utils.
|
||||
* @param {any} dataTableEntryObject Additional data table details.
|
||||
*/
|
||||
getFormfields(columns: any, dateTransformColumns: string[], dataTableEntryObject: any) {
|
||||
|
||||
+15
-12
@@ -2,7 +2,7 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormGroup, FormBuilder, Validators, FormControl } from '@angular/forms';
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
/** Custom Services */
|
||||
import { RecurringDepositsService } from 'app/deposits/recurring-deposits/recurring-deposits.service';
|
||||
@@ -44,14 +44,14 @@ export class EditTransactionComponent implements OnInit {
|
||||
* @param {FormBuilder} formBuilder Form Builder.
|
||||
* @param {RecurringDepositsService} recurringDepositsService Recurring Deposits Service.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {DatePipe} datePipe DatePipe.
|
||||
* @param {Dates} dateUtils Date Utils.
|
||||
* @param {Router} router Router for navigation.
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private recurringDepositsService: RecurringDepositsService,
|
||||
private settingsService: SettingsService, ) {
|
||||
this.route.data.subscribe((data: { recurringDepositsAccountTransactionTemplate: any }) => {
|
||||
@@ -108,16 +108,19 @@ export class EditTransactionComponent implements OnInit {
|
||||
* Submit the transaction details.
|
||||
*/
|
||||
submit() {
|
||||
const prevTransactionDate: Date = this.editTransactionForm.value.transactionDate;
|
||||
// TODO: Update once language and date settings are setup
|
||||
const editTransactionFormData = this.editTransactionForm.value;
|
||||
const locale = this.settingsService.language.code;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
this.editTransactionForm.patchValue({
|
||||
transactionDate: this.datePipe.transform(prevTransactionDate, dateFormat)
|
||||
});
|
||||
const transactionData = this.editTransactionForm.value;
|
||||
transactionData.locale = this.settingsService.language.code;
|
||||
transactionData.dateFormat = dateFormat;
|
||||
this.recurringDepositsService.executeRecurringDepositsAccountTransactionsCommand(this.recurringDepositAccountId, 'modify', transactionData, this.transactionTemplateData.id)
|
||||
const prevTransactionDate: Date = this.editTransactionForm.value.transactionDate;
|
||||
if (editTransactionFormData.transactionDate instanceof Date) {
|
||||
editTransactionFormData.transactionDate = this.dateUtils.formatDate(prevTransactionDate, dateFormat);
|
||||
}
|
||||
const data = {
|
||||
...editTransactionFormData,
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
this.recurringDepositsService.executeRecurringDepositsAccountTransactionsCommand(this.recurringDepositAccountId, 'modify', data, this.transactionTemplateData.id)
|
||||
.subscribe(res => {
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user