diff --git a/src/app/clients/clients-view/general-tab/general-tab.component.html b/src/app/clients/clients-view/general-tab/general-tab.component.html index 9c79ddd8e..c5bc05322 100644 --- a/src/app/clients/clients-view/general-tab/general-tab.component.html +++ b/src/app/clients/clients-view/general-tab/general-tab.component.html @@ -306,7 +306,7 @@ + + + + + + + + diff --git a/src/app/shares/shares-account-actions/undo-approval-shares-account/undo-approval-shares-account.component.scss b/src/app/shares/shares-account-actions/undo-approval-shares-account/undo-approval-shares-account.component.scss new file mode 100644 index 000000000..5096d3538 --- /dev/null +++ b/src/app/shares/shares-account-actions/undo-approval-shares-account/undo-approval-shares-account.component.scss @@ -0,0 +1,7 @@ +.container { + max-width: 37rem; + .confirm-text { + font-size: 16px; + text-align: center; + } +} diff --git a/src/app/shares/shares-account-actions/undo-approval-shares-account/undo-approval-shares-account.component.spec.ts b/src/app/shares/shares-account-actions/undo-approval-shares-account/undo-approval-shares-account.component.spec.ts new file mode 100644 index 000000000..3752c6c71 --- /dev/null +++ b/src/app/shares/shares-account-actions/undo-approval-shares-account/undo-approval-shares-account.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { UndoApprovalSharesAccountComponent } from './undo-approval-shares-account.component'; + +describe('UndoApprovalSharesAccountComponent', () => { + let component: UndoApprovalSharesAccountComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ UndoApprovalSharesAccountComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(UndoApprovalSharesAccountComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/shares/shares-account-actions/undo-approval-shares-account/undo-approval-shares-account.component.ts b/src/app/shares/shares-account-actions/undo-approval-shares-account/undo-approval-shares-account.component.ts new file mode 100644 index 000000000..851d94b71 --- /dev/null +++ b/src/app/shares/shares-account-actions/undo-approval-shares-account/undo-approval-shares-account.component.ts @@ -0,0 +1,37 @@ +/** Angular Imports */ +import { Component } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; + +/** Custom Services */ +import { SharesService } from 'app/shares/shares.service'; + +/** + * Undo Approval Shares Account Component + */ +@Component({ + selector: 'mifosx-undo-approval-shares-account', + templateUrl: './undo-approval-shares-account.component.html', + styleUrls: ['./undo-approval-shares-account.component.scss'] +}) +export class UndoApprovalSharesAccountComponent { + + /** Shares Account Id */ + accountId: any; + + constructor(private sharesService: SharesService, + private route: ActivatedRoute, + private router: Router) { + this.accountId = this.route.parent.parent.snapshot.params['shareAccountId']; + } + + /** + * Submits the form and undo the approval of share account, + * if successful redirects to the share account. + */ + submit() { + this.sharesService.executeSharesAccountCommand(this.accountId, 'undoapproval', {}).subscribe(() => { + this.router.navigate(['../../'], { relativeTo: this.route }); + }); + } + +} diff --git a/src/app/shares/shares-account-view/shares-account-view.component.ts b/src/app/shares/shares-account-view/shares-account-view.component.ts index 0d4f706bc..4417a4917 100644 --- a/src/app/shares/shares-account-view/shares-account-view.component.ts +++ b/src/app/shares/shares-account-view/shares-account-view.component.ts @@ -97,6 +97,9 @@ export class SharesAccountViewComponent implements OnInit { case 'Activate': this.router.navigate(['actions/Activate'], { relativeTo: this.route }); break; + case 'Undo Approval': + this.router.navigate(['actions/Undo Approval'], { relativeTo: this.route }); + break; case 'Delete': this.deleteSharesAccount(); break; diff --git a/src/app/shares/shares.module.ts b/src/app/shares/shares.module.ts index af0690c94..add5ce279 100644 --- a/src/app/shares/shares.module.ts +++ b/src/app/shares/shares.module.ts @@ -22,6 +22,7 @@ import { ApproveSharesAccountComponent } from './shares-account-actions/approve- import { RejectSharesAccountComponent } from './shares-account-actions/reject-shares-account/reject-shares-account.component'; import { CloseSharesAccountComponent } from './shares-account-actions/close-shares-account/close-shares-account.component'; import { ActivateSharesAccountComponent } from './shares-account-actions/activate-shares-account/activate-shares-account.component'; +import { UndoApprovalSharesAccountComponent } from './shares-account-actions/undo-approval-shares-account/undo-approval-shares-account.component'; /** * Shares Module @@ -50,7 +51,8 @@ import { ActivateSharesAccountComponent } from './shares-account-actions/activat ApproveSharesAccountComponent, RejectSharesAccountComponent, CloseSharesAccountComponent, - ActivateSharesAccountComponent + ActivateSharesAccountComponent, + UndoApprovalSharesAccountComponent ], providers: [DatePipe] })