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
+7
-7
@@ -6,16 +6,16 @@
|
||||
|
||||
<mat-form-field fxFlex>
|
||||
<mat-label>Note</mat-label>
|
||||
<textarea matInput [formControl]="note"></textarea>
|
||||
<textarea matInput [formControl]="note" cdkTextareaAutosize cdkAutosizeMinRows="2"></textarea>
|
||||
</mat-form-field>
|
||||
|
||||
</mat-card-content>
|
||||
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
|
||||
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
|
||||
<button mat-raised-button color="primary" (click)="submit()"
|
||||
*mifosxHasPermission="'DISBURSALUNDO_LOAN'">Submit</button>
|
||||
</mat-card-actions>
|
||||
|
||||
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
|
||||
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
|
||||
<button mat-raised-button color="primary" (click)="submit()"
|
||||
*mifosxHasPermission="'DISBURSALUNDO_LOAN'">Submit</button>
|
||||
</mat-card-actions>
|
||||
</mat-card-content>
|
||||
|
||||
</mat-card>
|
||||
|
||||
|
||||
+8
-2
@@ -1,5 +1,5 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { FormControl, FormBuilder } from '@angular/forms';
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
|
||||
@@ -16,6 +16,8 @@ import { LoansService } from '../../../loans.service';
|
||||
})
|
||||
export class UndoDisbursalComponent implements OnInit {
|
||||
|
||||
@Input() actionName: string;
|
||||
|
||||
/** Loan ID. */
|
||||
loanId: any;
|
||||
/** Undo disbursal form. */
|
||||
@@ -45,7 +47,11 @@ export class UndoDisbursalComponent implements OnInit {
|
||||
* Submits the undo disbursal form.
|
||||
*/
|
||||
submit() {
|
||||
this.loansService.loanActionButtons(this.loanId, 'undodisbursal', {'note': this.note.value}).subscribe((response: any) => {
|
||||
let command = 'undodisbursal';
|
||||
if (this.actionName === 'Undo Last Disbursal') {
|
||||
command = 'undolastdisbursal';
|
||||
}
|
||||
this.loansService.loanActionButtons(this.loanId, command, {'note': this.note.value}).subscribe((response: any) => {
|
||||
this.router.navigate(['../../general'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user