From 224aaf94a69ddfb20166ff51945453ca7af2f031 Mon Sep 17 00:00:00 2001 From: ExostFlash Date: Fri, 11 Apr 2025 14:14:42 +0000 Subject: [PATCH 01/19] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'FencerJudgeF?= =?UTF-8?q?ront/README.md'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FencerJudgeFront/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FencerJudgeFront/README.md b/FencerJudgeFront/README.md index c5c9b8d..cf8675c 100644 --- a/FencerJudgeFront/README.md +++ b/FencerJudgeFront/README.md @@ -10,7 +10,7 @@ To start a local development server, run: ng serve ``` -Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files. +Once the server is running, open your browser and navigate to `http://localhost/`. The application will automatically reload whenever you modify any of the source files. ## Code scaffolding -- 2.45.3 From a6cd64dd5ded96a404397918460988676704e932 Mon Sep 17 00:00:00 2001 From: ExostFlash Date: Mon, 2 Jun 2025 09:57:48 +0200 Subject: [PATCH 02/19] Add interfaces & services --- FencerJudgeFront/src/app/app.component.ts | 2 +- .../essentials/header/header.component.ts | 6 +- .../src/app/interfaces/matches.ts | 19 +++++ .../src/app/interfaces/models/user.model.ts | 5 ++ FencerJudgeFront/src/app/interfaces/player.ts | 5 ++ .../src/app/interfaces/referee.ts | 12 ++++ .../src/app/services/matches.service.spec.ts | 16 +++++ .../src/app/services/matches.service.ts | 71 +++++++++++++++++++ .../src/app/services/player.service.spec.ts | 16 +++++ .../src/app/services/player.service.ts | 30 ++++++++ .../src/app/services/referee.service.spec.ts | 16 +++++ .../src/app/services/referee.service.ts | 42 +++++++++++ FencerJudgeFront/tsconfig.json | 8 ++- package-lock.json | 6 ++ 14 files changed, 248 insertions(+), 6 deletions(-) create mode 100644 FencerJudgeFront/src/app/interfaces/matches.ts create mode 100644 FencerJudgeFront/src/app/interfaces/models/user.model.ts create mode 100644 FencerJudgeFront/src/app/interfaces/player.ts create mode 100644 FencerJudgeFront/src/app/interfaces/referee.ts create mode 100644 FencerJudgeFront/src/app/services/matches.service.spec.ts create mode 100644 FencerJudgeFront/src/app/services/matches.service.ts create mode 100644 FencerJudgeFront/src/app/services/player.service.spec.ts create mode 100644 FencerJudgeFront/src/app/services/player.service.ts create mode 100644 FencerJudgeFront/src/app/services/referee.service.spec.ts create mode 100644 FencerJudgeFront/src/app/services/referee.service.ts create mode 100644 package-lock.json diff --git a/FencerJudgeFront/src/app/app.component.ts b/FencerJudgeFront/src/app/app.component.ts index edbb159..c713d57 100644 --- a/FencerJudgeFront/src/app/app.component.ts +++ b/FencerJudgeFront/src/app/app.component.ts @@ -4,7 +4,7 @@ import { Component } from '@angular/core'; selector: 'app-root', templateUrl: './app.component.html', standalone: false, - styleUrl: './app.component.css' + styleUrl: './app.component.css', }) export class AppComponent { title = 'FencerJudgeFront'; diff --git a/FencerJudgeFront/src/app/components/essentials/header/header.component.ts b/FencerJudgeFront/src/app/components/essentials/header/header.component.ts index f572069..ffc3163 100644 --- a/FencerJudgeFront/src/app/components/essentials/header/header.component.ts +++ b/FencerJudgeFront/src/app/components/essentials/header/header.component.ts @@ -4,8 +4,6 @@ import { Component } from '@angular/core'; selector: 'app-header', standalone: false, templateUrl: './header.component.html', - styleUrl: './header.component.css' + styleUrl: './header.component.css', }) -export class HeaderComponent { - -} +export class HeaderComponent {} diff --git a/FencerJudgeFront/src/app/interfaces/matches.ts b/FencerJudgeFront/src/app/interfaces/matches.ts new file mode 100644 index 0000000..26c6767 --- /dev/null +++ b/FencerJudgeFront/src/app/interfaces/matches.ts @@ -0,0 +1,19 @@ +export enum MatchState { + ONGOING = 1, + OVER = 2, + NOT_STARTED = 3, +} + +export interface Matches { + id: number; + refereeID: number; + player1ID: number; + score1: number; + player2ID: number; + score2: number; + country: String; + city: String; + weapon: String; + date: Date; + state: MatchState; +} diff --git a/FencerJudgeFront/src/app/interfaces/models/user.model.ts b/FencerJudgeFront/src/app/interfaces/models/user.model.ts new file mode 100644 index 0000000..954ae9a --- /dev/null +++ b/FencerJudgeFront/src/app/interfaces/models/user.model.ts @@ -0,0 +1,5 @@ +export interface UserModel { + id: number; + name: string; + firstName: string; +} diff --git a/FencerJudgeFront/src/app/interfaces/player.ts b/FencerJudgeFront/src/app/interfaces/player.ts new file mode 100644 index 0000000..6f39558 --- /dev/null +++ b/FencerJudgeFront/src/app/interfaces/player.ts @@ -0,0 +1,5 @@ +import { UserModel } from './models/user.model'; + +export interface Player extends UserModel { + club: string; +} diff --git a/FencerJudgeFront/src/app/interfaces/referee.ts b/FencerJudgeFront/src/app/interfaces/referee.ts new file mode 100644 index 0000000..3b4f0c1 --- /dev/null +++ b/FencerJudgeFront/src/app/interfaces/referee.ts @@ -0,0 +1,12 @@ +import { UserModel } from './models/user.model'; + +export enum RefereeLevel { + DEPARTMENTAL = 0, + REGIONAL = 1, + NATIONAL = 2, + INTERNATIONAL = 3, +} + +export interface Referee extends UserModel { + level: RefereeLevel; +} diff --git a/FencerJudgeFront/src/app/services/matches.service.spec.ts b/FencerJudgeFront/src/app/services/matches.service.spec.ts new file mode 100644 index 0000000..0e9bf15 --- /dev/null +++ b/FencerJudgeFront/src/app/services/matches.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { MatchesService } from './matches.service'; + +describe('MatchesService', () => { + let service: MatchesService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(MatchesService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/FencerJudgeFront/src/app/services/matches.service.ts b/FencerJudgeFront/src/app/services/matches.service.ts new file mode 100644 index 0000000..12a6201 --- /dev/null +++ b/FencerJudgeFront/src/app/services/matches.service.ts @@ -0,0 +1,71 @@ +import { Injectable } from '@angular/core'; +import { Observable, of } from 'rxjs'; +import { Matches, MatchState } from '@interfaces/matches'; + +@Injectable({ providedIn: 'root' }) +export class MatchesService { + private matches: Matches[] = [ + { + id: 1, + refereeID: 10, + player1ID: 1, + score1: 15, + player2ID: 2, + score2: 13, + country: 'France', + city: 'Paris', + weapon: 'Fleuret', + date: new Date('2025-06-10T14:00:00'), + state: MatchState.OVER, + }, + { + id: 2, + refereeID: 11, + player1ID: 3, + score1: 5, + player2ID: 4, + score2: 7, + country: 'France', + city: 'Lyon', + weapon: 'Épée', + date: new Date('2025-06-15T10:00:00'), + state: MatchState.ONGOING, + }, + { + id: 3, + refereeID: 12, + player1ID: 5, + score1: 0, + player2ID: 6, + score2: 0, + country: 'Belgique', + city: 'Bruxelles', + weapon: 'Sabre', + date: new Date('2025-06-20T16:30:00'), + state: MatchState.NOT_STARTED, + }, + ]; + + constructor() { + console.log('[MatchesService] Initial matches loaded:', this.matches); + } + + getMatches(): Observable { + console.log('[MatchesService] Fetching all matches'); + return of(this.matches); + } + + getMatchById(id: number): Observable { + const match = this.matches.find((m) => m.id === id); + console.log(`[MatchesService] Fetching match ID: ${id}`, match); + return of(match); + } + + // Préparation future pour WebSocket + connectToMatchUpdatesWebSocket(): void { + console.log( + '[MatchesService] WebSocket connection placeholder initialized' + ); + // ici tu pourrais plus tard faire : this.socket = new WebSocket('ws://...') etc. + } +} diff --git a/FencerJudgeFront/src/app/services/player.service.spec.ts b/FencerJudgeFront/src/app/services/player.service.spec.ts new file mode 100644 index 0000000..5355445 --- /dev/null +++ b/FencerJudgeFront/src/app/services/player.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { PlayerService } from './player.service'; + +describe('PlayerService', () => { + let service: PlayerService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(PlayerService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/FencerJudgeFront/src/app/services/player.service.ts b/FencerJudgeFront/src/app/services/player.service.ts new file mode 100644 index 0000000..53d4350 --- /dev/null +++ b/FencerJudgeFront/src/app/services/player.service.ts @@ -0,0 +1,30 @@ +import { Injectable } from '@angular/core'; +import { Observable, of } from 'rxjs'; +import { Player } from '@interfaces/player'; + +@Injectable({ providedIn: 'root' }) +export class PlayerService { + private players: Player[] = [ + { id: 1, name: 'Martin', firstName: 'Alex', club: 'Lille Escrime' }, + { id: 2, name: 'Nguyen', firstName: 'Sophie', club: 'Paris Epée' }, + { id: 3, name: 'Klein', firstName: 'Thomas', club: 'Strasbourg Sabre' }, + { id: 4, name: 'Leclerc', firstName: 'Lucie', club: 'Nice Fleuret' }, + { id: 5, name: 'Dubois', firstName: 'Hugo', club: 'Lyon Epée' }, + { id: 6, name: 'Girard', firstName: 'Manon', club: 'Marseille Club' }, + ]; + + constructor() { + console.log('[PlayerService] Initial players loaded:', this.players); + } + + getPlayers(): Observable { + console.log('[PlayerService] Fetching all players'); + return of(this.players); + } + + getPlayerById(id: number): Observable { + const player = this.players.find((p) => p.id === id); + console.log(`[PlayerService] Fetching player ID: ${id}`, player); + return of(player); + } +} diff --git a/FencerJudgeFront/src/app/services/referee.service.spec.ts b/FencerJudgeFront/src/app/services/referee.service.spec.ts new file mode 100644 index 0000000..b0f470c --- /dev/null +++ b/FencerJudgeFront/src/app/services/referee.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { RefereeService } from './referee.service'; + +describe('RefereeService', () => { + let service: RefereeService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(RefereeService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/FencerJudgeFront/src/app/services/referee.service.ts b/FencerJudgeFront/src/app/services/referee.service.ts new file mode 100644 index 0000000..6963230 --- /dev/null +++ b/FencerJudgeFront/src/app/services/referee.service.ts @@ -0,0 +1,42 @@ +import { Injectable } from '@angular/core'; +import { Observable, of } from 'rxjs'; +import { Referee, RefereeLevel } from '@interfaces/referee'; + +@Injectable({ providedIn: 'root' }) +export class RefereeService { + private referees: Referee[] = [ + { + id: 10, + name: 'Durand', + firstName: 'Pierre', + level: RefereeLevel.NATIONAL, + }, + { + id: 11, + name: 'Lemoine', + firstName: 'Anna', + level: RefereeLevel.REGIONAL, + }, + { + id: 12, + name: 'Morel', + firstName: 'Lucas', + level: RefereeLevel.DEPARTMENTAL, + }, + ]; + + constructor() { + console.log('[RefereeService] Initial referees loaded:', this.referees); + } + + getReferees(): Observable { + console.log('[RefereeService] Fetching all referees'); + return of(this.referees); + } + + getRefereeById(id: number): Observable { + const ref = this.referees.find((r) => r.id === id); + console.log(`[RefereeService] Fetching referee ID: ${id}`, ref); + return of(ref); + } +} diff --git a/FencerJudgeFront/tsconfig.json b/FencerJudgeFront/tsconfig.json index 5525117..06d41df 100644 --- a/FencerJudgeFront/tsconfig.json +++ b/FencerJudgeFront/tsconfig.json @@ -16,7 +16,13 @@ "moduleResolution": "bundler", "importHelpers": true, "target": "ES2022", - "module": "ES2022" + "module": "ES2022", + "baseUrl": "./src", + "paths": { + "@interfaces/*": ["app/interfaces/*"], + "@services/*": ["app/services/*"], + "@utils/*": ["app/utils/*"] + } }, "angularCompilerOptions": { "enableI18nLegacyMessageIdFormat": false, diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..966ef08 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "jpe-controle", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} -- 2.45.3 From 542435db99863009537e0eebbb91ee5955ed0e66 Mon Sep 17 00:00:00 2001 From: ExostFlash Date: Mon, 2 Jun 2025 10:24:50 +0200 Subject: [PATCH 03/19] Add connexion with app --- .../src/app/app-routing.module.ts | 15 ++++++-- FencerJudgeFront/src/app/app.module.ts | 16 +++++---- .../essentials/login/login.component.css | 0 .../essentials/login/login.component.html | 18 ++++++++++ .../essentials/login/login.component.spec.ts | 23 ++++++++++++ .../essentials/login/login.component.ts | 25 +++++++++++++ .../essentials/logout/logout.component.css | 0 .../essentials/logout/logout.component.html | 1 + .../logout/logout.component.spec.ts | 23 ++++++++++++ .../essentials/logout/logout.component.ts | 11 ++++++ .../src/app/components/home/home.component.ts | 6 ++-- .../src/app/guards/auth.guard.spec.ts | 17 +++++++++ FencerJudgeFront/src/app/guards/auth.guard.ts | 15 ++++++++ .../src/app/services/auth.service.spec.ts | 16 +++++++++ .../src/app/services/auth.service.ts | 35 +++++++++++++++++++ FencerJudgeFront/tsconfig.json | 8 ++++- 16 files changed, 214 insertions(+), 15 deletions(-) create mode 100644 FencerJudgeFront/src/app/components/essentials/login/login.component.css create mode 100644 FencerJudgeFront/src/app/components/essentials/login/login.component.html create mode 100644 FencerJudgeFront/src/app/components/essentials/login/login.component.spec.ts create mode 100644 FencerJudgeFront/src/app/components/essentials/login/login.component.ts create mode 100644 FencerJudgeFront/src/app/components/essentials/logout/logout.component.css create mode 100644 FencerJudgeFront/src/app/components/essentials/logout/logout.component.html create mode 100644 FencerJudgeFront/src/app/components/essentials/logout/logout.component.spec.ts create mode 100644 FencerJudgeFront/src/app/components/essentials/logout/logout.component.ts create mode 100644 FencerJudgeFront/src/app/guards/auth.guard.spec.ts create mode 100644 FencerJudgeFront/src/app/guards/auth.guard.ts create mode 100644 FencerJudgeFront/src/app/services/auth.service.spec.ts create mode 100644 FencerJudgeFront/src/app/services/auth.service.ts diff --git a/FencerJudgeFront/src/app/app-routing.module.ts b/FencerJudgeFront/src/app/app-routing.module.ts index 0297262..45896b5 100644 --- a/FencerJudgeFront/src/app/app-routing.module.ts +++ b/FencerJudgeFront/src/app/app-routing.module.ts @@ -1,10 +1,19 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; -const routes: Routes = []; +import { authGuard } from './guards/auth.guard'; + +import { LoginComponent } from './components/essentials/login/login.component'; +import { HomeComponent } from './components/home/home.component'; + +const routes: Routes = [ + { path: 'login', component: LoginComponent }, + { path: '', component: HomeComponent }, + { path: 'home', component: HomeComponent }, +]; @NgModule({ imports: [RouterModule.forRoot(routes)], - exports: [RouterModule] + exports: [RouterModule], }) -export class AppRoutingModule { } +export class AppRoutingModule {} diff --git a/FencerJudgeFront/src/app/app.module.ts b/FencerJudgeFront/src/app/app.module.ts index 6a4581d..1a172c4 100644 --- a/FencerJudgeFront/src/app/app.module.ts +++ b/FencerJudgeFront/src/app/app.module.ts @@ -1,24 +1,26 @@ import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; +import { FormsModule } from '@angular/forms'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { HeaderComponent } from './components/essentials/header/header.component'; import { FooterComponent } from './components/essentials/footer/footer.component'; import { HomeComponent } from './components/home/home.component'; +import { LoginComponent } from './components/essentials/login/login.component'; +import { LogoutComponent } from './components/essentials/logout/logout.component'; @NgModule({ declarations: [ AppComponent, HeaderComponent, FooterComponent, - HomeComponent - ], - imports: [ - BrowserModule, - AppRoutingModule + HomeComponent, + LoginComponent, + LogoutComponent, ], + imports: [BrowserModule, AppRoutingModule, FormsModule], providers: [], - bootstrap: [AppComponent] + bootstrap: [AppComponent], }) -export class AppModule { } +export class AppModule {} diff --git a/FencerJudgeFront/src/app/components/essentials/login/login.component.css b/FencerJudgeFront/src/app/components/essentials/login/login.component.css new file mode 100644 index 0000000..e69de29 diff --git a/FencerJudgeFront/src/app/components/essentials/login/login.component.html b/FencerJudgeFront/src/app/components/essentials/login/login.component.html new file mode 100644 index 0000000..4028cda --- /dev/null +++ b/FencerJudgeFront/src/app/components/essentials/login/login.component.html @@ -0,0 +1,18 @@ +
+ + + +
{{ errorMessage }}
+
diff --git a/FencerJudgeFront/src/app/components/essentials/login/login.component.spec.ts b/FencerJudgeFront/src/app/components/essentials/login/login.component.spec.ts new file mode 100644 index 0000000..4adbc3d --- /dev/null +++ b/FencerJudgeFront/src/app/components/essentials/login/login.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LoginComponent } from './login.component'; + +describe('LoginComponent', () => { + let component: LoginComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [LoginComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(LoginComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/FencerJudgeFront/src/app/components/essentials/login/login.component.ts b/FencerJudgeFront/src/app/components/essentials/login/login.component.ts new file mode 100644 index 0000000..3ff2888 --- /dev/null +++ b/FencerJudgeFront/src/app/components/essentials/login/login.component.ts @@ -0,0 +1,25 @@ +import { Component } from '@angular/core'; +import { Router } from '@angular/router'; +import { AuthService } from '@services/auth.service'; + +@Component({ + selector: 'app-login', + standalone: false, + templateUrl: './login.component.html', + styleUrl: './login.component.css', +}) +export class LoginComponent { + email = ''; + password = ''; + errorMessage = ''; + + constructor(private authService: AuthService, private router: Router) {} + + onSubmit() { + if (this.authService.login(this.email, this.password)) { + this.router.navigate(['/']); + } else { + this.errorMessage = 'Identifiants incorrects'; + } + } +} diff --git a/FencerJudgeFront/src/app/components/essentials/logout/logout.component.css b/FencerJudgeFront/src/app/components/essentials/logout/logout.component.css new file mode 100644 index 0000000..e69de29 diff --git a/FencerJudgeFront/src/app/components/essentials/logout/logout.component.html b/FencerJudgeFront/src/app/components/essentials/logout/logout.component.html new file mode 100644 index 0000000..c6ae40e --- /dev/null +++ b/FencerJudgeFront/src/app/components/essentials/logout/logout.component.html @@ -0,0 +1 @@ +

logout works!

diff --git a/FencerJudgeFront/src/app/components/essentials/logout/logout.component.spec.ts b/FencerJudgeFront/src/app/components/essentials/logout/logout.component.spec.ts new file mode 100644 index 0000000..074294b --- /dev/null +++ b/FencerJudgeFront/src/app/components/essentials/logout/logout.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LogoutComponent } from './logout.component'; + +describe('LogoutComponent', () => { + let component: LogoutComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [LogoutComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(LogoutComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/FencerJudgeFront/src/app/components/essentials/logout/logout.component.ts b/FencerJudgeFront/src/app/components/essentials/logout/logout.component.ts new file mode 100644 index 0000000..f8b8892 --- /dev/null +++ b/FencerJudgeFront/src/app/components/essentials/logout/logout.component.ts @@ -0,0 +1,11 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-logout', + standalone: false, + templateUrl: './logout.component.html', + styleUrl: './logout.component.css' +}) +export class LogoutComponent { + +} diff --git a/FencerJudgeFront/src/app/components/home/home.component.ts b/FencerJudgeFront/src/app/components/home/home.component.ts index 906862d..67af68d 100644 --- a/FencerJudgeFront/src/app/components/home/home.component.ts +++ b/FencerJudgeFront/src/app/components/home/home.component.ts @@ -4,8 +4,6 @@ import { Component } from '@angular/core'; selector: 'app-home', standalone: false, templateUrl: './home.component.html', - styleUrl: './home.component.css' + styleUrl: './home.component.css', }) -export class HomeComponent { - -} +export class HomeComponent {} diff --git a/FencerJudgeFront/src/app/guards/auth.guard.spec.ts b/FencerJudgeFront/src/app/guards/auth.guard.spec.ts new file mode 100644 index 0000000..4ae275e --- /dev/null +++ b/FencerJudgeFront/src/app/guards/auth.guard.spec.ts @@ -0,0 +1,17 @@ +import { TestBed } from '@angular/core/testing'; +import { CanActivateFn } from '@angular/router'; + +import { authGuard } from './auth.guard'; + +describe('authGuard', () => { + const executeGuard: CanActivateFn = (...guardParameters) => + TestBed.runInInjectionContext(() => authGuard(...guardParameters)); + + beforeEach(() => { + TestBed.configureTestingModule({}); + }); + + it('should be created', () => { + expect(executeGuard).toBeTruthy(); + }); +}); diff --git a/FencerJudgeFront/src/app/guards/auth.guard.ts b/FencerJudgeFront/src/app/guards/auth.guard.ts new file mode 100644 index 0000000..b3ed4e3 --- /dev/null +++ b/FencerJudgeFront/src/app/guards/auth.guard.ts @@ -0,0 +1,15 @@ +import { inject } from '@angular/core'; +import { CanActivateFn, Router } from '@angular/router'; +import { AuthService } from '@services/auth.service'; + +export const authGuard: CanActivateFn = (route, state) => { + const authService = inject(AuthService); + const router = inject(Router); + + if (!authService.isAuthenticated()) { + router.navigate(['/login']); + return false; + } + + return true; +}; diff --git a/FencerJudgeFront/src/app/services/auth.service.spec.ts b/FencerJudgeFront/src/app/services/auth.service.spec.ts new file mode 100644 index 0000000..f1251ca --- /dev/null +++ b/FencerJudgeFront/src/app/services/auth.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { AuthService } from './auth.service'; + +describe('AuthService', () => { + let service: AuthService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(AuthService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/FencerJudgeFront/src/app/services/auth.service.ts b/FencerJudgeFront/src/app/services/auth.service.ts new file mode 100644 index 0000000..522d786 --- /dev/null +++ b/FencerJudgeFront/src/app/services/auth.service.ts @@ -0,0 +1,35 @@ +import { Injectable } from '@angular/core'; +import { Router } from '@angular/router'; + +@Injectable({ + providedIn: 'root', +}) +export class AuthService { + private isLoggedIn = false; + private readonly hardcodedUser = { + email: 'user@test.com', + password: 'password123', + }; + + constructor(private router: Router) {} + + login(email: string, password: string): boolean { + if ( + email === this.hardcodedUser.email && + password === this.hardcodedUser.password + ) { + this.isLoggedIn = true; + return true; + } + return false; + } + + logout(): void { + this.isLoggedIn = false; + this.router.navigate(['/login']); + } + + isAuthenticated(): boolean { + return this.isLoggedIn; + } +} diff --git a/FencerJudgeFront/tsconfig.json b/FencerJudgeFront/tsconfig.json index 5525117..06d41df 100644 --- a/FencerJudgeFront/tsconfig.json +++ b/FencerJudgeFront/tsconfig.json @@ -16,7 +16,13 @@ "moduleResolution": "bundler", "importHelpers": true, "target": "ES2022", - "module": "ES2022" + "module": "ES2022", + "baseUrl": "./src", + "paths": { + "@interfaces/*": ["app/interfaces/*"], + "@services/*": ["app/services/*"], + "@utils/*": ["app/utils/*"] + } }, "angularCompilerOptions": { "enableI18nLegacyMessageIdFormat": false, -- 2.45.3 From b787a136699cdb6e7609b245e50429d9ea46e5c5 Mon Sep 17 00:00:00 2001 From: ExostFlash Date: Mon, 2 Jun 2025 10:36:29 +0200 Subject: [PATCH 04/19] Add @guards on the tsconfig.json --- FencerJudgeFront/src/app/app-routing.module.ts | 2 +- FencerJudgeFront/tsconfig.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/FencerJudgeFront/src/app/app-routing.module.ts b/FencerJudgeFront/src/app/app-routing.module.ts index 45896b5..0f8009a 100644 --- a/FencerJudgeFront/src/app/app-routing.module.ts +++ b/FencerJudgeFront/src/app/app-routing.module.ts @@ -1,7 +1,7 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; -import { authGuard } from './guards/auth.guard'; +import { authGuard } from '@guards/auth.guard'; import { LoginComponent } from './components/essentials/login/login.component'; import { HomeComponent } from './components/home/home.component'; diff --git a/FencerJudgeFront/tsconfig.json b/FencerJudgeFront/tsconfig.json index 06d41df..fca3db7 100644 --- a/FencerJudgeFront/tsconfig.json +++ b/FencerJudgeFront/tsconfig.json @@ -21,6 +21,7 @@ "paths": { "@interfaces/*": ["app/interfaces/*"], "@services/*": ["app/services/*"], + "@guards/*": ["app/guards/*"], "@utils/*": ["app/utils/*"] } }, -- 2.45.3 From e05f356beef1a7a6c329291617b7a6b2d97dd06c Mon Sep 17 00:00:00 2001 From: ExostFlash Date: Mon, 2 Jun 2025 13:25:51 +0200 Subject: [PATCH 05/19] modif --- .../src/app/app-routing.module.ts | 2 + .../essentials/footer/footer.component.html | 59 ++++++++++++++++++- .../essentials/header/header.component.html | 46 ++++++++++++++- .../essentials/header/header.component.ts | 18 +++++- .../essentials/logout/logout.component.ts | 9 ++- FencerJudgeFront/src/styles.css | 3 + 6 files changed, 132 insertions(+), 5 deletions(-) diff --git a/FencerJudgeFront/src/app/app-routing.module.ts b/FencerJudgeFront/src/app/app-routing.module.ts index 0f8009a..f88972f 100644 --- a/FencerJudgeFront/src/app/app-routing.module.ts +++ b/FencerJudgeFront/src/app/app-routing.module.ts @@ -4,10 +4,12 @@ import { RouterModule, Routes } from '@angular/router'; import { authGuard } from '@guards/auth.guard'; import { LoginComponent } from './components/essentials/login/login.component'; +import { LogoutComponent } from './components/essentials/logout/logout.component'; import { HomeComponent } from './components/home/home.component'; const routes: Routes = [ { path: 'login', component: LoginComponent }, + { path: 'logout', component: LogoutComponent }, { path: '', component: HomeComponent }, { path: 'home', component: HomeComponent }, ]; diff --git a/FencerJudgeFront/src/app/components/essentials/footer/footer.component.html b/FencerJudgeFront/src/app/components/essentials/footer/footer.component.html index 28c0d7d..d280498 100644 --- a/FencerJudgeFront/src/app/components/essentials/footer/footer.component.html +++ b/FencerJudgeFront/src/app/components/essentials/footer/footer.component.html @@ -1 +1,58 @@ -

footer works!

+ diff --git a/FencerJudgeFront/src/app/components/essentials/header/header.component.html b/FencerJudgeFront/src/app/components/essentials/header/header.component.html index 4f5a95d..b68cf30 100644 --- a/FencerJudgeFront/src/app/components/essentials/header/header.component.html +++ b/FencerJudgeFront/src/app/components/essentials/header/header.component.html @@ -1 +1,45 @@ -

header works!

+ + diff --git a/FencerJudgeFront/src/app/components/essentials/header/header.component.ts b/FencerJudgeFront/src/app/components/essentials/header/header.component.ts index ffc3163..8d32d92 100644 --- a/FencerJudgeFront/src/app/components/essentials/header/header.component.ts +++ b/FencerJudgeFront/src/app/components/essentials/header/header.component.ts @@ -1,4 +1,6 @@ import { Component } from '@angular/core'; +import { Router } from '@angular/router'; +import { AuthService } from '@services/auth.service'; @Component({ selector: 'app-header', @@ -6,4 +8,18 @@ import { Component } from '@angular/core'; templateUrl: './header.component.html', styleUrl: './header.component.css', }) -export class HeaderComponent {} +export class HeaderComponent { + constructor(private router: Router, public authService: AuthService) {} + + isHomeActive(): boolean { + return this.router.url === '/' || this.router.url === '/list'; + } + + isHomeActiveBool(): boolean { + if (this.router.url != '/list') { + return true; + } else { + return false; + } + } +} diff --git a/FencerJudgeFront/src/app/components/essentials/logout/logout.component.ts b/FencerJudgeFront/src/app/components/essentials/logout/logout.component.ts index f8b8892..6da5b61 100644 --- a/FencerJudgeFront/src/app/components/essentials/logout/logout.component.ts +++ b/FencerJudgeFront/src/app/components/essentials/logout/logout.component.ts @@ -1,11 +1,16 @@ import { Component } from '@angular/core'; +import { Router } from '@angular/router'; +import { AuthService } from '@services/auth.service'; @Component({ selector: 'app-logout', standalone: false, templateUrl: './logout.component.html', - styleUrl: './logout.component.css' + styleUrl: './logout.component.css', }) export class LogoutComponent { - + constructor(private authService: AuthService, private router: Router) { + this.authService.logout(); + this.router.navigate(['/']); // Redirection après déconnexion + } } diff --git a/FencerJudgeFront/src/styles.css b/FencerJudgeFront/src/styles.css index 90d4ee0..c44aac6 100644 --- a/FencerJudgeFront/src/styles.css +++ b/FencerJudgeFront/src/styles.css @@ -1 +1,4 @@ /* You can add global styles to this file, and also import other style files */ +.bg-primary-custom { + background-color: #414141; +} -- 2.45.3 From f61416c4d0989068efd70c62312a8ad59d0c7f4e Mon Sep 17 00:00:00 2001 From: ExostFlash Date: Mon, 2 Jun 2025 14:06:26 +0200 Subject: [PATCH 06/19] Add list matchs --- .../src/app/app-routing.module.ts | 2 + FencerJudgeFront/src/app/app.module.ts | 2 + .../components/matches/matches.component.css | 8 +++ .../components/matches/matches.component.html | 51 ++++++++++++++ .../matches/matches.component.spec.ts | 23 +++++++ .../components/matches/matches.component.ts | 66 +++++++++++++++++++ 6 files changed, 152 insertions(+) create mode 100644 FencerJudgeFront/src/app/components/matches/matches.component.css create mode 100644 FencerJudgeFront/src/app/components/matches/matches.component.html create mode 100644 FencerJudgeFront/src/app/components/matches/matches.component.spec.ts create mode 100644 FencerJudgeFront/src/app/components/matches/matches.component.ts diff --git a/FencerJudgeFront/src/app/app-routing.module.ts b/FencerJudgeFront/src/app/app-routing.module.ts index f88972f..5bf8bf7 100644 --- a/FencerJudgeFront/src/app/app-routing.module.ts +++ b/FencerJudgeFront/src/app/app-routing.module.ts @@ -6,12 +6,14 @@ import { authGuard } from '@guards/auth.guard'; import { LoginComponent } from './components/essentials/login/login.component'; import { LogoutComponent } from './components/essentials/logout/logout.component'; import { HomeComponent } from './components/home/home.component'; +import { MatchesComponent } from './components/matches/matches.component'; const routes: Routes = [ { path: 'login', component: LoginComponent }, { path: 'logout', component: LogoutComponent }, { path: '', component: HomeComponent }, { path: 'home', component: HomeComponent }, + { path: 'matches', component: MatchesComponent }, ]; @NgModule({ diff --git a/FencerJudgeFront/src/app/app.module.ts b/FencerJudgeFront/src/app/app.module.ts index 1a172c4..a3dd923 100644 --- a/FencerJudgeFront/src/app/app.module.ts +++ b/FencerJudgeFront/src/app/app.module.ts @@ -9,6 +9,7 @@ import { FooterComponent } from './components/essentials/footer/footer.component import { HomeComponent } from './components/home/home.component'; import { LoginComponent } from './components/essentials/login/login.component'; import { LogoutComponent } from './components/essentials/logout/logout.component'; +import { MatchesComponent } from './components/matches/matches.component'; @NgModule({ declarations: [ @@ -18,6 +19,7 @@ import { LogoutComponent } from './components/essentials/logout/logout.component HomeComponent, LoginComponent, LogoutComponent, + MatchesComponent, ], imports: [BrowserModule, AppRoutingModule, FormsModule], providers: [], diff --git a/FencerJudgeFront/src/app/components/matches/matches.component.css b/FencerJudgeFront/src/app/components/matches/matches.component.css new file mode 100644 index 0000000..2fa4ff6 --- /dev/null +++ b/FencerJudgeFront/src/app/components/matches/matches.component.css @@ -0,0 +1,8 @@ +.border-start-5 { + border-left: 5px solid #ccc; +} + +.card:hover { + transform: translateY(-2px); + transition: 0.2s ease-in-out; +} diff --git a/FencerJudgeFront/src/app/components/matches/matches.component.html b/FencerJudgeFront/src/app/components/matches/matches.component.html new file mode 100644 index 0000000..a5561bb --- /dev/null +++ b/FencerJudgeFront/src/app/components/matches/matches.component.html @@ -0,0 +1,51 @@ +
+

Liste des Matchs

+ +
+
+
+
+
+
+ {{ match.city }} — + {{ + match.date | date : "longDate" + }} +
+ {{ match.weapon }} +
+ +
+
+ {{ getPlayerName(match.player1ID) }} + {{ match.score1 }} +
+ +
vs
+ +
+ {{ getPlayerName(match.player2ID) }} + {{ match.score2 }} +
+
+ +
+ + {{ getMatchStatusLabel(match.state) }} + +
+
+
+
+
+
diff --git a/FencerJudgeFront/src/app/components/matches/matches.component.spec.ts b/FencerJudgeFront/src/app/components/matches/matches.component.spec.ts new file mode 100644 index 0000000..7f7c3e1 --- /dev/null +++ b/FencerJudgeFront/src/app/components/matches/matches.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MatchesComponent } from './matches.component'; + +describe('MatchesComponent', () => { + let component: MatchesComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [MatchesComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(MatchesComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/FencerJudgeFront/src/app/components/matches/matches.component.ts b/FencerJudgeFront/src/app/components/matches/matches.component.ts new file mode 100644 index 0000000..935e3d1 --- /dev/null +++ b/FencerJudgeFront/src/app/components/matches/matches.component.ts @@ -0,0 +1,66 @@ +import { Component } from '@angular/core'; + +import { MatchesService } from '@services/matches.service'; +import { Matches, MatchState } from '@interfaces/matches'; + +import { PlayerService } from '@services/player.service'; +import { Player } from '@interfaces/player'; + +@Component({ + selector: 'app-matches', + standalone: false, + templateUrl: './matches.component.html', + styleUrl: './matches.component.css', +}) +export class MatchesComponent { + matches: Matches[] = []; + playersMap: Map = new Map(); + MatchState = MatchState; + + constructor( + private matchesService: MatchesService, + private playerService: PlayerService + ) {} + + ngOnInit(): void { + this.playerService.getPlayers().subscribe((players) => { + // construire la map ID -> joueur + players.forEach((player) => this.playersMap.set(player.id, player)); + }); + + this.matchesService.getMatches().subscribe((data) => { + this.matches = data; + }); + } + + getPlayerName(id: number): string { + const player = this.playersMap.get(id); + return player ? `${player.firstName} ${player.name}` : 'Joueur inconnu'; + } + + getMatchBorderColor(state: MatchState): string { + switch (state) { + case MatchState.NOT_STARTED: + return 'border-secondary'; + case MatchState.ONGOING: + return 'border-warning'; + case MatchState.OVER: + return 'border-success'; + default: + return 'border-light'; + } + } + + getMatchStatusLabel(state: MatchState): string { + switch (state) { + case MatchState.NOT_STARTED: + return 'À venir'; + case MatchState.ONGOING: + return 'En cours'; + case MatchState.OVER: + return 'Terminé'; + default: + return 'Inconnu'; + } + } +} -- 2.45.3 From 83c6b6e504b5e8d2402636c29b150c23a3701b8c Mon Sep 17 00:00:00 2001 From: ExostFlash Date: Mon, 2 Jun 2025 15:04:33 +0200 Subject: [PATCH 07/19] modif match --- .../src/app/app-routing.module.ts | 2 + FencerJudgeFront/src/app/app.module.ts | 2 + .../matches-id/matches-id.component.css | 3 + .../matches-id/matches-id.component.html | 94 ++++++++++++ .../matches-id/matches-id.component.spec.ts | 23 +++ .../matches-id/matches-id.component.ts | 141 ++++++++++++++++++ .../components/matches/matches.component.html | 2 + .../components/matches/matches.component.ts | 8 +- .../src/app/services/matches.service.ts | 10 ++ 9 files changed, 284 insertions(+), 1 deletion(-) create mode 100644 FencerJudgeFront/src/app/components/matches-id/matches-id.component.css create mode 100644 FencerJudgeFront/src/app/components/matches-id/matches-id.component.html create mode 100644 FencerJudgeFront/src/app/components/matches-id/matches-id.component.spec.ts create mode 100644 FencerJudgeFront/src/app/components/matches-id/matches-id.component.ts diff --git a/FencerJudgeFront/src/app/app-routing.module.ts b/FencerJudgeFront/src/app/app-routing.module.ts index 5bf8bf7..fcdc89f 100644 --- a/FencerJudgeFront/src/app/app-routing.module.ts +++ b/FencerJudgeFront/src/app/app-routing.module.ts @@ -7,6 +7,7 @@ import { LoginComponent } from './components/essentials/login/login.component'; import { LogoutComponent } from './components/essentials/logout/logout.component'; import { HomeComponent } from './components/home/home.component'; import { MatchesComponent } from './components/matches/matches.component'; +import { MatchesIdComponent } from './components/matches-id/matches-id.component'; const routes: Routes = [ { path: 'login', component: LoginComponent }, @@ -14,6 +15,7 @@ const routes: Routes = [ { path: '', component: HomeComponent }, { path: 'home', component: HomeComponent }, { path: 'matches', component: MatchesComponent }, + { path: 'matches/:id', component: MatchesIdComponent }, ]; @NgModule({ diff --git a/FencerJudgeFront/src/app/app.module.ts b/FencerJudgeFront/src/app/app.module.ts index a3dd923..0c33646 100644 --- a/FencerJudgeFront/src/app/app.module.ts +++ b/FencerJudgeFront/src/app/app.module.ts @@ -10,6 +10,7 @@ import { HomeComponent } from './components/home/home.component'; import { LoginComponent } from './components/essentials/login/login.component'; import { LogoutComponent } from './components/essentials/logout/logout.component'; import { MatchesComponent } from './components/matches/matches.component'; +import { MatchesIdComponent } from './components/matches-id/matches-id.component'; @NgModule({ declarations: [ @@ -20,6 +21,7 @@ import { MatchesComponent } from './components/matches/matches.component'; LoginComponent, LogoutComponent, MatchesComponent, + MatchesIdComponent, ], imports: [BrowserModule, AppRoutingModule, FormsModule], providers: [], diff --git a/FencerJudgeFront/src/app/components/matches-id/matches-id.component.css b/FencerJudgeFront/src/app/components/matches-id/matches-id.component.css new file mode 100644 index 0000000..f517d5c --- /dev/null +++ b/FencerJudgeFront/src/app/components/matches-id/matches-id.component.css @@ -0,0 +1,3 @@ +.card { + border-left-width: 0.5rem !important; +} diff --git a/FencerJudgeFront/src/app/components/matches-id/matches-id.component.html b/FencerJudgeFront/src/app/components/matches-id/matches-id.component.html new file mode 100644 index 0000000..38721f0 --- /dev/null +++ b/FencerJudgeFront/src/app/components/matches-id/matches-id.component.html @@ -0,0 +1,94 @@ +
+

Détail du Match

+ +
+
+
+
+ {{ match.city }}, {{ match.country }} +
+ {{ match.date | date : "fullDate" }} - + {{ match.date | date : "shortTime" }} +
+ {{ match.weapon }} +
+ +
+
+ {{ player1?.firstName }} {{ player1?.name }}
+ {{ player1?.club }} +
+ +
+ + + {{ match.score1 }} + + vs + + {{ match.score2 }} + + + + + {{ match.score1 }} + vs + {{ match.score2 }} + +
+ +
+ {{ player2?.firstName }} {{ player2?.name }}
+ {{ player2?.club }} +
+
+ +
+ + {{ getMatchStateLabel(match.state) }} + +
+ +
+
Arbitre
+
+

+ {{ referee.firstName }} {{ referee.name }} +

+

+ Niveau : {{ getRefereeLevelLabel(referee.level) }} +

+
+
+

Arbitre non trouvé.

+
+
+
+
+
+ + +
+

Match non trouvé.

+
diff --git a/FencerJudgeFront/src/app/components/matches-id/matches-id.component.spec.ts b/FencerJudgeFront/src/app/components/matches-id/matches-id.component.spec.ts new file mode 100644 index 0000000..b09ff2d --- /dev/null +++ b/FencerJudgeFront/src/app/components/matches-id/matches-id.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MatchesIdComponent } from './matches-id.component'; + +describe('MatchesIdComponent', () => { + let component: MatchesIdComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [MatchesIdComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(MatchesIdComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/FencerJudgeFront/src/app/components/matches-id/matches-id.component.ts b/FencerJudgeFront/src/app/components/matches-id/matches-id.component.ts new file mode 100644 index 0000000..2e0be56 --- /dev/null +++ b/FencerJudgeFront/src/app/components/matches-id/matches-id.component.ts @@ -0,0 +1,141 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { AuthService } from '@services/auth.service'; + +import { MatchesService } from '@services/matches.service'; +import { MatchState, Matches } from '@interfaces/matches'; +import { PlayerService } from '@services/player.service'; +import { Player } from '@interfaces/player'; +import { RefereeService } from '@services/referee.service'; +import { Referee, RefereeLevel } from '@interfaces/referee'; + +@Component({ + selector: 'app-matches-id', + standalone: false, + templateUrl: './matches-id.component.html', + styleUrl: './matches-id.component.css', +}) +export class MatchesIdComponent implements OnInit { + match: Matches | undefined; + player1: Player | undefined; + player2: Player | undefined; + referee: Referee | undefined; + + constructor( + private route: ActivatedRoute, + private matchService: MatchesService, + private playerService: PlayerService, + private refereeService: RefereeService, + public authService: AuthService + ) {} + + ngOnInit(): void { + const id = Number(this.route.snapshot.paramMap.get('id')); + this.matchService.getMatchById(id).subscribe((match) => { + if (match) { + this.match = match; + + this.playerService + .getPlayerById(match.player1ID) + .subscribe((p1) => (this.player1 = p1!)); + this.playerService + .getPlayerById(match.player2ID) + .subscribe((p2) => (this.player2 = p2!)); + + this.refereeService + .getRefereeById(match.refereeID) + .subscribe((ref) => (this.referee = ref!)); + } + }); + } + + saveScores(): void { + if (this.match) { + this.matchService.updateMatch(this.match.id, { + score1: this.match.score1, + score2: this.match.score2, + }); + } + } + + getMatchStateLabel(state: MatchState): string { + switch (state) { + case MatchState.NOT_STARTED: + return 'À venir'; + case MatchState.ONGOING: + return 'En cours'; + case MatchState.OVER: + return 'Terminé'; + default: + return 'Inconnu'; + } + } + + getMatchStateColor(state: MatchState): string { + switch (state) { + case MatchState.NOT_STARTED: + return 'secondary'; + case MatchState.ONGOING: + return 'warning'; + case MatchState.OVER: + return 'success'; + default: + return 'light'; + } + } + + getRefereeLevelLabel(level: RefereeLevel): string { + switch (level) { + case RefereeLevel.NATIONAL: + return 'National'; + case RefereeLevel.REGIONAL: + return 'Régional'; + case RefereeLevel.DEPARTMENTAL: + return 'Départemental'; + default: + return 'Inconnu'; + } + } + + updateScores(): void { + if (this.match) { + this.matchService.updateMatch(this.match.id, { + score1: this.match.score1, + score2: this.match.score2, + }); + } + } + + incrementScore(player: 1 | 2): void { + if (!this.match) return; + + // Incrémente le score du joueur + if (player === 1) { + this.match.score1 += 1; + } else { + this.match.score2 += 1; + } + + // Change l'état en fonction des scores + if ( + this.match.score1 === 1 && + this.match.score2 === 0 && + this.match.state === MatchState.NOT_STARTED + ) { + this.match.state = MatchState.ONGOING; // passage à l'état 1 (en cours) + } else if ( + this.match.score2 === 1 && + this.match.score1 === 0 && + this.match.state === MatchState.NOT_STARTED + ) { + this.match.state = MatchState.ONGOING; + } + + // Si l'un des scores arrive à 15, on considère le match terminé + if (this.match.score1 >= 15 || this.match.score2 >= 15) { + this.match.state = MatchState.OVER; // passage à l'état 2 (terminé) + } + + this.updateScores(); + } +} diff --git a/FencerJudgeFront/src/app/components/matches/matches.component.html b/FencerJudgeFront/src/app/components/matches/matches.component.html index a5561bb..e7036ad 100644 --- a/FencerJudgeFront/src/app/components/matches/matches.component.html +++ b/FencerJudgeFront/src/app/components/matches/matches.component.html @@ -6,6 +6,8 @@
diff --git a/FencerJudgeFront/src/app/components/matches/matches.component.ts b/FencerJudgeFront/src/app/components/matches/matches.component.ts index 935e3d1..623f011 100644 --- a/FencerJudgeFront/src/app/components/matches/matches.component.ts +++ b/FencerJudgeFront/src/app/components/matches/matches.component.ts @@ -1,4 +1,5 @@ import { Component } from '@angular/core'; +import { Router } from '@angular/router'; import { MatchesService } from '@services/matches.service'; import { Matches, MatchState } from '@interfaces/matches'; @@ -19,7 +20,8 @@ export class MatchesComponent { constructor( private matchesService: MatchesService, - private playerService: PlayerService + private playerService: PlayerService, + private router: Router ) {} ngOnInit(): void { @@ -63,4 +65,8 @@ export class MatchesComponent { return 'Inconnu'; } } + + goToMatchDetail(matchId: number): void { + this.router.navigate(['/matches', matchId]); + } } diff --git a/FencerJudgeFront/src/app/services/matches.service.ts b/FencerJudgeFront/src/app/services/matches.service.ts index 12a6201..fef45dd 100644 --- a/FencerJudgeFront/src/app/services/matches.service.ts +++ b/FencerJudgeFront/src/app/services/matches.service.ts @@ -68,4 +68,14 @@ export class MatchesService { ); // ici tu pourrais plus tard faire : this.socket = new WebSocket('ws://...') etc. } + + updateMatch(id: number, updatedData: Partial): void { + const match = this.matches.find((m) => m.id === id); + if (match) { + Object.assign(match, updatedData); + console.log(`[MatchesService] Match ${id} mis à jour :`, match); + } else { + console.warn(`[MatchesService] Match ${id} introuvable`); + } + } } -- 2.45.3 From 5a8ea535979fc7bdbe8c91dcc815bce246337e22 Mon Sep 17 00:00:00 2001 From: ExostFlash Date: Mon, 2 Jun 2025 16:17:17 +0200 Subject: [PATCH 08/19] modif --- FencerJudgeFront/src/app/app-routing.module.ts | 8 ++++++-- FencerJudgeFront/src/app/app.module.ts | 4 ++-- .../app/components/essentials/header/header.component.ts | 2 +- .../app/components/essentials/login/login.component.ts | 2 +- .../app/components/essentials/logout/logout.component.ts | 2 +- .../{ => match}/matches-id/matches-id.component.css | 0 .../{ => match}/matches-id/matches-id.component.html | 8 ++++---- .../{ => match}/matches-id/matches-id.component.spec.ts | 0 .../{ => match}/matches-id/matches-id.component.ts | 8 ++++---- .../components/{ => match}/matches/matches.component.css | 0 .../components/{ => match}/matches/matches.component.html | 0 .../{ => match}/matches/matches.component.spec.ts | 0 .../components/{ => match}/matches/matches.component.ts | 4 ++-- FencerJudgeFront/src/app/guards/auth.guard.ts | 2 +- .../src/app/services/{ => auth}/auth.service.spec.ts | 0 .../src/app/services/{ => auth}/auth.service.ts | 0 .../app/services/{ => matches}/matches.service.spec.ts | 0 .../src/app/services/{ => matches}/matches.service.ts | 0 .../src/app/services/{ => player}/player.service.spec.ts | 0 .../src/app/services/{ => player}/player.service.ts | 0 .../app/services/{ => referee}/referee.service.spec.ts | 0 .../src/app/services/{ => referee}/referee.service.ts | 0 22 files changed, 22 insertions(+), 18 deletions(-) rename FencerJudgeFront/src/app/components/{ => match}/matches-id/matches-id.component.css (100%) rename FencerJudgeFront/src/app/components/{ => match}/matches-id/matches-id.component.html (90%) rename FencerJudgeFront/src/app/components/{ => match}/matches-id/matches-id.component.spec.ts (100%) rename FencerJudgeFront/src/app/components/{ => match}/matches-id/matches-id.component.ts (93%) rename FencerJudgeFront/src/app/components/{ => match}/matches/matches.component.css (100%) rename FencerJudgeFront/src/app/components/{ => match}/matches/matches.component.html (100%) rename FencerJudgeFront/src/app/components/{ => match}/matches/matches.component.spec.ts (100%) rename FencerJudgeFront/src/app/components/{ => match}/matches/matches.component.ts (93%) rename FencerJudgeFront/src/app/services/{ => auth}/auth.service.spec.ts (100%) rename FencerJudgeFront/src/app/services/{ => auth}/auth.service.ts (100%) rename FencerJudgeFront/src/app/services/{ => matches}/matches.service.spec.ts (100%) rename FencerJudgeFront/src/app/services/{ => matches}/matches.service.ts (100%) rename FencerJudgeFront/src/app/services/{ => player}/player.service.spec.ts (100%) rename FencerJudgeFront/src/app/services/{ => player}/player.service.ts (100%) rename FencerJudgeFront/src/app/services/{ => referee}/referee.service.spec.ts (100%) rename FencerJudgeFront/src/app/services/{ => referee}/referee.service.ts (100%) diff --git a/FencerJudgeFront/src/app/app-routing.module.ts b/FencerJudgeFront/src/app/app-routing.module.ts index fcdc89f..b958478 100644 --- a/FencerJudgeFront/src/app/app-routing.module.ts +++ b/FencerJudgeFront/src/app/app-routing.module.ts @@ -5,15 +5,19 @@ import { authGuard } from '@guards/auth.guard'; import { LoginComponent } from './components/essentials/login/login.component'; import { LogoutComponent } from './components/essentials/logout/logout.component'; + import { HomeComponent } from './components/home/home.component'; -import { MatchesComponent } from './components/matches/matches.component'; -import { MatchesIdComponent } from './components/matches-id/matches-id.component'; + +import { MatchesComponent } from './components/match/matches/matches.component'; +import { MatchesIdComponent } from './components/match/matches-id/matches-id.component'; const routes: Routes = [ { path: 'login', component: LoginComponent }, { path: 'logout', component: LogoutComponent }, + { path: '', component: HomeComponent }, { path: 'home', component: HomeComponent }, + { path: 'matches', component: MatchesComponent }, { path: 'matches/:id', component: MatchesIdComponent }, ]; diff --git a/FencerJudgeFront/src/app/app.module.ts b/FencerJudgeFront/src/app/app.module.ts index 0c33646..e17ffe8 100644 --- a/FencerJudgeFront/src/app/app.module.ts +++ b/FencerJudgeFront/src/app/app.module.ts @@ -9,8 +9,8 @@ import { FooterComponent } from './components/essentials/footer/footer.component import { HomeComponent } from './components/home/home.component'; import { LoginComponent } from './components/essentials/login/login.component'; import { LogoutComponent } from './components/essentials/logout/logout.component'; -import { MatchesComponent } from './components/matches/matches.component'; -import { MatchesIdComponent } from './components/matches-id/matches-id.component'; +import { MatchesComponent } from './components/match/matches/matches.component'; +import { MatchesIdComponent } from './components/match/matches-id/matches-id.component'; @NgModule({ declarations: [ diff --git a/FencerJudgeFront/src/app/components/essentials/header/header.component.ts b/FencerJudgeFront/src/app/components/essentials/header/header.component.ts index 8d32d92..cb059ae 100644 --- a/FencerJudgeFront/src/app/components/essentials/header/header.component.ts +++ b/FencerJudgeFront/src/app/components/essentials/header/header.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; import { Router } from '@angular/router'; -import { AuthService } from '@services/auth.service'; +import { AuthService } from '@services/auth/auth.service'; @Component({ selector: 'app-header', diff --git a/FencerJudgeFront/src/app/components/essentials/login/login.component.ts b/FencerJudgeFront/src/app/components/essentials/login/login.component.ts index 3ff2888..f7b137a 100644 --- a/FencerJudgeFront/src/app/components/essentials/login/login.component.ts +++ b/FencerJudgeFront/src/app/components/essentials/login/login.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; import { Router } from '@angular/router'; -import { AuthService } from '@services/auth.service'; +import { AuthService } from '@services/auth/auth.service'; @Component({ selector: 'app-login', diff --git a/FencerJudgeFront/src/app/components/essentials/logout/logout.component.ts b/FencerJudgeFront/src/app/components/essentials/logout/logout.component.ts index 6da5b61..7945a95 100644 --- a/FencerJudgeFront/src/app/components/essentials/logout/logout.component.ts +++ b/FencerJudgeFront/src/app/components/essentials/logout/logout.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; import { Router } from '@angular/router'; -import { AuthService } from '@services/auth.service'; +import { AuthService } from '@services/auth/auth.service'; @Component({ selector: 'app-logout', diff --git a/FencerJudgeFront/src/app/components/matches-id/matches-id.component.css b/FencerJudgeFront/src/app/components/match/matches-id/matches-id.component.css similarity index 100% rename from FencerJudgeFront/src/app/components/matches-id/matches-id.component.css rename to FencerJudgeFront/src/app/components/match/matches-id/matches-id.component.css diff --git a/FencerJudgeFront/src/app/components/matches-id/matches-id.component.html b/FencerJudgeFront/src/app/components/match/matches-id/matches-id.component.html similarity index 90% rename from FencerJudgeFront/src/app/components/matches-id/matches-id.component.html rename to FencerJudgeFront/src/app/components/match/matches-id/matches-id.component.html index 38721f0..3e82262 100644 --- a/FencerJudgeFront/src/app/components/matches-id/matches-id.component.html +++ b/FencerJudgeFront/src/app/components/match/matches-id/matches-id.component.html @@ -21,9 +21,9 @@
- {{ player1?.firstName }} {{ player1?.name }}{{ player1.firstName }} {{ player1.name }}
- {{ player1?.club }} + {{ player1.club }}
@@ -58,9 +58,9 @@
- {{ player2?.firstName }} {{ player2?.name }}{{ player2.firstName }} {{ player2.name }}
- {{ player2?.club }} + {{ player2.club }}
diff --git a/FencerJudgeFront/src/app/components/matches-id/matches-id.component.spec.ts b/FencerJudgeFront/src/app/components/match/matches-id/matches-id.component.spec.ts similarity index 100% rename from FencerJudgeFront/src/app/components/matches-id/matches-id.component.spec.ts rename to FencerJudgeFront/src/app/components/match/matches-id/matches-id.component.spec.ts diff --git a/FencerJudgeFront/src/app/components/matches-id/matches-id.component.ts b/FencerJudgeFront/src/app/components/match/matches-id/matches-id.component.ts similarity index 93% rename from FencerJudgeFront/src/app/components/matches-id/matches-id.component.ts rename to FencerJudgeFront/src/app/components/match/matches-id/matches-id.component.ts index 2e0be56..65d932b 100644 --- a/FencerJudgeFront/src/app/components/matches-id/matches-id.component.ts +++ b/FencerJudgeFront/src/app/components/match/matches-id/matches-id.component.ts @@ -1,12 +1,12 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; -import { AuthService } from '@services/auth.service'; +import { AuthService } from '@services/auth/auth.service'; -import { MatchesService } from '@services/matches.service'; +import { MatchesService } from '@services/matches/matches.service'; import { MatchState, Matches } from '@interfaces/matches'; -import { PlayerService } from '@services/player.service'; +import { PlayerService } from '@services/player/player.service'; import { Player } from '@interfaces/player'; -import { RefereeService } from '@services/referee.service'; +import { RefereeService } from '@services/referee/referee.service'; import { Referee, RefereeLevel } from '@interfaces/referee'; @Component({ diff --git a/FencerJudgeFront/src/app/components/matches/matches.component.css b/FencerJudgeFront/src/app/components/match/matches/matches.component.css similarity index 100% rename from FencerJudgeFront/src/app/components/matches/matches.component.css rename to FencerJudgeFront/src/app/components/match/matches/matches.component.css diff --git a/FencerJudgeFront/src/app/components/matches/matches.component.html b/FencerJudgeFront/src/app/components/match/matches/matches.component.html similarity index 100% rename from FencerJudgeFront/src/app/components/matches/matches.component.html rename to FencerJudgeFront/src/app/components/match/matches/matches.component.html diff --git a/FencerJudgeFront/src/app/components/matches/matches.component.spec.ts b/FencerJudgeFront/src/app/components/match/matches/matches.component.spec.ts similarity index 100% rename from FencerJudgeFront/src/app/components/matches/matches.component.spec.ts rename to FencerJudgeFront/src/app/components/match/matches/matches.component.spec.ts diff --git a/FencerJudgeFront/src/app/components/matches/matches.component.ts b/FencerJudgeFront/src/app/components/match/matches/matches.component.ts similarity index 93% rename from FencerJudgeFront/src/app/components/matches/matches.component.ts rename to FencerJudgeFront/src/app/components/match/matches/matches.component.ts index 623f011..a1cf3dc 100644 --- a/FencerJudgeFront/src/app/components/matches/matches.component.ts +++ b/FencerJudgeFront/src/app/components/match/matches/matches.component.ts @@ -1,10 +1,10 @@ import { Component } from '@angular/core'; import { Router } from '@angular/router'; -import { MatchesService } from '@services/matches.service'; +import { MatchesService } from '@services/matches/matches.service'; import { Matches, MatchState } from '@interfaces/matches'; -import { PlayerService } from '@services/player.service'; +import { PlayerService } from '@services/player/player.service'; import { Player } from '@interfaces/player'; @Component({ diff --git a/FencerJudgeFront/src/app/guards/auth.guard.ts b/FencerJudgeFront/src/app/guards/auth.guard.ts index b3ed4e3..2da4546 100644 --- a/FencerJudgeFront/src/app/guards/auth.guard.ts +++ b/FencerJudgeFront/src/app/guards/auth.guard.ts @@ -1,6 +1,6 @@ import { inject } from '@angular/core'; import { CanActivateFn, Router } from '@angular/router'; -import { AuthService } from '@services/auth.service'; +import { AuthService } from '@services/auth/auth.service'; export const authGuard: CanActivateFn = (route, state) => { const authService = inject(AuthService); diff --git a/FencerJudgeFront/src/app/services/auth.service.spec.ts b/FencerJudgeFront/src/app/services/auth/auth.service.spec.ts similarity index 100% rename from FencerJudgeFront/src/app/services/auth.service.spec.ts rename to FencerJudgeFront/src/app/services/auth/auth.service.spec.ts diff --git a/FencerJudgeFront/src/app/services/auth.service.ts b/FencerJudgeFront/src/app/services/auth/auth.service.ts similarity index 100% rename from FencerJudgeFront/src/app/services/auth.service.ts rename to FencerJudgeFront/src/app/services/auth/auth.service.ts diff --git a/FencerJudgeFront/src/app/services/matches.service.spec.ts b/FencerJudgeFront/src/app/services/matches/matches.service.spec.ts similarity index 100% rename from FencerJudgeFront/src/app/services/matches.service.spec.ts rename to FencerJudgeFront/src/app/services/matches/matches.service.spec.ts diff --git a/FencerJudgeFront/src/app/services/matches.service.ts b/FencerJudgeFront/src/app/services/matches/matches.service.ts similarity index 100% rename from FencerJudgeFront/src/app/services/matches.service.ts rename to FencerJudgeFront/src/app/services/matches/matches.service.ts diff --git a/FencerJudgeFront/src/app/services/player.service.spec.ts b/FencerJudgeFront/src/app/services/player/player.service.spec.ts similarity index 100% rename from FencerJudgeFront/src/app/services/player.service.spec.ts rename to FencerJudgeFront/src/app/services/player/player.service.spec.ts diff --git a/FencerJudgeFront/src/app/services/player.service.ts b/FencerJudgeFront/src/app/services/player/player.service.ts similarity index 100% rename from FencerJudgeFront/src/app/services/player.service.ts rename to FencerJudgeFront/src/app/services/player/player.service.ts diff --git a/FencerJudgeFront/src/app/services/referee.service.spec.ts b/FencerJudgeFront/src/app/services/referee/referee.service.spec.ts similarity index 100% rename from FencerJudgeFront/src/app/services/referee.service.spec.ts rename to FencerJudgeFront/src/app/services/referee/referee.service.spec.ts diff --git a/FencerJudgeFront/src/app/services/referee.service.ts b/FencerJudgeFront/src/app/services/referee/referee.service.ts similarity index 100% rename from FencerJudgeFront/src/app/services/referee.service.ts rename to FencerJudgeFront/src/app/services/referee/referee.service.ts -- 2.45.3 From d56d17724a99d8fa9341098bf14fc04b41a20fff Mon Sep 17 00:00:00 2001 From: DarkMax31 Date: Mon, 2 Jun 2025 16:18:54 +0200 Subject: [PATCH 09/19] front --- .../essentials/footer/footer.component.css | 21 ++++ .../essentials/footer/footer.component.html | 3 +- .../essentials/header/header.component.css | 25 +++++ .../essentials/header/header.component.html | 2 +- .../essentials/login/login.component.css | 101 ++++++++++++++++++ .../essentials/login/login.component.html | 46 ++++---- .../app/components/home/home.component.html | 2 +- 7 files changed, 179 insertions(+), 21 deletions(-) diff --git a/FencerJudgeFront/src/app/components/essentials/footer/footer.component.css b/FencerJudgeFront/src/app/components/essentials/footer/footer.component.css index e69de29..a76370e 100644 --- a/FencerJudgeFront/src/app/components/essentials/footer/footer.component.css +++ b/FencerJudgeFront/src/app/components/essentials/footer/footer.component.css @@ -0,0 +1,21 @@ + +.footer-gris { + background-color: #2c2c2c; /* Gris foncé personnalisé */ +} + +.flag-bar { + height: 6px; /* épaisseur du trait */ + width: 100%; /* toute la largeur */ + background: linear-gradient( + to right, + #0055a4 0%, /* bleu */ + #0055a4 33.33%, /* 1/3 */ + #fff 33.33%, /* blanc */ + #fff 66.66%, /* 2/3 */ + #ef4135 66.66%, /* rouge */ + #ef4135 100% + ); + margin-bottom: 8px; + border-radius: 3px; /* optionnel, pour arrondir les bords */ + box-shadow: 0 1px 3px rgba(0,0,0,0.1); +} \ No newline at end of file diff --git a/FencerJudgeFront/src/app/components/essentials/footer/footer.component.html b/FencerJudgeFront/src/app/components/essentials/footer/footer.component.html index d280498..01eca56 100644 --- a/FencerJudgeFront/src/app/components/essentials/footer/footer.component.html +++ b/FencerJudgeFront/src/app/components/essentials/footer/footer.component.html @@ -1,4 +1,4 @@ -
+ diff --git a/FencerJudgeFront/src/app/components/essentials/header/header.component.css b/FencerJudgeFront/src/app/components/essentials/header/header.component.css index e69de29..9df8f3d 100644 --- a/FencerJudgeFront/src/app/components/essentials/header/header.component.css +++ b/FencerJudgeFront/src/app/components/essentials/header/header.component.css @@ -0,0 +1,25 @@ +.navbar { + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); +} + +.navbar-brand { + font-weight: 700; + font-size: 1.4rem; + display: flex; + align-items: center; +} + +.navbar-brand img { + height: 30px; + margin-right: 0.5rem; +} + +.nav-link { + transition: color 0.3s ease; +} + +.nav-link:hover, +.active-link { + color: #ffcc00 !important; + font-weight: 600; +} diff --git a/FencerJudgeFront/src/app/components/essentials/header/header.component.html b/FencerJudgeFront/src/app/components/essentials/header/header.component.html index b68cf30..38e238f 100644 --- a/FencerJudgeFront/src/app/components/essentials/header/header.component.html +++ b/FencerJudgeFront/src/app/components/essentials/header/header.component.html @@ -20,7 +20,7 @@ [routerLinkActiveOptions]="{ exact: isHomeActiveBool() }" [class.active-link]="isHomeActive()" > - Match + Matchs
  • - - - -
    {{ errorMessage }}
    - + diff --git a/FencerJudgeFront/src/app/components/home/home.component.html b/FencerJudgeFront/src/app/components/home/home.component.html index 5f2c53f..a1ac75f 100644 --- a/FencerJudgeFront/src/app/components/home/home.component.html +++ b/FencerJudgeFront/src/app/components/home/home.component.html @@ -1 +1 @@ -

    home works!

    +

    HELLO !

    -- 2.45.3 From 4d2d6608e7fda832d135e347b19dbe7e82c0bebc Mon Sep 17 00:00:00 2001 From: ExostFlash Date: Mon, 2 Jun 2025 16:57:44 +0200 Subject: [PATCH 10/19] Modif --- .../essentials/header/header.component.html | 2 - .../essentials/header/header.component.ts | 4 +- .../essentials/login/login.component.css | 45 ++++++++++++++----- .../essentials/login/login.component.html | 26 ++++++----- 4 files changed, 51 insertions(+), 26 deletions(-) diff --git a/FencerJudgeFront/src/app/components/essentials/header/header.component.html b/FencerJudgeFront/src/app/components/essentials/header/header.component.html index 38e238f..d0e7a6f 100644 --- a/FencerJudgeFront/src/app/components/essentials/header/header.component.html +++ b/FencerJudgeFront/src/app/components/essentials/header/header.component.html @@ -17,8 +17,6 @@ class="nav-link" routerLink="/matches" routerLinkActive="active-link" - [routerLinkActiveOptions]="{ exact: isHomeActiveBool() }" - [class.active-link]="isHomeActive()" > Matchs diff --git a/FencerJudgeFront/src/app/components/essentials/header/header.component.ts b/FencerJudgeFront/src/app/components/essentials/header/header.component.ts index cb059ae..6b0a735 100644 --- a/FencerJudgeFront/src/app/components/essentials/header/header.component.ts +++ b/FencerJudgeFront/src/app/components/essentials/header/header.component.ts @@ -12,11 +12,11 @@ export class HeaderComponent { constructor(private router: Router, public authService: AuthService) {} isHomeActive(): boolean { - return this.router.url === '/' || this.router.url === '/list'; + return this.router.url === '/' || this.router.url === '/home'; } isHomeActiveBool(): boolean { - if (this.router.url != '/list') { + if (this.router.url != '/home') { return true; } else { return false; diff --git a/FencerJudgeFront/src/app/components/essentials/login/login.component.css b/FencerJudgeFront/src/app/components/essentials/login/login.component.css index af759d0..2a0292b 100644 --- a/FencerJudgeFront/src/app/components/essentials/login/login.component.css +++ b/FencerJudgeFront/src/app/components/essentials/login/login.component.css @@ -1,15 +1,8 @@ -body { - margin: 0; - font-family: 'Segoe UI', sans-serif; - background: linear-gradient(to bottom, #235d4f, #63b48c); - color: #fff; -} - .login-container { display: flex; justify-content: center; align-items: center; - min-height: 100vh; + min-height: 25vh; padding: 2rem; } @@ -22,13 +15,43 @@ body { color: #333; } +.login-header-img { + position: absolute; + height: inherit; + width: 100%; + background-color: rgba(0, 0, 0, 0.25); + top: 0; + left: 0; +} + .login-header { - background: url('https://www.lejdd.fr/lmnr/var/jdd/public/media/image/2022/07/19/12/escrime-comment-les-francais-apprivoisent-leurs-armes.jpg?VersionId=Mw31AogdDUwVLuCaVdxMozm9kito7TTP') no-repeat center/cover; - text-align: center; - padding: 2rem 1rem; + background: url("https://www.lejdd.fr/lmnr/var/jdd/public/media/image/2022/07/19/12/escrime-comment-les-francais-apprivoisent-leurs-armes.jpg?VersionId=Mw31AogdDUwVLuCaVdxMozm9kito7TTP") + no-repeat center/cover; + position: relative; + padding: 4rem 1rem; + display: flex; + justify-content: center; + align-items: center; + min-height: 300px; color: white; } +.login-header::before { + content: ""; + position: absolute; + inset: 0; + background: rgba(0, 0, 0, 0.3); /* voile sombre */ + backdrop-filter: blur(2px); /* effet de flou */ + z-index: 1; + border-radius: 0.5rem; +} + +.login-header h1 { + position: relative; + z-index: 2; + padding: 2rem; +} + .login-header h2 { margin-bottom: 0.5rem; } diff --git a/FencerJudgeFront/src/app/components/essentials/login/login.component.html b/FencerJudgeFront/src/app/components/essentials/login/login.component.html index 1fc3520..980a230 100644 --- a/FencerJudgeFront/src/app/components/essentials/login/login.component.html +++ b/FencerJudgeFront/src/app/components/essentials/login/login.component.html @@ -1,25 +1,29 @@ -
  • +
    \ No newline at end of file -- 2.45.3 From 5a73a70e0252b22c51b2a3a78e858d4ba25f9664 Mon Sep 17 00:00:00 2001 From: ExostFlash Date: Mon, 2 Jun 2025 18:35:15 +0200 Subject: [PATCH 12/19] add Matches Add --- .../src/app/app-routing.module.ts | 6 ++ FencerJudgeFront/src/app/app.module.ts | 2 + .../essentials/footer/footer.component.html | 7 +- .../essentials/header/header.component.html | 9 ++ .../matches-add/matches-add.component.css | 0 .../matches-add/matches-add.component.html | 1 + .../matches-add/matches-add.component.spec.ts | 23 +++++ .../matches-add/matches-add.component.ts | 96 +++++++++++++++++++ .../match/matches-id/matches-id.component.ts | 2 + .../app/services/matches/matches.service.ts | 12 +++ .../src/app/services/player/player.service.ts | 31 ++++++ .../app/services/referee/referee.service.ts | 31 ++++++ db.lock.db | 6 ++ 13 files changed, 220 insertions(+), 6 deletions(-) create mode 100644 FencerJudgeFront/src/app/components/match/matches-add/matches-add.component.css create mode 100644 FencerJudgeFront/src/app/components/match/matches-add/matches-add.component.html create mode 100644 FencerJudgeFront/src/app/components/match/matches-add/matches-add.component.spec.ts create mode 100644 FencerJudgeFront/src/app/components/match/matches-add/matches-add.component.ts create mode 100644 db.lock.db diff --git a/FencerJudgeFront/src/app/app-routing.module.ts b/FencerJudgeFront/src/app/app-routing.module.ts index b958478..a1cc001 100644 --- a/FencerJudgeFront/src/app/app-routing.module.ts +++ b/FencerJudgeFront/src/app/app-routing.module.ts @@ -10,6 +10,7 @@ import { HomeComponent } from './components/home/home.component'; import { MatchesComponent } from './components/match/matches/matches.component'; import { MatchesIdComponent } from './components/match/matches-id/matches-id.component'; +import { MatchesAddComponent } from './components/match/matches-add/matches-add.component'; const routes: Routes = [ { path: 'login', component: LoginComponent }, @@ -19,6 +20,11 @@ const routes: Routes = [ { path: 'home', component: HomeComponent }, { path: 'matches', component: MatchesComponent }, + { + path: 'matches/add', + component: MatchesAddComponent, + canActivate: [authGuard], + }, { path: 'matches/:id', component: MatchesIdComponent }, ]; diff --git a/FencerJudgeFront/src/app/app.module.ts b/FencerJudgeFront/src/app/app.module.ts index e17ffe8..f035f52 100644 --- a/FencerJudgeFront/src/app/app.module.ts +++ b/FencerJudgeFront/src/app/app.module.ts @@ -11,6 +11,7 @@ import { LoginComponent } from './components/essentials/login/login.component'; import { LogoutComponent } from './components/essentials/logout/logout.component'; import { MatchesComponent } from './components/match/matches/matches.component'; import { MatchesIdComponent } from './components/match/matches-id/matches-id.component'; +import { MatchesAddComponent } from './components/match/matches-add/matches-add.component'; @NgModule({ declarations: [ @@ -22,6 +23,7 @@ import { MatchesIdComponent } from './components/match/matches-id/matches-id.com LogoutComponent, MatchesComponent, MatchesIdComponent, + MatchesAddComponent, ], imports: [BrowserModule, AppRoutingModule, FormsModule], providers: [], diff --git a/FencerJudgeFront/src/app/components/essentials/footer/footer.component.html b/FencerJudgeFront/src/app/components/essentials/footer/footer.component.html index 01eca56..86a3a7b 100644 --- a/FencerJudgeFront/src/app/components/essentials/footer/footer.component.html +++ b/FencerJudgeFront/src/app/components/essentials/footer/footer.component.html @@ -47,12 +47,7 @@
    - © FencerJudge - Tous droits réservés - Mentions légales - Cookies - Accessibilité - Nous contacter - Presse + © FencerJudge - Tous droits réservés
    diff --git a/FencerJudgeFront/src/app/components/essentials/header/header.component.html b/FencerJudgeFront/src/app/components/essentials/header/header.component.html index d0e7a6f..c8ae8e8 100644 --- a/FencerJudgeFront/src/app/components/essentials/header/header.component.html +++ b/FencerJudgeFront/src/app/components/essentials/header/header.component.html @@ -21,6 +21,15 @@ Matchs +