build: Use prettier for typescript
Stop ignoring .ts files in prettier and fix existing issues.
This commit is contained in:
@@ -8,9 +8,8 @@ describe('AddRoleComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ AddRoleComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [AddRoleComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -15,7 +15,6 @@ import { GroupsService } from '../../groups.service';
|
||||
styleUrls: ['./add-role.component.scss']
|
||||
})
|
||||
export class AddRoleComponent implements OnInit {
|
||||
|
||||
/** Groups Add Role Form */
|
||||
groupsAddRoleForm: UntypedFormGroup;
|
||||
/** Client Member Data */
|
||||
@@ -31,10 +30,12 @@ export class AddRoleComponent implements OnInit {
|
||||
* @param {ActivatedRoute} route Activated Route
|
||||
* @param {Router} router Router
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private groupsService: GroupsService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private groupsService: GroupsService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router
|
||||
) {
|
||||
this.route.data.subscribe((data: { groupAndTemplateData: any }) => {
|
||||
this.groupAndTemplateData = data.groupAndTemplateData;
|
||||
});
|
||||
@@ -51,8 +52,14 @@ export class AddRoleComponent implements OnInit {
|
||||
*/
|
||||
createGroupsAddRoleForm() {
|
||||
this.groupsAddRoleForm = this.formBuilder.group({
|
||||
'clientId': ['', Validators.required],
|
||||
'role': ['', Validators.required]
|
||||
clientId: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
role: [
|
||||
'',
|
||||
Validators.required
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -60,9 +67,10 @@ export class AddRoleComponent implements OnInit {
|
||||
* Submits the form and assigns the group role.
|
||||
*/
|
||||
submit() {
|
||||
this.groupsService.executeGroupCommand(this.groupAndTemplateData.id, 'assignRole', this.groupsAddRoleForm.value).subscribe(() => {
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
});
|
||||
this.groupsService
|
||||
.executeGroupCommand(this.groupAndTemplateData.id, 'assignRole', this.groupsAddRoleForm.value)
|
||||
.subscribe(() => {
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,9 +8,8 @@ describe('CommitteeTabComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CommitteeTabComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [CommitteeTabComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -19,7 +19,6 @@ import { GroupsService } from 'app/groups/groups.service';
|
||||
styleUrls: ['./committee-tab.component.scss']
|
||||
})
|
||||
export class CommitteeTabComponent {
|
||||
|
||||
/** Group Status */
|
||||
groupStatus: any;
|
||||
/** Group Roles Data */
|
||||
@@ -27,7 +26,12 @@ export class CommitteeTabComponent {
|
||||
/** Groups View Data */
|
||||
groupViewData: any;
|
||||
/** Columns to be Displayed for client members table */
|
||||
groupRolesColumns: string[] = ['Name', 'Role', 'Client Id', 'Actions'];
|
||||
groupRolesColumns: string[] = [
|
||||
'Name',
|
||||
'Role',
|
||||
'Client Id',
|
||||
'Actions'
|
||||
];
|
||||
|
||||
/** Roles Table */
|
||||
@ViewChild('rolesTable') rolesTableRef: MatTable<Element>;
|
||||
@@ -38,9 +42,11 @@ export class CommitteeTabComponent {
|
||||
* @param {GroupsService} groupsService Groups Service
|
||||
* @param {MatDialog} dialog Mat Dialog
|
||||
*/
|
||||
constructor(private route: ActivatedRoute,
|
||||
private groupsService: GroupsService,
|
||||
public dialog: MatDialog) {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private groupsService: GroupsService,
|
||||
public dialog: MatDialog
|
||||
) {
|
||||
this.route.parent.data.subscribe((data: { groupViewData: any }) => {
|
||||
this.groupViewData = data.groupViewData;
|
||||
this.groupRolesData = this.groupViewData.groupRoles;
|
||||
@@ -65,5 +71,4 @@ export class CommitteeTabComponent {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('UnassignRoleDialogComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ UnassignRoleDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [UnassignRoleDialogComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+4
-4
@@ -11,12 +11,12 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
styleUrls: ['./unassign-role-dialog.component.scss']
|
||||
})
|
||||
export class UnassignRoleDialogComponent {
|
||||
|
||||
/**
|
||||
* @param {MatDialogRef} dialogRef Component reference to dialog.
|
||||
* @param {any} data.
|
||||
*/
|
||||
constructor(public dialogRef: MatDialogRef<UnassignRoleDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<UnassignRoleDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any
|
||||
) {}
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('UnassignStaffDialogComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ UnassignStaffDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [UnassignStaffDialogComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+1
-3
@@ -11,10 +11,8 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
styleUrls: ['./unassign-staff-dialog.component.scss']
|
||||
})
|
||||
export class UnassignStaffDialogComponent {
|
||||
|
||||
/**
|
||||
* @param {MatDialogRef} dialogRef Component reference to dialog.
|
||||
*/
|
||||
constructor(public dialogRef: MatDialogRef<UnassignStaffDialogComponent>) { }
|
||||
|
||||
constructor(public dialogRef: MatDialogRef<UnassignStaffDialogComponent>) {}
|
||||
}
|
||||
|
||||
@@ -8,9 +8,8 @@ describe('DatatableTabsComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ DatatableTabsComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [DatatableTabsComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -11,7 +11,6 @@ import { ActivatedRoute } from '@angular/router';
|
||||
styleUrls: ['./datatable-tabs.component.scss']
|
||||
})
|
||||
export class DatatableTabsComponent {
|
||||
|
||||
entityId: string;
|
||||
/** Group Datatable */
|
||||
entityDatatable: any;
|
||||
@@ -30,5 +29,4 @@ export class DatatableTabsComponent {
|
||||
this.multiRowDatatableFlag = this.entityDatatable.columnHeaders[0].columnName === 'id' ? true : false;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,9 +8,8 @@ describe('GeneralTabComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ GeneralTabComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [GeneralTabComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -11,7 +11,6 @@ import { ActivatedRoute } from '@angular/router';
|
||||
styleUrls: ['./general-tab.component.scss']
|
||||
})
|
||||
export class GeneralTabComponent {
|
||||
|
||||
/** Group's all accounts data */
|
||||
groupAccountData: any;
|
||||
/** Group's loan accounts data */
|
||||
@@ -27,19 +26,62 @@ export class GeneralTabComponent {
|
||||
/** Group's Client Members */
|
||||
groupClientMembers: any;
|
||||
/** Columns to be Displayed for client members table */
|
||||
clientMemberColumns: string[] = ['Name', 'Account No', 'Office', 'JLG Loan Application'];
|
||||
clientMemberColumns: string[] = [
|
||||
'Name',
|
||||
'Account No',
|
||||
'Office',
|
||||
'JLG Loan Application'
|
||||
];
|
||||
/** Columns to be displayed for open loan accounts table */
|
||||
openLoansColumns: string[] = ['Account No', 'Loan Account', 'Original Loan', 'Loan Balance', 'Amount Paid', 'Type', 'Actions'];
|
||||
openLoansColumns: string[] = [
|
||||
'Account No',
|
||||
'Loan Account',
|
||||
'Original Loan',
|
||||
'Loan Balance',
|
||||
'Amount Paid',
|
||||
'Type',
|
||||
'Actions'
|
||||
];
|
||||
/** Columns to be displayed for closed loan accounts table */
|
||||
closedLoansColumns: string[] = ['Account No', 'Loan Account', 'Original Loan', 'Loan Balance', 'Amount Paid', 'Type', 'Closed Date'];
|
||||
closedLoansColumns: string[] = [
|
||||
'Account No',
|
||||
'Loan Account',
|
||||
'Original Loan',
|
||||
'Loan Balance',
|
||||
'Amount Paid',
|
||||
'Type',
|
||||
'Closed Date'
|
||||
];
|
||||
/** Columns to be displayed for open savings accounts table */
|
||||
openSavingsColumns: string[] = ['Account No', 'Saving Account', 'Last Active', 'Balance', 'Actions'];
|
||||
openSavingsColumns: string[] = [
|
||||
'Account No',
|
||||
'Saving Account',
|
||||
'Last Active',
|
||||
'Balance',
|
||||
'Actions'
|
||||
];
|
||||
/** Columns to be displayed for closed accounts table */
|
||||
closedSavingsColumns: string[] = ['Account No', 'Saving Account', 'Closed Date'];
|
||||
closedSavingsColumns: string[] = [
|
||||
'Account No',
|
||||
'Saving Account',
|
||||
'Closed Date'
|
||||
];
|
||||
/** Columns to be displayed for GSIM Accounts Table */
|
||||
gsimAccountsColumns: string[] = ['GSIM Id', 'Account Number', 'Product', 'Balance', 'Status'];
|
||||
gsimAccountsColumns: string[] = [
|
||||
'GSIM Id',
|
||||
'Account Number',
|
||||
'Product',
|
||||
'Balance',
|
||||
'Status'
|
||||
];
|
||||
/** Columns to be displayed for GLIM Accounts Table */
|
||||
glimAccountsColumns: string[] = ['GLIM Id', 'Account Number', 'Product', 'Original Loan', 'Status'];
|
||||
glimAccountsColumns: string[] = [
|
||||
'GLIM Id',
|
||||
'Account Number',
|
||||
'Product',
|
||||
'Original Loan',
|
||||
'Status'
|
||||
];
|
||||
/** Boolean for toggling loan accounts table */
|
||||
showClosedLoanAccounts = false;
|
||||
/** Boolean for toggling savings accounts table */
|
||||
@@ -50,14 +92,16 @@ export class GeneralTabComponent {
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
*/
|
||||
constructor(private route: ActivatedRoute) {
|
||||
this.route.data.subscribe((data: { groupAccountsData: any, groupClientMembers: any, groupSummary: any, glimData: any, gsimData: any }) => {
|
||||
this.glimAccounts = data.glimData;
|
||||
this.gsimAccounts = data.gsimData;
|
||||
this.groupAccountData = data.groupAccountsData;
|
||||
this.savingAccounts = data.groupAccountsData.savingsAccounts;
|
||||
this.loanAccounts = data.groupAccountsData.loanAccounts;
|
||||
this.groupSummary = data.groupSummary[0];
|
||||
});
|
||||
this.route.data.subscribe(
|
||||
(data: { groupAccountsData: any; groupClientMembers: any; groupSummary: any; glimData: any; gsimData: any }) => {
|
||||
this.glimAccounts = data.glimData;
|
||||
this.gsimAccounts = data.gsimData;
|
||||
this.groupAccountData = data.groupAccountsData;
|
||||
this.savingAccounts = data.groupAccountsData.savingsAccounts;
|
||||
this.loanAccounts = data.groupAccountsData.loanAccounts;
|
||||
this.groupSummary = data.groupSummary[0];
|
||||
}
|
||||
);
|
||||
this.route.parent.data.subscribe((data: { groupViewData: any }) => {
|
||||
this.groupClientMembers = data.groupViewData.clientMembers;
|
||||
});
|
||||
@@ -84,5 +128,4 @@ export class GeneralTabComponent {
|
||||
routeEdit($event: MouseEvent) {
|
||||
$event.stopPropagation();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('ActivateGroupComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ActivateGroupComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [ActivateGroupComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+12
-9
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
styleUrls: ['./activate-group.component.scss']
|
||||
})
|
||||
export class ActivateGroupComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -35,12 +34,14 @@ export class ActivateGroupComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService SettingsService
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private groupsService: GroupsService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private groupsService: GroupsService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.groupId = this.route.parent.snapshot.params['groupId'];
|
||||
}
|
||||
|
||||
@@ -54,7 +55,10 @@ export class ActivateGroupComponent implements OnInit {
|
||||
*/
|
||||
createActivateGroupForm() {
|
||||
this.activateGroupForm = this.formBuilder.group({
|
||||
'activationDate': ['', Validators.required]
|
||||
activationDate: [
|
||||
'',
|
||||
Validators.required
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -79,5 +83,4 @@ export class ActivateGroupComponent implements OnInit {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('AttachGroupMeetingComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ AttachGroupMeetingComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [AttachGroupMeetingComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+50
-21
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
styleUrls: ['./attach-group-meeting.component.scss']
|
||||
})
|
||||
export class AttachGroupMeetingComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -44,12 +43,14 @@ export class AttachGroupMeetingComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService SettingsService
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private groupsService: GroupsService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private groupsService: GroupsService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.route.data.subscribe((data: { groupActionData: any }) => {
|
||||
this.calendarTemplate = data.groupActionData;
|
||||
this.frequencyOptions = this.calendarTemplate.frequencyOptions;
|
||||
@@ -69,8 +70,11 @@ export class AttachGroupMeetingComponent implements OnInit {
|
||||
*/
|
||||
createGroupMeetingForm() {
|
||||
this.groupMeetingForm = this.formBuilder.group({
|
||||
'startDate': ['', Validators.required],
|
||||
'repeating': [false]
|
||||
startDate: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
repeating: [false]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -86,23 +90,49 @@ export class AttachGroupMeetingComponent implements OnInit {
|
||||
this.groupMeetingForm.removeControl('repeatsOnDay');
|
||||
switch (frequency) {
|
||||
case 1: // Daily
|
||||
this.repetitionIntervals = ['1', '2', '3'];
|
||||
break;
|
||||
this.repetitionIntervals = [
|
||||
'1',
|
||||
'2',
|
||||
'3'
|
||||
];
|
||||
break;
|
||||
case 2: // Weekly
|
||||
this.repetitionIntervals = ['1', '2', '3'];
|
||||
this.repetitionIntervals = [
|
||||
'1',
|
||||
'2',
|
||||
'3'
|
||||
];
|
||||
this.groupMeetingForm.addControl('repeatsOnDay', new UntypedFormControl('', Validators.required));
|
||||
break;
|
||||
break;
|
||||
case 3: // Monthly
|
||||
this.repetitionIntervals = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11'];
|
||||
break;
|
||||
this.repetitionIntervals = [
|
||||
'1',
|
||||
'2',
|
||||
'3',
|
||||
'4',
|
||||
'5',
|
||||
'6',
|
||||
'7',
|
||||
'8',
|
||||
'9',
|
||||
'10',
|
||||
'11'
|
||||
];
|
||||
break;
|
||||
case 4: // Yearly
|
||||
this.repetitionIntervals = ['1', '2', '3', '4', '5'];
|
||||
break;
|
||||
this.repetitionIntervals = [
|
||||
'1',
|
||||
'2',
|
||||
'3',
|
||||
'4',
|
||||
'5'
|
||||
];
|
||||
break;
|
||||
}
|
||||
});
|
||||
this.groupMeetingForm.patchValue({
|
||||
'frequency': 1,
|
||||
'interval': '1'
|
||||
frequency: 1,
|
||||
interval: '1'
|
||||
});
|
||||
} else {
|
||||
this.groupMeetingForm.removeControl('frequency');
|
||||
@@ -119,7 +149,7 @@ export class AttachGroupMeetingComponent implements OnInit {
|
||||
const locale = this.settingsService.language.code;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const title = `groups_${this.groupId}_CollectionMeeting`;
|
||||
const typeId = groupMeetingFormData.repeating ? '1' : '4' ;
|
||||
const typeId = groupMeetingFormData.repeating ? '1' : '4';
|
||||
const prevStartDate: Date = this.groupMeetingForm.value.startDate;
|
||||
if (groupMeetingFormData.startDate instanceof Date) {
|
||||
groupMeetingFormData.startDate = this.dateUtils.formatDate(prevStartDate, dateFormat);
|
||||
@@ -135,5 +165,4 @@ export class AttachGroupMeetingComponent implements OnInit {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,9 +8,8 @@ describe('CloseGroupComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CloseGroupComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [CloseGroupComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
styleUrls: ['./close-group.component.scss']
|
||||
})
|
||||
export class CloseGroupComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -37,12 +36,14 @@ export class CloseGroupComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService SettingsService
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private groupsService: GroupsService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private groupsService: GroupsService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.route.data.subscribe((data: { groupActionData: any }) => {
|
||||
this.closureData = data.groupActionData.closureReasons;
|
||||
});
|
||||
@@ -59,8 +60,14 @@ export class CloseGroupComponent implements OnInit {
|
||||
*/
|
||||
createCloseGroupForm() {
|
||||
this.closeGroupForm = this.formBuilder.group({
|
||||
'closureDate': ['', Validators.required],
|
||||
'closureReasonId': ['', Validators.required]
|
||||
closureDate: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
closureReasonId: [
|
||||
'',
|
||||
Validators.required
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -84,5 +91,4 @@ export class CloseGroupComponent implements OnInit {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('EditGroupMeetingScheduleComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EditGroupMeetingScheduleComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [EditGroupMeetingScheduleComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+16
-10
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
styleUrls: ['./edit-group-meeting-schedule.component.scss']
|
||||
})
|
||||
export class EditGroupMeetingScheduleComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -42,12 +41,14 @@ export class EditGroupMeetingScheduleComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService SettingsService
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private groupsService: GroupsService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private groupsService: GroupsService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.route.data.subscribe((data: { groupActionData: any }) => {
|
||||
this.calendarTemplate = data.groupActionData;
|
||||
this.nextMeetingDates = this.calendarTemplate.nextTenRecurringDates;
|
||||
@@ -66,8 +67,14 @@ export class EditGroupMeetingScheduleComponent implements OnInit {
|
||||
*/
|
||||
createEditMeetingScheduleForm() {
|
||||
this.groupEditMeetingScheduleForm = this.formBuilder.group({
|
||||
'presentMeetingDate': ['', Validators.required],
|
||||
'newMeetingDate': ['', Validators.required]
|
||||
presentMeetingDate: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
newMeetingDate: [
|
||||
'',
|
||||
Validators.required
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -97,5 +104,4 @@ export class EditGroupMeetingScheduleComponent implements OnInit {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('EditGroupMeetingComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EditGroupMeetingComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [EditGroupMeetingComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+57
-22
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
styleUrls: ['./edit-group-meeting.component.scss']
|
||||
})
|
||||
export class EditGroupMeetingComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -46,12 +45,14 @@ export class EditGroupMeetingComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService SettingsService
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private groupsService: GroupsService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private groupsService: GroupsService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.route.data.subscribe((data: { groupActionData: any }) => {
|
||||
this.calendarTemplate = data.groupActionData;
|
||||
this.frequencyOptions = this.calendarTemplate.frequencyOptions;
|
||||
@@ -72,9 +73,18 @@ export class EditGroupMeetingComponent implements OnInit {
|
||||
*/
|
||||
createEditGroupMeetingForm() {
|
||||
this.groupEditMeetingForm = this.formBuilder.group({
|
||||
'startDate': ['', Validators.required],
|
||||
'frequency': ['', Validators.required],
|
||||
'interval': ['', Validators.required]
|
||||
startDate: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
frequency: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
interval: [
|
||||
'',
|
||||
Validators.required
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -86,25 +96,51 @@ export class EditGroupMeetingComponent implements OnInit {
|
||||
this.groupEditMeetingForm.removeControl('repeatsOnDay');
|
||||
switch (frequency) {
|
||||
case 1: // Daily
|
||||
this.repetitionIntervals = ['1', '2', '3'];
|
||||
break;
|
||||
this.repetitionIntervals = [
|
||||
'1',
|
||||
'2',
|
||||
'3'
|
||||
];
|
||||
break;
|
||||
case 2: // Weekly
|
||||
this.repetitionIntervals = ['1', '2', '3'];
|
||||
this.repetitionIntervals = [
|
||||
'1',
|
||||
'2',
|
||||
'3'
|
||||
];
|
||||
this.groupEditMeetingForm.addControl('repeatsOnDay', new UntypedFormControl('', Validators.required));
|
||||
this.groupEditMeetingForm.get('repeatsOnDay').patchValue(this.calendarTemplate.repeatsOnDay.id);
|
||||
break;
|
||||
break;
|
||||
case 3: // Monthly
|
||||
this.repetitionIntervals = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11'];
|
||||
break;
|
||||
this.repetitionIntervals = [
|
||||
'1',
|
||||
'2',
|
||||
'3',
|
||||
'4',
|
||||
'5',
|
||||
'6',
|
||||
'7',
|
||||
'8',
|
||||
'9',
|
||||
'10',
|
||||
'11'
|
||||
];
|
||||
break;
|
||||
case 4: // Yearly
|
||||
this.repetitionIntervals = ['1', '2', '3', '4', '5'];
|
||||
break;
|
||||
this.repetitionIntervals = [
|
||||
'1',
|
||||
'2',
|
||||
'3',
|
||||
'4',
|
||||
'5'
|
||||
];
|
||||
break;
|
||||
}
|
||||
});
|
||||
this.groupEditMeetingForm.patchValue({
|
||||
'startDate': this.calendarTemplate.startDate && new Date(this.calendarTemplate.startDate),
|
||||
'frequency': this.calendarTemplate.frequency.id,
|
||||
'interval': `${this.calendarTemplate.interval}`
|
||||
startDate: this.calendarTemplate.startDate && new Date(this.calendarTemplate.startDate),
|
||||
frequency: this.calendarTemplate.frequency.id,
|
||||
interval: `${this.calendarTemplate.interval}`
|
||||
});
|
||||
}
|
||||
|
||||
@@ -141,5 +177,4 @@ export class EditGroupMeetingComponent implements OnInit {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,9 +8,8 @@ describe('GroupActionsComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ GroupActionsComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [GroupActionsComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -11,24 +11,23 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||
styleUrls: ['./group-actions.component.scss']
|
||||
})
|
||||
export class GroupActionsComponent {
|
||||
|
||||
/** Flag object to store possible actions and render appropriate UI to the user */
|
||||
actions: {
|
||||
'Assign Staff': boolean
|
||||
'Close': boolean
|
||||
'Activate': boolean
|
||||
'Attach Meeting': boolean
|
||||
'Attendance': boolean
|
||||
'Manage Members': boolean
|
||||
'Edit Meeting': boolean
|
||||
'Edit Meeting Schedule': boolean
|
||||
'Transfer Clients': boolean
|
||||
'Assign Staff': boolean;
|
||||
Close: boolean;
|
||||
Activate: boolean;
|
||||
'Attach Meeting': boolean;
|
||||
Attendance: boolean;
|
||||
'Manage Members': boolean;
|
||||
'Edit Meeting': boolean;
|
||||
'Edit Meeting Schedule': boolean;
|
||||
'Transfer Clients': boolean;
|
||||
} = {
|
||||
'Assign Staff': false,
|
||||
'Close': false,
|
||||
'Activate': false,
|
||||
Close: false,
|
||||
Activate: false,
|
||||
'Attach Meeting': false,
|
||||
'Attendance': false,
|
||||
Attendance: false,
|
||||
'Manage Members': false,
|
||||
'Edit Meeting': false,
|
||||
'Edit Meeting Schedule': false,
|
||||
@@ -39,11 +38,12 @@ export class GroupActionsComponent {
|
||||
* @param {ActivatedRoute} route Activated Route
|
||||
* @param {Router} router Router
|
||||
*/
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router) {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router
|
||||
) {
|
||||
this.router.routeReuseStrategy.shouldReuseRoute = () => false;
|
||||
const action = this.route.snapshot.params['action'];
|
||||
this.actions[action] = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('GroupAssignStaffComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ GroupAssignStaffComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [GroupAssignStaffComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+9
-8
@@ -15,7 +15,6 @@ import { GroupsService } from 'app/groups/groups.service';
|
||||
styleUrls: ['./group-assign-staff.component.scss']
|
||||
})
|
||||
export class GroupAssignStaffComponent implements OnInit {
|
||||
|
||||
/** Group Assign Staff form. */
|
||||
groupAssignStaffForm: UntypedFormGroup;
|
||||
/** Staff Data */
|
||||
@@ -30,10 +29,12 @@ export class GroupAssignStaffComponent implements OnInit {
|
||||
* @param {ActivatedRoute} route Activated Route
|
||||
* @param {Router} router Router
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private groupsService: GroupsService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private groupsService: GroupsService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router
|
||||
) {
|
||||
this.route.data.subscribe((data: { groupActionData: any }) => {
|
||||
this.groupData = data.groupActionData;
|
||||
});
|
||||
@@ -49,7 +50,7 @@ export class GroupAssignStaffComponent implements OnInit {
|
||||
*/
|
||||
createGroupAssignStaffForm() {
|
||||
this.groupAssignStaffForm = this.formBuilder.group({
|
||||
'staffId': ['']
|
||||
staffId: ['']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -57,10 +58,10 @@ export class GroupAssignStaffComponent implements OnInit {
|
||||
* Submits the form and assigns staff for the group.
|
||||
*/
|
||||
submit() {
|
||||
this.groupsService.executeGroupCommand(this.groupData.id, 'assignStaff', this.groupAssignStaffForm.value)
|
||||
this.groupsService
|
||||
.executeGroupCommand(this.groupData.id, 'assignStaff', this.groupAssignStaffForm.value)
|
||||
.subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('GroupAttendanceComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ GroupAttendanceComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [GroupAttendanceComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+25
-17
@@ -25,7 +25,6 @@ import { Dates } from 'app/core/utils/dates';
|
||||
styleUrls: ['./group-attendance.component.scss']
|
||||
})
|
||||
export class GroupAttendanceComponent implements OnInit {
|
||||
|
||||
/** Members data. */
|
||||
membersData: any;
|
||||
/** Group Data */
|
||||
@@ -33,7 +32,10 @@ export class GroupAttendanceComponent implements OnInit {
|
||||
/** Attendance Type Options */
|
||||
attendanceTypeOptions: any;
|
||||
/** Columns to be displayed in member's attendance table. */
|
||||
displayedColumns: string[] = ['name', 'attendance'];
|
||||
displayedColumns: string[] = [
|
||||
'name',
|
||||
'attendance'
|
||||
];
|
||||
/** Start Date Form Control */
|
||||
meetingDate = new UntypedFormControl();
|
||||
/** Meeting Dates Data */
|
||||
@@ -50,13 +52,15 @@ export class GroupAttendanceComponent implements OnInit {
|
||||
* @param {MatDialog} dialog Mat Dialog
|
||||
* @param {SettingsService} settingsService SettingsService
|
||||
*/
|
||||
constructor(private route: ActivatedRoute,
|
||||
private dateUtils: Dates,
|
||||
private router: Router,
|
||||
private groupsService: GroupsService,
|
||||
public dialog: MatDialog,
|
||||
private settingsService: SettingsService) {
|
||||
this.route.data.subscribe(( data: { groupActionData: any }) => {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private dateUtils: Dates,
|
||||
private router: Router,
|
||||
private groupsService: GroupsService,
|
||||
public dialog: MatDialog,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.route.data.subscribe((data: { groupActionData: any }) => {
|
||||
this.groupData = data.groupActionData;
|
||||
this.membersData = data.groupActionData.clientMembers;
|
||||
});
|
||||
@@ -67,8 +71,9 @@ export class GroupAttendanceComponent implements OnInit {
|
||||
*/
|
||||
ngOnInit() {
|
||||
this.dataSource = this.membersData.map((member: any) => ({ clientId: member.id, attendanceType: 1 }));
|
||||
this.meetingDates = this.groupData.collectionMeetingCalendar.recurringDates
|
||||
.filter((date: any) => new Date(date).getTime() < new Date().getTime());
|
||||
this.meetingDates = this.groupData.collectionMeetingCalendar.recurringDates.filter(
|
||||
(date: any) => new Date(date).getTime() < new Date().getTime()
|
||||
);
|
||||
this.getAttendanceOptions();
|
||||
}
|
||||
|
||||
@@ -76,7 +81,8 @@ export class GroupAttendanceComponent implements OnInit {
|
||||
* Gets attendance type options based on calendar id.
|
||||
*/
|
||||
getAttendanceOptions() {
|
||||
this.groupsService.getMeetingsTemplate(this.groupData.id, this.groupData.collectionMeetingCalendar.id)
|
||||
this.groupsService
|
||||
.getMeetingsTemplate(this.groupData.id, this.groupData.collectionMeetingCalendar.id)
|
||||
.subscribe((response: any) => {
|
||||
this.attendanceTypeOptions = response.attendanceTypeOptions;
|
||||
});
|
||||
@@ -94,7 +100,8 @@ export class GroupAttendanceComponent implements OnInit {
|
||||
value: member.attendanceType,
|
||||
options: { label: 'value', value: 'id', data: this.attendanceTypeOptions },
|
||||
required: false
|
||||
}),
|
||||
})
|
||||
|
||||
];
|
||||
const data = {
|
||||
title: 'Assign Member Attendance',
|
||||
@@ -126,9 +133,10 @@ export class GroupAttendanceComponent implements OnInit {
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
this.groupsService.assignGroupAttendance(this.groupData.id, this.groupData.collectionMeetingCalendar.id, data).subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
this.groupsService
|
||||
.assignGroupAttendance(this.groupData.id, this.groupData.collectionMeetingCalendar.id, data)
|
||||
.subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('GroupTransferClientsComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ GroupTransferClientsComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [GroupTransferClientsComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+20
-15
@@ -16,7 +16,6 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
styleUrls: ['./group-transfer-clients.component.scss']
|
||||
})
|
||||
export class GroupTransferClientsComponent implements OnInit, AfterViewInit {
|
||||
|
||||
/** Transfer Clients form. */
|
||||
transferClientsForm: UntypedFormGroup;
|
||||
/** Group Data */
|
||||
@@ -36,11 +35,13 @@ export class GroupTransferClientsComponent implements OnInit, AfterViewInit {
|
||||
* @param {GroupsService} groupsService GroupsService.
|
||||
* @param {SettingsService} settingsService SettingsService
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private groupsService: GroupsService,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private groupsService: GroupsService,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.route.data.subscribe((data: { groupActionData: any }) => {
|
||||
this.groupData = data.groupActionData;
|
||||
this.clientMembers = this.groupData.clientMembers;
|
||||
@@ -55,12 +56,11 @@ export class GroupTransferClientsComponent implements OnInit, AfterViewInit {
|
||||
* Subscribes to Groups search filter:
|
||||
*/
|
||||
ngAfterViewInit() {
|
||||
this.transferClientsForm.get('destinationGroupId').valueChanges.subscribe( (value: string) => {
|
||||
this.transferClientsForm.get('destinationGroupId').valueChanges.subscribe((value: string) => {
|
||||
if (value.length >= 2) {
|
||||
this.groupsService.getFilteredGroups('name', 'ASC', value, this.groupData.officeId)
|
||||
.subscribe( (data: any) => {
|
||||
this.groupsData = data;
|
||||
});
|
||||
this.groupsService.getFilteredGroups('name', 'ASC', value, this.groupData.officeId).subscribe((data: any) => {
|
||||
this.groupsData = data;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -70,9 +70,15 @@ export class GroupTransferClientsComponent implements OnInit, AfterViewInit {
|
||||
*/
|
||||
createTransferClientsForm() {
|
||||
this.transferClientsForm = this.formBuilder.group({
|
||||
'clients': ['', Validators.required],
|
||||
'inheritDestinationGroupLoanOfficer': [false],
|
||||
'destinationGroupId': ['', Validators.required]
|
||||
clients: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
inheritDestinationGroupLoanOfficer: [false],
|
||||
destinationGroupId: [
|
||||
'',
|
||||
Validators.required
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -100,5 +106,4 @@ export class GroupTransferClientsComponent implements OnInit, AfterViewInit {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('ManageGroupMembersComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ManageGroupMembersComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [ManageGroupMembersComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+19
-13
@@ -20,7 +20,6 @@ import { MatDialog } from '@angular/material/dialog';
|
||||
styleUrls: ['./manage-group-members.component.scss']
|
||||
})
|
||||
export class ManageGroupMembersComponent implements AfterViewInit {
|
||||
|
||||
/** Group Data */
|
||||
groupData: any;
|
||||
/** Client data. */
|
||||
@@ -37,24 +36,26 @@ export class ManageGroupMembersComponent implements AfterViewInit {
|
||||
* @param {ClientsService} clientsService Clients Service
|
||||
* @param {MatDialog} dialog Mat Dialog
|
||||
*/
|
||||
constructor(private route: ActivatedRoute,
|
||||
private groupsService: GroupsService,
|
||||
private clientsService: ClientsService,
|
||||
public dialog: MatDialog) {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private groupsService: GroupsService,
|
||||
private clientsService: ClientsService,
|
||||
public dialog: MatDialog
|
||||
) {
|
||||
this.route.data.subscribe((data: { groupActionData: any }) => {
|
||||
this.groupData = data.groupActionData;
|
||||
this.clientMembers = data.groupActionData.clientMembers || [];
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Subscribes to Clients search filter:
|
||||
*/
|
||||
ngAfterViewInit() {
|
||||
this.clientChoice.valueChanges.subscribe( (value: string) => {
|
||||
this.clientChoice.valueChanges.subscribe((value: string) => {
|
||||
if (value.length >= 2) {
|
||||
this.clientsService.getFilteredClients('displayName', 'ASC', true, value, this.groupData.officeId)
|
||||
this.clientsService
|
||||
.getFilteredClients('displayName', 'ASC', true, value, this.groupData.officeId)
|
||||
.subscribe((data: any) => {
|
||||
this.clientsData = data.pageItems;
|
||||
});
|
||||
@@ -67,8 +68,11 @@ export class ManageGroupMembersComponent implements AfterViewInit {
|
||||
*/
|
||||
addClient() {
|
||||
if (!this.clientMembers.includes(this.clientChoice.value)) {
|
||||
this.groupsService.executeGroupCommand(this.groupData.id, 'associateClients', {clientMembers: [this.clientChoice.value.id]})
|
||||
.subscribe(() => { this.clientMembers.push(this.clientChoice.value); });
|
||||
this.groupsService
|
||||
.executeGroupCommand(this.groupData.id, 'associateClients', { clientMembers: [this.clientChoice.value.id] })
|
||||
.subscribe(() => {
|
||||
this.clientMembers.push(this.clientChoice.value);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,8 +87,11 @@ export class ManageGroupMembersComponent implements AfterViewInit {
|
||||
});
|
||||
removeMemberDialogRef.afterClosed().subscribe((response: any) => {
|
||||
if (response.delete) {
|
||||
this.groupsService.executeGroupCommand(this.groupData.id, 'disassociateClients', {clientMembers: [client.id]})
|
||||
.subscribe(() => { this.clientMembers.splice(index, 1); });
|
||||
this.groupsService
|
||||
.executeGroupCommand(this.groupData.id, 'disassociateClients', { clientMembers: [client.id] })
|
||||
.subscribe(() => {
|
||||
this.clientMembers.splice(index, 1);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -97,5 +104,4 @@ export class ManageGroupMembersComponent implements AfterViewInit {
|
||||
displayClient(client: any): string | undefined {
|
||||
return client ? client.displayName : undefined;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,9 +8,8 @@ describe('GroupsViewComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ GroupsViewComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [GroupsViewComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -19,7 +19,6 @@ import { GroupsService } from '../groups.service';
|
||||
styleUrls: ['./groups-view.component.scss']
|
||||
})
|
||||
export class GroupsViewComponent {
|
||||
|
||||
/** Group view data */
|
||||
groupViewData: any;
|
||||
/** Group datatables data */
|
||||
@@ -32,11 +31,13 @@ export class GroupsViewComponent {
|
||||
* @param {Router} router Router
|
||||
* @param {MatDialog} dialog Dialog
|
||||
*/
|
||||
constructor(private route: ActivatedRoute,
|
||||
private groupsService: GroupsService,
|
||||
private router: Router,
|
||||
public dialog: MatDialog) {
|
||||
this.route.data.subscribe((data: { groupViewData: any, groupDatatables: any }) => {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private groupsService: GroupsService,
|
||||
private router: Router,
|
||||
public dialog: MatDialog
|
||||
) {
|
||||
this.route.data.subscribe((data: { groupViewData: any; groupDatatables: any }) => {
|
||||
this.groupViewData = data.groupViewData;
|
||||
this.groupDatatables = data.groupDatatables;
|
||||
});
|
||||
@@ -79,7 +80,7 @@ export class GroupsViewComponent {
|
||||
get editMeeting() {
|
||||
if (this.groupViewData.collectionMeetingCalendar) {
|
||||
const entityType = this.groupViewData.collectionMeetingCalendar.entityType.value;
|
||||
if (entityType === 'GROUPS' && this.groupViewData.hierarchy === '.' + this.groupViewData.id + '.' ) {
|
||||
if (entityType === 'GROUPS' && this.groupViewData.hierarchy === '.' + this.groupViewData.id + '.') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -92,8 +93,7 @@ export class GroupsViewComponent {
|
||||
*/
|
||||
reload() {
|
||||
const url: string = this.router.url;
|
||||
this.router.navigateByUrl(`/groups`, {skipLocationChange: true})
|
||||
.then(() => this.router.navigate([url]));
|
||||
this.router.navigateByUrl(`/groups`, { skipLocationChange: true }).then(() => this.router.navigate([url]));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -103,7 +103,8 @@ export class GroupsViewComponent {
|
||||
const unAssignStaffDialogRef = this.dialog.open(UnassignStaffDialogComponent);
|
||||
unAssignStaffDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
|
||||
if (response.confirm) {
|
||||
this.groupsService.executeGroupCommand(this.groupViewData.id, 'unassignStaff', { staffId: this.groupViewData.staffId })
|
||||
this.groupsService
|
||||
.executeGroupCommand(this.groupViewData.id, 'unassignStaff', { staffId: this.groupViewData.staffId })
|
||||
.subscribe(() => {
|
||||
this.reload();
|
||||
});
|
||||
@@ -126,5 +127,4 @@ export class GroupsViewComponent {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,9 +8,8 @@ describe('NotesTabComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ NotesTabComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [NotesTabComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -17,7 +17,6 @@ import { GroupsService } from '../../groups.service';
|
||||
styleUrls: ['./notes-tab.component.scss']
|
||||
})
|
||||
export class NotesTabComponent {
|
||||
|
||||
/** Group ID */
|
||||
entityId: string;
|
||||
/** Username */
|
||||
@@ -31,9 +30,11 @@ export class NotesTabComponent {
|
||||
* @param {GroupsService} groupsService Groups Service
|
||||
* @param {AuthenticationService} authenticationService Authentication Service.
|
||||
*/
|
||||
constructor(private route: ActivatedRoute,
|
||||
private authenticationService: AuthenticationService,
|
||||
private groupsService: GroupsService) {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private authenticationService: AuthenticationService,
|
||||
private groupsService: GroupsService
|
||||
) {
|
||||
const savedCredentials = this.authenticationService.getCredentials();
|
||||
this.username = savedCredentials.username;
|
||||
this.entityId = this.route.parent.snapshot.params['groupId'];
|
||||
@@ -72,10 +73,8 @@ export class NotesTabComponent {
|
||||
* @param {string} noteId Note Id.
|
||||
*/
|
||||
deleteNote(noteId: string, index: number) {
|
||||
this.groupsService.deleteGroupNote(this.entityId, noteId)
|
||||
.subscribe(() => {
|
||||
this.groupsService.deleteGroupNote(this.entityId, noteId).subscribe(() => {
|
||||
this.entityNotes.splice(index, 1);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user