feat: add centers action (edit-meeting) (#1099)

Fixes: #1098
This commit is contained in:
Muskan Khedia
2020-07-15 00:06:07 +05:30
committed by GitHub
parent 7a249fb257
commit f55aaa0133
15 changed files with 463 additions and 4 deletions
@@ -50,6 +50,19 @@ export class CentersViewComponent implements OnInit {
} else { this.meetingData = false; }
}
/**
* Checks if meeting is editable.
*/
get editMeeting() {
if (this.centerViewData.collectionMeetingCalendar) {
const entityType = this.centerViewData.collectionMeetingCalendar.entityType.value;
if (entityType === 'CENTERS' && this.centerViewData.hierarchy === '.' + this.centerViewData.id + '.' ) {
return true;
}
}
return false;
}
/**
* Performs action button/option action.
* @param {string} name action name.
@@ -63,6 +76,10 @@ export class CentersViewComponent implements OnInit {
case 'Attach Meeting':
this.router.navigate([`actions/${name}`], { relativeTo: this.route });
break;
case 'Edit Meeting':
const queryParams: any = { calendarId: this.centerViewData.collectionMeetingCalendar.id };
this.router.navigate([`actions/${name}`], { relativeTo: this.route, queryParams: queryParams });
break;
case 'Unassign Staff':
this.centersUnassignStaff();
break;