WEB-252: Buy Down fee adjustment template pop up window - Adjustment button active / not active
This commit is contained in:
@@ -120,7 +120,6 @@ export class MakeAccountTransfersComponent implements OnInit, AfterViewInit {
|
|||||||
this.id = this.route.snapshot.queryParams['savingsId'];
|
this.id = this.route.snapshot.queryParams['savingsId'];
|
||||||
this.interbank = this.route.snapshot.queryParams['interbank'] === 'true';
|
this.interbank = this.route.snapshot.queryParams['interbank'] === 'true';
|
||||||
this.balance = this.router.getCurrentNavigation().extras.state.balance;
|
this.balance = this.router.getCurrentNavigation().extras.state.balance;
|
||||||
console.log('is interbank?', this.interbank);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
this.accountTypeId = '0';
|
this.accountTypeId = '0';
|
||||||
|
|||||||
-2
@@ -71,8 +71,6 @@ export class MakeRepaymentComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.command = this.dataObject.type.code.split('.')[1];
|
this.command = this.dataObject.type.code.split('.')[1];
|
||||||
console.log(this.command);
|
|
||||||
console.log(this.dataObject.type);
|
|
||||||
this.maxDate = this.settingsService.businessDate;
|
this.maxDate = this.settingsService.businessDate;
|
||||||
this.createRepaymentLoanForm();
|
this.createRepaymentLoanForm();
|
||||||
this.setRepaymentLoanDetails();
|
this.setRepaymentLoanDetails();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||||
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { UntypedFormControl, ReactiveFormsModule } from '@angular/forms';
|
import { UntypedFormControl, Validators } from '@angular/forms';
|
||||||
import { MatPaginator } from '@angular/material/paginator';
|
import { MatPaginator } from '@angular/material/paginator';
|
||||||
import { MatSort } from '@angular/material/sort';
|
import { MatSort } from '@angular/material/sort';
|
||||||
import {
|
import {
|
||||||
@@ -29,9 +29,9 @@ import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base';
|
|||||||
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
|
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
|
||||||
import { AlertService } from 'app/core/alert/alert.service';
|
import { AlertService } from 'app/core/alert/alert.service';
|
||||||
import { DatepickerBase } from 'app/shared/form-dialog/formfield/model/datepicker-base';
|
import { DatepickerBase } from 'app/shared/form-dialog/formfield/model/datepicker-base';
|
||||||
import { NgIf, NgClass } from '@angular/common';
|
import { NgClass } from '@angular/common';
|
||||||
import { MatCheckbox } from '@angular/material/checkbox';
|
import { MatCheckbox } from '@angular/material/checkbox';
|
||||||
import { MatButton, MatIconButton } from '@angular/material/button';
|
import { MatIconButton } from '@angular/material/button';
|
||||||
import { ExternalIdentifierComponent } from '../../../shared/external-identifier/external-identifier.component';
|
import { ExternalIdentifierComponent } from '../../../shared/external-identifier/external-identifier.component';
|
||||||
import { MatMenuTrigger, MatMenu, MatMenuItem } from '@angular/material/menu';
|
import { MatMenuTrigger, MatMenu, MatMenuItem } from '@angular/material/menu';
|
||||||
import { MatIcon } from '@angular/material/icon';
|
import { MatIcon } from '@angular/material/icon';
|
||||||
@@ -472,8 +472,11 @@ export class TransactionsTabComponent implements OnInit {
|
|||||||
value: transactionAmount,
|
value: transactionAmount,
|
||||||
type: 'number',
|
type: 'number',
|
||||||
required: true,
|
required: true,
|
||||||
max: transactionAmount,
|
|
||||||
min: 0.001,
|
min: 0.001,
|
||||||
|
max: transactionAmount,
|
||||||
|
validators: [
|
||||||
|
Validators.min(0.001),
|
||||||
|
Validators.max(transactionAmount)],
|
||||||
order: 2
|
order: 2
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -481,7 +484,8 @@ export class TransactionsTabComponent implements OnInit {
|
|||||||
const data = {
|
const data = {
|
||||||
title: `Adjustment ${transaction.type.value} Transaction`,
|
title: `Adjustment ${transaction.type.value} Transaction`,
|
||||||
layout: { addButtonText: 'Adjustment' },
|
layout: { addButtonText: 'Adjustment' },
|
||||||
formfields: formfields
|
formfields: formfields,
|
||||||
|
pristine: false
|
||||||
};
|
};
|
||||||
const chargebackDialogRef = this.dialog.open(FormDialogComponent, { data });
|
const chargebackDialogRef = this.dialog.open(FormDialogComponent, { data });
|
||||||
chargebackDialogRef.afterClosed().subscribe((response: { data: any }) => {
|
chargebackDialogRef.afterClosed().subscribe((response: { data: any }) => {
|
||||||
@@ -544,8 +548,11 @@ export class TransactionsTabComponent implements OnInit {
|
|||||||
value: transactionAmount,
|
value: transactionAmount,
|
||||||
type: 'number',
|
type: 'number',
|
||||||
required: true,
|
required: true,
|
||||||
max: transactionAmount,
|
|
||||||
min: 0.001,
|
min: 0.001,
|
||||||
|
max: transactionAmount,
|
||||||
|
validators: [
|
||||||
|
Validators.min(0.001),
|
||||||
|
Validators.max(transactionAmount)],
|
||||||
order: 2
|
order: 2
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -553,7 +560,8 @@ export class TransactionsTabComponent implements OnInit {
|
|||||||
const data = {
|
const data = {
|
||||||
title: `Adjustment ${transaction.type.value} Transaction`,
|
title: `Adjustment ${transaction.type.value} Transaction`,
|
||||||
layout: { addButtonText: 'Adjustment' },
|
layout: { addButtonText: 'Adjustment' },
|
||||||
formfields: formfields
|
formfields: formfields,
|
||||||
|
pristine: false
|
||||||
};
|
};
|
||||||
const chargebackDialogRef = this.dialog.open(FormDialogComponent, { data });
|
const chargebackDialogRef = this.dialog.open(FormDialogComponent, { data });
|
||||||
chargebackDialogRef.afterClosed().subscribe((response: { data: any }) => {
|
chargebackDialogRef.afterClosed().subscribe((response: { data: any }) => {
|
||||||
|
|||||||
@@ -204,7 +204,6 @@ export class ViewTransactionComponent implements OnInit {
|
|||||||
* Undo the loans transaction
|
* Undo the loans transaction
|
||||||
*/
|
*/
|
||||||
undoTransaction() {
|
undoTransaction() {
|
||||||
console.log(this.transactionData);
|
|
||||||
const accountId = this.route.snapshot.params['loanId'];
|
const accountId = this.route.snapshot.params['loanId'];
|
||||||
|
|
||||||
if (this.transactionType.contractTermination) {
|
if (this.transactionType.contractTermination) {
|
||||||
|
|||||||
-1
@@ -54,7 +54,6 @@ export class SavingsActiveClientMembersComponent implements OnInit {
|
|||||||
|
|
||||||
dataSource: any;
|
dataSource: any;
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
console.log('Active Client Members in LoansActiveClientMembersComponent:', this.activeClientMembers);
|
|
||||||
this.dataSource = new MatTableDataSource<any>(this.activeClientMembers);
|
this.dataSource = new MatTableDataSource<any>(this.activeClientMembers);
|
||||||
}
|
}
|
||||||
get selectedClientMembers() {
|
get selectedClientMembers() {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
|
import { UntypedFormControl, UntypedFormGroup, ValidatorFn, Validators } from '@angular/forms';
|
||||||
|
|
||||||
import { FormfieldBase } from './formfield/model/formfield-base';
|
import { FormfieldBase } from './formfield/model/formfield-base';
|
||||||
|
|
||||||
@@ -14,10 +14,21 @@ export class FormGroupService {
|
|||||||
|
|
||||||
formfields.forEach((formfield) => {
|
formfields.forEach((formfield) => {
|
||||||
group[formfield.controlName] = formfield.required
|
group[formfield.controlName] = formfield.required
|
||||||
? new UntypedFormControl(formfield.value, Validators.required)
|
? new UntypedFormControl(formfield.value, this.buildValidators(formfield))
|
||||||
: new UntypedFormControl(formfield.value);
|
: new UntypedFormControl(formfield.value, this.buildValidators(formfield));
|
||||||
});
|
});
|
||||||
|
|
||||||
return new UntypedFormGroup(group);
|
return new UntypedFormGroup(group);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buildValidators(formfield: FormfieldBase): ValidatorFn[] {
|
||||||
|
let validators: ValidatorFn[] = [];
|
||||||
|
if (formfield.required) {
|
||||||
|
validators.push(Validators.required);
|
||||||
|
}
|
||||||
|
if (formfield.validators) {
|
||||||
|
formfield.validators.forEach((validator: ValidatorFn) => validators.push(validator));
|
||||||
|
}
|
||||||
|
return validators;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,12 @@
|
|||||||
[formControlName]="formfield.controlName"
|
[formControlName]="formfield.controlName"
|
||||||
[required]="formfield.required"
|
[required]="formfield.required"
|
||||||
/>
|
/>
|
||||||
|
<mat-error *ngIf="form.controls[formfield.controlName].hasError('max')">
|
||||||
|
<strong>{{ 'labels.commons.Maximum Value must be' | translate }} {{ formfield.max }}</strong>
|
||||||
|
</mat-error>
|
||||||
|
<mat-error *ngIf="form.controls[formfield.controlName].hasError('min')">
|
||||||
|
<strong>{{ 'labels.commons.Minimum Value must be' | translate }} {{ formfield.min }}</strong>
|
||||||
|
</mat-error>
|
||||||
|
|
||||||
<mat-select
|
<mat-select
|
||||||
*ngIf="formfield.controlType === 'select'"
|
*ngIf="formfield.controlType === 'select'"
|
||||||
|
|||||||
@@ -1,10 +1,16 @@
|
|||||||
|
import { ValidatorFn } from '@angular/forms';
|
||||||
|
|
||||||
export class FormfieldBase {
|
export class FormfieldBase {
|
||||||
controlType: string;
|
controlType: string;
|
||||||
controlName: string;
|
controlName: string;
|
||||||
|
type: string;
|
||||||
label: string;
|
label: string;
|
||||||
value: any;
|
value: any;
|
||||||
required: boolean;
|
required: boolean;
|
||||||
order: number;
|
order: number;
|
||||||
|
validators?: ValidatorFn[];
|
||||||
|
min?: number | null;
|
||||||
|
max?: number | null;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
options: {
|
options: {
|
||||||
@@ -14,6 +20,9 @@ export class FormfieldBase {
|
|||||||
value?: any;
|
value?: any;
|
||||||
required?: boolean;
|
required?: boolean;
|
||||||
order?: number;
|
order?: number;
|
||||||
|
validators?: ValidatorFn[];
|
||||||
|
min?: number | null;
|
||||||
|
max?: number | null;
|
||||||
} = {}
|
} = {}
|
||||||
) {
|
) {
|
||||||
this.controlType = options.controlType || '';
|
this.controlType = options.controlType || '';
|
||||||
@@ -22,5 +31,8 @@ export class FormfieldBase {
|
|||||||
this.value = options.value === undefined ? '' : options.value;
|
this.value = options.value === undefined ? '' : options.value;
|
||||||
this.required = !!options.required;
|
this.required = !!options.required;
|
||||||
this.order = options.order === undefined ? 1 : options.order;
|
this.order = options.order === undefined ? 1 : options.order;
|
||||||
|
this.validators = options.validators === undefined ? [] : options.validators;
|
||||||
|
this.min = options.min === undefined ? null : options.min;
|
||||||
|
this.max = options.max === undefined ? null : options.max;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,8 +39,6 @@ export class AuditTrailsDataSource implements DataSource<any> {
|
|||||||
pageIndex: number = 0,
|
pageIndex: number = 0,
|
||||||
limit: number = 10
|
limit: number = 10
|
||||||
) {
|
) {
|
||||||
console.log(pageIndex);
|
|
||||||
console.log(limit);
|
|
||||||
this.auditTrailsSubject.next([]);
|
this.auditTrailsSubject.next([]);
|
||||||
this.systemService
|
this.systemService
|
||||||
.getAuditTrails(filterBy, orderBy, sortOrder, pageIndex * limit, limit)
|
.getAuditTrails(filterBy, orderBy, sortOrder, pageIndex * limit, limit)
|
||||||
|
|||||||
Reference in New Issue
Block a user