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
@@ -8,9 +8,8 @@ describe('CenterNavigationComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CenterNavigationComponent ]
})
.compileComponents();
declarations: [CenterNavigationComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -5,14 +5,12 @@ import { Component, Input, ViewChild } from '@angular/core';
import { LoanAccountTableComponent } from '../loan-account-table/loan-account-table.component';
import { SavingsAccountTableComponent } from '../savings-account-table/savings-account-table.component';
@Component({
selector: 'mifosx-center-navigation',
templateUrl: './center-navigation.component.html',
styleUrls: ['./center-navigation.component.scss']
})
export class CenterNavigationComponent {
@ViewChild(LoanAccountTableComponent) loanAccountTableComponent: LoanAccountTableComponent;
@ViewChild(SavingsAccountTableComponent) savingsAccountTableComponent: SavingsAccountTableComponent;
@@ -21,6 +19,5 @@ export class CenterNavigationComponent {
@Input() centerSummaryData: any;
@Input() groupData: any;
constructor() { }
constructor() {}
}
@@ -8,9 +8,8 @@ describe('ClientNavigationComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ClientNavigationComponent ]
})
.compileComponents();
declarations: [ClientNavigationComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -13,7 +13,6 @@ import { MemberGroupsComponent } from '../member-groups/member-groups.component'
styleUrls: ['./client-navigation.component.scss']
})
export class ClientNavigationComponent {
@ViewChild(LoanAccountTableComponent) loanAccountTableComponent: LoanAccountTableComponent;
@ViewChild(SavingsAccountTableComponent) savingsAccountTableComponent: SavingsAccountTableComponent;
@ViewChild(ShareAccountTableComponent) shareAccountTableComponent: ShareAccountTableComponent;
@@ -22,6 +21,5 @@ export class ClientNavigationComponent {
@Input() clientData: any;
@Input() clientAccountsData: any;
constructor() { }
constructor() {}
}
@@ -8,9 +8,8 @@ describe('GroupNavigationComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ GroupNavigationComponent ]
})
.compileComponents();
declarations: [GroupNavigationComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -5,14 +5,12 @@ import { Component, Input, ViewChild } from '@angular/core';
import { LoanAccountTableComponent } from '../loan-account-table/loan-account-table.component';
import { SavingsAccountTableComponent } from '../savings-account-table/savings-account-table.component';
@Component({
selector: 'mifosx-group-navigation',
templateUrl: './group-navigation.component.html',
styleUrls: ['./group-navigation.component.scss']
})
export class GroupNavigationComponent {
@ViewChild(LoanAccountTableComponent) loanAccountTableComponent: LoanAccountTableComponent;
@ViewChild(SavingsAccountTableComponent) savingsAccountTableComponent: SavingsAccountTableComponent;
@@ -20,6 +18,5 @@ export class GroupNavigationComponent {
@Input() groupAccountsData: any;
@Input() clientData: any;
constructor() { }
constructor() {}
}
@@ -8,9 +8,8 @@ describe('LoanAccountTableComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LoanAccountTableComponent ]
})
.compileComponents();
declarations: [LoanAccountTableComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -13,9 +13,13 @@ import { AccountsFilterPipe } from '../../pipes/accounts-filter.pipe';
styleUrls: ['./loan-account-table.component.scss']
})
export class LoanAccountTableComponent {
/** Columns to be displayed in the loan accounts table. */
displayedColumns: string[] = ['accountNo', 'productName', 'Type', 'Status'];
displayedColumns: string[] = [
'accountNo',
'productName',
'Type',
'Status'
];
/** Show closed loan accounts */
showClosed = false;
/** Data source for loan account table. */
@@ -31,7 +35,12 @@ export class LoanAccountTableComponent {
/** Loan Account Setter */
@Input() set loanAccountData(data: any) {
this.accountData = data;
const filteredAccountData = this.accountsFilterPipe.transform(data, 'loan', this.showClosed ? 'closed' : 'open', 'isLoan');
const filteredAccountData = this.accountsFilterPipe.transform(
data,
'loan',
this.showClosed ? 'closed' : 'open',
'isLoan'
);
this.dataSource = new MatTableDataSource(filteredAccountData);
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
@@ -40,7 +49,7 @@ export class LoanAccountTableComponent {
/**
* @param {AccountsFilterPipe} accountsFilterPipe Accounts Filter Pipe.
*/
constructor(private accountsFilterPipe: AccountsFilterPipe) { }
constructor(private accountsFilterPipe: AccountsFilterPipe) {}
/**
* Filters data in users table based on passed value.
@@ -55,10 +64,14 @@ export class LoanAccountTableComponent {
*/
toggleClosed() {
this.showClosed = !this.showClosed;
const filteredAccountData = this.accountsFilterPipe.transform(this.accountData, 'loan', this.showClosed ? 'closed' : 'open', 'isLoan');
const filteredAccountData = this.accountsFilterPipe.transform(
this.accountData,
'loan',
this.showClosed ? 'closed' : 'open',
'isLoan'
);
this.dataSource = new MatTableDataSource(filteredAccountData);
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
}
}
@@ -8,9 +8,8 @@ describe('MemberGroupsComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ MemberGroupsComponent ]
})
.compileComponents();
declarations: [MemberGroupsComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -10,9 +10,11 @@ import { MatTableDataSource } from '@angular/material/table';
styleUrls: ['./member-groups.component.scss']
})
export class MemberGroupsComponent {
/** Columns to be displayed in the member groups table. */
displayedColumns: string[] = ['accountNo', 'name'];
displayedColumns: string[] = [
'accountNo',
'name'
];
/** Data source for member groups table. */
dataSource: MatTableDataSource<any>;
@@ -28,7 +30,7 @@ export class MemberGroupsComponent {
this.dataSource.sort = this.sort;
}
constructor() { }
constructor() {}
/**
* Filters data in member groups table based on passed value.
@@ -37,5 +39,4 @@ export class MemberGroupsComponent {
applyFilter(filterValue: string) {
this.dataSource.filter = filterValue.trim().toLowerCase();
}
}
@@ -23,6 +23,7 @@ const routes: Routes = [
}
}
])
];
/**
@@ -37,4 +38,4 @@ const routes: Routes = [
OfficesResolver
]
})
export class NavigationRoutingModule { }
export class NavigationRoutingModule {}
@@ -8,9 +8,8 @@ describe('NavigationComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ NavigationComponent ]
})
.compileComponents();
declarations: [NavigationComponent]
}).compileComponents();
}));
beforeEach(() => {
+10 -10
View File
@@ -22,7 +22,6 @@ import { ClientNavigationComponent } from './client-navigation/client-navigation
styleUrls: ['./navigation.component.scss']
})
export class NavigationComponent implements OnInit {
/** Navigation Components */
@ViewChild(OfficeNavigationComponent) officeNavigationComponent: OfficeNavigationComponent;
@ViewChild(StaffNavigationComponent) staffNavigationComponent: StaffNavigationComponent;
@@ -66,9 +65,11 @@ export class NavigationComponent implements OnInit {
* @param {ActivatedRoute} route Activated Route.
* @param {Router} router Router for navigation.
*/
constructor(private navigationService: NavigationService,
private route: ActivatedRoute,
private router: Router) {
constructor(
private navigationService: NavigationService,
private route: ActivatedRoute,
private router: Router
) {
this.route.data.subscribe((data: { offices: any }) => {
this.officeData = data.offices;
});
@@ -89,7 +90,7 @@ export class NavigationComponent implements OnInit {
* Sets the office selector
*/
setOfficeSelector() {
this.officeSelector.valueChanges.subscribe(officeId => {
this.officeSelector.valueChanges.subscribe((officeId) => {
this.employeeSelector.reset(null, { emitEvent: false });
this.centerSelector.reset(null, { emitEvent: false });
this.groupSelector.reset(null, { emitEvent: false });
@@ -115,7 +116,7 @@ export class NavigationComponent implements OnInit {
* Sets the employee selector
*/
setEmployeeSelector() {
this.employeeSelector.valueChanges.subscribe(employeeId => {
this.employeeSelector.valueChanges.subscribe((employeeId) => {
if (employeeId) {
this.centerSelector.reset(null, { emitEvent: false });
this.groupSelector.reset(null, { emitEvent: false });
@@ -141,7 +142,7 @@ export class NavigationComponent implements OnInit {
* Sets the center selector
*/
setCenterSelector() {
this.centerSelector.valueChanges.subscribe(centerId => {
this.centerSelector.valueChanges.subscribe((centerId) => {
if (centerId) {
this.groupSelector.reset(null, { emitEvent: false });
this.clientSelector.reset(null, { emitEvent: false });
@@ -173,7 +174,7 @@ export class NavigationComponent implements OnInit {
* Sets the group selector
*/
setGroupSelector() {
this.groupSelector.valueChanges.subscribe(groupId => {
this.groupSelector.valueChanges.subscribe((groupId) => {
if (groupId) {
this.clientSelector.reset(null, { emitEvent: false });
this.clientData = null;
@@ -199,7 +200,7 @@ export class NavigationComponent implements OnInit {
* Sets the client selector
*/
setClientSelector() {
this.clientSelector.valueChanges.subscribe(clientId => {
this.clientSelector.valueChanges.subscribe((clientId) => {
if (clientId) {
this.selectedItemAccounts = null;
this.navigationService.getClient(clientId).subscribe((client: any) => {
@@ -212,5 +213,4 @@ export class NavigationComponent implements OnInit {
}
});
}
}
+1 -1
View File
@@ -42,4 +42,4 @@ import { MemberGroupsComponent } from './member-groups/member-groups.component';
MemberGroupsComponent
]
})
export class NavigationModule { }
export class NavigationModule {}
+6 -15
View File
@@ -12,11 +12,10 @@ import { Observable } from 'rxjs';
providedIn: 'root'
})
export class NavigationService {
/**
* @param {HttpClient} http Http Client to send requests.
*/
constructor(private http: HttpClient) { }
constructor(private http: HttpClient) {}
/**
* @returns {Observable<any>} Offices.
@@ -30,8 +29,7 @@ export class NavigationService {
* @returns {Observable<any>} Employees
*/
getEmployees(officeId: number): Observable<any> {
const httpParams = new HttpParams()
.set('officeId', officeId.toString());
const httpParams = new HttpParams().set('officeId', officeId.toString());
return this.http.get('/staff', { params: httpParams });
}
@@ -40,9 +38,7 @@ export class NavigationService {
* @returns {Observable<any>} Centers
*/
getCentersFromStaffId(staffId: number): Observable<any> {
const httpParams = new HttpParams()
.set('R_staffId', staffId.toString())
.set('genericResultSet', false.toString());
const httpParams = new HttpParams().set('R_staffId', staffId.toString()).set('genericResultSet', false.toString());
return this.http.get('/runreports/GroupNamesByStaff', { params: httpParams });
}
@@ -51,8 +47,7 @@ export class NavigationService {
* @returns {Observable<any>} Center
*/
getCenter(centerId: number): Observable<any> {
const httpParams = new HttpParams()
.set('associations', 'groupMembers');
const httpParams = new HttpParams().set('associations', 'groupMembers');
return this.http.get(`/centers/${centerId}`, { params: httpParams });
}
@@ -69,9 +64,7 @@ export class NavigationService {
* @returns {Observable<any>} Center Accounts
*/
getCenterSummary(centerId: number): Observable<any> {
const httpParams = new HttpParams()
.set('R_groupId', centerId.toString())
.set('genericResultSet', false.toString());
const httpParams = new HttpParams().set('R_groupId', centerId.toString()).set('genericResultSet', false.toString());
return this.http.get('/runreports/GroupSummaryCounts', { params: httpParams });
}
@@ -80,8 +73,7 @@ export class NavigationService {
* @returns {Observable<any>} Group
*/
getGroup(groupId: number): Observable<any> {
const httpParams = new HttpParams()
.set('associations', 'all');
const httpParams = new HttpParams().set('associations', 'all');
return this.http.get(`/groups/${groupId}`, { params: httpParams });
}
@@ -108,5 +100,4 @@ export class NavigationService {
getClientAccounts(clientId: number): Observable<any> {
return this.http.get(`/clients/${clientId}/accounts`);
}
}
@@ -8,9 +8,8 @@ describe('OfficeNavigationComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ OfficeNavigationComponent ]
})
.compileComponents();
declarations: [OfficeNavigationComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -1,4 +1,3 @@
/** Angular Imports */
import { Component, Input } from '@angular/core';
@@ -8,10 +7,8 @@ import { Component, Input } from '@angular/core';
styleUrls: ['./office-navigation.component.scss']
})
export class OfficeNavigationComponent {
@Input() officeData: any;
@Input() employeeData: any;
constructor() { }
constructor() {}
}
-2
View File
@@ -13,7 +13,6 @@ import { NavigationService } from './navigation.service';
*/
@Injectable()
export class OfficesResolver implements Resolve<Object> {
/**
* @param {NavigationService} navigationService Navigation service.
*/
@@ -26,5 +25,4 @@ export class OfficesResolver implements Resolve<Object> {
resolve(): Observable<any> {
return this.navigationService.getOffices();
}
}
@@ -8,9 +8,8 @@ describe('SavingsAccountTableComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ SavingsAccountTableComponent ]
})
.compileComponents();
declarations: [SavingsAccountTableComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -13,9 +13,13 @@ import { AccountsFilterPipe } from '../../pipes/accounts-filter.pipe';
styleUrls: ['./savings-account-table.component.scss']
})
export class SavingsAccountTableComponent {
/** Columns to be displayed in the savings accounts table. */
displayedColumns: string[] = ['accountNo', 'productName', 'accountBalance', 'Status'];
displayedColumns: string[] = [
'accountNo',
'productName',
'accountBalance',
'Status'
];
/** Show closed saving accounts */
showClosed = false;
/** Data source for savings account table. */
@@ -31,7 +35,12 @@ export class SavingsAccountTableComponent {
/** Savings Account Setter */
@Input() set savingsAccountData(data: any) {
this.accountData = data;
const filteredAccountData = this.accountsFilterPipe.transform(data, 'saving', this.showClosed ? 'closed' : 'open', 'isSavings');
const filteredAccountData = this.accountsFilterPipe.transform(
data,
'saving',
this.showClosed ? 'closed' : 'open',
'isSavings'
);
this.dataSource = new MatTableDataSource(filteredAccountData);
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
@@ -40,7 +49,7 @@ export class SavingsAccountTableComponent {
/**
* @param {AccountsFilterPipe} accountsFilterPipe Accounts Filter Pipe.
*/
constructor(private accountsFilterPipe: AccountsFilterPipe) { }
constructor(private accountsFilterPipe: AccountsFilterPipe) {}
/**
* Filters data in users table based on passed value.
@@ -55,10 +64,14 @@ export class SavingsAccountTableComponent {
*/
toggleClosed() {
this.showClosed = !this.showClosed;
const filteredAccountData = this.accountsFilterPipe.transform(this.accountData, 'saving', this.showClosed ? 'closed' : 'open', 'isSavings');
const filteredAccountData = this.accountsFilterPipe.transform(
this.accountData,
'saving',
this.showClosed ? 'closed' : 'open',
'isSavings'
);
this.dataSource = new MatTableDataSource(filteredAccountData);
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
}
}
@@ -8,9 +8,8 @@ describe('ShareAccountTableComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ShareAccountTableComponent ]
})
.compileComponents();
declarations: [ShareAccountTableComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -13,9 +13,13 @@ import { AccountsFilterPipe } from '../../pipes/accounts-filter.pipe';
styleUrls: ['./share-account-table.component.scss']
})
export class ShareAccountTableComponent {
/** Columns to be displayed in the share accounts table. */
displayedColumns: string[] = ['accountNo', 'productName', 'totalApprovedShares', 'Status'];
displayedColumns: string[] = [
'accountNo',
'productName',
'totalApprovedShares',
'Status'
];
/** Show closed share accounts */
showClosed = false;
/** Data source for share account table. */
@@ -31,7 +35,12 @@ export class ShareAccountTableComponent {
/** Share Account Setter */
@Input() set shareAccountData(data: any) {
this.accountData = data;
const filteredAccountData = this.accountsFilterPipe.transform(data, 'share', this.showClosed ? 'closed' : 'open', 'isShare');
const filteredAccountData = this.accountsFilterPipe.transform(
data,
'share',
this.showClosed ? 'closed' : 'open',
'isShare'
);
this.dataSource = new MatTableDataSource(filteredAccountData);
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
@@ -40,7 +49,7 @@ export class ShareAccountTableComponent {
/**
* @param {AccountsFilterPipe} accountsFilterPipe Accounts Filter Pipe.
*/
constructor(private accountsFilterPipe: AccountsFilterPipe) { }
constructor(private accountsFilterPipe: AccountsFilterPipe) {}
/**
* Filters data in users table based on passed value.
@@ -55,10 +64,14 @@ export class ShareAccountTableComponent {
*/
toggleClosed() {
this.showClosed = !this.showClosed;
const filteredAccountData = this.accountsFilterPipe.transform(this.accountData, 'share', this.showClosed ? 'closed' : 'open', 'isShare');
const filteredAccountData = this.accountsFilterPipe.transform(
this.accountData,
'share',
this.showClosed ? 'closed' : 'open',
'isShare'
);
this.dataSource = new MatTableDataSource(filteredAccountData);
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
}
}
@@ -8,9 +8,8 @@ describe('StaffNavigationComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ StaffNavigationComponent ]
})
.compileComponents();
declarations: [StaffNavigationComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -7,10 +7,8 @@ import { Component, Input } from '@angular/core';
styleUrls: ['./staff-navigation.component.scss']
})
export class StaffNavigationComponent {
@Input() employeeData: any;
@Input() centerData: any;
constructor() { }
constructor() {}
}