feat: add centers action (activate) (#1085)

Fixes: #1084
This commit is contained in:
Muskan Khedia
2020-07-14 10:42:53 +05:30
committed by GitHub
parent 6c081eb724
commit f861e466bf
15 changed files with 276 additions and 37 deletions
@@ -1,6 +1,7 @@
/** Angular Imports */
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { ActivatedRoute, Router } from '@angular/router';
import { MatDialog } from '@angular/material';
/**
* Create Center View
@@ -23,7 +24,9 @@ export class CentersViewComponent implements OnInit {
* Retrieves the data for center
* @param route route Activated Route.
*/
constructor(private route: ActivatedRoute) {
constructor(private route: ActivatedRoute,
private router: Router,
public dialog: MatDialog) {
this.route.data.subscribe((data: {
centerViewData: any,
centerDatatables: any
@@ -39,4 +42,16 @@ export class CentersViewComponent implements OnInit {
} else { this.meetingData = false; }
}
/**
* 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;
}
}
}