Set autosize and min two rows in textarea controls (#1604)
Co-authored-by: Jose Alberto Hernandez <alberto@MacBook-Pro.local>
This commit is contained in:
co-authored by
Jose Alberto Hernandez
parent
7bbab6423e
commit
475059a974
@@ -28,12 +28,15 @@ export class LoansViewComponent implements OnInit {
|
||||
recalculateInterest: any;
|
||||
/** Status */
|
||||
status: string;
|
||||
entityType: string;
|
||||
/** Loan Id */
|
||||
loanId: number;
|
||||
/** Client Id */
|
||||
clientId: any;
|
||||
clientId: number;
|
||||
/** Button Configuration */
|
||||
buttonConfig: LoansAccountButtonConfiguration;
|
||||
/** Disburse Transaction number */
|
||||
disburseTransactionNo = 0;
|
||||
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
@@ -51,6 +54,21 @@ export class LoansViewComponent implements OnInit {
|
||||
this.recalculateInterest = this.loanDetailsData.recalculateInterest || true;
|
||||
this.status = this.loanDetailsData.status.value;
|
||||
this.setConditionalButtons();
|
||||
|
||||
if (this.loanDetailsData.multiDisburseLoan) {
|
||||
this.loanDetailsData.transactions.forEach((tranaction: any) => {
|
||||
if (tranaction.type.disbursement) {
|
||||
this.disburseTransactionNo++;
|
||||
}
|
||||
});
|
||||
}
|
||||
if (this.router.url.includes('clients')) {
|
||||
this.entityType = 'Client';
|
||||
} else if (this.router.url.includes('groups')) {
|
||||
this.entityType = 'Group';
|
||||
} else if (this.router.url.includes('centers')) {
|
||||
this.entityType = 'Center';
|
||||
}
|
||||
}
|
||||
|
||||
// Defines the buttons based on the status of the loan account
|
||||
@@ -61,12 +79,14 @@ export class LoansViewComponent implements OnInit {
|
||||
|
||||
this.buttonConfig.addOption({
|
||||
name: (this.loanDetailsData.loanOfficerName ? 'Change Loan Officer' : 'Assign Loan Officer'),
|
||||
icon: 'user-tie',
|
||||
taskPermissionName: 'DISBURSE_LOAN'
|
||||
});
|
||||
|
||||
if (this.loanDetailsData.isVariableInstallmentsAllowed) {
|
||||
this.buttonConfig.addOption({
|
||||
name: 'Edit Repayment Schedule',
|
||||
icon: 'edit',
|
||||
taskPermissionName: 'ADJUST_REPAYMENT_SCHEDULE'
|
||||
});
|
||||
}
|
||||
@@ -75,7 +95,7 @@ export class LoansViewComponent implements OnInit {
|
||||
|
||||
this.buttonConfig.addButton({
|
||||
name: (this.loanDetailsData.loanOfficerName ? 'Change Loan Officer' : 'Assign Loan Officer'),
|
||||
icon: 'fa fa-user',
|
||||
icon: 'user-tie',
|
||||
taskPermissionName: 'DISBURSE_LOAN'
|
||||
});
|
||||
|
||||
@@ -83,24 +103,30 @@ export class LoansViewComponent implements OnInit {
|
||||
if (this.loanDetailsData.canDisburse || this.loanDetailsData.multiDisburseLoan) {
|
||||
this.buttonConfig.addButton({
|
||||
name: 'Disburse',
|
||||
icon: 'fa fa-flag',
|
||||
icon: 'hand-holding-usd',
|
||||
taskPermissionName: 'DISBURSE_LOAN'
|
||||
});
|
||||
}
|
||||
if (this.loanDetailsData.canDisburse) {
|
||||
this.buttonConfig.addButton({
|
||||
name: 'Disburse To Savings',
|
||||
icon: 'fa fa-flag',
|
||||
icon: 'piggy-bank',
|
||||
taskPermissionName: 'DISBURSETOSAVINGS_LOAN'
|
||||
});
|
||||
}
|
||||
|
||||
if (this.loanDetailsData.multiDisburseLoan && this.disburseTransactionNo > 1) {
|
||||
this.buttonConfig.addButton({
|
||||
name: 'Undo Last Disbursal',
|
||||
icon: 'undo',
|
||||
taskPermissionName: 'DISBURSALLASTUNDO_LOAN'
|
||||
});
|
||||
}
|
||||
// loan officer not assigned to loan, below logic
|
||||
// helps to display otherwise not
|
||||
if (!this.loanDetailsData.loanOfficerName) {
|
||||
this.buttonConfig.addButton({
|
||||
name: 'Assign Loan Officer',
|
||||
icon: 'fa fa-user',
|
||||
icon: 'user-tie',
|
||||
taskPermissionName: 'UPDATELOANOFFICER_LOAN'
|
||||
});
|
||||
}
|
||||
@@ -108,7 +134,7 @@ export class LoansViewComponent implements OnInit {
|
||||
if (this.recalculateInterest) {
|
||||
this.buttonConfig.addButton({
|
||||
name: 'Prepay Loan',
|
||||
icon: 'fa fa-money',
|
||||
icon: 'coins',
|
||||
taskPermissionName: 'REPAYMENT_LOAN'
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user