build: Use prettier for typescript
Stop ignoring .ts files in prettier and fix existing issues.
This commit is contained in:
@@ -17,6 +17,7 @@ const routes: Routes = [
|
||||
data: { title: 'Settings', breadcrumb: 'Settings' }
|
||||
}
|
||||
])
|
||||
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -29,4 +30,4 @@ const routes: Routes = [
|
||||
exports: [RouterModule],
|
||||
providers: []
|
||||
})
|
||||
export class SettingsRoutingModule { }
|
||||
export class SettingsRoutingModule {}
|
||||
|
||||
@@ -8,9 +8,8 @@ describe('SettingsComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ SettingsComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [SettingsComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -14,7 +14,6 @@ import { UntypedFormControl } from '@angular/forms';
|
||||
styleUrls: ['./settings.component.scss']
|
||||
})
|
||||
export class SettingsComponent implements OnInit {
|
||||
|
||||
/** Placeholder for languages. update once translations are set up */
|
||||
languages: any[] = [
|
||||
{
|
||||
@@ -34,32 +33,32 @@ export class SettingsComponent implements OnInit {
|
||||
'MM-dd-yy',
|
||||
'yyyy-MM-dd'
|
||||
];
|
||||
/** Decimals. */
|
||||
decimals: string[] = [
|
||||
'0',
|
||||
'1',
|
||||
'2',
|
||||
'3',
|
||||
'4',
|
||||
'5',
|
||||
'6',
|
||||
'7',
|
||||
'8',
|
||||
];
|
||||
/** Decimals. */
|
||||
decimals: string[] = [
|
||||
'0',
|
||||
'1',
|
||||
'2',
|
||||
'3',
|
||||
'4',
|
||||
'5',
|
||||
'6',
|
||||
'7',
|
||||
'8'
|
||||
];
|
||||
/** Placeholder for fonts. */
|
||||
fonts: any;
|
||||
|
||||
/** Language Setting */
|
||||
language = new UntypedFormControl('');
|
||||
/** Date Format Setting */
|
||||
dateFormat = new UntypedFormControl('');
|
||||
dateFormat = new UntypedFormControl('');
|
||||
/** Decimals to Display Setting */
|
||||
decimalsToDisplay = new UntypedFormControl('');
|
||||
decimalsToDisplay = new UntypedFormControl('');
|
||||
|
||||
/**
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private settingsService: SettingsService) { }
|
||||
constructor(private settingsService: SettingsService) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.language.patchValue(this.settingsService.language);
|
||||
@@ -92,5 +91,4 @@ export class SettingsComponent implements OnInit {
|
||||
compareOptions(option1: any, option2: any) {
|
||||
return option1 && option2 && option1.code === option2.code;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,4 +20,4 @@ import { SettingsComponent } from './settings.component';
|
||||
],
|
||||
declarations: [SettingsComponent]
|
||||
})
|
||||
export class SettingsModule { }
|
||||
export class SettingsModule {}
|
||||
|
||||
@@ -13,7 +13,6 @@ import { environment } from '../../environments/environment';
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SettingsService {
|
||||
|
||||
public static businessDateFormat = 'yyyy-MM-dd';
|
||||
public static businessDateConfigName = 'enable-business-date';
|
||||
public static businessDateType = 'BUSINESS_DATE';
|
||||
@@ -21,8 +20,10 @@ export class SettingsService {
|
||||
minAllowedDate = new Date(1950, 0, 1);
|
||||
maxAllowedDate = new Date(2100, 0, 1);
|
||||
|
||||
constructor(private alertService: AlertService,
|
||||
private dateUtils: Dates) { }
|
||||
constructor(
|
||||
private alertService: AlertService,
|
||||
private dateUtils: Dates
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Sets date format setting throughout the app.
|
||||
@@ -36,7 +37,7 @@ export class SettingsService {
|
||||
* Sets language setting throughout the app.
|
||||
* @param {any} language Language.
|
||||
*/
|
||||
setLanguage(language: { name: string, code: string }) {
|
||||
setLanguage(language: { name: string; code: string }) {
|
||||
localStorage.setItem('mifosXLanguage', JSON.stringify(language));
|
||||
}
|
||||
|
||||
@@ -241,8 +242,10 @@ export class SettingsService {
|
||||
if (data.type === dateType) {
|
||||
const dateVal = new Date(data.date);
|
||||
this.setBusinessDate(this.dateUtils.formatDate(dateVal, SettingsService.businessDateFormat));
|
||||
this.alertService.alert({ type: dateType + ' Set',
|
||||
message: this.dateUtils.formatDate(dateVal, this.dateFormat())});
|
||||
this.alertService.alert({
|
||||
type: dateType + ' Set',
|
||||
message: this.dateUtils.formatDate(dateVal, this.dateFormat())
|
||||
});
|
||||
return;
|
||||
}
|
||||
});
|
||||
@@ -255,5 +258,4 @@ export class SettingsService {
|
||||
get themeDarkEnabled() {
|
||||
return JSON.parse(localStorage.getItem('mifosXThemeDarkEnabled'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user