@@ -227,7 +227,8 @@
|
||||
<i class="fa fa-check"></i>
|
||||
</button>
|
||||
<button *ngIf="!element.status.submittedAndPendingApproval && !element.status.active"
|
||||
class="account-action-button" mat-raised-button color="primary">
|
||||
class="account-action-button" mat-raised-button color="primary"
|
||||
[routerLink]="['../','savingsaccounts', element.id, 'actions', 'Undo Approval']">
|
||||
<i class="fa fa-undo"></i>
|
||||
</button>
|
||||
<button *ngIf="!element.status.submittedAndPendingApproval && !element.status.active"
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
<mifosx-reject-savings-account *ngIf="actions['Reject']"></mifosx-reject-savings-account>
|
||||
<mifosx-withdraw-savings-account *ngIf="actions['Withdraw']"></mifosx-withdraw-savings-account>
|
||||
<mifosx-activate-savings-account *ngIf="actions['Activate']"></mifosx-activate-savings-account>
|
||||
|
||||
<mifosx-undo-approval-savings-account *ngIf="actions['Undo Approval']"></mifosx-undo-approval-savings-account>
|
||||
@@ -20,11 +20,13 @@ export class SavingAccountActionsComponent {
|
||||
'Reject': boolean
|
||||
'Withdraw': boolean
|
||||
'Activate': boolean
|
||||
'Undo Approval': boolean
|
||||
} = {
|
||||
'Approve': false,
|
||||
'Reject': false,
|
||||
'Withdraw': false,
|
||||
'Activate': false
|
||||
'Activate': false,
|
||||
'Undo Approval': false
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
<div class="container">
|
||||
|
||||
<mat-card>
|
||||
|
||||
<form [formGroup]="undoApprovalSavingsAccountForm" (ngSubmit)="submit()">
|
||||
|
||||
<mat-card-content>
|
||||
|
||||
<mat-form-field fxFlex>
|
||||
<mat-label>Note</mat-label>
|
||||
<textarea matInput formControlName="note"></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]="['../../']">Cancel</button>
|
||||
<button mat-raised-button color="warn" [disabled]="!undoApprovalSavingsAccountForm.valid">Confirm</button>
|
||||
</mat-card-actions>
|
||||
|
||||
</form>
|
||||
|
||||
</mat-card>
|
||||
|
||||
</div>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.container {
|
||||
max-width: 37rem;
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { UndoApprovalSavingsAccountComponent } from './undo-approval-savings-account.component';
|
||||
|
||||
describe('UndoApprovalSavingsAccountComponent', () => {
|
||||
let component: UndoApprovalSavingsAccountComponent;
|
||||
let fixture: ComponentFixture<UndoApprovalSavingsAccountComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ UndoApprovalSavingsAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(UndoApprovalSavingsAccountComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormGroup, FormBuilder } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
/** Custom Services */
|
||||
import { SavingsService } from 'app/savings/savings.service';
|
||||
|
||||
/**
|
||||
* Undo Approval Savings Account Component
|
||||
*/
|
||||
@Component({
|
||||
selector: 'mifosx-undo-approval-savings-account',
|
||||
templateUrl: './undo-approval-savings-account.component.html',
|
||||
styleUrls: ['./undo-approval-savings-account.component.scss']
|
||||
})
|
||||
export class UndoApprovalSavingsAccountComponent implements OnInit {
|
||||
|
||||
/** Undo Approval Savings Account form. */
|
||||
undoApprovalSavingsAccountForm: FormGroup;
|
||||
/** Savings Account Id */
|
||||
accountId: any;
|
||||
|
||||
/**
|
||||
* @param {FormBuilder} formBuilder Form Builder
|
||||
* @param {SavingsService} savingsService Savings Service
|
||||
* @param {ActivatedRoute} route Activated Route
|
||||
* @param {Router} router Router
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private savingsService: SavingsService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router) {
|
||||
this.accountId = this.route.parent.snapshot.params['savingAccountId'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the undo-approval savings form.
|
||||
*/
|
||||
ngOnInit() {
|
||||
this.createUndoApprovalSavingsAccountForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the undo-approval savings account form.
|
||||
*/
|
||||
createUndoApprovalSavingsAccountForm() {
|
||||
this.undoApprovalSavingsAccountForm = this.formBuilder.group({
|
||||
'note': ['']
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Submits the form and undo the approval of share account,
|
||||
* if successful redirects to the share account.
|
||||
*/
|
||||
submit() {
|
||||
const data = {
|
||||
...this.undoApprovalSavingsAccountForm.value,
|
||||
};
|
||||
this.savingsService.executeSavingsAccountCommand(this.accountId, 'undoapproval', data).subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
<div>
|
||||
<img mat-card-md-image class="profile-image"
|
||||
matTooltip="Savings Account"
|
||||
src="assets/images/savings_account_placeholder.png">
|
||||
[src]="'assets/images/savings_account_placeholder.png'">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -102,6 +102,7 @@ export class SavingsAccountViewComponent implements OnInit {
|
||||
case 'Reject':
|
||||
case 'Withdraw':
|
||||
case 'Activate':
|
||||
case 'Undo Approval':
|
||||
this.router.navigate([`actions/${name}`], { relativeTo: this.route });
|
||||
break;
|
||||
case 'Modify Application':
|
||||
|
||||
@@ -29,6 +29,7 @@ import { ApproveSavingsAccountComponent } from './saving-account-actions/approve
|
||||
import { RejectSavingsAccountComponent } from './saving-account-actions/reject-savings-account/reject-savings-account.component';
|
||||
import { WithdrawSavingsAccountComponent } from './saving-account-actions/withdraw-savings-account/withdraw-savings-account.component';
|
||||
import { ActivateSavingsAccountComponent } from './saving-account-actions/activate-savings-account/activate-savings-account.component';
|
||||
import { UndoApprovalSavingsAccountComponent } from './saving-account-actions/undo-approval-savings-account/undo-approval-savings-account.component';
|
||||
|
||||
/**
|
||||
* Savings Module
|
||||
@@ -62,7 +63,8 @@ import { ActivateSavingsAccountComponent } from './saving-account-actions/activa
|
||||
ApproveSavingsAccountComponent,
|
||||
RejectSavingsAccountComponent,
|
||||
WithdrawSavingsAccountComponent,
|
||||
ActivateSavingsAccountComponent
|
||||
ActivateSavingsAccountComponent,
|
||||
UndoApprovalSavingsAccountComponent
|
||||
],
|
||||
providers: [DatePipe]
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user