build: Use prettier for typescript
Stop ignoring .ts files in prettier and fix existing issues.
This commit is contained in:
@@ -13,19 +13,17 @@ import { ClientsService } from '../../../clients.service';
|
||||
*/
|
||||
@Injectable()
|
||||
export class ClientChargeOverviewResolver implements Resolve<Object> {
|
||||
/**
|
||||
* @param {ClientsService} ClientsService Clients service.
|
||||
*/
|
||||
constructor(private clientsService: ClientsService) {}
|
||||
|
||||
/**
|
||||
* @param {ClientsService} ClientsService Clients service.
|
||||
*/
|
||||
constructor(private clientsService: ClientsService) { }
|
||||
|
||||
/**
|
||||
* Returns the Client Charge data.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<any> {
|
||||
const clientId = route.parent.params.clientId;
|
||||
return this.clientsService.getAllClientCharges(clientId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Client Charge data.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<any> {
|
||||
const clientId = route.parent.params.clientId;
|
||||
return this.clientsService.getAllClientCharges(clientId);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('ChargesOverviewComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ChargesOverviewComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [ChargesOverviewComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+14
-7
@@ -14,9 +14,15 @@ import { ActivatedRoute } from '@angular/router';
|
||||
styleUrls: ['./charges-overview.component.scss']
|
||||
})
|
||||
export class ChargesOverviewComponent implements OnInit {
|
||||
|
||||
/** Columns to be displayed in charge overview table. */
|
||||
displayedColumns: string[] = ['name', 'dueAsOf', 'due', 'paid', 'waived', 'outstanding'];
|
||||
displayedColumns: string[] = [
|
||||
'name',
|
||||
'dueAsOf',
|
||||
'due',
|
||||
'paid',
|
||||
'waived',
|
||||
'outstanding'
|
||||
];
|
||||
/** Data source for charge overview table. */
|
||||
dataSource: MatTableDataSource<any>;
|
||||
/** Charge Overview data */
|
||||
@@ -30,10 +36,12 @@ export class ChargesOverviewComponent implements OnInit {
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {MatDialog} dialog Dialog reference.
|
||||
*/
|
||||
constructor(private route: ActivatedRoute,
|
||||
public dialog: MatDialog) {
|
||||
this.route.data.subscribe((data: { clientChargesData: any }) => {
|
||||
this.chargeOverviewData = data.clientChargesData;
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
public dialog: MatDialog
|
||||
) {
|
||||
this.route.data.subscribe((data: { clientChargesData: any }) => {
|
||||
this.chargeOverviewData = data.clientChargesData;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -48,5 +56,4 @@ export class ChargesOverviewComponent implements OnInit {
|
||||
this.dataSource = new MatTableDataSource(this.chargeOverviewData.pageItems);
|
||||
this.dataSource.paginator = this.paginator;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('ClientPayChargesComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ClientPayChargesComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [ClientPayChargesComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+23
-13
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
styleUrls: ['./client-pay-charges.component.scss']
|
||||
})
|
||||
export class ClientPayChargesComponent implements OnInit {
|
||||
|
||||
/** Transaction Form. */
|
||||
transactionForm: any;
|
||||
/** Transaction Data. */
|
||||
@@ -25,14 +24,14 @@ export class ClientPayChargesComponent implements OnInit {
|
||||
/** Minimum Date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
|
||||
/**
|
||||
* Retrieves the charge data from `resolve`.
|
||||
* @param {ClientService} clientService Products Service.
|
||||
* @param {FormBuilder} formBuilder Form Builder.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {Router} router Router for navigation.
|
||||
* @param {SettingsService} settingsService Setting service
|
||||
*/
|
||||
/**
|
||||
* Retrieves the charge data from `resolve`.
|
||||
* @param {ClientService} clientService Products Service.
|
||||
* @param {FormBuilder} formBuilder Form Builder.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {Router} router Router for navigation.
|
||||
* @param {SettingsService} settingsService Setting service
|
||||
*/
|
||||
constructor(
|
||||
private clientsService: ClientsService,
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
@@ -55,8 +54,14 @@ export class ClientPayChargesComponent implements OnInit {
|
||||
*/
|
||||
setTransactionForm() {
|
||||
this.transactionForm = this.formBuilder.group({
|
||||
'amount': [this.transactionData.amount, Validators.required],
|
||||
'transactionDate': [new Date(), Validators.required]
|
||||
amount: [
|
||||
this.transactionData.amount,
|
||||
Validators.required
|
||||
],
|
||||
transactionDate: [
|
||||
new Date(),
|
||||
Validators.required
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -77,8 +82,13 @@ export class ClientPayChargesComponent implements OnInit {
|
||||
locale
|
||||
};
|
||||
this.clientsService.payClientCharge(this.transactionData.clientId, this.transactionData.id, data).subscribe(() => {
|
||||
this.router.navigate(['../../..', 'general'], { relativeTo: this.route });
|
||||
this.router.navigate(
|
||||
[
|
||||
'../../..',
|
||||
'general'
|
||||
],
|
||||
{ relativeTo: this.route }
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,9 +8,8 @@ describe('ViewChargeComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ViewChargeComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [ViewChargeComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -12,30 +12,38 @@ import { ClientsService } from 'app/clients/clients.service';
|
||||
styleUrls: ['./view-charge.component.scss']
|
||||
})
|
||||
export class ViewChargeComponent {
|
||||
|
||||
/** Charge Data. */
|
||||
chargeData: any;
|
||||
/** Mat Table Column defs. */
|
||||
viewChargeTableColumns: string[] = ['id', 'officeName', 'type', 'transactionDate', 'amount', 'actions'];
|
||||
viewChargeTableColumns: string[] = [
|
||||
'id',
|
||||
'officeName',
|
||||
'type',
|
||||
'transactionDate',
|
||||
'amount',
|
||||
'actions'
|
||||
];
|
||||
|
||||
/**
|
||||
* Retrieves the selected job data from `resolve`.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {Router} router Router for navigation.
|
||||
*/
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private clientService: ClientsService) {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private clientService: ClientsService
|
||||
) {
|
||||
this.route.data.subscribe((data: { clientChargeData: any }) => {
|
||||
this.chargeData = data.clientChargeData;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Waive Charge.
|
||||
*/
|
||||
waiveCharge() {
|
||||
const waiveChargeObj = { clientId: this.chargeData.clientId, resourceType: this.chargeData.id};
|
||||
const waiveChargeObj = { clientId: this.chargeData.clientId, resourceType: this.chargeData.id };
|
||||
this.clientService.waiveClientCharge(waiveChargeObj).subscribe(() => {
|
||||
this.getChargeData();
|
||||
});
|
||||
@@ -45,7 +53,7 @@ export class ViewChargeComponent {
|
||||
* Undo Transaction.
|
||||
*/
|
||||
undoTransaction(transactionId: any) {
|
||||
const transactionData = { clientId: this.chargeData.clientId.toString(), transactionId: transactionId};
|
||||
const transactionData = { clientId: this.chargeData.clientId.toString(), transactionId: transactionId };
|
||||
this.clientService.undoTransaction(transactionData).subscribe(() => {
|
||||
this.getChargeData();
|
||||
});
|
||||
@@ -65,8 +73,11 @@ export class ViewChargeComponent {
|
||||
*/
|
||||
deleteCharge() {
|
||||
this.clientService.deleteCharge(this.chargeData.clientId, this.chargeData.id).subscribe(() => {
|
||||
this.router.navigate(['../../clients', this.chargeData.clientId, 'general']);
|
||||
this.router.navigate([
|
||||
'../../clients',
|
||||
this.chargeData.clientId,
|
||||
'general'
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user