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('WorkingDaysComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ WorkingDaysComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [WorkingDaysComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -25,7 +25,6 @@ const recurrenceDefaultValue = 'FREQ=WEEKLY;INTERVAL=1;BYDAY=';
|
||||
styleUrls: ['./working-days.component.scss']
|
||||
})
|
||||
export class WorkingDaysComponent implements OnInit, AfterViewInit {
|
||||
|
||||
/** Working days form. */
|
||||
workingDaysForm: UntypedFormGroup;
|
||||
/** Working days data. */
|
||||
@@ -59,14 +58,16 @@ export class WorkingDaysComponent implements OnInit, AfterViewInit {
|
||||
* @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service.
|
||||
* @param {PopoverService} popoverService PopoverService.
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private organizationService: OrganizationService,
|
||||
private settingsService: SettingsService,
|
||||
private router: Router,
|
||||
private dialog: MatDialog,
|
||||
private configurationWizardService: ConfigurationWizardService,
|
||||
private popoverService: PopoverService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private organizationService: OrganizationService,
|
||||
private settingsService: SettingsService,
|
||||
private router: Router,
|
||||
private dialog: MatDialog,
|
||||
private configurationWizardService: ConfigurationWizardService,
|
||||
private popoverService: PopoverService
|
||||
) {
|
||||
this.route.data.subscribe((data: { workingDays: any }) => {
|
||||
this.workingDaysData = data.workingDays;
|
||||
});
|
||||
@@ -86,9 +87,9 @@ export class WorkingDaysComponent implements OnInit, AfterViewInit {
|
||||
this.setWeeklyWorkingDays();
|
||||
this.repaymentRescheduleTypeData = this.workingDaysData.repaymentRescheduleOptions;
|
||||
this.workingDaysForm = this.formBuilder.group({
|
||||
'recurrence': this.formBuilder.array(this.createRecurrenceFormArray()),
|
||||
'repaymentRescheduleType': [this.workingDaysData.repaymentRescheduleType.id],
|
||||
'extendTermForDailyRepayments': [this.workingDaysData.extendTermForDailyRepayments]
|
||||
recurrence: this.formBuilder.array(this.createRecurrenceFormArray()),
|
||||
repaymentRescheduleType: [this.workingDaysData.repaymentRescheduleType.id],
|
||||
extendTermForDailyRepayments: [this.workingDaysData.extendTermForDailyRepayments]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -113,7 +114,7 @@ export class WorkingDaysComponent implements OnInit, AfterViewInit {
|
||||
* Creates the recurrence form array.
|
||||
*/
|
||||
createRecurrenceFormArray() {
|
||||
return this.weekDays.map(weekDay => new UntypedFormControl(weekDay.checked));
|
||||
return this.weekDays.map((weekDay) => new UntypedFormControl(weekDay.checked));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -131,7 +132,7 @@ export class WorkingDaysComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
}
|
||||
workingDays.recurrence = recurrence;
|
||||
this.organizationService.updateWorkingDays(workingDays).subscribe(response => {
|
||||
this.organizationService.updateWorkingDays(workingDays).subscribe((response) => {
|
||||
if (this.configurationWizardService.showDefineWorkingDays === true) {
|
||||
this.configurationWizardService.showDefineWorkingDays = false;
|
||||
this.openNextStepDialog();
|
||||
@@ -148,7 +149,12 @@ export class WorkingDaysComponent implements OnInit, AfterViewInit {
|
||||
* @param position String.
|
||||
* @param backdrop Boolean.
|
||||
*/
|
||||
showPopover(template: TemplateRef<any>, target: HTMLElement | ElementRef<any>, position: string, backdrop: boolean): void {
|
||||
showPopover(
|
||||
template: TemplateRef<any>,
|
||||
target: HTMLElement | ElementRef<any>,
|
||||
position: string,
|
||||
backdrop: boolean
|
||||
): void {
|
||||
setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200);
|
||||
}
|
||||
|
||||
@@ -158,7 +164,7 @@ export class WorkingDaysComponent implements OnInit, AfterViewInit {
|
||||
ngAfterViewInit() {
|
||||
if (this.configurationWizardService.showDefineWorkingDays === true) {
|
||||
setTimeout(() => {
|
||||
this.showPopover(this.templateWorkingDaysFormRef, this.workingDaysFormRef.nativeElement, 'right', true);
|
||||
this.showPopover(this.templateWorkingDaysFormRef, this.workingDaysFormRef.nativeElement, 'right', true);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -183,21 +189,21 @@ export class WorkingDaysComponent implements OnInit, AfterViewInit {
|
||||
* Next Step (System) Dialog Configuration Wizard.
|
||||
*/
|
||||
openNextStepDialog() {
|
||||
const nextStepDialogRef = this.dialog.open( NextStepDialogComponent, {
|
||||
const nextStepDialogRef = this.dialog.open(NextStepDialogComponent, {
|
||||
data: {
|
||||
nextStepName: 'Setup System',
|
||||
previousStepName: 'Organization',
|
||||
stepPercentage: 30
|
||||
},
|
||||
}
|
||||
});
|
||||
nextStepDialogRef.afterClosed().subscribe((response: { nextStep: boolean }) => {
|
||||
if (response.nextStep) {
|
||||
this.configurationWizardService.showDefineWorkingDays = false;
|
||||
this.configurationWizardService.showDatatables = true;
|
||||
this.router.navigate(['/system']);
|
||||
if (response.nextStep) {
|
||||
this.configurationWizardService.showDefineWorkingDays = false;
|
||||
this.configurationWizardService.showDatatables = true;
|
||||
this.router.navigate(['/system']);
|
||||
} else {
|
||||
this.configurationWizardService.showDefineWorkingDays = false;
|
||||
this.router.navigate(['/home']);
|
||||
this.configurationWizardService.showDefineWorkingDays = false;
|
||||
this.router.navigate(['/home']);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ import { OrganizationService } from '../organization.service';
|
||||
*/
|
||||
@Injectable()
|
||||
export class WorkingDaysResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {OrganizationService} organizationService Organization service.
|
||||
*/
|
||||
@@ -26,5 +25,4 @@ export class WorkingDaysResolver implements Resolve<Object> {
|
||||
resolve(): Observable<any> {
|
||||
return this.organizationService.getWorkingDays();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user