feat: add recurring deposit actions (activate) (#1002)

Fixes: #1000
This commit is contained in:
Muskan Khedia
2020-07-07 14:20:59 +05:30
committed by GitHub
parent 3b7406057a
commit a472d886dd
14 changed files with 314 additions and 48 deletions
@@ -39,15 +39,15 @@
<mat-card-actions class="account-actions">
<ng-container *ngFor="let button of buttonConfig.singleButtons">
<button mat-raised-button >
<button mat-raised-button (click)="doAction(button.name)">
<i class="{{button.icon}}"></i> {{button.name}}</button>
</ng-container>
<ng-container *ngIf="buttonConfig.options.length > 0">
<ng-container *ngIf="buttonConfig.options.length">
<button mat-raised-button [matMenuTriggerFor]="More">More</button>
<mat-menu #More="matMenu">
<span *ngFor="let option of buttonConfig.options">
<button mat-menu-item >{{option.name}}</button>
<button mat-menu-item (click)="doAction(option.name)">{{option.name}}</button>
</span>
</mat-menu>
</ng-container>
@@ -71,4 +71,16 @@ export class RecurringDepositsAccountViewComponent implements OnInit {
}
}
/**
* Performs action button/option action.
* @param {string} name action name.
*/
doAction(name: string) {
switch (name) {
case 'Activate':
this.router.navigate([`actions/${name}`], { relativeTo: this.route });
break;
}
}
}