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('EditGroupComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EditGroupComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [EditGroupComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates';
|
||||
styleUrls: ['./edit-group.component.scss']
|
||||
})
|
||||
export class EditGroupComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -40,16 +39,19 @@ export class EditGroupComponent implements OnInit {
|
||||
* @param {Dates} dateUtils Date Utils to format date.
|
||||
* @param {SettingsService} settingsService SettingsService
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private groupService: GroupsService,
|
||||
private dateUtils: Dates,
|
||||
private settingsService: SettingsService) {
|
||||
this.route.data.subscribe( (data: { groupAndTemplateData: any, groupViewData: any } ) => {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private groupService: GroupsService,
|
||||
private dateUtils: Dates,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.route.data.subscribe((data: { groupAndTemplateData: any; groupViewData: any }) => {
|
||||
this.staffData = data.groupAndTemplateData.staffOptions;
|
||||
this.groupData = data.groupAndTemplateData;
|
||||
this.submittedOnDate = data.groupViewData.timeline.submittedOnDate && new Date(data.groupViewData.timeline.submittedOnDate);
|
||||
this.submittedOnDate =
|
||||
data.groupViewData.timeline.submittedOnDate && new Date(data.groupViewData.timeline.submittedOnDate);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -60,10 +62,10 @@ export class EditGroupComponent implements OnInit {
|
||||
this.maxDate = this.settingsService.businessDate;
|
||||
this.createEditGroupForm();
|
||||
this.editGroupForm.patchValue({
|
||||
'name': this.groupData.name,
|
||||
'submittedOnDate': this.submittedOnDate,
|
||||
'staffId': this.groupData.staffId,
|
||||
'externalId': this.groupData.externalId
|
||||
name: this.groupData.name,
|
||||
submittedOnDate: this.submittedOnDate,
|
||||
staffId: this.groupData.staffId,
|
||||
externalId: this.groupData.externalId
|
||||
});
|
||||
}
|
||||
|
||||
@@ -72,10 +74,18 @@ export class EditGroupComponent implements OnInit {
|
||||
*/
|
||||
createEditGroupForm() {
|
||||
this.editGroupForm = this.formBuilder.group({
|
||||
'name': ['', [Validators.required, Validators.pattern('(^[A-z]).*')]],
|
||||
'submittedOnDate': ['', Validators.required],
|
||||
'staffId': [''],
|
||||
'externalId': ['']
|
||||
name: [
|
||||
'',
|
||||
[
|
||||
Validators.required,
|
||||
Validators.pattern('(^[A-z]).*')]
|
||||
],
|
||||
submittedOnDate: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
staffId: [''],
|
||||
externalId: ['']
|
||||
});
|
||||
this.buildDependencies();
|
||||
}
|
||||
@@ -86,7 +96,9 @@ export class EditGroupComponent implements OnInit {
|
||||
buildDependencies() {
|
||||
if (this.groupData.active) {
|
||||
this.editGroupForm.addControl('activationDate', new UntypedFormControl('', Validators.required));
|
||||
this.editGroupForm.get('activationDate').patchValue(this.groupData.activationDate && new Date(this.groupData.activationDate));
|
||||
this.editGroupForm
|
||||
.get('activationDate')
|
||||
.patchValue(this.groupData.activationDate && new Date(this.groupData.activationDate));
|
||||
} else {
|
||||
this.editGroupForm.removeControl('activationDate');
|
||||
}
|
||||
@@ -117,5 +129,4 @@ export class EditGroupComponent implements OnInit {
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user