Skip to content

Commit b6f8c0b

Browse files
committed
todo detail page / ng lint / todo category java entity
1 parent e357372 commit b6f8c0b

25 files changed

+351
-124
lines changed

src/angular/package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/angular/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"@ngrx/entity": "^6.0.1",
3131
"@ngrx/store": "^6.0.1",
3232
"@ngrx/store-devtools": "^6.0.1",
33+
"awesome-bootstrap-checkbox": "^1.0.1",
3334
"bootstrap": "^4.1.1",
3435
"core-js": "^2.5.6",
3536
"ngrx-data": "^6.0.0-beta.6",

src/angular/server.json

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@
1919
"active": false
2020
},
2121
{
22-
"description": "nbn bnb nbnbnnbn bnnbnbnb nbnbnb nbb nb nb nbnb",
2322
"title": "Spring Boot for my crocodile",
23+
"description": "special edition teeth-proof for big mouth",
24+
"active": true,
2425
"id": 3
2526
},
2627
{
27-
"description": "bebebbebbb be be b be bbbebbebeb b ebebebebeb b eb",
2828
"title": "Beer is not my first name",
29+
"description": "autre truc",
30+
"active": null,
2931
"id": 4
3032
},
3133
{
@@ -34,28 +36,22 @@
3436
"id": 5
3537
},
3638
{
37-
"description": "tdtd tdt ddddt dtdt dtdtddtdtd tdtd",
3839
"title": "That's barealy a Todo List right ?",
39-
"id": 7,
40-
"active": true
40+
"description": "the brand new description",
41+
"active": false,
42+
"id": 7
4143
},
4244
{
4345
"description": "ititit ititit it it it it it ititit itit ",
4446
"title": "Do something about it",
4547
"id": 8,
4648
"active": true
4749
},
48-
{
49-
"title": "test calculate",
50-
"description": "description for the todo",
51-
"active": true,
52-
"id": 9
53-
},
5450
{
5551
"title": "test meuh",
56-
"description": "bilou bilou bilou bilou bilou bilou bilou bilou bilou bilou bilou bilou ",
52+
"description": "er ererererer er e rer ererer er",
5753
"active": true,
58-
"id": 10
54+
"id": 9
5955
}
6056
]
6157
}
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
import { NgModule } from '@angular/core';
22
import { RouterModule, Routes } from '@angular/router';
33

4-
import { CommonModule } from '@angular/common';
54
import { TodoComponent } from '../todo/todo.component';
65
import { AdminModule } from '../admin/admin.module';
6+
import { TodoEditComponent } from '../todo/todo-edit/todo-edit.component';
77

88
const routes: Routes = [
99
{
10-
path: 'admin',
10+
path: '',
11+
redirectTo: 'todopage',
12+
pathMatch: 'full'
13+
},
14+
{
15+
path: 'adminpage',
1116
loadChildren: () => AdminModule
1217
},
1318
{
14-
path: 'todo',
19+
path: 'todopage',
1520
component: TodoComponent
1621
},
17-
{
18-
path: '',
19-
redirectTo: 'todo',
20-
pathMatch: 'full'
21-
}
22+
{ path: 'todopage/:id', component: TodoEditComponent },
23+
{ path: '**', redirectTo: 'todopage' } // bad routes redirect to todopage
2224
];
2325

2426
@NgModule({
25-
imports: [RouterModule.forRoot(routes)],
27+
imports: [RouterModule.forRoot(routes, { useHash: true })],
2628
exports: [RouterModule]
2729
})
2830
export class AppRoutingModule {}

src/angular/src/app/app.component.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
import { OnInit } from '@angular/core/src/metadata/lifecycle_hooks';
2-
import {
3-
Component,
4-
ChangeDetectionStrategy,
5-
ViewContainerRef
6-
} from '@angular/core';
7-
import { TodosService } from './services/todos.service';
8-
import { Todo } from './dto/todo';
9-
import { Observable } from 'rxjs';
1+
import { Component, ChangeDetectionStrategy } from '@angular/core';
102
import { ToastService } from './services/toast.service';
113

124
@Component({
@@ -15,10 +7,8 @@ import { ToastService } from './services/toast.service';
157
styleUrls: ['./app.component.css'],
168
changeDetection: ChangeDetectionStrategy.OnPush
179
})
18-
export class AppComponent implements OnInit {
10+
export class AppComponent {
1911
constructor(
2012
private toastService: ToastService // create an instance of the service that intercepts $entities actions
2113
) {}
22-
23-
ngOnInit() {}
2414
}

src/angular/src/app/app.module.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ import { AppComponent } from './app.component';
66
import { AppStoreModule } from './store/app-store.module';
77
import { ServicesModule } from './services/services.module';
88
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
9-
import { CounterComponent } from './counter/counter.component';
109
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
11-
import { CountervalidComponent } from './counter/countervalid/countervalid.component';
1210
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
1311
import { CompModule } from './comp/comp.module';
1412
import { ToastrModule } from 'ngx-toastr';

src/angular/src/app/comp/comp.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import { CommonModule } from '@angular/common';
33
import { FaInputComponent } from './fa-input/fa-input.component';
44
import { HelloComponent } from './hello/hello.component';
55
import { NavbarComponent } from './navbar/navbar.component';
6-
import { AppRoutingModule } from '../app-routing/app-routing.module';
76
import { FooterComponent } from './footer/footer.component';
7+
import { RouterModule } from '@angular/router';
88

99
/**
1010
* Module des composants annexes non liés aux routes
1111
*/
1212
@NgModule({
13-
imports: [CommonModule, AppRoutingModule],
13+
imports: [CommonModule, RouterModule],
1414
declarations: [
1515
FaInputComponent,
1616
HelloComponent,

src/angular/src/app/comp/navbar/navbar.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
<a class="nav-link" href="#">NgRx Data / SpringBoot</a>
1414
</li>
1515
<li class="nav-item">
16-
<a class="nav-link" [routerLinkActive]="['active']" [routerLink]="'todo'">Todo</a>
16+
<a class="nav-link" [routerLinkActive]="['active']" [routerLink]="'todopage'">Todo</a>
1717
</li>
1818
<li class="nav-item">
19-
<a class="nav-link" [routerLinkActive]="['active']" [routerLink]="'admin'">Admin</a>
19+
<a class="nav-link" [routerLinkActive]="['active']" [routerLink]="'adminpage'">Admin</a>
2020
</li>
2121
</ul>
2222
<div class="float-right pr-3">

src/angular/src/app/counter/counter.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Component, OnInit } from '@angular/core';
22
import { TodosService } from '../services/todos.service';
3-
import { Observable } from 'rxjs/Observable';
3+
import { Observable } from 'rxjs';
44

55
@Component({
66
selector: 'app-counter',
@@ -11,7 +11,7 @@ export class CounterComponent implements OnInit {
1111
counter$: Observable<number>;
1212

1313
constructor(private todosService: TodosService) {
14-
this.counter$ = todosService.count$;
14+
this.counter$ = this.todosService.count$;
1515
}
1616

1717
ngOnInit() {}

src/angular/src/app/counter/countervalid/countervalid.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Component, OnInit } from '@angular/core';
22
import { TodosService } from '../../services/todos.service';
3-
import { Observable } from 'rxjs/Observable';
3+
import { Observable } from 'rxjs';
44
import { Todo } from '../../dto/todo';
55

66
@Component({
@@ -12,8 +12,8 @@ export class CountervalidComponent implements OnInit {
1212
filteredTodos$: Observable<Todo[]>;
1313

1414
constructor(private todosService: TodosService) {
15-
todosService.setFilter(true);
16-
this.filteredTodos$ = todosService.filteredEntities$;
15+
this.todosService.setFilter(true);
16+
this.filteredTodos$ = this.todosService.filteredEntities$;
1717
}
1818

1919
ngOnInit() {}

0 commit comments

Comments
 (0)