diff --git a/src/app/components/fiche-contact/fiche-contact.component.html b/src/app/components/fiche-contact/fiche-contact.component.html index 6c65a73..5499a7d 100644 --- a/src/app/components/fiche-contact/fiche-contact.component.html +++ b/src/app/components/fiche-contact/fiche-contact.component.html @@ -1 +1,18 @@ -

fiche-contact works!

+
+ + + +

{{ personne.prenom }} {{ personne.nom }}

+

+ {{ personne.telephone }}

+

+ {{ personne.email }}

+

+ {{ personne.dateNaissance }}

+

+ {{ personne.adresse }}

+
diff --git a/src/app/components/fiche-contact/fiche-contact.component.scss b/src/app/components/fiche-contact/fiche-contact.component.scss index e69de29..d0f4200 100644 --- a/src/app/components/fiche-contact/fiche-contact.component.scss +++ b/src/app/components/fiche-contact/fiche-contact.component.scss @@ -0,0 +1,8 @@ +.btn-secondary { + color: #fff; + background-color: #5a1e63 !important; + width: 100%; + max-width: 330px; + padding: 15px; + margin: auto; +} diff --git a/src/app/components/fiche-contact/fiche-contact.component.ts b/src/app/components/fiche-contact/fiche-contact.component.ts index 7496ca9..25ae576 100644 --- a/src/app/components/fiche-contact/fiche-contact.component.ts +++ b/src/app/components/fiche-contact/fiche-contact.component.ts @@ -1,15 +1,14 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; @Component({ selector: 'app-fiche-contact', templateUrl: './fiche-contact.component.html', - styleUrls: ['./fiche-contact.component.scss'] + styleUrls: ['./fiche-contact.component.scss'], }) export class FicheContactComponent implements OnInit { + @Input() personne: any; - constructor() { } - - ngOnInit(): void { - } + constructor() {} + ngOnInit(): void {} } diff --git a/src/app/models/contact.ts b/src/app/models/contact.ts new file mode 100644 index 0000000..2c632a4 --- /dev/null +++ b/src/app/models/contact.ts @@ -0,0 +1,8 @@ +export interface Contact { + nom: string; + prenom: string; + telephone: string; + email: string; + adresse: string; + dateNaissance: Date; +} diff --git a/src/app/models/menu.ts b/src/app/models/menu.ts new file mode 100644 index 0000000..990f122 --- /dev/null +++ b/src/app/models/menu.ts @@ -0,0 +1,10 @@ +import { Membre } from './membre'; +import { Team } from './team'; + +export interface Menu { + libelle: string; + dateMenu: Date; + membre: Membre; + team: Team; + validationProposition: boolean; +} diff --git a/src/app/models/to-do-list.ts b/src/app/models/to-do-list.ts new file mode 100644 index 0000000..48fba0f --- /dev/null +++ b/src/app/models/to-do-list.ts @@ -0,0 +1,7 @@ +import { Team } from './team'; + +export interface ToDoList { + nom: string; + team: Team; + tache: string; +} diff --git a/src/app/pages/page-repertoire/page-repertoire.component.html b/src/app/pages/page-repertoire/page-repertoire.component.html index 2d3d7d1..8919361 100644 --- a/src/app/pages/page-repertoire/page-repertoire.component.html +++ b/src/app/pages/page-repertoire/page-repertoire.component.html @@ -1,2 +1,32 @@ - \ No newline at end of file + + +
+ + + + +
+ + +
+ +
+
+ +
+ +

{{ personne.prenom }} {{ personne.nom }}

+
+
+ +
diff --git a/src/app/pages/page-repertoire/page-repertoire.component.scss b/src/app/pages/page-repertoire/page-repertoire.component.scss index e69de29..6634178 100644 --- a/src/app/pages/page-repertoire/page-repertoire.component.scss +++ b/src/app/pages/page-repertoire/page-repertoire.component.scss @@ -0,0 +1,15 @@ +.btn-secondary { + color: #fff; + background-color: #5a1e63 !important; + width: 100%; + max-width: 330px; + padding: 15px; + margin: auto; +} + +.input-group mb-3 { + width: 100%; + max-width: 330px; + padding: 15px; + margin: auto; +} diff --git a/src/app/pages/page-repertoire/page-repertoire.component.ts b/src/app/pages/page-repertoire/page-repertoire.component.ts index 5e2707e..c4fff1b 100644 --- a/src/app/pages/page-repertoire/page-repertoire.component.ts +++ b/src/app/pages/page-repertoire/page-repertoire.component.ts @@ -1,15 +1,50 @@ import { Component, OnInit } from '@angular/core'; +import { RepertoireService } from 'src/app/services/repertoire.service'; @Component({ selector: 'app-page-repertoire', templateUrl: './page-repertoire.component.html', - styleUrls: ['./page-repertoire.component.scss'] + styleUrls: ['./page-repertoire.component.scss'], }) export class PageRepertoireComponent implements OnInit { + public listContact: any[]; + public listFull: any[]; + keyword: any; + openDetails: any; - constructor() { } - - ngOnInit(): void { + constructor(private repertoireService: RepertoireService) { + this.listContact = []; + this.listFull = []; } + ngOnInit(): void { + this.repertoireService.getContact().subscribe((listContact: any[]) => { + console.log(listContact); + this.listContact = listContact; + this.listFull = listContact; + }); + } + + // Méthode pour récuper ce qui est saisi dans l'input + onSearchChange(prenom: string): void { + this.keyword = prenom; + if (prenom == '') { + this.listContact = this.listFull; + } else { + this.applyFilter(prenom); + } + } + + // Méthode qui applique un filtre sur ce qui est récupéré de l'input sur le prénom + applyFilter(filter: any) { + let prenom = this.listFull.filter((contact) => + contact.prenom.toLowerCase().includes(filter.toLowerCase()) + ); + this.listContact = prenom; + } + + onClick(personne: any) { + console.log(personne); + this.openDetails = personne; + } } diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index 918bfd9..8fafb7b 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -20,7 +20,7 @@ export class AuthService { signup(membre: Membre): Observable { console.log(membre); - return this.http.post(`${this.apiUrl}/creation-compte`, membre); + return this.http.post(`${this.apiUrl}/membres/sign-up`, membre); } signin(email: string, password: string): Observable { diff --git a/src/app/services/organizee.service.spec.ts b/src/app/services/organizee.service.spec.ts new file mode 100644 index 0000000..6148a1d --- /dev/null +++ b/src/app/services/organizee.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { OrganizeeService } from './organizee.service'; + +describe('OrganizeeService', () => { + let service: OrganizeeService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(OrganizeeService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/services/organizee.service.ts b/src/app/services/organizee.service.ts new file mode 100644 index 0000000..3e88f65 --- /dev/null +++ b/src/app/services/organizee.service.ts @@ -0,0 +1,18 @@ +import { HttpClient } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { map, Observable } from 'rxjs'; +import { environment } from 'src/environments/environment'; + +@Injectable({ + providedIn: 'root', +}) +export class OrganizeeService { + apiUrl: string; + tokenKey: string; + + constructor(private http: HttpClient) { + // On se sert des variables d'environnement de notre application + this.apiUrl = environment.apiUrl; + this.tokenKey = environment.tokenKey; + } +} diff --git a/src/app/services/repertoire.service.spec.ts b/src/app/services/repertoire.service.spec.ts new file mode 100644 index 0000000..bc77b79 --- /dev/null +++ b/src/app/services/repertoire.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { RepertoireService } from './repertoire.service'; + +describe('RepertoireService', () => { + let service: RepertoireService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(RepertoireService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/services/repertoire.service.ts b/src/app/services/repertoire.service.ts new file mode 100644 index 0000000..2c5c5ec --- /dev/null +++ b/src/app/services/repertoire.service.ts @@ -0,0 +1,28 @@ +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { map, Observable } from 'rxjs'; +import { environment } from 'src/environments/environment'; +import { Contact } from '../models/contact'; + +@Injectable({ + providedIn: 'root', +}) +export class RepertoireService { + apiUrl: string; + tokenKey: string; + + constructor(private http: HttpClient) { + // On se sert des variables d'environnement de notre application + this.apiUrl = environment.apiUrl; + this.tokenKey = environment.tokenKey; + } + + getContact(): Observable { + return this.http.get(`${this.apiUrl}/contacts/team/1`); + } + + //sur le component fiche contact de la page repertoire + // sur clic de btn modifier ou supproimer ca renvois vers page modifier contact + //page modifier contact faire un get by id du contact en question + // appeler methode/ update /delette/ add et contact by id +} diff --git a/src/assets/images/adresse.jpg b/src/assets/images/adresse.jpg new file mode 100644 index 0000000..deca31c Binary files /dev/null and b/src/assets/images/adresse.jpg differ diff --git a/src/assets/images/contact-1.png b/src/assets/images/contact-1.png new file mode 100644 index 0000000..cf254af Binary files /dev/null and b/src/assets/images/contact-1.png differ diff --git a/src/assets/images/gateau.png b/src/assets/images/gateau.png new file mode 100644 index 0000000..b97d3b3 Binary files /dev/null and b/src/assets/images/gateau.png differ diff --git a/src/assets/images/logo-gmail.png b/src/assets/images/logo-gmail.png new file mode 100644 index 0000000..1b91717 Binary files /dev/null and b/src/assets/images/logo-gmail.png differ diff --git a/src/assets/images/phone.png b/src/assets/images/phone.png new file mode 100644 index 0000000..2d41a02 Binary files /dev/null and b/src/assets/images/phone.png differ diff --git a/src/environments/environment.ts b/src/environments/environment.ts index ecf1531..90149fd 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,7 +4,7 @@ export const environment = { production: false, - apiUrl: 'http://localhost:3306', + apiUrl: 'http://localhost:8088', tokenKey: 'TOKEN-ORGANIZEE', };