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
@@ -15,15 +15,20 @@ const routes: Routes = [
children: [
{
path: 'individual-collection-sheet',
data: { title: 'Individual Collection Sheet', breadcrumb: 'Individual Collection Sheet', routeParamBreadcrumb: false },
data: {
title: 'Individual Collection Sheet',
breadcrumb: 'Individual Collection Sheet',
routeParamBreadcrumb: false
},
component: IndividualCollectionSheetComponent,
resolve: {
officesData: OfficesResolver
}
},
}
]
}
])
];
@NgModule({
@@ -31,4 +36,4 @@ const routes: Routes = [
providers: [],
exports: [RouterModule]
})
export class CollectionsRoutingModule { }
export class CollectionsRoutingModule {}
+1 -1
View File
@@ -19,4 +19,4 @@ import { IndividualCollectionSheetComponent } from './individual-collection-shee
IndividualCollectionSheetComponent
]
})
export class CollectionsModule { }
export class CollectionsModule {}
+2 -6
View File
@@ -12,8 +12,7 @@ import { Observable } from 'rxjs';
providedIn: 'root'
})
export class CollectionsService {
constructor(private http: HttpClient) { }
constructor(private http: HttpClient) {}
/**
* Returns all the offices
@@ -27,9 +26,7 @@ export class CollectionsService {
* @param {officeId} OfficeId any
*/
getStaffs(officeId: any): Observable<any> {
const httpParams = new HttpParams()
.set('officeId', officeId)
.set('status', 'all');
const httpParams = new HttpParams().set('officeId', officeId).set('status', 'all');
return this.http.get(`/staff`, { params: httpParams });
}
@@ -50,5 +47,4 @@ export class CollectionsService {
const httpParams = new HttpParams().set('command', 'saveCollectionSheet');
return this.http.post(`/collectionsheet`, data, { params: httpParams });
}
}
@@ -8,9 +8,8 @@ describe('IndividualCollectionSheetComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ IndividualCollectionSheetComponent ]
})
.compileComponents();
declarations: [IndividualCollectionSheetComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -31,7 +31,6 @@ import { Dates } from 'app/core/utils/dates';
styleUrls: ['./individual-collection-sheet.component.scss']
})
export class IndividualCollectionSheetComponent implements OnInit {
/** Offices Data */
officesData: any;
/** Loan Officer Data */
@@ -62,16 +61,29 @@ export class IndividualCollectionSheetComponent implements OnInit {
noData = false;
/** Columns to be displayed in loans table. */
loansDisplayedColumns: string[] = ['loanAccount', 'productName', 'clientName', 'totalDue', 'charges', 'actions'];
loansDisplayedColumns: string[] = [
'loanAccount',
'productName',
'clientName',
'totalDue',
'charges',
'actions'
];
/** Columns to be displayed in savings table. */
savingsDisplayedColumns: string[] = ['depositAccount', 'savingsAccountNo', 'productName', 'clientName', 'totalDue', 'actions'];
savingsDisplayedColumns: string[] = [
'depositAccount',
'savingsAccountNo',
'productName',
'clientName',
'totalDue',
'actions'
];
/** Data source for loans table. */
loansDataSource: MatTableDataSource<any>;
/** Data source for savings table. */
savingsDataSource: MatTableDataSource<any>;
/** Paginator for table. */
@ViewChild(MatPaginator, { read: true }) paginator: MatPaginator;
/** Sorter for table. */
@@ -87,13 +99,15 @@ export class IndividualCollectionSheetComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(private formBuilder: UntypedFormBuilder,
private collectionsService: CollectionsService,
private route: ActivatedRoute,
private dateUtils: Dates,
public dialog: MatDialog,
private router: Router,
private settingsService: SettingsService) {
constructor(
private formBuilder: UntypedFormBuilder,
private collectionsService: CollectionsService,
private route: ActivatedRoute,
private dateUtils: Dates,
public dialog: MatDialog,
private router: Router,
private settingsService: SettingsService
) {
this.route.data.subscribe((data: { officesData: any }) => {
this.officesData = data.officesData;
});
@@ -104,7 +118,9 @@ export class IndividualCollectionSheetComponent implements OnInit {
if (localStorage.getItem('Success')) {
localStorage.removeItem('Success');
this.Success = true;
setTimeout(() => { this.Success = false; }, 3000);
setTimeout(() => {
this.Success = false;
}, 3000);
}
this.createCollectionSheetForm();
this.buildDependencies();
@@ -115,9 +131,15 @@ export class IndividualCollectionSheetComponent implements OnInit {
*/
createCollectionSheetForm() {
this.collectionSheetForm = this.formBuilder.group({
'officeId': ['', Validators.required],
'transactionDate': [new Date(), Validators.required],
'staffId': ['']
officeId: [
'',
Validators.required
],
transactionDate: [
new Date(),
Validators.required
],
staffId: ['']
});
}
@@ -174,7 +196,7 @@ export class IndividualCollectionSheetComponent implements OnInit {
/**
* Gets Loan Total Due Amount
*/
getLoanTotalDueAmount (loan: any) {
getLoanTotalDueAmount(loan: any) {
let principalInterestDue = loan.totalDue;
let chargesDue = loan.chargesDue;
if (isNaN(principalInterestDue)) {
@@ -226,7 +248,8 @@ export class IndividualCollectionSheetComponent implements OnInit {
label: 'Bank #',
type: 'number',
required: false
}),
})
];
const data = {
title: `Payment for ${type === 'loans' ? 'Loan' : 'Saving'} Id ${type === 'loans' ? selectedData.loanId : selectedData.savingsId}`,
@@ -259,7 +282,12 @@ export class IndividualCollectionSheetComponent implements OnInit {
const savingsTransaction = {
savingsId: selectedData.savingsId,
transactionAmount: dueAmount,
depositAccountType: selectedData.depositAccountType === 'Saving Deposit' ? 100 : (selectedData.depositAccountType === 'Recurring Deposit' ? 300 : 400)
depositAccountType:
selectedData.depositAccountType === 'Saving Deposit'
? 100
: selectedData.depositAccountType === 'Recurring Deposit'
? 300
: 400
};
if (response.data.paymentTypeId !== '') {
savingsTransaction['paymentTypeId'] = response.data.paymentTypeId;
@@ -299,7 +327,9 @@ export class IndividualCollectionSheetComponent implements OnInit {
this.isCollapsed = true;
} else {
this.noData = true;
setTimeout(() => { this.noData = false; }, 3000);
setTimeout(() => {
this.noData = false;
}, 3000);
}
});
}
@@ -331,8 +361,6 @@ export class IndividualCollectionSheetComponent implements OnInit {
*/
reload() {
const url: string = this.router.url;
this.router.navigateByUrl(`/collections`, { skipLocationChange: true })
.then(() => this.router.navigate([url]));
this.router.navigateByUrl(`/collections`, { skipLocationChange: true }).then(() => this.router.navigate([url]));
}
}