build: Use prettier for typescript
Stop ignoring .ts files in prettier and fix existing issues.
This commit is contained in:
+75
-53
@@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates';
|
||||
styleUrls: ['./edit-standing-instructions.component.scss']
|
||||
})
|
||||
export class EditStandingInstructionsComponent implements OnInit {
|
||||
|
||||
/** Standing Instructions Data */
|
||||
standingInstructionsData: any;
|
||||
/** Standing Instructions Id */
|
||||
@@ -50,12 +49,14 @@ export class EditStandingInstructionsComponent implements OnInit {
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
* @param {Dates} dateUtils Date Utils
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private accountTransfersService: AccountTransfersService,
|
||||
private settingsService: SettingsService,
|
||||
private dateUtils: Dates) {
|
||||
private dateUtils: Dates
|
||||
) {
|
||||
this.route.data.subscribe((data: { standingInstructionsDataAndTemplate: any }) => {
|
||||
this.standingInstructionsData = data.standingInstructionsDataAndTemplate;
|
||||
this.standingInstructionsId = data.standingInstructionsDataAndTemplate.id;
|
||||
@@ -77,26 +78,28 @@ export class EditStandingInstructionsComponent implements OnInit {
|
||||
this.standingInstructionsData.recurrenceOnMonthDay.push(n);
|
||||
}
|
||||
this.editStandingInstructionsForm.patchValue({
|
||||
'name': this.standingInstructionsData.name,
|
||||
'applicant': this.standingInstructionsData.fromClient.displayName,
|
||||
'type': this.standingInstructionsData.transferType.value,
|
||||
'priority': this.standingInstructionsData.priority.id,
|
||||
'status': this.standingInstructionsData.status.id,
|
||||
'fromAccountType': this.standingInstructionsData.fromAccountType.value,
|
||||
'fromAccount': this.standingInstructionsData.fromAccount.productName,
|
||||
'destination': this.allowclientedit ? 'Within Bank' : 'Own Account',
|
||||
'toOffice': this.standingInstructionsData.toOffice.name,
|
||||
'toClientId': this.standingInstructionsData.toClient.displayName,
|
||||
'toAccountType': this.standingInstructionsData.toAccountType.value,
|
||||
'toAccount': this.standingInstructionsData.toAccount.productName,
|
||||
'instructionType': this.standingInstructionsData.instructionType.id,
|
||||
'amount': this.standingInstructionsData.amount,
|
||||
'validFrom': this.standingInstructionsData.validFrom && new Date(this.standingInstructionsData.validFrom),
|
||||
'validTill': this.standingInstructionsData.validTill && new Date(this.standingInstructionsData.validTill),
|
||||
'recurrenceType': this.standingInstructionsData.recurrenceType.id,
|
||||
'recurrenceInterval': this.standingInstructionsData.recurrenceInterval,
|
||||
'recurrenceFrequency': this.standingInstructionsData.recurrenceFrequency.id,
|
||||
'recurrenceOnMonthDay': this.standingInstructionsData.recurrenceOnMonthDay && new Date(this.standingInstructionsData.recurrenceOnMonthDay)
|
||||
name: this.standingInstructionsData.name,
|
||||
applicant: this.standingInstructionsData.fromClient.displayName,
|
||||
type: this.standingInstructionsData.transferType.value,
|
||||
priority: this.standingInstructionsData.priority.id,
|
||||
status: this.standingInstructionsData.status.id,
|
||||
fromAccountType: this.standingInstructionsData.fromAccountType.value,
|
||||
fromAccount: this.standingInstructionsData.fromAccount.productName,
|
||||
destination: this.allowclientedit ? 'Within Bank' : 'Own Account',
|
||||
toOffice: this.standingInstructionsData.toOffice.name,
|
||||
toClientId: this.standingInstructionsData.toClient.displayName,
|
||||
toAccountType: this.standingInstructionsData.toAccountType.value,
|
||||
toAccount: this.standingInstructionsData.toAccount.productName,
|
||||
instructionType: this.standingInstructionsData.instructionType.id,
|
||||
amount: this.standingInstructionsData.amount,
|
||||
validFrom: this.standingInstructionsData.validFrom && new Date(this.standingInstructionsData.validFrom),
|
||||
validTill: this.standingInstructionsData.validTill && new Date(this.standingInstructionsData.validTill),
|
||||
recurrenceType: this.standingInstructionsData.recurrenceType.id,
|
||||
recurrenceInterval: this.standingInstructionsData.recurrenceInterval,
|
||||
recurrenceFrequency: this.standingInstructionsData.recurrenceFrequency.id,
|
||||
recurrenceOnMonthDay:
|
||||
this.standingInstructionsData.recurrenceOnMonthDay &&
|
||||
new Date(this.standingInstructionsData.recurrenceOnMonthDay)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -105,26 +108,41 @@ export class EditStandingInstructionsComponent implements OnInit {
|
||||
*/
|
||||
createEditStandingInstructionsForm() {
|
||||
this.editStandingInstructionsForm = this.formBuilder.group({
|
||||
'name': [{value: '', disabled: true}],
|
||||
'applicant': [{ value: '', disabled: true }],
|
||||
'type': [{ value: '', disabled: true }],
|
||||
'priority': ['', Validators.required],
|
||||
'status': ['', Validators.required],
|
||||
'fromAccountType': [{ value: '', disabled: true }],
|
||||
'fromAccount': [{ value: '', disabled: true }],
|
||||
'destination': [{ value: '', disabled: true }],
|
||||
'toOffice': [{ value: '', disabled: true }],
|
||||
'toClientId': [{ value: '', disabled: true }],
|
||||
'toAccountType': [{ value: '', disabled: true }],
|
||||
'toAccount': [{ value: '', disabled: true }],
|
||||
'instructionType': '',
|
||||
'amount': '',
|
||||
'validFrom': ['', Validators.required],
|
||||
'validTill': ['', Validators.required],
|
||||
'recurrenceType': ['', Validators.required],
|
||||
'recurrenceInterval': '',
|
||||
'recurrenceFrequency': '',
|
||||
'recurrenceOnMonthDay': ''
|
||||
name: [{ value: '', disabled: true }],
|
||||
applicant: [{ value: '', disabled: true }],
|
||||
type: [{ value: '', disabled: true }],
|
||||
priority: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
status: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
fromAccountType: [{ value: '', disabled: true }],
|
||||
fromAccount: [{ value: '', disabled: true }],
|
||||
destination: [{ value: '', disabled: true }],
|
||||
toOffice: [{ value: '', disabled: true }],
|
||||
toClientId: [{ value: '', disabled: true }],
|
||||
toAccountType: [{ value: '', disabled: true }],
|
||||
toAccount: [{ value: '', disabled: true }],
|
||||
instructionType: '',
|
||||
amount: '',
|
||||
validFrom: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
validTill: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
recurrenceType: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
recurrenceInterval: '',
|
||||
recurrenceFrequency: '',
|
||||
recurrenceOnMonthDay: ''
|
||||
});
|
||||
}
|
||||
|
||||
@@ -147,19 +165,23 @@ export class EditStandingInstructionsComponent implements OnInit {
|
||||
dateFormat,
|
||||
instructionType: this.editStandingInstructionsForm.value.instructionType,
|
||||
locale,
|
||||
monthDayFormat: 'dd MMMM',
|
||||
monthDayFormat: 'dd MMMM',
|
||||
priority: this.editStandingInstructionsForm.value.priority,
|
||||
recurrenceFrequency: this.editStandingInstructionsForm.value.recurrenceFrequency,
|
||||
recurrenceInterval: this.editStandingInstructionsForm.value.recurrenceInterval,
|
||||
recurrenceOnMonthDay: this.dateUtils.formatDate(this.editStandingInstructionsForm.value.recurrenceOnMonthDay, 'dd MMMM'),
|
||||
recurrenceType: this.editStandingInstructionsForm.value.recurrenceType,
|
||||
status: this.editStandingInstructionsForm.value.status,
|
||||
recurrenceFrequency: this.editStandingInstructionsForm.value.recurrenceFrequency,
|
||||
recurrenceInterval: this.editStandingInstructionsForm.value.recurrenceInterval,
|
||||
recurrenceOnMonthDay: this.dateUtils.formatDate(
|
||||
this.editStandingInstructionsForm.value.recurrenceOnMonthDay,
|
||||
'dd MMMM'
|
||||
),
|
||||
recurrenceType: this.editStandingInstructionsForm.value.recurrenceType,
|
||||
status: this.editStandingInstructionsForm.value.status,
|
||||
validFrom: this.dateUtils.formatDate(this.editStandingInstructionsForm.value.validFrom, dateFormat),
|
||||
validTill: this.dateUtils.formatDate(this.editStandingInstructionsForm.value.validTill, dateFormat)
|
||||
};
|
||||
this.accountTransfersService.updateStandingInstructionsData(this.standingInstructionsId, standingInstructionData).subscribe((response: any) => {
|
||||
this.router.navigate(['../view'], { relativeTo: this.route });
|
||||
});
|
||||
this.accountTransfersService
|
||||
.updateStandingInstructionsData(this.standingInstructionsId, standingInstructionData)
|
||||
.subscribe((response: any) => {
|
||||
this.router.navigate(['../view'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user