Skip to content

Commit

Permalink
build: Use prettier for typescript
Browse files Browse the repository at this point in the history
Stop ignoring .ts files in prettier and fix existing issues.
  • Loading branch information
rhopman committed Dec 19, 2024
1 parent bf1d99f commit cfe8d4f
Show file tree
Hide file tree
Showing 1,800 changed files with 22,335 additions and 16,741 deletions.
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/dist
/node_modules
**/.git
*.ts
src/environments/.env.ts
20 changes: 10 additions & 10 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import { defineConfig } from "cypress";
import { defineConfig } from 'cypress';

export default defineConfig({
videosFolder: "cypress/videos",
screenshotsFolder: "cypress/screenshots",
fixturesFolder: "cypress/fixtures",
videosFolder: 'cypress/videos',
screenshotsFolder: 'cypress/screenshots',
fixturesFolder: 'cypress/fixtures',

e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require("./cypress/plugins/index.ts")(on, config);
return require('./cypress/plugins/index.ts')(on, config);
},
baseUrl: "http://localhost:4200",
baseUrl: 'http://localhost:4200'
},

component: {
devServer: {
framework: "angular",
bundler: "webpack",
framework: 'angular',
bundler: 'webpack'
},
specPattern: "**/*.cy.ts",
},
specPattern: '**/*.cy.ts'
}
});
1 change: 0 additions & 1 deletion e2e/src/login/login.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ describe('app', () => {
it('should login into the app', () => {
page.validLogin();
});

});
2 changes: 0 additions & 2 deletions e2e/src/login/login.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { browser, element, by } from 'protractor';
* Login Page e2e page object
*/
export class LoginPage {

/** username field */
usernameField = element(by.css('input[formControlName="username"]'));
/** password field */
Expand Down Expand Up @@ -37,5 +36,4 @@ export class LoginPage {
this.passwordField.sendKeys('123');
this.loginButton.click();
}

}
35 changes: 23 additions & 12 deletions src/app/account-transfers/account-transfers-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ const routes: Routes = [
children: [
{
path: 'create-standing-instructions',
data: { title: 'Create Standing Instructions', breadcrumb: 'Create Standing Instructions', routeParamBreadcrumb: 'Create Standing Instructions' },
data: {
title: 'Create Standing Instructions',
breadcrumb: 'Create Standing Instructions',
routeParamBreadcrumb: 'Create Standing Instructions'
},
component: CreateStandingInstructionsComponent,
resolve: {
standingIntructionsTemplate: StandingInstructionsTemplateResolver
Expand All @@ -42,7 +46,11 @@ const routes: Routes = [
},
{
path: 'list-standing-instructions',
data: { title: 'List Standing Instructions', breadcrumb: 'List Standing Instructions', routeParamBreadcrumb: 'List Standing Instructions' },
data: {
title: 'List Standing Instructions',
breadcrumb: 'List Standing Instructions',
routeParamBreadcrumb: 'List Standing Instructions'
},
component: ListStandingInstructionsComponent,
resolve: {
standingIntructionsTemplate: StandingInstructionsTemplateResolver
Expand Down Expand Up @@ -71,29 +79,33 @@ const routes: Routes = [
data: { title: 'View Standing Instructions', breadcrumb: 'view', routeParamBreadcrumb: false },
component: ViewStandingInstructionsComponent,
resolve: {
standingInstructionsData: ViewStandingInstructionsResolver,
},
standingInstructionsData: ViewStandingInstructionsResolver
}
},
{
path: 'edit',
data: { title: 'Edit Standing Instructions', breadcrumb: 'edit', routeParamBreadcrumb: false },
component: EditStandingInstructionsComponent,
resolve: {
standingInstructionsDataAndTemplate: StandingInstructionsDataAndTemplateResolver,
},
standingInstructionsDataAndTemplate: StandingInstructionsDataAndTemplateResolver
}
},
{
path: 'list-account-transactions',
data: { title: 'List Account Transactions', breadcrumb: 'List Account Transactions', routeParamBreadcrumb: 'List Account Transactions' },
data: {
title: 'List Account Transactions',
breadcrumb: 'List Account Transactions',
routeParamBreadcrumb: 'List Account Transactions'
},
component: ListTransactionsComponent,
resolve: {
listTransactionData: ListTransactionsResolver
}
},
}
]
},
}
]
},
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
Expand All @@ -108,5 +120,4 @@ const routes: Routes = [
ViewAccountTransferResolver
]
})

export class AccountTransfersRoutingModule { }
export class AccountTransfersRoutingModule {}
11 changes: 8 additions & 3 deletions src/app/account-transfers/account-transfers.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ import { ViewAccountTransferComponent } from './view-account-transfer/view-accou
* All components related to Account Transfers functions should be declared here.
*/
@NgModule({
imports: [SharedModule, PipesModule, DirectivesModule, AccountTransfersRoutingModule],
imports: [
SharedModule,
PipesModule,
DirectivesModule,
AccountTransfersRoutingModule
],
declarations: [
ViewStandingInstructionsComponent,
EditStandingInstructionsComponent,
Expand All @@ -31,6 +36,6 @@ import { ViewAccountTransferComponent } from './view-account-transfer/view-accou
ListTransactionsComponent,
ViewAccountTransferComponent
],
providers: [ ]
providers: []
})
export class AccountTransfersModule { }
export class AccountTransfersModule {}
34 changes: 18 additions & 16 deletions src/app/account-transfers/account-transfers.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import { Observable } from 'rxjs';
providedIn: 'root'
})
export class AccountTransfersService {

constructor(private http: HttpClient) { }
constructor(private http: HttpClient) {}

/**
* @params standingInstructionsId
Expand All @@ -33,10 +32,16 @@ export class AccountTransfersService {
return this.http.put(`/standinginstructions/${standinginstructionsId}`, data, { params: httpParams });
}

getStandingInstructionsTemplate(clientId: any, officeId: any, accountTypeId: string, formValue?: any): Observable<any> {
let httpParams = new HttpParams().set('fromAccountType', accountTypeId)
.set('fromClientId', clientId)
.set('fromOfficeId', officeId);
getStandingInstructionsTemplate(
clientId: any,
officeId: any,
accountTypeId: string,
formValue?: any
): Observable<any> {
let httpParams = new HttpParams()
.set('fromAccountType', accountTypeId)
.set('fromClientId', clientId)
.set('fromOfficeId', officeId);
if (formValue) {
const propNames = Object.getOwnPropertyNames(formValue);
for (let i = 0; i < propNames.length; i++) {
Expand All @@ -52,8 +57,7 @@ export class AccountTransfersService {
}

newAccountTranferResource(id: any, accountTypeId: any, formValue?: any): Observable<any> {
let httpParams = new HttpParams().set('fromAccountId', id)
.set('fromAccountType', accountTypeId);
let httpParams = new HttpParams().set('fromAccountId', id).set('fromAccountType', accountTypeId);
if (formValue) {
const propNames = Object.getOwnPropertyNames(formValue);
for (let i = 0; i < propNames.length; i++) {
Expand All @@ -62,7 +66,6 @@ export class AccountTransfersService {
}
}
return this.http.get(`/accounttransfers/template`, { params: httpParams });

}

createAccountTransfer(data: any): Observable<any> {
Expand Down Expand Up @@ -94,18 +97,17 @@ export class AccountTransfersService {
return this.http.delete(`/standinginstructions/${id}`, { params: httpParams });
}


getStandingInstructionsTransactions(standingInstructionsId: any, dateFormat: any, locale: any) {
const httpParams = new HttpParams().set('associations', 'transactions')
.set('dateFormat', dateFormat)
.set('limit', '14')
.set('locale', locale)
.set('offset', '0');
const httpParams = new HttpParams()
.set('associations', 'transactions')
.set('dateFormat', dateFormat)
.set('limit', '14')
.set('locale', locale)
.set('offset', '0');
return this.http.get(`/standinginstructions/${standingInstructionsId}`, { params: httpParams });
}

getViewAccountTransferDetails(transferId: any): Observable<any> {
return this.http.get(`/accounttransfers/${transferId}`);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,24 @@ import { SettingsService } from 'app/settings/settings.service';
*/
@Injectable()
export class ListTransactionsResolver implements Resolve<Object> {
/**
* @param {AccountTransfersService} accountTransfersService Account Transfers service.
* @param {SettingsService} settingsService Settings Service.
*/
constructor(
private accountTransfersService: AccountTransfersService,
private settingsService: SettingsService
) {}

/**
* @param {AccountTransfersService} accountTransfersService Account Transfers service.
* @param {SettingsService} settingsService Settings Service.
*/
constructor(private accountTransfersService: AccountTransfersService,
private settingsService: SettingsService) { }

/**
* Returns the Standing Instructions Data.
* @param {ActivatedRouteSnapshot} route Route Snapshot
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const id = route.parent.paramMap.get('standingInstructionsId');
const dateFormat = this.settingsService.dateFormat;
const locale = this.settingsService.language.code;
return this.accountTransfersService.getStandingInstructionsTransactions(id, dateFormat, locale);
}
/**
* Returns the Standing Instructions Data.
* @param {ActivatedRouteSnapshot} route Route Snapshot
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const id = route.parent.paramMap.get('standingInstructionsId');
const dateFormat = this.settingsService.dateFormat;
const locale = this.settingsService.language.code;
return this.accountTransfersService.getStandingInstructionsTransactions(id, dateFormat, locale);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,32 @@ import { AccountTransfersService } from '../account-transfers.service';
*/
@Injectable()
export class MakeAccountTransferTemplateResolver implements Resolve<Object> {
accountTypeId: string;
id: any;
/**
* @param {accountTransfersService} AccountTransfersService Account Transfers service.
*/
constructor(private accountTransfersService: AccountTransfersService) {}

accountTypeId: string;
id: any;
/**
* @param {accountTransfersService} AccountTransfersService Account Transfers service.
*/
constructor(private accountTransfersService: AccountTransfersService) { }

/**
* Returns the Standing Instructions Data.
* @param {ActivatedRouteSnapshot} route Route Snapshot
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const accountType = route.queryParamMap.get('accountType');
switch (accountType) {
case 'fromloans':
this.accountTypeId = '1';
this.id = route.queryParamMap.get('loanId');
break;
case 'fromsavings':
this.accountTypeId = '2';
this.id = route.queryParamMap.get('savingsId');
break;
default:
this.accountTypeId = '0';
}
return this.accountTransfersService.newAccountTranferResource(this.id, this.accountTypeId);
/**
* Returns the Standing Instructions Data.
* @param {ActivatedRouteSnapshot} route Route Snapshot
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const accountType = route.queryParamMap.get('accountType');
switch (accountType) {
case 'fromloans':
this.accountTypeId = '1';
this.id = route.queryParamMap.get('loanId');
break;
case 'fromsavings':
this.accountTypeId = '2';
this.id = route.queryParamMap.get('savingsId');
break;
default:
this.accountTypeId = '0';
}

return this.accountTransfersService.newAccountTranferResource(this.id, this.accountTypeId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,18 @@ import { AccountTransfersService } from '../account-transfers.service';
*/
@Injectable()
export class StandingInstructionsDataAndTemplateResolver implements Resolve<Object> {
/**
* @param {accountTransfersService} AccountTransfersService Account Transfers service.
*/
constructor(private accountTransfersService: AccountTransfersService) {}

/**
* @param {accountTransfersService} AccountTransfersService Account Transfers service.
*/
constructor(private accountTransfersService: AccountTransfersService) { }

/**
* Returns the Standing Instructions Data.
* @param {ActivatedRouteSnapshot} route Route Snapshot
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const standingInstructionsId = route.parent.paramMap.get('standingInstructionsId');
return this.accountTransfersService.getStandingInstructionsDataAndTemplate(standingInstructionsId);
}

/**
* Returns the Standing Instructions Data.
* @param {ActivatedRouteSnapshot} route Route Snapshot
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const standingInstructionsId = route.parent.paramMap.get('standingInstructionsId');
return this.accountTransfersService.getStandingInstructionsDataAndTemplate(standingInstructionsId);
}
}
Loading

0 comments on commit cfe8d4f

Please sign in to comment.