feat: add edit share account page (#881)

Fixes: #880
This commit is contained in:
Karan Takalkar
2020-06-17 15:15:39 +05:30
committed by GitHub
parent d51bd6466a
commit 21c54d0baa
16 changed files with 385 additions and 42 deletions
@@ -34,7 +34,7 @@
<mat-card-actions class="account-actions">
<ng-container *ngFor="let button of buttonConfig.singleButtons">
<button mat-raised-button *mifosxHasPermission="button.taskPermissionName">
<button mat-raised-button *mifosxHasPermission="button.taskPermissionName" (click)="doAction(button.name)">
<i class="{{button.icon}}"></i> {{button.name}}</button>
</ng-container>
@@ -1,6 +1,6 @@
/** Angular Imports */
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { ActivatedRoute, Router } from '@angular/router';
/** Custom Buttons Configuration */
import { SharesButtonsConfiguration } from './shares-buttons.config';
@@ -24,7 +24,8 @@ export class SharesAccountViewComponent implements OnInit {
* Fetches shares account data from `resolve`
* @param {ActivatedRoute} route Activated Route
*/
constructor(private route: ActivatedRoute) {
constructor(private route: ActivatedRoute,
private router: Router) {
this.route.data.subscribe((data: { sharesAccountData: any }) => {
this.sharesAccountData = data.sharesAccountData;
});
@@ -66,4 +67,12 @@ export class SharesAccountViewComponent implements OnInit {
}
}
doAction(name: string) {
switch (name) {
case 'Modify Application':
this.router.navigate(['edit-shares-account'], { relativeTo: this.route });
break;
}
}
}
@@ -4,14 +4,12 @@ export class SharesButtonsConfiguration {
optionArray: {
name: string,
taskPermissionName: string,
action?: Function
}[];
buttonsArray: {
name: string,
icon: string,
taskPermissionName: string,
action?: Function
}[];
constructor(status: string) {