From 1ffd4ad2ee0f209542ca5f6000f7c581a7658f64 Mon Sep 17 00:00:00 2001 From: Sana EL HIRI Date: Fri, 21 Jan 2022 15:10:24 +0100 Subject: [PATCH 1/4] dev --- src/app/app-routing.module.ts | 5 +- src/app/app.module.ts | 2 + .../page-test-form.component.html | 80 +++++++++++++++++++ .../page-test-form.component.scss | 0 .../page-test-form.component.spec.ts | 25 ++++++ .../page-test-form.component.ts | 15 ++++ 6 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 src/app/pages/page-test-form/page-test-form.component.html create mode 100644 src/app/pages/page-test-form/page-test-form.component.scss create mode 100644 src/app/pages/page-test-form/page-test-form.component.spec.ts create mode 100644 src/app/pages/page-test-form/page-test-form.component.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 7010ac8..b34ba92 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -13,6 +13,7 @@ import { PageNotFoundComponent } from './pages/page-not-found/page-not-found.com import { PageRepertoireComponent } from './pages/page-repertoire/page-repertoire.component'; import { PageResetPasswordComponent } from './pages/page-reset-password/page-reset-password.component'; import { PageSignupComponent } from './pages/page-signup/page-signup.component'; +import { PageTestFormComponent } from './pages/page-test-form/page-test-form.component'; import { PageToDoListComponent } from './pages/page-to-do-list/page-to-do-list.component'; import { PageUpdateMemberComponent } from './pages/page-update-member/page-update-member.component'; @@ -32,7 +33,9 @@ const routes: Routes = [ { path: 'to-do-list', component: PageToDoListComponent }, { path: 'modifier-membre', component: PageUpdateMemberComponent }, { path: 'creation-team', component : PageCreationTeamComponent}, - { path: '**', component: PageNotFoundComponent }, + { path: 'test', component : PageTestFormComponent}, + { path: '**', component: PageNotFoundComponent } + ]; @NgModule({ diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 8c02ccc..46e47df 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -34,6 +34,7 @@ import { CreneauComponent } from './components/creneau/creneau.component'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { HttpClientModule } from '@angular/common/http'; import { PageCreationTeamComponent } from './pages/page-creation-team/page-creation-team.component'; +import { PageTestFormComponent } from './pages/page-test-form/page-test-form.component'; @NgModule({ declarations: [ @@ -67,6 +68,7 @@ import { PageCreationTeamComponent } from './pages/page-creation-team/page-creat PaginationComponent, CreneauComponent, PageCreationTeamComponent, + PageTestFormComponent, ], imports: [ BrowserModule, diff --git a/src/app/pages/page-test-form/page-test-form.component.html b/src/app/pages/page-test-form/page-test-form.component.html new file mode 100644 index 0000000..d9f78fc --- /dev/null +++ b/src/app/pages/page-test-form/page-test-form.component.html @@ -0,0 +1,80 @@ +

page-test-form works!

+ +
+
+
+

Incrivez-vous !

+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ + + +
+
+
diff --git a/src/app/pages/page-test-form/page-test-form.component.scss b/src/app/pages/page-test-form/page-test-form.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/page-test-form/page-test-form.component.spec.ts b/src/app/pages/page-test-form/page-test-form.component.spec.ts new file mode 100644 index 0000000..f1a9abd --- /dev/null +++ b/src/app/pages/page-test-form/page-test-form.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PageTestFormComponent } from './page-test-form.component'; + +describe('PageTestFormComponent', () => { + let component: PageTestFormComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ PageTestFormComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(PageTestFormComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/page-test-form/page-test-form.component.ts b/src/app/pages/page-test-form/page-test-form.component.ts new file mode 100644 index 0000000..056d5ac --- /dev/null +++ b/src/app/pages/page-test-form/page-test-form.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-page-test-form', + templateUrl: './page-test-form.component.html', + styleUrls: ['./page-test-form.component.scss'] +}) +export class PageTestFormComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} From e53a9a062dc7e75dd226a02deaa852eaed349b42 Mon Sep 17 00:00:00 2001 From: Sana EL HIRI Date: Mon, 14 Feb 2022 11:47:09 +0100 Subject: [PATCH 2/4] Team crud Ok connection Back Ok --- src/app/app-routing.module.ts | 1 - src/app/app.module.ts | 9 --- .../page-creation-team.component.ts | 6 +- .../page-test-form.component.html | 80 ------------------- .../page-test-form.component.scss | 0 .../page-test-form.component.spec.ts | 25 ------ .../page-test-form.component.ts | 15 ---- src/app/services/team.service.spec.ts | 16 ++++ src/app/services/team.service.ts | 41 ++++++++++ 9 files changed, 60 insertions(+), 133 deletions(-) delete mode 100644 src/app/pages/page-test-form/page-test-form.component.html delete mode 100644 src/app/pages/page-test-form/page-test-form.component.scss delete mode 100644 src/app/pages/page-test-form/page-test-form.component.spec.ts delete mode 100644 src/app/pages/page-test-form/page-test-form.component.ts create mode 100644 src/app/services/team.service.spec.ts create mode 100644 src/app/services/team.service.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index bbc5f51..4587264 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -15,7 +15,6 @@ import { PageNotFoundComponent } from './pages/page-not-found/page-not-found.com import { PageRepertoireComponent } from './pages/page-repertoire/page-repertoire.component'; import { PageResetPasswordComponent } from './pages/page-reset-password/page-reset-password.component'; import { PageSignupComponent } from './pages/page-signup/page-signup.component'; -import { PageTestFormComponent } from './pages/page-test-form/page-test-form.component'; import { PageToDoListComponent } from './pages/page-to-do-list/page-to-do-list.component'; import { PageUpdateMemberComponent } from './pages/page-update-member/page-update-member.component'; diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 7dcf04b..3f9fcc5 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -36,14 +36,10 @@ import { HttpClientModule } from '@angular/common/http'; import { PageAjoutContactComponent } from './pages/page-ajout-contact/page-ajout-contact.component'; import { PageModifierContactComponent } from './pages/page-modifier-contact/page-modifier-contact.component'; import { PageCreationTeamComponent } from './pages/page-creation-team/page-creation-team.component'; -<<<<<<< HEAD -import { PageTestFormComponent } from './pages/page-test-form/page-test-form.component'; -======= import { AutofocusFixModule } from 'ngx-autofocus-fix'; ->>>>>>> 5c7e4662b2e3c8af6778c79d1b56aa66a0fdf0a1 @NgModule({ declarations: [ @@ -79,11 +75,6 @@ import { AutofocusFixModule } from 'ngx-autofocus-fix'; PageAjoutContactComponent, PageModifierContactComponent, PageCreationTeamComponent, -<<<<<<< HEAD - PageTestFormComponent, -======= - ->>>>>>> 5c7e4662b2e3c8af6778c79d1b56aa66a0fdf0a1 ], imports: [ BrowserModule, diff --git a/src/app/pages/page-creation-team/page-creation-team.component.ts b/src/app/pages/page-creation-team/page-creation-team.component.ts index 9326242..c7a9ec7 100644 --- a/src/app/pages/page-creation-team/page-creation-team.component.ts +++ b/src/app/pages/page-creation-team/page-creation-team.component.ts @@ -7,7 +7,7 @@ import { } from '@angular/forms'; import { Router } from '@angular/router'; import { Team } from 'src/app/models/team'; -import { AuthService } from '../../services/auth.service'; +import { TeamService } from 'src/app/services/team.service'; @Component({ selector: 'app-page-creation-team', @@ -17,7 +17,7 @@ import { AuthService } from '../../services/auth.service'; export class PageCreationTeamComponent implements OnInit { public teamForm: FormGroup; constructor( - private authService: AuthService, + private teamService: TeamService, private router: Router, private fb: FormBuilder ) { @@ -43,7 +43,7 @@ export class PageCreationTeamComponent implements OnInit { if (team.nom !== '' ) { - this.authService.creationTeam(team).subscribe((resp) => { + this.teamService.addTeam(team).subscribe((resp) => { this.router.navigate(['compte']); }); } else { diff --git a/src/app/pages/page-test-form/page-test-form.component.html b/src/app/pages/page-test-form/page-test-form.component.html deleted file mode 100644 index d9f78fc..0000000 --- a/src/app/pages/page-test-form/page-test-form.component.html +++ /dev/null @@ -1,80 +0,0 @@ -

page-test-form works!

- - diff --git a/src/app/pages/page-test-form/page-test-form.component.scss b/src/app/pages/page-test-form/page-test-form.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/pages/page-test-form/page-test-form.component.spec.ts b/src/app/pages/page-test-form/page-test-form.component.spec.ts deleted file mode 100644 index f1a9abd..0000000 --- a/src/app/pages/page-test-form/page-test-form.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { PageTestFormComponent } from './page-test-form.component'; - -describe('PageTestFormComponent', () => { - let component: PageTestFormComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ PageTestFormComponent ] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(PageTestFormComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/pages/page-test-form/page-test-form.component.ts b/src/app/pages/page-test-form/page-test-form.component.ts deleted file mode 100644 index 056d5ac..0000000 --- a/src/app/pages/page-test-form/page-test-form.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-page-test-form', - templateUrl: './page-test-form.component.html', - styleUrls: ['./page-test-form.component.scss'] -}) -export class PageTestFormComponent implements OnInit { - - constructor() { } - - ngOnInit(): void { - } - -} diff --git a/src/app/services/team.service.spec.ts b/src/app/services/team.service.spec.ts new file mode 100644 index 0000000..d9ca39e --- /dev/null +++ b/src/app/services/team.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { TeamService } from '../services/team.service'; + +describe('TeamService', () => { + let service: TeamService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(TeamService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/services/team.service.ts b/src/app/services/team.service.ts new file mode 100644 index 0000000..1aed726 --- /dev/null +++ b/src/app/services/team.service.ts @@ -0,0 +1,41 @@ +import { HttpClient } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs'; +import { environment } from 'src/environments/environment'; +import { Team } from '../models/team'; + +@Injectable({ + providedIn: 'root' +}) +export class TeamService { + apiUrl: string; + tokenKey: string; + + + constructor(private http: HttpClient) { + this.apiUrl = environment.apiUrl; + this.tokenKey = environment.tokenKey; + } + getTeams(): Observable { + return this.http.get(`${this.apiUrl}/teams/all`); + } + + getTeamById(id: any): Observable { + return this.http.get(`${this.apiUrl}/teams/1` + id); + } + + addTeam(team: Team): Observable { + console.log(team); + + return this.http.post(`${this.apiUrl}/teams/add`, team); + } + + deleteTeam(team: Team): Observable { + return this.http.delete(`${this.apiUrl}/teams/delete/1`); + } + + updateTeam(team: Team): Observable { + return this.http.put(`${this.apiUrl}/teams/update/1`, team); + } + +} From 026ac428181b1c18df888ac190cb870ca54785af Mon Sep 17 00:00:00 2001 From: Sana EL HIRI Date: Mon, 14 Feb 2022 15:45:32 +0100 Subject: [PATCH 3/4] =?UTF-8?q?Side=20bar=20css=20ok=20avanc=C3=A9es=20sur?= =?UTF-8?q?=20ticket=20page=20account=20et=20page=20membreetc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../side-bar/side-bar.component.html | 30 ++- .../side-bar/side-bar.component.scss | 24 ++ .../page-account/page-account.component.html | 44 +++- .../page-account/page-account.component.scss | 7 + .../page-add-member.component.html | 235 ++++++++++-------- .../page-add-member.component.scss | 57 ++++- .../page-add-member.component.ts | 6 +- .../page-creation-team.component.html | 55 ++-- .../page-creation-team.component.scss | 21 +- .../page-delete-member.component.html | 11 + .../page-not-found.component.html | 2 +- .../page-update-member.component.html | 11 + src/app/services/membre.service.spec.ts | 16 ++ src/app/services/membre.service.ts | 40 +++ 14 files changed, 402 insertions(+), 157 deletions(-) create mode 100644 src/app/services/membre.service.spec.ts create mode 100644 src/app/services/membre.service.ts diff --git a/src/app/components/side-bar/side-bar.component.html b/src/app/components/side-bar/side-bar.component.html index 2d7f65e..2f43159 100644 --- a/src/app/components/side-bar/side-bar.component.html +++ b/src/app/components/side-bar/side-bar.component.html @@ -1,11 +1,21 @@ -