Skip to content

Commit b4844c2

Browse files
format code
1 parent fbe1fe6 commit b4844c2

65 files changed

Lines changed: 2044 additions & 2022 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/angular.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
node: [ '20', '18' ]
18+
node: [ '20', '22' ]
1919
defaults:
2020
run:
2121
working-directory: "frontend"
Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
1-
import { NgModule } from '@angular/core';
2-
import { Routes, RouterModule } from '@angular/router';
3-
import { AuthComponent } from './auth/auth.component';
4-
import { PortfolioComponent } from './portfolio/portfolio.component';
5-
import { StocksComponent } from './stocks/stocks.component';
6-
import { SipComponent } from './sip/sip.component';
7-
import { AuthGuard } from './auth/auth.guard';
8-
import { PageNotFoundComponent } from './page-not-found/page-not-found.component';
9-
import { PortfolioDetailComponent } from './portfolio/portfolio-detail/portfolio-detail.component';
10-
import { PortfolioResolverService } from './portfolio/portfolio-resolver.service';
11-
import { StockDetailComponent } from './stocks/stock-detail/stock-detail.component';
12-
import { StockResolverService } from './stocks/stock-resolver.service';
13-
14-
const routes: Routes = [
15-
{ path: '', redirectTo: '/portfolio', pathMatch: 'full' },
16-
{ path: 'auth', component: AuthComponent },
17-
{
18-
path: 'portfolio', component: PortfolioComponent, resolve: { portfolioList: PortfolioResolverService }, canActivate: [AuthGuard],
19-
children: [
20-
{
21-
path: ':id',
22-
component: PortfolioDetailComponent
23-
}
24-
]
25-
},
26-
{ path: 'sip-calculator', component: SipComponent, canActivate: [AuthGuard] },
27-
{
28-
path: 'stocks', component: StocksComponent, canActivate: [AuthGuard], resolve: { stockList: StockResolverService },
29-
children: [
30-
{
31-
path: ':id',
32-
component: StockDetailComponent
33-
}
34-
]
35-
},
36-
{ path: 'not-found', component: PageNotFoundComponent },
37-
{ path: '**', redirectTo: 'not-found' }
38-
];
39-
40-
@NgModule({
41-
imports: [RouterModule.forRoot(routes, {})],
42-
exports: [RouterModule]
43-
})
44-
export class AppRoutingModule { }
1+
import { NgModule } from '@angular/core';
2+
import { Routes, RouterModule } from '@angular/router';
3+
import { AuthComponent } from './auth/auth.component';
4+
import { PortfolioComponent } from './portfolio/portfolio.component';
5+
import { StocksComponent } from './stocks/stocks.component';
6+
import { SipComponent } from './sip/sip.component';
7+
import { AuthGuard } from './auth/auth.guard';
8+
import { PageNotFoundComponent } from './page-not-found/page-not-found.component';
9+
import { PortfolioDetailComponent } from './portfolio/portfolio-detail/portfolio-detail.component';
10+
import { PortfolioResolverService } from './portfolio/portfolio-resolver.service';
11+
import { StockDetailComponent } from './stocks/stock-detail/stock-detail.component';
12+
import { StockResolverService } from './stocks/stock-resolver.service';
13+
14+
const routes: Routes = [
15+
{ path: '', redirectTo: '/portfolio', pathMatch: 'full' },
16+
{ path: 'auth', component: AuthComponent },
17+
{
18+
path: 'portfolio', component: PortfolioComponent, resolve: { portfolioList: PortfolioResolverService }, canActivate: [AuthGuard],
19+
children: [
20+
{
21+
path: ':id',
22+
component: PortfolioDetailComponent
23+
}
24+
]
25+
},
26+
{ path: 'sip-calculator', component: SipComponent, canActivate: [AuthGuard] },
27+
{
28+
path: 'stocks', component: StocksComponent, canActivate: [AuthGuard], resolve: { stockList: StockResolverService },
29+
children: [
30+
{
31+
path: ':id',
32+
component: StockDetailComponent
33+
}
34+
]
35+
},
36+
{ path: 'not-found', component: PageNotFoundComponent },
37+
{ path: '**', redirectTo: 'not-found' }
38+
];
39+
40+
@NgModule({
41+
imports: [RouterModule.forRoot(routes, {})],
42+
exports: [RouterModule]
43+
})
44+
export class AppRoutingModule { }
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
<app-header></app-header>
2-
<div>
3-
<hr>
4-
</div>
5-
<div class="container">
6-
<div class="row">
7-
<div class="col-md-12">
8-
<router-outlet></router-outlet>
9-
</div>
10-
</div>
1+
<app-header></app-header>
2+
<div>
3+
<hr>
4+
</div>
5+
<div class="container">
6+
<div class="row">
7+
<div class="col-md-12">
8+
<router-outlet></router-outlet>
9+
</div>
10+
</div>
1111
</div>
Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,36 @@
1-
import { TestBed } from '@angular/core/testing';
2-
import { RouterTestingModule } from '@angular/router/testing';
3-
import { provideHttpClientTesting } from '@angular/common/http/testing';
4-
import { AppComponent } from './app.component';
5-
import { FormsModule } from '@angular/forms';
6-
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
7-
8-
describe('AppComponent', () => {
9-
beforeEach(async () => {
10-
await TestBed.configureTestingModule({
11-
declarations: [
12-
AppComponent
13-
],
14-
imports: [RouterTestingModule,
15-
FormsModule],
16-
providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
17-
}).compileComponents();
18-
});
19-
20-
it('should create the app', () => {
21-
const fixture = TestBed.createComponent(AppComponent);
22-
const app = fixture.componentInstance;
23-
expect(app).toBeTruthy();
24-
});
25-
26-
it(`should have as title 'investment-profile'`, () => {
27-
const fixture = TestBed.createComponent(AppComponent);
28-
const app = fixture.componentInstance;
29-
expect(app.title).toEqual('investment-profile');
30-
});
31-
32-
});
1+
import { TestBed } from '@angular/core/testing';
2+
import { RouterTestingModule } from '@angular/router/testing';
3+
import { provideHttpClientTesting } from '@angular/common/http/testing';
4+
import { AppComponent } from './app.component';
5+
import { FormsModule } from '@angular/forms';
6+
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
7+
import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core';
8+
import { HeaderComponent } from './header/header.component';
9+
10+
describe('AppComponent', () => {
11+
beforeEach(async () => {
12+
await TestBed.configureTestingModule({
13+
declarations: [
14+
AppComponent,
15+
HeaderComponent
16+
],
17+
imports: [RouterTestingModule,
18+
FormsModule],
19+
providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()],
20+
schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA]
21+
}).compileComponents();
22+
});
23+
24+
it('should create the app', () => {
25+
const fixture = TestBed.createComponent(AppComponent);
26+
const app = fixture.componentInstance;
27+
expect(app).toBeTruthy();
28+
});
29+
30+
it(`should have as title 'investment-profile'`, () => {
31+
const fixture = TestBed.createComponent(AppComponent);
32+
const app = fixture.componentInstance;
33+
expect(app.title).toEqual('investment-profile');
34+
});
35+
36+
});

frontend/src/app/app.component.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
import { Component, OnInit } from '@angular/core';
2-
import { AuthService } from './auth/auth.service';
3-
4-
@Component({
5-
selector: 'app-root',
6-
templateUrl: './app.component.html',
7-
styleUrls: ['./app.component.css'],
8-
standalone: false
9-
})
10-
export class AppComponent implements OnInit {
11-
12-
title = 'investment-profile';
13-
14-
constructor(private authService: AuthService) { }
15-
16-
ngOnInit(): void {
17-
this.authService.autoLogin();
18-
}
19-
20-
}
1+
import { Component, OnInit } from '@angular/core';
2+
import { AuthService } from './auth/auth.service';
3+
4+
@Component({
5+
selector: 'app-root',
6+
templateUrl: './app.component.html',
7+
styleUrls: ['./app.component.css'],
8+
standalone: false
9+
})
10+
export class AppComponent implements OnInit {
11+
12+
title = 'investment-profile';
13+
14+
constructor(private authService: AuthService) { }
15+
16+
ngOnInit(): void {
17+
this.authService.autoLogin();
18+
}
19+
20+
}

frontend/src/app/app.module.ts

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,50 @@
1-
import { BrowserModule } from '@angular/platform-browser';
2-
import { NgModule } from '@angular/core';
3-
4-
import { AppRoutingModule } from './app-routing.module';
5-
import { AppComponent } from './app.component';
6-
import { PortfolioComponent } from './portfolio/portfolio.component';
7-
import { LoadingSpinnerComponent } from './shared/loading-spinner/loading-spinner.component';
8-
import { SipComponent } from './sip/sip.component';
9-
import { StocksComponent } from './stocks/stocks.component';
10-
import { AuthComponent } from './auth/auth.component';
11-
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
12-
import { DropdownDirective } from './shared/dropdown.directive';
13-
import { HeaderComponent } from './header/header.component';
14-
import { LoginComponent } from './auth/login/login.component';
15-
import { MustMatchDirective } from './auth/register/must-match.directive';
16-
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
17-
import { RegisterComponent } from './auth/register/register.component';
18-
import { PageNotFoundComponent } from './page-not-found/page-not-found.component';
19-
import { MatTableModule } from '@angular/material/table';
20-
import { PortfolioDetailComponent } from './portfolio/portfolio-detail/portfolio-detail.component';
21-
import { PortfolioListComponent } from './portfolio/portfolio-list/portfolio-list.component';
22-
import { StockListComponent } from './stocks/stock-list/stock-list.component';
23-
import { StockDetailComponent } from './stocks/stock-detail/stock-detail.component';
24-
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
25-
26-
@NgModule({ declarations: [
27-
AppComponent,
28-
AuthComponent,
29-
DropdownDirective,
30-
LoadingSpinnerComponent,
31-
HeaderComponent,
32-
RegisterComponent,
33-
LoginComponent,
34-
MustMatchDirective,
35-
PortfolioComponent,
36-
SipComponent,
37-
StocksComponent,
38-
PageNotFoundComponent,
39-
PortfolioDetailComponent,
40-
PortfolioListComponent,
41-
StockListComponent,
42-
StockDetailComponent
43-
],
44-
bootstrap: [AppComponent], imports: [BrowserModule,
45-
FormsModule,
46-
ReactiveFormsModule,
47-
AppRoutingModule,
48-
MatTableModule,
49-
BrowserAnimationsModule], providers: [provideHttpClient(withInterceptorsFromDi())] })
50-
export class AppModule { }
1+
import { BrowserModule } from '@angular/platform-browser';
2+
import { NgModule } from '@angular/core';
3+
4+
import { AppRoutingModule } from './app-routing.module';
5+
import { AppComponent } from './app.component';
6+
import { PortfolioComponent } from './portfolio/portfolio.component';
7+
import { LoadingSpinnerComponent } from './shared/loading-spinner/loading-spinner.component';
8+
import { SipComponent } from './sip/sip.component';
9+
import { StocksComponent } from './stocks/stocks.component';
10+
import { AuthComponent } from './auth/auth.component';
11+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
12+
import { DropdownDirective } from './shared/dropdown.directive';
13+
import { HeaderComponent } from './header/header.component';
14+
import { LoginComponent } from './auth/login/login.component';
15+
import { MustMatchDirective } from './auth/register/must-match.directive';
16+
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
17+
import { RegisterComponent } from './auth/register/register.component';
18+
import { PageNotFoundComponent } from './page-not-found/page-not-found.component';
19+
import { MatTableModule } from '@angular/material/table';
20+
import { PortfolioDetailComponent } from './portfolio/portfolio-detail/portfolio-detail.component';
21+
import { PortfolioListComponent } from './portfolio/portfolio-list/portfolio-list.component';
22+
import { StockListComponent } from './stocks/stock-list/stock-list.component';
23+
import { StockDetailComponent } from './stocks/stock-detail/stock-detail.component';
24+
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
25+
26+
@NgModule({ declarations: [
27+
AppComponent,
28+
AuthComponent,
29+
DropdownDirective,
30+
LoadingSpinnerComponent,
31+
HeaderComponent,
32+
RegisterComponent,
33+
LoginComponent,
34+
MustMatchDirective,
35+
PortfolioComponent,
36+
SipComponent,
37+
StocksComponent,
38+
PageNotFoundComponent,
39+
PortfolioDetailComponent,
40+
PortfolioListComponent,
41+
StockListComponent,
42+
StockDetailComponent
43+
],
44+
bootstrap: [AppComponent], imports: [BrowserModule,
45+
FormsModule,
46+
ReactiveFormsModule,
47+
AppRoutingModule,
48+
MatTableModule,
49+
BrowserAnimationsModule], providers: [provideHttpClient(withInterceptorsFromDi())] })
50+
export class AppModule { }
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
.card {
2-
margin: 0 auto;
3-
float: none;
4-
margin-bottom: 10px;
1+
.card {
2+
margin: 0 auto;
3+
float: none;
4+
margin-bottom: 10px;
55
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
<app-register></app-register>
1+
<app-register></app-register>
22
<app-login></app-login>
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import { Component } from '@angular/core';
2-
import { Router } from '@angular/router';
3-
import { AuthService } from './auth.service';
4-
5-
@Component({
6-
selector: 'app-auth',
7-
templateUrl: './auth.component.html',
8-
standalone: false
9-
})
10-
export class AuthComponent {
11-
error: string = null;
12-
13-
constructor(private authService: AuthService, private router: Router) { }
14-
}
1+
import { Component } from '@angular/core';
2+
import { Router } from '@angular/router';
3+
import { AuthService } from './auth.service';
4+
5+
@Component({
6+
selector: 'app-auth',
7+
templateUrl: './auth.component.html',
8+
standalone: false
9+
})
10+
export class AuthComponent {
11+
error: string = null;
12+
13+
constructor(private authService: AuthService, private router: Router) { }
14+
}

0 commit comments

Comments
 (0)