diff --git a/src/app/groups/common-resolvers/group-actions.resolver.ts b/src/app/groups/common-resolvers/group-actions.resolver.ts index 4345209fc..ca6631940 100644 --- a/src/app/groups/common-resolvers/group-actions.resolver.ts +++ b/src/app/groups/common-resolvers/group-actions.resolver.ts @@ -15,12 +15,12 @@ import { GroupsService } from '../groups.service'; export class GroupActionsResolver implements Resolve { /** - * @param {GroupsService} groupsService Savings service. + * @param {GroupsService} groupsService Groups service. */ constructor(private groupsService: GroupsService) { } /** - * Returns the Savings account actions data. + * Returns the group actions data. * @param {ActivatedRouteSnapshot} route Route Snapshot * @returns {Observable} */ diff --git a/src/app/groups/edit-group/edit-group.component.ts b/src/app/groups/edit-group/edit-group.component.ts index 47da3cd1e..49969fe94 100644 --- a/src/app/groups/edit-group/edit-group.component.ts +++ b/src/app/groups/edit-group/edit-group.component.ts @@ -21,7 +21,7 @@ export class EditGroupComponent implements OnInit { minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ maxDate = new Date(); - /** Group form. */ + /** Edit Group form. */ editGroupForm: FormGroup; /** Staff data. */ staffData: any; @@ -51,7 +51,7 @@ export class EditGroupComponent implements OnInit { } /** - * Creates and sets the group form. + * Creates and sets the edit group form. */ ngOnInit() { this.createEditGroupForm(); @@ -64,7 +64,7 @@ export class EditGroupComponent implements OnInit { } /** - * Creates the group form. + * Creates the edit group form. */ createEditGroupForm() { this.editGroupForm = this.formBuilder.group({ @@ -89,7 +89,7 @@ export class EditGroupComponent implements OnInit { } /** - * Submits the group form and creates group, + * Submits the group form and edits group, * if successful redirects to groups. */ submit() { diff --git a/src/app/groups/groups-view/add-role/add-role.component.html b/src/app/groups/groups-view/add-role/add-role.component.html index dd8d344f4..2db0d501a 100644 --- a/src/app/groups/groups-view/add-role/add-role.component.html +++ b/src/app/groups/groups-view/add-role/add-role.component.html @@ -38,7 +38,8 @@ - + diff --git a/src/app/groups/groups-view/add-role/add-role.component.ts b/src/app/groups/groups-view/add-role/add-role.component.ts index 59c05815d..0d32238ff 100644 --- a/src/app/groups/groups-view/add-role/add-role.component.ts +++ b/src/app/groups/groups-view/add-role/add-role.component.ts @@ -18,7 +18,7 @@ export class AddRoleComponent implements OnInit { /** Groups Add Role Form */ groupsAddRoleForm: FormGroup; - /** Client Menmber Data */ + /** Client Member Data */ clientMemberData: any; /** Role Data */ roleData: any; diff --git a/src/app/groups/groups-view/group-actions/activate-group/activate-group.component.ts b/src/app/groups/groups-view/group-actions/activate-group/activate-group.component.ts index bdbd07ffa..d0e379ee7 100644 --- a/src/app/groups/groups-view/group-actions/activate-group/activate-group.component.ts +++ b/src/app/groups/groups-view/group-actions/activate-group/activate-group.component.ts @@ -23,12 +23,12 @@ export class ActivateGroupComponent implements OnInit { maxDate = new Date(); /** Activate group form. */ activateGroupForm: FormGroup; - /** Group Account Id */ + /** Group Id */ groupId: any; /** * @param {FormBuilder} formBuilder Form Builder - * @param {groupsService} groupsService Shares Service + * @param {groupsService} groupsService Groups Service * @param {DatePipe} datePipe Date Pipe * @param {ActivatedRoute} route Activated Route * @param {Router} router Router @@ -41,9 +41,6 @@ export class ActivateGroupComponent implements OnInit { this.groupId = this.route.parent.snapshot.params['groupId']; } - /** - * Creates the activate group form. - */ ngOnInit() { this.createActivateGroupForm(); } diff --git a/src/app/groups/groups-view/group-actions/attach-group-meeting/attach-group-meeting.component.html b/src/app/groups/groups-view/group-actions/attach-group-meeting/attach-group-meeting.component.html index efbbee406..fbe8bbe32 100644 --- a/src/app/groups/groups-view/group-actions/attach-group-meeting/attach-group-meeting.component.html +++ b/src/app/groups/groups-view/group-actions/attach-group-meeting/attach-group-meeting.component.html @@ -64,7 +64,8 @@ - + diff --git a/src/app/groups/groups-view/group-actions/close-group/close-group.component.html b/src/app/groups/groups-view/group-actions/close-group/close-group.component.html index d82412fea..890281745 100644 --- a/src/app/groups/groups-view/group-actions/close-group/close-group.component.html +++ b/src/app/groups/groups-view/group-actions/close-group/close-group.component.html @@ -26,7 +26,7 @@ - CLosure Reason is required + Closure Reason is required diff --git a/src/app/groups/groups-view/group-actions/close-group/close-group.component.ts b/src/app/groups/groups-view/group-actions/close-group/close-group.component.ts index 164544711..6f915e1cb 100644 --- a/src/app/groups/groups-view/group-actions/close-group/close-group.component.ts +++ b/src/app/groups/groups-view/group-actions/close-group/close-group.component.ts @@ -21,9 +21,9 @@ export class CloseGroupComponent implements OnInit { minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ maxDate = new Date(); - /** Close Share Account form. */ + /** Close Group form. */ closeGroupForm: FormGroup; - /** Group Data */ + /** Group Closure Data */ closureData: any; /** Group Id */ groupId: any; diff --git a/src/app/groups/groups-view/group-actions/edit-group-meeting-schedule/edit-group-meeting-schedule.component.html b/src/app/groups/groups-view/group-actions/edit-group-meeting-schedule/edit-group-meeting-schedule.component.html index 5da12e1ac..4629540ea 100644 --- a/src/app/groups/groups-view/group-actions/edit-group-meeting-schedule/edit-group-meeting-schedule.component.html +++ b/src/app/groups/groups-view/group-actions/edit-group-meeting-schedule/edit-group-meeting-schedule.component.html @@ -36,7 +36,8 @@ - + diff --git a/src/app/groups/groups-view/group-actions/edit-group-meeting/edit-group-meeting.component.html b/src/app/groups/groups-view/group-actions/edit-group-meeting/edit-group-meeting.component.html index 0264fd4c3..bec4dc561 100644 --- a/src/app/groups/groups-view/group-actions/edit-group-meeting/edit-group-meeting.component.html +++ b/src/app/groups/groups-view/group-actions/edit-group-meeting/edit-group-meeting.component.html @@ -71,7 +71,8 @@ - + diff --git a/src/app/groups/groups-view/group-actions/group-actions.component.ts b/src/app/groups/groups-view/group-actions/group-actions.component.ts index 31407d910..a05373360 100644 --- a/src/app/groups/groups-view/group-actions/group-actions.component.ts +++ b/src/app/groups/groups-view/group-actions/group-actions.component.ts @@ -37,6 +37,7 @@ export class GroupActionsComponent { /** * @param {ActivatedRoute} route Activated Route + * @param {Router} router Router */ constructor(private route: ActivatedRoute, private router: Router) { diff --git a/src/app/groups/groups-view/group-actions/group-assign-staff/group-assign-staff.component.ts b/src/app/groups/groups-view/group-actions/group-assign-staff/group-assign-staff.component.ts index 43bb08da0..487452ca6 100644 --- a/src/app/groups/groups-view/group-actions/group-assign-staff/group-assign-staff.component.ts +++ b/src/app/groups/groups-view/group-actions/group-assign-staff/group-assign-staff.component.ts @@ -18,7 +18,7 @@ export class GroupAssignStaffComponent implements OnInit { /** Group Assign Staff form. */ groupAssignStaffForm: FormGroup; - /** Field Officer Data */ + /** Staff Data */ staffData: any; /** Group Data */ groupData: any; @@ -39,9 +39,6 @@ export class GroupAssignStaffComponent implements OnInit { }); } - /** - * Creates the group assign staff form. - */ ngOnInit() { this.staffData = this.groupData.staffOptions; this.createGroupAssignStaffForm(); diff --git a/src/app/groups/groups-view/group-actions/group-attendance/group-attendance.component.html b/src/app/groups/groups-view/group-actions/group-attendance/group-attendance.component.html index bf1a45678..90e65e1cb 100644 --- a/src/app/groups/groups-view/group-actions/group-attendance/group-attendance.component.html +++ b/src/app/groups/groups-view/group-actions/group-attendance/group-attendance.component.html @@ -41,7 +41,8 @@ - + diff --git a/src/app/groups/groups-view/group-actions/group-transfer-clients/group-transfer-clients.component.html b/src/app/groups/groups-view/group-actions/group-transfer-clients/group-transfer-clients.component.html index 2b35033df..e6989d26e 100644 --- a/src/app/groups/groups-view/group-actions/group-transfer-clients/group-transfer-clients.component.html +++ b/src/app/groups/groups-view/group-actions/group-transfer-clients/group-transfer-clients.component.html @@ -69,8 +69,9 @@ - - + + diff --git a/src/app/groups/groups-view/group-actions/group-transfer-clients/group-transfer-clients.component.ts b/src/app/groups/groups-view/group-actions/group-transfer-clients/group-transfer-clients.component.ts index 5a59f06ba..37edea3e3 100644 --- a/src/app/groups/groups-view/group-actions/group-transfer-clients/group-transfer-clients.component.ts +++ b/src/app/groups/groups-view/group-actions/group-transfer-clients/group-transfer-clients.component.ts @@ -24,7 +24,7 @@ export class GroupTransferClientsComponent implements OnInit, AfterViewInit { groupsData: any = []; /** Staff data. */ staffData: any; - /** Group Members. */ + /** Client Members. */ clientMembers: any[] = []; /** diff --git a/src/app/groups/groups-view/group-actions/manage-group-members/manage-group-members.component.ts b/src/app/groups/groups-view/group-actions/manage-group-members/manage-group-members.component.ts index 9556281ab..d84dfe472 100644 --- a/src/app/groups/groups-view/group-actions/manage-group-members/manage-group-members.component.ts +++ b/src/app/groups/groups-view/group-actions/manage-group-members/manage-group-members.component.ts @@ -11,7 +11,9 @@ import { GroupsService } from 'app/groups/groups.service'; import { ClientsService } from 'app/clients/clients.service'; import { MatDialog } from '@angular/material'; - +/** + * Manage Group Members Component + */ @Component({ selector: 'mifosx-manage-group-members', templateUrl: './manage-group-members.component.html', @@ -25,7 +27,7 @@ export class ManageGroupMembersComponent implements AfterViewInit { clientsData: any = []; /** Client Members. */ clientMembers: any[] = []; - /** ClientChoice. */ + /** Client Choice. */ clientChoice = new FormControl(''); /** @@ -72,7 +74,8 @@ export class ManageGroupMembersComponent implements AfterViewInit { /** * Remove client. - * @param index Client's array index. + * @param {number} index Client's array index. + * @param {any} client Client */ removeClient(index: number, client: any) { const removeMemberDialogRef = this.dialog.open(DeleteDialogComponent, { diff --git a/src/app/groups/groups-view/groups-view.component.html b/src/app/groups/groups-view/groups-view.component.html index 344dbc1c2..50677f6a4 100644 --- a/src/app/groups/groups-view/groups-view.component.html +++ b/src/app/groups/groups-view/groups-view.component.html @@ -84,7 +84,7 @@ - + diff --git a/src/app/groups/groups-view/groups-view.component.ts b/src/app/groups/groups-view/groups-view.component.ts index 910458741..fd862f12b 100644 --- a/src/app/groups/groups-view/groups-view.component.ts +++ b/src/app/groups/groups-view/groups-view.component.ts @@ -28,6 +28,9 @@ export class GroupsViewComponent { /** * Fetches group data from `resolve` * @param {ActivatedRoute} route Activated Route + * @param {GroupsService} groupsService Groups Service + * @param {Router} router Router + * @param {MatDialog} dialog Dialog */ constructor(private route: ActivatedRoute, private groupsService: GroupsService, diff --git a/src/app/groups/groups-view/notes-tab/notes-tab.component.ts b/src/app/groups/groups-view/notes-tab/notes-tab.component.ts index dfcb481c2..5207518ac 100644 --- a/src/app/groups/groups-view/notes-tab/notes-tab.component.ts +++ b/src/app/groups/groups-view/notes-tab/notes-tab.component.ts @@ -41,6 +41,9 @@ export class NotesTabComponent implements OnInit { /** * Fetches notes data from `resolve` * @param {Activated Route} route Activated Route. + * @param {FormBuilder} formBuilder FormBuilder + * @param {GroupsService} groupsService Groups Service + * @param {MatDialog} dialog MatDialog * @param {AuthenticationService} authenticationService Authentication Service. */ constructor(private route: ActivatedRoute, diff --git a/src/app/groups/groups.component.html b/src/app/groups/groups.component.html index 0f147e9b9..32c53720e 100644 --- a/src/app/groups/groups.component.html +++ b/src/app/groups/groups.component.html @@ -1,4 +1,5 @@ +
diff --git a/src/app/groups/groups.component.ts b/src/app/groups/groups.component.ts index 75869763b..016a09613 100644 --- a/src/app/groups/groups.component.ts +++ b/src/app/groups/groups.component.ts @@ -2,7 +2,6 @@ import { Component, OnInit, ViewChild, AfterViewInit } from '@angular/core'; import { MatPaginator, MatSort, MatCheckbox } from '@angular/material'; import { FormControl } from '@angular/forms'; -import { Router, ActivatedRoute } from '@angular/router'; /** rxjs Imports */ import { merge } from 'rxjs'; @@ -44,6 +43,9 @@ export class GroupsComponent implements OnInit, AfterViewInit { /** Sorter for groups table. */ @ViewChild(MatSort) sort: MatSort; + /** + * @param {GroupsService} groupsService Groups Service + */ constructor(private groupsService: GroupsService) { } ngOnInit() { diff --git a/src/app/groups/groups.service.ts b/src/app/groups/groups.service.ts index 6986672bf..3ddf8c23c 100644 --- a/src/app/groups/groups.service.ts +++ b/src/app/groups/groups.service.ts @@ -4,7 +4,6 @@ import { HttpClient, HttpParams } from '@angular/common/http'; /** rxjs Imports */ import { Observable } from 'rxjs'; -import { map } from 'rxjs/operators'; /** * Groups service. @@ -19,24 +18,6 @@ export class GroupsService { */ constructor(private http: HttpClient) { } - /** - * @param {string} orderBy Property by which entries should be sorted. - * @param {string} sortOrder Sort order: ascending or descending. - * @param {string} name Filter value for groups names. - * @returns {Observable} Groups. - */ - getFilteredGroups(orderBy: string, sortOrder: string, name: string, officeId?: any, orphansOnly?: any): Observable { - let httpParams = new HttpParams() - .set('name', name) - .set('sortOrder', sortOrder) - .set('orderBy', orderBy); - if (officeId) { - httpParams = httpParams.set('officeId', officeId); - } - httpParams = orphansOnly ? httpParams.set('orphansOnly', orphansOnly) : httpParams; - return this.http.get('/groups', { params: httpParams }); - } - /** * @param {any} filterBy Properties by which entries should be filtered. * @param {string} orderBy Property by which entries should be sorted. @@ -61,25 +42,38 @@ export class GroupsService { return this.http.get('/groups', { params: httpParams }); } + /** + * @param {string} orderBy Property by which entries should be sorted. + * @param {string} sortOrder Sort order: ascending or descending. + * @param {string} name Filter value for groups names. + * @param {any} officeId? Office Id. + * @param {any} orphansOnly? Orphans Only. + * @returns {Observable} Groups. + */ + getFilteredGroups(orderBy: string, sortOrder: string, name: string, officeId?: any, orphansOnly?: any): Observable { + let httpParams = new HttpParams() + .set('name', name) + .set('sortOrder', sortOrder) + .set('orderBy', orderBy); + if (officeId) { + httpParams = httpParams.set('officeId', officeId); + } + httpParams = orphansOnly ? httpParams.set('orphansOnly', orphansOnly) : httpParams; + return this.http.get('/groups', { params: httpParams }); + } + /** * @param {number} officeId Office Id of office to get groups for. * @returns {Observable} */ getGroupsByOfficeId(officeId: number): Observable { - const httpParams = new HttpParams().set('officeId', officeId.toString()); - return this.http.get('/groups', { params: httpParams } ); + const httpParams = new HttpParams().set('officeId', officeId.toString()); + return this.http.get('/groups', { params: httpParams } ); } /** - * @param {string} groupId shares account Id - * @returns {Observable} - */ - deleteGroup(groupId: string): Observable { - return this.http.delete(`/groups/${groupId}`); - } - - /** - * @param groupId Group Id of group to get data for. + * @param {string} groupId Group Id of group to get data for. + * @param {string} template? Is template data required. * @returns {Observable} Group data. */ getGroupData(groupId: string, template?: string): Observable { @@ -98,38 +92,6 @@ export class GroupsService { return this.http.get(`/runreports/GroupSummaryCounts`, { params: httpParams }); } - /** - * @param {any} command Command - * @returns {Observable} - */ - getGroupCommandTemplate(command: string): Observable { - const httpParams = new HttpParams().set('command', command); - return this.http.get(`/groups/template`, { params: httpParams }); - } - - /** - * @param {string} groupId Group Id - * @param {string} command Command - * @param {any} roleId Role Id - * @returns {Observable} - */ - executeGroupCommand(groupId: string, command: string, data: any): Observable { - const httpParams = new HttpParams().set('command', command); - return this.http.post(`/groups/${groupId}`, data, { params: httpParams }); - } - - /** - * @param {string} groupId Group Id - * @param {any} roleId Role Id - * @returns {Observable} - */ - unAssignRoleCommand(groupId: string, roleId: any): Observable { - const httpParams = new HttpParams() - .set('command', 'unassignRole') - .set('roleId', roleId); - return this.http.post(`/groups/${groupId}`, {}, { params: httpParams }); - } - /** * @param groupId Group Id of group to get data for. * @returns {Observable} Group Accounts data. @@ -225,14 +187,35 @@ export class GroupsService { } /** - * @param {number} officeId Office Id of office to get staff for. + * @param {any} command Command + * @returns {Observable} Group Command Template + */ + getGroupCommandTemplate(command: string): Observable { + const httpParams = new HttpParams().set('command', command); + return this.http.get(`/groups/template`, { params: httpParams }); + } + + /** + * @param {string} groupId Group Id + * @param {string} command Command + * @param {any} data Command payload * @returns {Observable} */ - getStaff(id: number): Observable { + executeGroupCommand(groupId: string, command: string, data: any): Observable { + const httpParams = new HttpParams().set('command', command); + return this.http.post(`/groups/${groupId}`, data, { params: httpParams }); + } + + /** + * @param {string} groupId Group Id + * @param {any} roleId Role Id + * @returns {Observable} + */ + unAssignRoleCommand(groupId: string, roleId: any): Observable { const httpParams = new HttpParams() - .set('officeId', id.toString()) - .set('staffInSelectedOfficeOnly', 'true'); - return this.http.get('/groups/template', { params: httpParams }); + .set('command', 'unassignRole') + .set('roleId', roleId); + return this.http.post(`/groups/${groupId}`, {}, { params: httpParams }); } /** @@ -244,7 +227,7 @@ export class GroupsService { } /** - * @param {any} group Group to be created. + * @param {any} group Group to be updated. * @param {any} groupId Group Id * @returns {Observable} */ @@ -252,6 +235,14 @@ export class GroupsService { return this.http.put(`/groups/${groupId}`, group); } + /** + * @param {string} groupId group Id + * @returns {Observable} + */ + deleteGroup(groupId: string): Observable { + return this.http.delete(`/groups/${groupId}`); + } + /** * @param {any} groupId Group Id * @returns {Observable} @@ -262,6 +253,7 @@ export class GroupsService { /** * @param {any} groupId Group Id + * @param {any} calendarId Calendar Id * @returns {Observable} */ getGroupCalendarAndTemplate(groupId: any, calendarId: any): Observable { @@ -271,6 +263,7 @@ export class GroupsService { /** * @param {any} groupId Group Id + * @param {any} data Group meeting data * @returns {Observable} */ createGroupMeeting(groupId: any, data: any): Observable { @@ -279,6 +272,8 @@ export class GroupsService { /** * @param {any} groupId Group Id + * @param {any} data Meeting Data + * @param {any} calendarId Calendar Id * @returns {Observable} */ updateGroupMeeting(groupId: any, data: any, calendarId: any): Observable { @@ -298,6 +293,7 @@ export class GroupsService { /** * @param {any} groupId Group Id * @param {any} calendarId Calendar Id + * @param {any} data Attendance Data * @returns {Observable} */ assignGroupAttendance(groupId: any, calendarId: any, data: any): Observable { @@ -305,4 +301,15 @@ export class GroupsService { return this.http.post(`/groups/${groupId}/meetings`, data, { params: httpParams }); } + /** + * @param {number} id Office Id of office to get staff for. + * @returns {Observable} Staff Data for group. + */ + getStaff(id: number): Observable { + const httpParams = new HttpParams() + .set('officeId', id.toString()) + .set('staffInSelectedOfficeOnly', 'true'); + return this.http.get('/groups/template', { params: httpParams }); + } + }