build: Use prettier for typescript

Stop ignoring .ts files in prettier and fix existing issues.
This commit is contained in:
Ralph Hopman
2025-01-15 11:59:30 +00:00
committed by Adam Saghy
parent 9d6cf1514a
commit cac1d11ad7
1812 changed files with 22516 additions and 16862 deletions
@@ -8,9 +8,8 @@ describe('AcceptClientTransferComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AcceptClientTransferComponent ]
})
.compileComponents();
declarations: [AcceptClientTransferComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
styleUrls: ['./accept-client-transfer.component.scss']
})
export class AcceptClientTransferComponent implements OnInit {
/** Accept Client Transfer form. */
acceptClientTransferForm: UntypedFormGroup;
/** Client Id */
@@ -33,12 +32,14 @@ export class AcceptClientTransferComponent implements OnInit {
* @param {ActivatedRoute} route Activated Route
* @param {Router} router Router
*/
constructor(private formBuilder: UntypedFormBuilder,
private clientsService: ClientsService,
private settingsService: SettingsService,
private dateUtils: Dates,
private route: ActivatedRoute,
private router: Router) {
constructor(
private formBuilder: UntypedFormBuilder,
private clientsService: ClientsService,
private settingsService: SettingsService,
private dateUtils: Dates,
private route: ActivatedRoute,
private router: Router
) {
this.route.data.subscribe((data: { clientActionData: any }) => {
this.transferDate = data.clientActionData;
});
@@ -57,8 +58,8 @@ export class AcceptClientTransferComponent implements OnInit {
*/
createAcceptClientTransferForm() {
this.acceptClientTransferForm = this.formBuilder.group({
'transferDate': {value: new Date(this.transferDate), disabled: true},
'note': ['']
transferDate: { value: new Date(this.transferDate), disabled: true },
note: ['']
});
}
@@ -74,11 +75,10 @@ export class AcceptClientTransferComponent implements OnInit {
acceptClientTransferFormData.transferDate = this.dateUtils.formatDate(prevTransferDate, dateFormat);
}
const data = {
...acceptClientTransferFormData,
...acceptClientTransferFormData
};
this.clientsService.executeClientCommand(this.clientId, 'acceptTransfer', data).subscribe(() => {
this.router.navigate(['../../'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('ActivateClientComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ActivateClientComponent ]
})
.compileComponents();
declarations: [ActivateClientComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
styleUrls: ['./activate-client.component.scss']
})
export class ActivateClientComponent implements OnInit {
/** Minimum date allowed. */
minDate = new Date(2000, 0, 1);
/** Maximum date allowed. */
@@ -35,12 +34,14 @@ export class ActivateClientComponent implements OnInit {
* @param {Router} router Router
* @param {SettingsService} settingsService Settings Service
*/
constructor(private formBuilder: UntypedFormBuilder,
private clientsService: ClientsService,
private dateUtils: Dates,
private route: ActivatedRoute,
private router: Router,
private settingsService: SettingsService) {
constructor(
private formBuilder: UntypedFormBuilder,
private clientsService: ClientsService,
private dateUtils: Dates,
private route: ActivatedRoute,
private router: Router,
private settingsService: SettingsService
) {
this.clientId = this.route.parent.snapshot.params['clientId'];
}
@@ -57,7 +58,10 @@ export class ActivateClientComponent implements OnInit {
*/
createActivateClientForm() {
this.activateClientForm = this.formBuilder.group({
'activationDate': ['', Validators.required]
activationDate: [
'',
Validators.required
]
});
}
@@ -82,5 +86,4 @@ export class ActivateClientComponent implements OnInit {
this.router.navigate(['../../'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('AddClientChargeComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AddClientChargeComponent ]
})
.compileComponents();
declarations: [AddClientChargeComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
styleUrls: ['./add-client-charge.component.scss']
})
export class AddClientChargeComponent implements OnInit {
/** Minimum Due Date allowed. */
minDate = new Date(2000, 0, 1);
/** Maximum Due Date allowed. */
@@ -64,7 +63,7 @@ export class AddClientChargeComponent implements OnInit {
* Subscribe to form controls value changes
*/
buildDependencies() {
this.clientChargeForm.controls.chargeId.valueChanges.subscribe(chargeId => {
this.clientChargeForm.controls.chargeId.valueChanges.subscribe((chargeId) => {
this.clientsService.getChargeAndTemplate(chargeId).subscribe((data: any) => {
this.chargeDetails = data;
const chargeTimeType = data.chargeTimeType.id;
@@ -85,14 +84,17 @@ export class AddClientChargeComponent implements OnInit {
this.clientChargeForm.removeControl('feeOnMonthDay');
}
if (chargeTimeType.value === 'Monthly Fee') {
this.clientChargeForm.addControl('feeInterval', new UntypedFormControl(data.feeInterval, Validators.required));
this.clientChargeForm.addControl(
'feeInterval',
new UntypedFormControl(data.feeInterval, Validators.required)
);
} else {
this.clientChargeForm.removeControl('feeInterval');
}
this.clientChargeForm.patchValue({
'amount': data.amount,
'chargeCalculationType': data.chargeCalculationType.id,
'chargeTimeType': data.chargeTimeType.id
amount: data.amount,
chargeCalculationType: data.chargeCalculationType.id,
chargeTimeType: data.chargeTimeType.id
});
});
});
@@ -103,10 +105,16 @@ export class AddClientChargeComponent implements OnInit {
*/
createClientsChargeForm() {
this.clientChargeForm = this.formBuilder.group({
'chargeId': ['', Validators.required],
'amount': ['', Validators.required],
'chargeCalculationType': [{ value: '', disabled: true }],
'chargeTimeType': [{ value: '', disabled: true }]
chargeId: [
'',
Validators.required
],
amount: [
'',
Validators.required
],
chargeCalculationType: [{ value: '', disabled: true }],
chargeTimeType: [{ value: '', disabled: true }]
});
}
@@ -136,9 +144,8 @@ export class AddClientChargeComponent implements OnInit {
}
}
}
this.clientsService.createClientCharge(this.clientId, clientCharge).subscribe( () => {
this.clientsService.createClientCharge(this.clientId, clientCharge).subscribe(() => {
this.router.navigate(['../../'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('AddClientCollateralComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ AddClientCollateralComponent ]
})
.compileComponents();
declarations: [AddClientCollateralComponent]
}).compileComponents();
});
beforeEach(() => {
@@ -16,7 +16,6 @@ import { SettingsService } from 'app/settings/settings.service';
styleUrls: ['./add-client-collateral.component.scss']
})
export class AddClientCollateralComponent implements OnInit {
/** Client Collateral Form */
clientCollateralForm: UntypedFormGroup;
/** Client Collateral Options */
@@ -39,13 +38,13 @@ export class AddClientCollateralComponent implements OnInit {
private router: Router,
private productsService: ProductsService,
private clientsService: ClientsService,
private settingsService: SettingsService,
) {
this.route.data.subscribe((data: { clientActionData: any }) => {
this.clientCollateralOptions = data.clientActionData;
});
this.clientId = this.route.parent.snapshot.params['clientId'];
}
private settingsService: SettingsService
) {
this.route.data.subscribe((data: { clientActionData: any }) => {
this.clientCollateralOptions = data.clientActionData;
});
this.clientId = this.route.parent.snapshot.params['clientId'];
}
ngOnInit(): void {
this.createClientCollateralForm();
@@ -56,22 +55,22 @@ export class AddClientCollateralComponent implements OnInit {
* Subscribe to Form controls value changes
*/
buildDependencies() {
this.clientCollateralForm.controls.collateralId.valueChanges.subscribe(collateralId => {
this.clientCollateralForm.controls.collateralId.valueChanges.subscribe((collateralId) => {
this.productsService.getCollateral(collateralId).subscribe((data: any) => {
this.collateralDetails = data;
this.clientCollateralForm.patchValue({
'name': data.name,
'quality': data.quality,
'unitType': data.unitType,
'basePrice': this.collateralDetails.basePrice,
'pctToBase': this.collateralDetails.pctToBase,
name: data.name,
quality: data.quality,
unitType: data.unitType,
basePrice: this.collateralDetails.basePrice,
pctToBase: this.collateralDetails.pctToBase
});
});
});
this.clientCollateralForm.controls.quantity.valueChanges.subscribe((quantity: any) => {
this.clientCollateralForm.patchValue({
'totalValue': this.collateralDetails.basePrice * quantity,
'totalCollateralValue': this.collateralDetails.basePrice * this.collateralDetails.pctToBase * quantity / 100
totalValue: this.collateralDetails.basePrice * quantity,
totalCollateralValue: (this.collateralDetails.basePrice * this.collateralDetails.pctToBase * quantity) / 100
});
});
}
@@ -81,15 +80,21 @@ export class AddClientCollateralComponent implements OnInit {
*/
createClientCollateralForm() {
this.clientCollateralForm = this.formBuilder.group({
'collateralId': [ '', Validators.required ],
'quantity': [ '', Validators.required ],
'name': [{ value: '', disabled: true }],
'quality': [{value: '', disabled: true}],
'unitType': [{value: '', disabled: true}],
'basePrice': [{value: '', disabled: true}],
'pctToBase': [{value: '', disabled: true}],
'totalValue': [{value: '', disabled: true}],
'totalCollateralValue': [{value: '', disabled: true}],
collateralId: [
'',
Validators.required
],
quantity: [
'',
Validators.required
],
name: [{ value: '', disabled: true }],
quality: [{ value: '', disabled: true }],
unitType: [{ value: '', disabled: true }],
basePrice: [{ value: '', disabled: true }],
pctToBase: [{ value: '', disabled: true }],
totalValue: [{ value: '', disabled: true }],
totalCollateralValue: [{ value: '', disabled: true }]
});
}
@@ -106,8 +111,7 @@ export class AddClientCollateralComponent implements OnInit {
locale
};
this.clientsService.createClientCollateral(this.clientId, clientCollateral).subscribe(() => {
this.router.navigate(['../../'], {relativeTo: this.route});
this.router.navigate(['../../'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('ClientActionsComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ClientActionsComponent ]
})
.compileComponents();
declarations: [ClientActionsComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -11,38 +11,37 @@ import { ActivatedRoute, Router } from '@angular/router';
styleUrls: ['./client-actions.component.scss']
})
export class ClientActionsComponent {
/** Flag object to store possible actions and render appropriate UI to the user */
actions: {
'Assign Staff': boolean
'Close': boolean
'Reject': boolean
'Survey': boolean
'Withdraw': boolean
'Update Default Savings': boolean
'Transfer Client': boolean
'Undo Transfer': boolean
'Accept Transfer': boolean
'Reject Transfer': boolean
'Reactivate': boolean
'Undo Rejection': boolean
'Add Charge': boolean
'Take Survey': boolean
'Client Screen Reports': boolean,
'Create Self Service User': boolean,
'Create Collateral': boolean
'Assign Staff': boolean;
Close: boolean;
Reject: boolean;
Survey: boolean;
Withdraw: boolean;
'Update Default Savings': boolean;
'Transfer Client': boolean;
'Undo Transfer': boolean;
'Accept Transfer': boolean;
'Reject Transfer': boolean;
Reactivate: boolean;
'Undo Rejection': boolean;
'Add Charge': boolean;
'Take Survey': boolean;
'Client Screen Reports': boolean;
'Create Self Service User': boolean;
'Create Collateral': boolean;
} = {
'Assign Staff': false,
'Close': false,
'Reject': false,
'Survey': false,
'Withdraw': false,
Close: false,
Reject: false,
Survey: false,
Withdraw: false,
'Update Default Savings': false,
'Transfer Client': false,
'Undo Transfer': false,
'Accept Transfer': false,
'Reject Transfer': false,
'Reactivate': false,
Reactivate: false,
'Undo Rejection': false,
'Add Charge': false,
'Take Survey': false,
@@ -55,11 +54,12 @@ export class ClientActionsComponent {
* @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 name = this.route.snapshot.params['name'];
this.actions[name] = true;
}
}
@@ -8,9 +8,8 @@ describe('ClientAssignStaffComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ClientAssignStaffComponent ]
})
.compileComponents();
declarations: [ClientAssignStaffComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -15,7 +15,6 @@ import { ClientsService } from 'app/clients/clients.service';
styleUrls: ['./client-assign-staff.component.scss']
})
export class ClientAssignStaffComponent implements OnInit {
/** Client Assign Staff form. */
clientAssignStaffForm: UntypedFormGroup;
/** Staff Data */
@@ -30,10 +29,12 @@ export class ClientAssignStaffComponent implements OnInit {
* @param {ActivatedRoute} route Activated Route
* @param {Router} router Router
*/
constructor(private formBuilder: UntypedFormBuilder,
private clientsService: ClientsService,
private route: ActivatedRoute,
private router: Router) {
constructor(
private formBuilder: UntypedFormBuilder,
private clientsService: ClientsService,
private route: ActivatedRoute,
private router: Router
) {
this.route.data.subscribe((data: { clientActionData: any }) => {
this.clientData = data.clientActionData;
});
@@ -52,7 +53,7 @@ export class ClientAssignStaffComponent implements OnInit {
*/
createClientAssignStaffForm() {
this.clientAssignStaffForm = this.formBuilder.group({
'staffId': ['']
staffId: ['']
});
}
@@ -60,10 +61,10 @@ export class ClientAssignStaffComponent implements OnInit {
* Submits the form and assigns staff for the client.
*/
submit() {
this.clientsService.executeClientCommand(this.clientData.id, 'assignStaff', this.clientAssignStaffForm.value)
this.clientsService
.executeClientCommand(this.clientData.id, 'assignStaff', this.clientAssignStaffForm.value)
.subscribe(() => {
this.router.navigate(['../../'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('ClientScreenReportsComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ClientScreenReportsComponent ]
})
.compileComponents();
declarations: [ClientScreenReportsComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -16,7 +16,6 @@ import { DomSanitizer } from '@angular/platform-browser';
styleUrls: ['./client-screen-reports.component.scss']
})
export class ClientScreenReportsComponent implements OnInit {
/** Client Screen Reportform. */
clientScreenReportForm: UntypedFormGroup;
/** Templates Data */
@@ -37,11 +36,13 @@ export class ClientScreenReportsComponent implements OnInit {
* @param {DomSanitizer} sanitizer DOM Sanitizer
* @param {Renderer2} renderer Renderer 2
*/
constructor(private formBuilder: UntypedFormBuilder,
private clientsService: ClientsService,
private route: ActivatedRoute,
private sanitizer: DomSanitizer,
private renderer: Renderer2) {
constructor(
private formBuilder: UntypedFormBuilder,
private clientsService: ClientsService,
private route: ActivatedRoute,
private sanitizer: DomSanitizer,
private renderer: Renderer2
) {
this.route.data.subscribe((data: { clientActionData: any }) => {
this.templatesData = data.clientActionData;
});
@@ -60,7 +61,7 @@ export class ClientScreenReportsComponent implements OnInit {
*/
createClientScreenReportForm() {
this.clientScreenReportForm = this.formBuilder.group({
'templateId': ['']
templateId: ['']
});
}
@@ -87,5 +88,4 @@ export class ClientScreenReportsComponent implements OnInit {
this.renderer.setProperty(this.screenReportRef.nativeElement, 'innerHTML', this.template);
});
}
}
@@ -8,9 +8,8 @@ describe('CloseClientComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CloseClientComponent ]
})
.compileComponents();
declarations: [CloseClientComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
styleUrls: ['./close-client.component.scss']
})
export class CloseClientComponent implements OnInit {
/** Minimum date allowed. */
minDate = new Date(2000, 0, 1);
/** Maximum date allowed. */
@@ -37,12 +36,14 @@ export class CloseClientComponent implements OnInit {
* @param {Router} router Router
* @param {SettingsService} settingsService Setting service
*/
constructor(private formBuilder: UntypedFormBuilder,
private clientsService: ClientsService,
private dateUtils: Dates,
private route: ActivatedRoute,
private router: Router,
private settingsService: SettingsService) {
constructor(
private formBuilder: UntypedFormBuilder,
private clientsService: ClientsService,
private dateUtils: Dates,
private route: ActivatedRoute,
private router: Router,
private settingsService: SettingsService
) {
this.route.data.subscribe((data: { clientActionData: any }) => {
this.closureData = data.clientActionData.narrations;
});
@@ -59,8 +60,14 @@ export class CloseClientComponent implements OnInit {
*/
createCloseClientForm() {
this.closeClientForm = this.formBuilder.group({
'closureDate': ['', Validators.required],
'closureReasonId': ['', Validators.required]
closureDate: [
'',
Validators.required
],
closureReasonId: [
'',
Validators.required
]
});
}
@@ -84,5 +91,4 @@ export class CloseClientComponent implements OnInit {
this.router.navigate(['../../'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('CreateSelfServiceUserComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CreateSelfServiceUserComponent ]
})
.compileComponents();
declarations: [CreateSelfServiceUserComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -1,6 +1,14 @@
/** Angular Imports. */
import { Component, OnInit } from '@angular/core';
import { UntypedFormBuilder, UntypedFormGroup, UntypedFormControl, Validators, AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';
import {
UntypedFormBuilder,
UntypedFormGroup,
UntypedFormControl,
Validators,
AbstractControl,
ValidationErrors,
ValidatorFn
} from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { Subscription } from 'rxjs';
@@ -14,17 +22,18 @@ import { PasswordsUtility } from 'app/core/utils/passwords-utility';
styleUrls: ['./create-self-service-user.component.scss']
})
export class CreateSelfServiceUserComponent implements OnInit {
createSelfServiceForm: UntypedFormGroup;
clientData: any;
hidePasswordField = true;
constructor(private formBuilder: UntypedFormBuilder,
private route: ActivatedRoute,
private clientService: ClientsService,
private router: Router,
private passwordsUtility: PasswordsUtility) {
this.route.data.subscribe((data: { clientActionData: any}) => {
constructor(
private formBuilder: UntypedFormBuilder,
private route: ActivatedRoute,
private clientService: ClientsService,
private router: Router,
private passwordsUtility: PasswordsUtility
) {
this.route.data.subscribe((data: { clientActionData: any }) => {
this.clientData = data.clientActionData;
});
}
@@ -45,8 +54,16 @@ export class CreateSelfServiceUserComponent implements OnInit {
this.createSelfServiceForm.removeControl('repeatPassword');
} else {
this.hidePasswordField = false;
this.createSelfServiceForm.addControl('password', new UntypedFormControl('', this.passwordsUtility.getPasswordValidators()));
this.createSelfServiceForm.addControl('repeatPassword', new UntypedFormControl('', [Validators.required, this.passwordsUtility.confirmPassword('password')]));
this.createSelfServiceForm.addControl(
'password',
new UntypedFormControl('', this.passwordsUtility.getPasswordValidators())
);
this.createSelfServiceForm.addControl(
'repeatPassword',
new UntypedFormControl('', [
Validators.required,
this.passwordsUtility.confirmPassword('password')])
);
}
});
}
@@ -56,13 +73,19 @@ export class CreateSelfServiceUserComponent implements OnInit {
*/
createSelfServiceUser() {
this.createSelfServiceForm = this.formBuilder.group({
'username': new UntypedFormControl('', [Validators.required]),
'firstname': new UntypedFormControl(this.clientData.firstname, [Validators.required]),
'lastname': new UntypedFormControl(this.clientData.lastname, [Validators.required]),
'email': new UntypedFormControl('', [Validators.required, Validators.email]),
'sendPasswordToEmail': new UntypedFormControl(true),
'passwordNeverExpires': new UntypedFormControl(false),
'status': new UntypedFormControl({value: this.clientData.subStatus.active ? 'Active' : 'Inactive', disabled: true})
username: new UntypedFormControl('', [Validators.required]),
firstname: new UntypedFormControl(this.clientData.firstname, [Validators.required]),
lastname: new UntypedFormControl(this.clientData.lastname, [Validators.required]),
email: new UntypedFormControl('', [
Validators.required,
Validators.email
]),
sendPasswordToEmail: new UntypedFormControl(true),
passwordNeverExpires: new UntypedFormControl(false),
status: new UntypedFormControl({
value: this.clientData.subStatus.active ? 'Active' : 'Inactive',
disabled: true
})
});
}
@@ -75,8 +98,7 @@ export class CreateSelfServiceUserComponent implements OnInit {
}
const clientId = this.clientData.id.toString();
const selfServiceForm = this.createSelfServiceForm.value;
selfServiceForm.roles = [2],
selfServiceForm.isSelfServiceUser = true;
(selfServiceForm.roles = [2]), (selfServiceForm.isSelfServiceUser = true);
selfServiceForm.staffId = this.clientData.staffId;
selfServiceForm.clients = [clientId];
selfServiceForm.officeId = this.clientData.officeId;
@@ -84,5 +106,4 @@ export class CreateSelfServiceUserComponent implements OnInit {
this.router.navigate(['../../general'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('ReactivateClientComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ReactivateClientComponent ]
})
.compileComponents();
declarations: [ReactivateClientComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
styleUrls: ['./reactivate-client.component.scss']
})
export class ReactivateClientComponent implements OnInit {
/** Minimum date allowed. */
minDate = new Date(2000, 0, 1);
/** Maximum date allowed. */
@@ -35,12 +34,14 @@ export class ReactivateClientComponent implements OnInit {
* @param {Router} router Router
* @param {SettingsService} settingsService Setting service
*/
constructor(private formBuilder: UntypedFormBuilder,
private clientsService: ClientsService,
private dateUtils: Dates,
private route: ActivatedRoute,
private router: Router,
private settingsService: SettingsService) {
constructor(
private formBuilder: UntypedFormBuilder,
private clientsService: ClientsService,
private dateUtils: Dates,
private route: ActivatedRoute,
private router: Router,
private settingsService: SettingsService
) {
this.clientId = this.route.parent.snapshot.params['clientId'];
}
@@ -57,7 +58,10 @@ export class ReactivateClientComponent implements OnInit {
*/
createReactivateClientForm() {
this.reactivateClientForm = this.formBuilder.group({
'reactivationDate': ['', Validators.required]
reactivationDate: [
'',
Validators.required
]
});
}
@@ -82,5 +86,4 @@ export class ReactivateClientComponent implements OnInit {
this.router.navigate(['../../'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('RejectClientTransferComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ RejectClientTransferComponent ]
})
.compileComponents();
declarations: [RejectClientTransferComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
styleUrls: ['./reject-client-transfer.component.scss']
})
export class RejectClientTransferComponent implements OnInit {
/** Reject Client Transfer form. */
rejectClientTransferForm: UntypedFormGroup;
/** Client Id */
@@ -31,12 +30,14 @@ export class RejectClientTransferComponent implements OnInit {
* @param {ActivatedRoute} route Activated Route
* @param {Router} router Router
*/
constructor(private formBuilder: UntypedFormBuilder,
private clientsService: ClientsService,
private settingsService: SettingsService,
private dateUtils: Dates,
private route: ActivatedRoute,
private router: Router) {
constructor(
private formBuilder: UntypedFormBuilder,
private clientsService: ClientsService,
private settingsService: SettingsService,
private dateUtils: Dates,
private route: ActivatedRoute,
private router: Router
) {
this.route.data.subscribe((data: { clientActionData: any }) => {
this.transferDate = data.clientActionData;
});
@@ -52,8 +53,8 @@ export class RejectClientTransferComponent implements OnInit {
*/
createRejectClientTransferForm() {
this.rejectClientTransferForm = this.formBuilder.group({
'transferDate': {value: new Date(this.transferDate), disabled: true},
'note': ['']
transferDate: { value: new Date(this.transferDate), disabled: true },
note: ['']
});
}
@@ -76,5 +77,4 @@ export class RejectClientTransferComponent implements OnInit {
this.router.navigate(['../../'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('RejectClientComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ RejectClientComponent ]
})
.compileComponents();
declarations: [RejectClientComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
styleUrls: ['./reject-client.component.scss']
})
export class RejectClientComponent implements OnInit {
/** Minimum date allowed. */
minDate = new Date(2000, 0, 1);
/** Maximum date allowed. */
@@ -37,12 +36,14 @@ export class RejectClientComponent implements OnInit {
* @param {Router} router Router
* @param {SettingsService} settingsService Setting service
*/
constructor(private formBuilder: UntypedFormBuilder,
private clientsService: ClientsService,
private dateUtils: Dates,
private route: ActivatedRoute,
private router: Router,
private settingsService: SettingsService) {
constructor(
private formBuilder: UntypedFormBuilder,
private clientsService: ClientsService,
private dateUtils: Dates,
private route: ActivatedRoute,
private router: Router,
private settingsService: SettingsService
) {
this.route.data.subscribe((data: { clientActionData: any }) => {
this.rejectionData = data.clientActionData.narrations;
});
@@ -59,8 +60,14 @@ export class RejectClientComponent implements OnInit {
*/
createRejectClientForm() {
this.rejectClientForm = this.formBuilder.group({
'rejectionDate': ['', Validators.required],
'rejectionReasonId': ['', Validators.required]
rejectionDate: [
'',
Validators.required
],
rejectionReasonId: [
'',
Validators.required
]
});
}
@@ -84,5 +91,4 @@ export class RejectClientComponent implements OnInit {
this.router.navigate(['../../'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('TakeSurveyComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ TakeSurveyComponent ]
})
.compileComponents();
declarations: [TakeSurveyComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -15,7 +15,6 @@ import { AuthenticationService } from '../../../../core/authentication/authentic
styleUrls: ['./take-survey.component.scss']
})
export class TakeSurveyComponent {
/** List of all Survey Data */
allSurveyData: any;
/** User Id */
@@ -28,13 +27,13 @@ export class TakeSurveyComponent {
clientId: any;
/** Stores the value to send to the API */
formData: {
userId: Number,
clientId: Number,
surveyId: Number,
scorecardValues: { questionId: Number, responseId: Number, value: String }[],
surveyName: String,
username: String,
id: Number
userId: Number;
clientId: Number;
surveyId: Number;
scorecardValues: { questionId: Number; responseId: Number; value: String }[];
surveyName: String;
username: String;
id: Number;
};
/**
@@ -44,10 +43,12 @@ export class TakeSurveyComponent {
* @param {Router} router Router
* @param {AuthenticationService} authenticationService AuthenticationService
*/
constructor(private route: ActivatedRoute,
private clientsService: ClientsService,
private router: Router,
private authenticationService: AuthenticationService) {
constructor(
private route: ActivatedRoute,
private clientsService: ClientsService,
private router: Router,
private authenticationService: AuthenticationService
) {
this.route.data.subscribe((data: { clientActionData: any }) => {
this.allSurveyData = data.clientActionData;
this.clientId = this.route.parent.snapshot.params['clientId'];
@@ -82,7 +83,6 @@ export class TakeSurveyComponent {
});
}
/**
* Checks if there is any response or not from the user and enables the submit button accordingly
*/
@@ -127,5 +127,4 @@ export class TakeSurveyComponent {
this.router.navigate(['../../general'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('TransferClientComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ TransferClientComponent ]
})
.compileComponents();
declarations: [TransferClientComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
styleUrls: ['./transfer-client.component.scss']
})
export class TransferClientComponent implements OnInit {
/** Minimum date allowed. */
minDate = new Date(2000, 0, 1);
/** Maximum date allowed. */
@@ -37,12 +36,14 @@ export class TransferClientComponent implements OnInit {
* @param {Router} router Router
* @param {SettingsService} settingsService Setting service
*/
constructor(private formBuilder: UntypedFormBuilder,
private clientsService: ClientsService,
private dateUtils: Dates,
private route: ActivatedRoute,
private router: Router,
private settingsService: SettingsService) {
constructor(
private formBuilder: UntypedFormBuilder,
private clientsService: ClientsService,
private dateUtils: Dates,
private route: ActivatedRoute,
private router: Router,
private settingsService: SettingsService
) {
this.route.data.subscribe((data: { clientActionData: any }) => {
this.officeData = data.clientActionData;
});
@@ -59,9 +60,15 @@ export class TransferClientComponent implements OnInit {
*/
createTransferClientForm() {
this.transferClientForm = this.formBuilder.group({
'destinationOfficeId': ['', Validators.required],
'transferDate': ['', Validators.required],
'note': ['']
destinationOfficeId: [
'',
Validators.required
],
transferDate: [
'',
Validators.required
],
note: ['']
});
}
@@ -85,5 +92,4 @@ export class TransferClientComponent implements OnInit {
this.router.navigate(['../../'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('UndoClientRejectionComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ UndoClientRejectionComponent ]
})
.compileComponents();
declarations: [UndoClientRejectionComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
styleUrls: ['./undo-client-rejection.component.scss']
})
export class UndoClientRejectionComponent implements OnInit {
/** Minimum date allowed. */
minDate = new Date(2000, 0, 1);
/** Maximum date allowed. */
@@ -34,12 +33,14 @@ export class UndoClientRejectionComponent implements OnInit {
* @param {ActivatedRoute} route Activated Route
* @param {Router} router Router
*/
constructor(private formBuilder: UntypedFormBuilder,
private clientsService: ClientsService,
private dateUtils: Dates,
private route: ActivatedRoute,
private router: Router,
private settingsService: SettingsService) {
constructor(
private formBuilder: UntypedFormBuilder,
private clientsService: ClientsService,
private dateUtils: Dates,
private route: ActivatedRoute,
private router: Router,
private settingsService: SettingsService
) {
this.clientId = this.route.parent.snapshot.params['clientId'];
}
@@ -56,7 +57,10 @@ export class UndoClientRejectionComponent implements OnInit {
*/
createUndoClientRejectionForm() {
this.undoClientRejectionForm = this.formBuilder.group({
'reopenedDate': ['', Validators.required]
reopenedDate: [
'',
Validators.required
]
});
}
@@ -81,5 +85,4 @@ export class UndoClientRejectionComponent implements OnInit {
this.router.navigate(['../../'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('UndoClientTransferComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ UndoClientTransferComponent ]
})
.compileComponents();
declarations: [UndoClientTransferComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
styleUrls: ['./undo-client-transfer.component.scss']
})
export class UndoClientTransferComponent implements OnInit {
/** Undo Client Transfer form. */
undoClientTransferForm: UntypedFormGroup;
/** Client Id */
@@ -31,12 +30,14 @@ export class UndoClientTransferComponent implements OnInit {
* @param {ActivatedRoute} route Activated Route
* @param {Router} router Router
*/
constructor(private formBuilder: UntypedFormBuilder,
private clientsService: ClientsService,
private settingsService: SettingsService,
private dateUtils: Dates,
private route: ActivatedRoute,
private router: Router) {
constructor(
private formBuilder: UntypedFormBuilder,
private clientsService: ClientsService,
private settingsService: SettingsService,
private dateUtils: Dates,
private route: ActivatedRoute,
private router: Router
) {
this.route.data.subscribe((data: { clientActionData: any }) => {
this.transferDate = data.clientActionData;
});
@@ -55,8 +56,8 @@ export class UndoClientTransferComponent implements OnInit {
*/
createUndoClientTransferForm() {
this.undoClientTransferForm = this.formBuilder.group({
'transferDate': {value: new Date(this.transferDate), disabled: true},
'note': ['']
transferDate: { value: new Date(this.transferDate), disabled: true },
note: ['']
});
}
@@ -79,5 +80,4 @@ export class UndoClientTransferComponent implements OnInit {
this.router.navigate(['../../'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('UpdateClientSavingsAccountComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ UpdateClientSavingsAccountComponent ]
})
.compileComponents();
declarations: [UpdateClientSavingsAccountComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -15,7 +15,6 @@ import { ClientsService } from 'app/clients/clients.service';
styleUrls: ['./update-client-savings-account.component.scss']
})
export class UpdateClientSavingsAccountComponent implements OnInit {
/** Client Update Savings Account form. */
clientSavingsAccountForm: UntypedFormGroup;
/** Savings Accounts Data */
@@ -30,10 +29,12 @@ export class UpdateClientSavingsAccountComponent implements OnInit {
* @param {ActivatedRoute} route Activated Route
* @param {Router} router Router
*/
constructor(private formBuilder: UntypedFormBuilder,
private clientsService: ClientsService,
private route: ActivatedRoute,
private router: Router) {
constructor(
private formBuilder: UntypedFormBuilder,
private clientsService: ClientsService,
private route: ActivatedRoute,
private router: Router
) {
this.route.data.subscribe((data: { clientActionData: any }) => {
this.clientData = data.clientActionData;
});
@@ -49,7 +50,7 @@ export class UpdateClientSavingsAccountComponent implements OnInit {
*/
createClientSavingsAccountForm() {
this.clientSavingsAccountForm = this.formBuilder.group({
'savingsAccountId': [this.clientData.savingsAccountId]
savingsAccountId: [this.clientData.savingsAccountId]
});
}
@@ -57,10 +58,10 @@ export class UpdateClientSavingsAccountComponent implements OnInit {
* Submits the form and update savings account for the client.
*/
submit() {
this.clientsService.executeClientCommand(this.clientData.id, 'updateSavingsAccount', this.clientSavingsAccountForm.value)
this.clientsService
.executeClientCommand(this.clientData.id, 'updateSavingsAccount', this.clientSavingsAccountForm.value)
.subscribe(() => {
this.router.navigate(['../../'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('ViewSurveyComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ViewSurveyComponent ]
})
.compileComponents();
declarations: [ViewSurveyComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -14,20 +14,23 @@ import { MatTableDataSource } from '@angular/material/table';
styleUrls: ['./view-survey.component.scss']
})
export class ViewSurveyComponent implements OnInit {
/** Survey Data */
surveyData: any;
/** Data source for view surveys table. */
dataSource: MatTableDataSource<any>;
/** Columns to be displayed in list of surveys table. */
displayedColumns: string[] = ['surveyName', 'createdBy', 'date', 'score'];
displayedColumns: string[] = [
'surveyName',
'createdBy',
'date',
'score'
];
/** Paginator for list of surveys table. */
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
/** Sorter for list of surveys table. */
@ViewChild(MatSort, { static: true }) sort: MatSort;
/**
* Retrieves the survey data from `resolve`.
* @param {ActivatedRoute} route Activated Route.
@@ -71,5 +74,4 @@ export class ViewSurveyComponent implements OnInit {
applyFilter(filterValue: string) {
this.dataSource.filter = filterValue.trim().toLowerCase();
}
}
@@ -8,9 +8,8 @@ describe('WithdrawClientComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ WithdrawClientComponent ]
})
.compileComponents();
declarations: [WithdrawClientComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
styleUrls: ['./withdraw-client.component.scss']
})
export class WithdrawClientComponent implements OnInit {
/** Minimum date allowed. */
minDate = new Date(2000, 0, 1);
/** Maximum date allowed. */
@@ -37,12 +36,14 @@ export class WithdrawClientComponent implements OnInit {
* @param {Router} router Router
* @param {SettingsService} settingsService Setting service
*/
constructor(private formBuilder: UntypedFormBuilder,
private clientsService: ClientsService,
private dateUtils: Dates,
private route: ActivatedRoute,
private router: Router,
private settingsService: SettingsService) {
constructor(
private formBuilder: UntypedFormBuilder,
private clientsService: ClientsService,
private dateUtils: Dates,
private route: ActivatedRoute,
private router: Router,
private settingsService: SettingsService
) {
this.route.data.subscribe((data: { clientActionData: any }) => {
this.withdrawalData = data.clientActionData.narrations;
});
@@ -59,8 +60,14 @@ export class WithdrawClientComponent implements OnInit {
*/
createWithdrawClientForm() {
this.withdrawClientForm = this.formBuilder.group({
'withdrawalDate': ['', Validators.required],
'withdrawalReasonId': ['', Validators.required]
withdrawalDate: [
'',
Validators.required
],
withdrawalReasonId: [
'',
Validators.required
]
});
}
@@ -84,5 +91,4 @@ export class WithdrawClientComponent implements OnInit {
this.router.navigate(['../../'], { relativeTo: this.route });
});
}
}