diff --git a/.idea/gradle.xml b/.idea/gradle.xml deleted file mode 100644 index 1126539..0000000 --- a/.idea/gradle.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml deleted file mode 100644 index eeec968..0000000 --- a/.idea/kotlinc.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index cb90649..a7e1300 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -4,7 +4,7 @@ - + \ No newline at end of file diff --git a/FencerJudgeBack/build.gradle.kts b/FencerJudgeBack/build.gradle.kts index e72e48d..f64df6d 100644 --- a/FencerJudgeBack/build.gradle.kts +++ b/FencerJudgeBack/build.gradle.kts @@ -33,7 +33,7 @@ dependencies { implementation("org.springframework.boot:spring-boot-starter-websocket") // SECURITY - implementation("org.springframework.boot:spring-boot-starter-security") +// implementation("org.springframework.boot:spring-boot-starter-security") // H2 Database runtimeOnly("com.h2database:h2") diff --git a/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/config/ConfigSecurity.kt b/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/config/ConfigSecurity.kt deleted file mode 100644 index 373883d..0000000 --- a/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/config/ConfigSecurity.kt +++ /dev/null @@ -1,56 +0,0 @@ -package fr.teamflash.fencerjudgeback.config - -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.context.annotation.Bean -import org.springframework.context.annotation.Configuration -import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder -import org.springframework.security.config.annotation.web.builders.HttpSecurity -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity -import org.springframework.security.core.userdetails.User -import org.springframework.security.core.userdetails.UserDetailsService -import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder -import org.springframework.security.provisioning.InMemoryUserDetailsManager -import org.springframework.security.web.SecurityFilterChain - -@Configuration -@EnableWebSecurity -class SecurityConfig { - - @Autowired - open fun configureGlobal(auth: AuthenticationManagerBuilder) { - val encoder = BCryptPasswordEncoder() - - //Créer des utilisateurs fixes - auth.inMemoryAuthentication() - .passwordEncoder(encoder) - .withUser("aaa") - .password(encoder.encode("bbb")) - .roles("USER") - .and() - .withUser("Admin") - .password(encoder.encode("Admin")) - .roles("ADMIN") - } - - @Bean - open fun securityFilterChain(http: HttpSecurity): SecurityFilterChain { - http.authorizeHttpRequests { authorize -> - authorize.requestMatchers("/ws/*").authenticated() - .anyRequest().permitAll() - } - .httpBasic { } - .formLogin { } - .csrf { it.disable() } - return http.build() - } - - @Bean - fun userDetailsService(): UserDetailsService { - val user = User.withUsername("user") - .password("{noop}password") // {noop} = pas de hash pour dev - .roles("USER") - .build() - - return InMemoryUserDetailsManager(user) - } -} diff --git a/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/config/WebSocketConfig.kt b/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/config/MatchWebSocketConfig.kt similarity index 89% rename from FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/config/WebSocketConfig.kt rename to FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/config/MatchWebSocketConfig.kt index ec13cd2..5138d75 100644 --- a/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/config/WebSocketConfig.kt +++ b/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/config/MatchWebSocketConfig.kt @@ -5,7 +5,6 @@ import org.springframework.messaging.simp.config.MessageBrokerRegistry import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker import org.springframework.web.socket.config.annotation.StompEndpointRegistry import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer -import org.springframework.web.socket.server.support.HttpSessionHandshakeInterceptor const val CHANNEL_MATCH_NAME: String = "/ws/topic/match" @@ -25,7 +24,6 @@ open class MatchWebSocketConfig : WebSocketMessageBrokerConfigurer { override fun registerStompEndpoints(registry: StompEndpointRegistry) { // Register the "/ws" endpoint, enabling SockJS fallback options registry.addEndpoint("/ws/matches-app") - .addInterceptors(HttpSessionHandshakeInterceptor()) .setAllowedOriginPatterns("*") // Allow connections from any origin (adjust for production) .withSockJS() } diff --git a/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/config/PlayerWebSocketConfig.kt b/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/config/PlayerWebSocketConfig.kt new file mode 100644 index 0000000..012e601 --- /dev/null +++ b/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/config/PlayerWebSocketConfig.kt @@ -0,0 +1,30 @@ +package fr.teamflash.fencerjudgeback.config + +import org.springframework.context.annotation.Configuration +import org.springframework.messaging.simp.config.MessageBrokerRegistry +import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker +import org.springframework.web.socket.config.annotation.StompEndpointRegistry +import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer + +const val CHANNEL_PLAYER_NAME: String = "/ws/topic/match" + +@Configuration +@EnableWebSocketMessageBroker +open class PlayerWebSocketConfig : WebSocketMessageBrokerConfigurer { + + override fun configureMessageBroker(registry: MessageBrokerRegistry) { + // Enable a simple memory-based message broker to send messages to clients + // Prefix for messages FROM server TO client + registry.enableSimpleBroker(CHANNEL_PLAYER_NAME) + + // Prefix for messages FROM client TO server + registry.setApplicationDestinationPrefixes("/ws") + } + + override fun registerStompEndpoints(registry: StompEndpointRegistry) { + // Register the "/ws" endpoint, enabling SockJS fallback options + registry.addEndpoint("/ws/players-app") + .setAllowedOriginPatterns("*") // Allow connections from any origin (adjust for production) + .withSockJS() + } +} \ No newline at end of file diff --git a/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/config/RefereeWebSocketConfig.kt b/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/config/RefereeWebSocketConfig.kt new file mode 100644 index 0000000..9d4cf59 --- /dev/null +++ b/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/config/RefereeWebSocketConfig.kt @@ -0,0 +1,30 @@ +package fr.teamflash.fencerjudgeback.config + +import org.springframework.context.annotation.Configuration +import org.springframework.messaging.simp.config.MessageBrokerRegistry +import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker +import org.springframework.web.socket.config.annotation.StompEndpointRegistry +import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer + +const val CHANNEL_REFEREE_NAME: String = "/ws/topic/referee" + +@Configuration +@EnableWebSocketMessageBroker +open class RefereeWebSocketConfig : WebSocketMessageBrokerConfigurer { + + override fun configureMessageBroker(registry: MessageBrokerRegistry) { + // Enable a simple memory-based message broker to send messages to clients + // Prefix for messages FROM server TO client + registry.enableSimpleBroker(CHANNEL_REFEREE_NAME) + + // Prefix for messages FROM client TO server + registry.setApplicationDestinationPrefixes("/ws") + } + + override fun registerStompEndpoints(registry: StompEndpointRegistry) { + // Register the "/ws" endpoint, enabling SockJS fallback options + registry.addEndpoint("/ws/referees-app") + .setAllowedOriginPatterns("*") // Allow connections from any origin (adjust for production) + .withSockJS() + } +} \ No newline at end of file diff --git a/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/entities/MatchBean.kt b/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/entities/MatchBean.kt index f37c7fd..87ccf3e 100644 --- a/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/entities/MatchBean.kt +++ b/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/entities/MatchBean.kt @@ -6,14 +6,7 @@ import jakarta.persistence.GenerationType import jakarta.persistence.Id import jakarta.persistence.SequenceGenerator import jakarta.persistence.Table -import jakarta.validation.constraints.* -import java.util.Date - -enum class MatchState { - ONGOING, - OVER, - NOT_STARTED -} +import jakarta.validation.constraints.* @Entity @Table(name="matches") @@ -35,6 +28,6 @@ data class MatchBean( var score1:Int=0, @field:Min(value = 0, message = "Score must be at least 0") var score2:Int=0, - val date: Date?=null, - val state: MatchState?=null + val date: String?=null, + val state:String?=null ) diff --git a/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/entities/RefereeBean.kt b/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/entities/RefereeBean.kt index cb2570a..4756fee 100644 --- a/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/entities/RefereeBean.kt +++ b/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/entities/RefereeBean.kt @@ -7,13 +7,6 @@ import jakarta.persistence.Id import jakarta.persistence.SequenceGenerator import jakarta.persistence.Table -enum class RefereeLevel { - DEPARTMENTAL, - REGIONAL, - NATIONAL, - INTERNATIONAL -} - @Entity @Table(name="referees") data class RefereeBean( @@ -23,5 +16,5 @@ data class RefereeBean( val id:Long?=null, val name:String?=null, val firstName:String?=null, - val level:RefereeLevel?=null + val qualification:String?=null ) \ No newline at end of file diff --git a/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/restControllers/MainController.kt b/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/restControllers/MainController.kt deleted file mode 100644 index 5dbfd7a..0000000 --- a/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/restControllers/MainController.kt +++ /dev/null @@ -1,12 +0,0 @@ -package fr.teamflash.fencerjudgeback.restControllers - -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.RestController - -@RestController -class MainController { - @GetMapping("/") - fun main() { - return print("Hello") - } -} \ No newline at end of file diff --git a/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/restControllers/MatchRestController.kt b/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/restControllers/MatchRestController.kt index ab2e7de..0957c00 100644 --- a/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/restControllers/MatchRestController.kt +++ b/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/restControllers/MatchRestController.kt @@ -1,21 +1,14 @@ package fr.teamflash.fencerjudgeback.restControllers import fr.teamflash.fencerjudgeback.entities.MatchBean -import fr.teamflash.fencerjudgeback.entities.MatchState import fr.teamflash.fencerjudgeback.services.MatchService import org.springframework.http.ResponseEntity import org.springframework.web.bind.annotation.* -import java.util.Date @RestController -@CrossOrigin(origins = ["*"]) @RequestMapping("/matches") class MatchRestController(private val matchService: MatchService) { - companion object { - const val URL_ORIGIN: String = "http://localhost:*" - } - // Lister tous les matchs @GetMapping("/") fun getAll(): ResponseEntity?> { @@ -24,7 +17,7 @@ class MatchRestController(private val matchService: MatchService) { // Lister tous les matchs à partir d'une certaine date @GetMapping("/date/{date}") - fun getAllFromDate(@PathVariable date: Date): ResponseEntity?> { + fun getAllFromDate(@PathVariable date:String): ResponseEntity?> { return ResponseEntity.ok(matchService.getAll().filter { it.date == date }) } @@ -49,19 +42,19 @@ class MatchRestController(private val matchService: MatchService) { // Lister les matchs en cours @GetMapping("/active") fun getAllActive(): ResponseEntity?> { - return ResponseEntity.ok(matchService.getAll().filter { it.state == MatchState.ONGOING }) + return ResponseEntity.ok(matchService.getAll().filter { it.state == "ACTIVE" }) } // Lister les matchs terminés @GetMapping("/over") fun getAllFinished(): ResponseEntity?> { - return ResponseEntity.ok(matchService.getAll().filter { it.state == MatchState.OVER }) + return ResponseEntity.ok(matchService.getAll().filter { it.state == "FINISHED" }) } // Lister les matchs non commencés @GetMapping("/not-started") fun getAllNotStarted(): ResponseEntity?> { - return ResponseEntity.ok(matchService.getAll().filter { it.state == MatchState.NOT_STARTED }) + return ResponseEntity.ok(matchService.getAll().filter { it.state == "NOT STARTED" }) } // Afficher un match par id @@ -73,6 +66,7 @@ class MatchRestController(private val matchService: MatchService) { // Ajouter un match @PostMapping("/create-match") fun createMatch(@RequestBody match: MatchBean): ResponseEntity { +// return ResponseEntity.status(HttpStatus.CREATED).body(matchService.createMatch(match)) return ResponseEntity.ok(matchService.createMatch(match)) } diff --git a/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/restControllers/PlayerRestController.kt b/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/restControllers/PlayerRestController.kt index 628282a..699c557 100644 --- a/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/restControllers/PlayerRestController.kt +++ b/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/restControllers/PlayerRestController.kt @@ -3,7 +3,6 @@ package fr.teamflash.fencerjudgeback.restControllers import fr.teamflash.fencerjudgeback.entities.PlayerBean import fr.teamflash.fencerjudgeback.services.PlayerService import org.springframework.http.ResponseEntity -import org.springframework.web.bind.annotation.CrossOrigin import org.springframework.web.bind.annotation.DeleteMapping import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.PathVariable @@ -14,7 +13,6 @@ import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RestController @RestController -@CrossOrigin(origins = ["*"]) @RequestMapping("/players") class PlayerRestController(private val playerService: PlayerService) { diff --git a/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/restControllers/RefereeRestController.kt b/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/restControllers/RefereeRestController.kt index 42ca424..e26e90f 100644 --- a/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/restControllers/RefereeRestController.kt +++ b/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/restControllers/RefereeRestController.kt @@ -1,11 +1,8 @@ package fr.teamflash.fencerjudgeback.restControllers -import fr.teamflash.fencerjudgeback.entities.MatchState import fr.teamflash.fencerjudgeback.entities.RefereeBean -import fr.teamflash.fencerjudgeback.entities.RefereeLevel import fr.teamflash.fencerjudgeback.services.RefereeService import org.springframework.http.ResponseEntity -import org.springframework.web.bind.annotation.CrossOrigin import org.springframework.web.bind.annotation.DeleteMapping import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.PathVariable @@ -16,7 +13,6 @@ import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RestController @RestController -@CrossOrigin(origins = ["*"]) @RequestMapping("/referees") class RefereeRestController(private val refereeService: RefereeService) { @@ -44,10 +40,10 @@ class RefereeRestController(private val refereeService: RefereeService) { return ResponseEntity.ok(refereeService.getByFirstName(firstName)) } - // Afficher un ou plusieurs arbitre(s) par niveau - @GetMapping("/level/{level}") - fun getByQualification(@PathVariable level: RefereeLevel): ResponseEntity?> { - return ResponseEntity.ok(refereeService.getByLevel(level)) + // Afficher un ou plusieurs arbitre(s) par qualification + @GetMapping("/qualification/{qualification}") + fun getByQualification(@PathVariable qualification:String): ResponseEntity?> { + return ResponseEntity.ok(refereeService.getByQualification(qualification)) } // Ajouter un arbitre diff --git a/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/services/RefereeService.kt b/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/services/RefereeService.kt index c3491ed..218a1cb 100644 --- a/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/services/RefereeService.kt +++ b/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/services/RefereeService.kt @@ -1,8 +1,6 @@ package fr.teamflash.fencerjudgeback.services -import fr.teamflash.fencerjudgeback.entities.MatchState import fr.teamflash.fencerjudgeback.entities.RefereeBean -import fr.teamflash.fencerjudgeback.entities.RefereeLevel import fr.teamflash.fencerjudgeback.repositories.RefereeRepository import fr.teamflash.fencerjudgeback.websocket.controllers.RefereeWebSocketController import fr.teamflash.fencerjudgeback.websocket.models.RefereeUpdateMessage @@ -44,10 +42,10 @@ class RefereeService( return refereeRepository.findAll().filter{ it.firstName == firstName } } - // Obtenir un ou plusieurs arbitre(s) par niveau - fun getByLevel(level: RefereeLevel): List? { - println("RefereeService.getByLevel : $level") - return refereeRepository.findAll().filter{ it.level == level } + // Obtenir un ou plusieurs arbitre(s) par qualification + fun getByQualification(qualification:String): List? { + println("RefereeService.getRefereeByQualification : $qualification") + return refereeRepository.findAll().filter{ it.qualification == qualification } } // Ajouter un arbitre (admin) diff --git a/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/websocket/controllers/RefereeWebSocketController.kt b/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/websocket/controllers/RefereeWebSocketController.kt index 792fdc1..6064fda 100644 --- a/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/websocket/controllers/RefereeWebSocketController.kt +++ b/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/websocket/controllers/RefereeWebSocketController.kt @@ -30,7 +30,7 @@ class RefereeWebSocketController( id = refereeUpdateMessage.refereeId, name = refereeUpdateMessage.name, firstName = refereeUpdateMessage.firstName, - level = refereeUpdateMessage.level + qualification = refereeUpdateMessage.qualification ) // Update the referee in the database diff --git a/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/websocket/models/MatchUpdateMessage.kt b/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/websocket/models/MatchUpdateMessage.kt index f30aef3..028845f 100644 --- a/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/websocket/models/MatchUpdateMessage.kt +++ b/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/websocket/models/MatchUpdateMessage.kt @@ -1,7 +1,6 @@ package fr.teamflash.fencerjudgeback.websocket.models import fr.teamflash.fencerjudgeback.entities.MatchBean -import java.util.* /** * Message model for match updates sent through WebSocket @@ -13,7 +12,7 @@ data class MatchUpdateMessage( val refereeId: Long?, val score1: Int, val score2: Int, - val date: Date?, + val date: String?, val type: UpdateType = UpdateType.SCORE_UPDATE ) { enum class UpdateType { diff --git a/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/websocket/models/RefereeUpdateMessage.kt b/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/websocket/models/RefereeUpdateMessage.kt index 12f0fdd..cb9c1be 100644 --- a/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/websocket/models/RefereeUpdateMessage.kt +++ b/FencerJudgeBack/src/main/kotlin/fr/teamflash/fencerjudgeback/websocket/models/RefereeUpdateMessage.kt @@ -1,7 +1,6 @@ package fr.teamflash.fencerjudgeback.websocket.models import fr.teamflash.fencerjudgeback.entities.RefereeBean -import fr.teamflash.fencerjudgeback.entities.RefereeLevel /** * Message model for referee updates sent through WebSocket @@ -10,7 +9,7 @@ data class RefereeUpdateMessage( val refereeId: Long, val name: String?, val firstName: String?, - val level: RefereeLevel?, + val qualification: String?, val type: UpdateType = UpdateType.REFEREE_UPDATE ) { enum class UpdateType { @@ -28,7 +27,7 @@ data class RefereeUpdateMessage( refereeId = refereeBean.id ?: 0, name = refereeBean.name, firstName = refereeBean.firstName, - level = refereeBean.level, + qualification = refereeBean.qualification, type = type ) } diff --git a/FencerJudgeFront/README.md b/FencerJudgeFront/README.md index cf8675c..c5c9b8d 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/`. 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:4200/`. The application will automatically reload whenever you modify any of the source files. ## Code scaffolding diff --git a/FencerJudgeFront/angular.json b/FencerJudgeFront/angular.json index 3f97b8b..f49bfa8 100644 --- a/FencerJudgeFront/angular.json +++ b/FencerJudgeFront/angular.json @@ -34,13 +34,10 @@ { "glob": "**/*", "input": "public" - }, - "src/assets/" + } ], "styles": [ - "src/styles.css", - "node_modules/bootstrap/dist/css/bootstrap.min.css", - "node_modules/bootstrap-icons/font/bootstrap-icons.css" + "src/styles.css" ], "scripts": [] }, @@ -69,9 +66,6 @@ "defaultConfiguration": "production" }, "serve": { - "options": { - "port": 80 - }, "builder": "@angular-devkit/build-angular:dev-server", "configurations": { "production": { @@ -108,8 +102,5 @@ } } } - }, - "cli": { - "analytics": false } } diff --git a/FencerJudgeFront/package-lock.json b/FencerJudgeFront/package-lock.json index 00f2a33..9da01e2 100644 --- a/FencerJudgeFront/package-lock.json +++ b/FencerJudgeFront/package-lock.json @@ -16,9 +16,6 @@ "@angular/platform-browser": "^19.1.0", "@angular/platform-browser-dynamic": "^19.1.0", "@angular/router": "^19.1.0", - "boostrap": "^2.0.0", - "bootstrap": "^5.3.5", - "bootstrap-icons": "^1.11.3", "rxjs": "~7.8.0", "tslib": "^2.3.0", "zone.js": "~0.15.0" @@ -4533,17 +4530,6 @@ "node": ">=14" } }, - "node_modules/@popperjs/core": { - "version": "2.11.8", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", - "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", - "license": "MIT", - "peer": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/popperjs" - } - }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.34.8", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.34.8.tgz", @@ -5935,48 +5921,6 @@ "dev": true, "license": "ISC" }, - "node_modules/boostrap": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/boostrap/-/boostrap-2.0.0.tgz", - "integrity": "sha512-JEeFMOweKeGXEM9rt95eaVISOkluG9aKcl0jQCETOVH9jynCZxuBZe2oWgcWJpj5wqYWZl625SnW7OgHT2Ineg==", - "deprecated": "Package no longer supported. Contact support@npmjs.com for more info.", - "license": "ISC" - }, - "node_modules/bootstrap": { - "version": "5.3.5", - "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.3.5.tgz", - "integrity": "sha512-ct1CHKtiobRimyGzmsSldEtM03E8fcEX4Tb3dGXz1V8faRwM50+vfHwTzOxB3IlKO7m+9vTH3s/3C6T2EAPeTA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/twbs" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/bootstrap" - } - ], - "license": "MIT", - "peerDependencies": { - "@popperjs/core": "^2.11.8" - } - }, - "node_modules/bootstrap-icons": { - "version": "1.11.3", - "resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.11.3.tgz", - "integrity": "sha512-+3lpHrCw/it2/7lBL15VR0HEumaBss0+f/Lb6ZvHISn1mlK83jjFpooTLsMWbIjJMDjDjOExMsTxnXSIT4k4ww==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/twbs" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/bootstrap" - } - ], - "license": "MIT" - }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", diff --git a/FencerJudgeFront/package.json b/FencerJudgeFront/package.json index aecac98..757656f 100644 --- a/FencerJudgeFront/package.json +++ b/FencerJudgeFront/package.json @@ -18,9 +18,6 @@ "@angular/platform-browser": "^19.1.0", "@angular/platform-browser-dynamic": "^19.1.0", "@angular/router": "^19.1.0", - "boostrap": "^2.0.0", - "bootstrap": "^5.3.5", - "bootstrap-icons": "^1.11.3", "rxjs": "~7.8.0", "tslib": "^2.3.0", "zone.js": "~0.15.0" diff --git a/FencerJudgeFront/public/favicon.ico b/FencerJudgeFront/public/favicon.ico index 7684fbd..57614f9 100644 Binary files a/FencerJudgeFront/public/favicon.ico and b/FencerJudgeFront/public/favicon.ico differ diff --git a/FencerJudgeFront/src/app/app-routing.module.ts b/FencerJudgeFront/src/app/app-routing.module.ts index 0440f68..0297262 100644 --- a/FencerJudgeFront/src/app/app-routing.module.ts +++ b/FencerJudgeFront/src/app/app-routing.module.ts @@ -1,41 +1,10 @@ import { NgModule } from '@angular/core'; 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'; - -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'; -import { MatchesDelComponent } from './components/match/matches-del/matches-del.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/add', - component: MatchesAddComponent, - canActivate: [authGuard], - }, - { - path: 'matches/del/:id', - component: MatchesDelComponent, - canActivate: [authGuard], - }, - { path: 'matches/:id', component: MatchesIdComponent }, -]; +const routes: Routes = []; @NgModule({ imports: [RouterModule.forRoot(routes)], - exports: [RouterModule], + exports: [RouterModule] }) -export class AppRoutingModule {} +export class AppRoutingModule { } diff --git a/FencerJudgeFront/src/app/app.component.html b/FencerJudgeFront/src/app/app.component.html index eaf43d3..36093e1 100644 --- a/FencerJudgeFront/src/app/app.component.html +++ b/FencerJudgeFront/src/app/app.component.html @@ -1,3 +1,336 @@ - - - \ No newline at end of file + + + + + + + + + + + +
+
+
+ +

Hello, {{ title }}

+

Congratulations! Your app is running. 🎉

+
+ +
+
+ @for (item of [ + { title: 'Explore the Docs', link: 'https://angular.dev' }, + { title: 'Learn with Tutorials', link: 'https://angular.dev/tutorials' }, + { title: 'CLI Docs', link: 'https://angular.dev/tools/cli' }, + { title: 'Angular Language Service', link: 'https://angular.dev/tools/language-service' }, + { title: 'Angular DevTools', link: 'https://angular.dev/tools/devtools' }, + ]; track item.title) { + + {{ item.title }} + + + + + } +
+ +
+
+
+ + + + + + + + + + + diff --git a/FencerJudgeFront/src/app/app.component.ts b/FencerJudgeFront/src/app/app.component.ts index c713d57..edbb159 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/app.module.ts b/FencerJudgeFront/src/app/app.module.ts index de9e710..b1c6c96 100644 --- a/FencerJudgeFront/src/app/app.module.ts +++ b/FencerJudgeFront/src/app/app.module.ts @@ -1,37 +1,18 @@ import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; -import { FormsModule } from '@angular/forms'; -import { HttpClientModule } from '@angular/common/http'; 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'; -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'; -import { SponsortComponent } from './templates/sponsort/sponsort.component'; -import { MatchesDelComponent } from './components/match/matches-del/matches-del.component'; @NgModule({ declarations: [ - AppComponent, - HeaderComponent, - FooterComponent, - HomeComponent, - LoginComponent, - LogoutComponent, - MatchesComponent, - MatchesIdComponent, - MatchesAddComponent, - SponsortComponent, - MatchesDelComponent, + AppComponent + ], + imports: [ + BrowserModule, + AppRoutingModule ], - imports: [BrowserModule, AppRoutingModule, FormsModule, HttpClientModule], providers: [], - bootstrap: [AppComponent], + bootstrap: [AppComponent] }) -export class AppModule {} +export class AppModule { } diff --git a/FencerJudgeFront/src/app/components/essentials/footer/footer.component.css b/FencerJudgeFront/src/app/components/essentials/footer/footer.component.css deleted file mode 100644 index 93884ad..0000000 --- a/FencerJudgeFront/src/app/components/essentials/footer/footer.component.css +++ /dev/null @@ -1,52 +0,0 @@ -footer { - color: white; - background-color: var(--h-f-bg); - padding: 2rem; -} - -.socialmedias { - display: flex; - justify-content: end; - align-items: center; -} - -.socialmedias a { - background-color: white; - text-decoration: none; - margin-left: 1rem; - height: 40px; - width: 40px; - border-radius: 50%; - display: flex; - align-items: center; - justify-content: center; - padding: .6rem; - transition: background-color .4s ease-in-out; -} - -.socialmedias a:hover { - background-color: var(--primary-color); -} - -.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 deleted file mode 100644 index 68e8789..0000000 --- a/FencerJudgeFront/src/app/components/essentials/footer/footer.component.html +++ /dev/null @@ -1,21 +0,0 @@ -
-
-
-
- FencerJudge - FencerJudge -
-
- Suivez-nous - - - - -
-
-
- © FencerJudge - Tous droits réservés -
-
-
-
\ No newline at end of file diff --git a/FencerJudgeFront/src/app/components/essentials/footer/footer.component.spec.ts b/FencerJudgeFront/src/app/components/essentials/footer/footer.component.spec.ts deleted file mode 100644 index aa27d1c..0000000 --- a/FencerJudgeFront/src/app/components/essentials/footer/footer.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { FooterComponent } from './footer.component'; - -describe('FooterComponent', () => { - let component: FooterComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [FooterComponent] - }) - .compileComponents(); - - fixture = TestBed.createComponent(FooterComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/FencerJudgeFront/src/app/components/essentials/footer/footer.component.ts b/FencerJudgeFront/src/app/components/essentials/footer/footer.component.ts deleted file mode 100644 index d8f2f2c..0000000 --- a/FencerJudgeFront/src/app/components/essentials/footer/footer.component.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-footer', - standalone: false, - templateUrl: './footer.component.html', - styleUrl: './footer.component.css' -}) -export class FooterComponent { - -} diff --git a/FencerJudgeFront/src/app/components/essentials/header/header.component.css b/FencerJudgeFront/src/app/components/essentials/header/header.component.css deleted file mode 100644 index d7282b5..0000000 --- a/FencerJudgeFront/src/app/components/essentials/header/header.component.css +++ /dev/null @@ -1,32 +0,0 @@ -nav { - background-color: var(--h-f-bg); -} - -.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; - color: white; -} - -.navbar-brand img { - height: 30px; - margin-right: 0.5rem; -} - -.nav-link { - text-transform: uppercase; - font-weight: 600; - color: white; - transition: color 0.3s ease; -} - -.nav-link:hover, -.active-link { - color: #ffcc00 !important; -} diff --git a/FencerJudgeFront/src/app/components/essentials/header/header.component.html b/FencerJudgeFront/src/app/components/essentials/header/header.component.html deleted file mode 100644 index d427b35..0000000 --- a/FencerJudgeFront/src/app/components/essentials/header/header.component.html +++ /dev/null @@ -1,28 +0,0 @@ - \ No newline at end of file diff --git a/FencerJudgeFront/src/app/components/essentials/header/header.component.spec.ts b/FencerJudgeFront/src/app/components/essentials/header/header.component.spec.ts deleted file mode 100644 index 63f2a45..0000000 --- a/FencerJudgeFront/src/app/components/essentials/header/header.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { HeaderComponent } from './header.component'; - -describe('HeaderComponent', () => { - let component: HeaderComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [HeaderComponent] - }) - .compileComponents(); - - fixture = TestBed.createComponent(HeaderComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/FencerJudgeFront/src/app/components/essentials/header/header.component.ts b/FencerJudgeFront/src/app/components/essentials/header/header.component.ts deleted file mode 100644 index 6b0a735..0000000 --- a/FencerJudgeFront/src/app/components/essentials/header/header.component.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Component } from '@angular/core'; -import { Router } from '@angular/router'; -import { AuthService } from '@services/auth/auth.service'; - -@Component({ - selector: 'app-header', - standalone: false, - templateUrl: './header.component.html', - styleUrl: './header.component.css', -}) -export class HeaderComponent { - constructor(private router: Router, public authService: AuthService) {} - - isHomeActive(): boolean { - return this.router.url === '/' || this.router.url === '/home'; - } - - isHomeActiveBool(): boolean { - 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 deleted file mode 100644 index a2b0cf2..0000000 --- a/FencerJudgeFront/src/app/components/essentials/login/login.component.css +++ /dev/null @@ -1,147 +0,0 @@ -.login-container { - display: flex; - justify-content: center; - align-items: center; - min-height: 25vh; - padding: 2rem; -} - -.login-card { - background-color: #fff; - border-radius: 12px; - overflow: hidden; - width: 500px; - box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25); - 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; - 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 */ - -webkit-backdrop-filter: blur(2px); - 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; -} - -.login-header p { - font-size: 0.85rem; - line-height: 1.4; -} - -.login-form { - padding: 1.5rem; - display: flex; - flex-direction: column; - gap: 1rem; -} - -.input-group { - display: flex; - align-items: center; - border-radius: 20px; - position: relative; - background-color: #235d4f; - padding: 1rem; -} - -.input-group input { - width: 100%; - padding: 1rem; - font-size: 16px; - color: white; - border: none; - border-bottom: 1px solid white; - outline: none; - background: transparent; -} - -.input-group input:focus~label, -.input-group input:valid~label { - top: 0; - left: 0; - color: #235d4f; - font-size: 12px; - padding: .6rem; -} - -.input-group input .form-control:focus { - border-color: transparent !important; -} - -.input-group label { - position: absolute; - top: 22px; - left: 0; - font-size: 16px; - color: white; - pointer-events: none; - transition: 0.5s; - padding: .6rem; -} - -.input-group .icon { - color: white; - margin-right: 0.5rem; -} - -.options { - display: flex; - justify-content: space-between; - font-size: 0.85rem; - color: #555; -} - -.options a { - color: #235d4f; - text-decoration: none; -} - -.login-btn { - background-color: #235d4f; - color: white; - padding: 0.6rem; - border: none; - border-radius: 6px; - font-size: 1rem; - cursor: pointer; - transition: background-color 0.3s; -} - -.login-btn:hover { - background-color: #1b4b3d; -} \ No newline at end of file diff --git a/FencerJudgeFront/src/app/components/essentials/login/login.component.html b/FencerJudgeFront/src/app/components/essentials/login/login.component.html deleted file mode 100644 index 993b80b..0000000 --- a/FencerJudgeFront/src/app/components/essentials/login/login.component.html +++ /dev/null @@ -1,22 +0,0 @@ - \ No newline at end of file diff --git a/FencerJudgeFront/src/app/components/essentials/login/login.component.spec.ts b/FencerJudgeFront/src/app/components/essentials/login/login.component.spec.ts deleted file mode 100644 index 4adbc3d..0000000 --- a/FencerJudgeFront/src/app/components/essentials/login/login.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -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 deleted file mode 100644 index f7b137a..0000000 --- a/FencerJudgeFront/src/app/components/essentials/login/login.component.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Component } from '@angular/core'; -import { Router } from '@angular/router'; -import { AuthService } from '@services/auth/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 deleted file mode 100644 index e69de29..0000000 diff --git a/FencerJudgeFront/src/app/components/essentials/logout/logout.component.html b/FencerJudgeFront/src/app/components/essentials/logout/logout.component.html deleted file mode 100644 index c6ae40e..0000000 --- a/FencerJudgeFront/src/app/components/essentials/logout/logout.component.html +++ /dev/null @@ -1 +0,0 @@ -

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 deleted file mode 100644 index 074294b..0000000 --- a/FencerJudgeFront/src/app/components/essentials/logout/logout.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -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 deleted file mode 100644 index 7945a95..0000000 --- a/FencerJudgeFront/src/app/components/essentials/logout/logout.component.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Component } from '@angular/core'; -import { Router } from '@angular/router'; -import { AuthService } from '@services/auth/auth.service'; - -@Component({ - selector: 'app-logout', - standalone: false, - templateUrl: './logout.component.html', - 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/app/components/home/home.component.css b/FencerJudgeFront/src/app/components/home/home.component.css deleted file mode 100644 index a09e6de..0000000 --- a/FencerJudgeFront/src/app/components/home/home.component.css +++ /dev/null @@ -1,740 +0,0 @@ -.match-card { - background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); - border: 2px solid var(--primary-color); - padding: 24px; - box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), - inset 0 1px 0 rgba(255, 255, 255, 0.1); - position: relative; - overflow: hidden; - transition: all 0.3s ease; - height: 90vh; - width: 100%; - display: flex; - flex-direction: column; - justify-content: space-between; -} - -.match-card::before { - content: ""; - position: absolute; - top: 0; - left: 0; - right: 0; - height: 2px; - background: linear-gradient(90deg, #daa520, var(--primary-color), #daa520); - background-size: 200% 100%; - animation: gradientShift 15s ease infinite; -} - -@keyframes gradientShift { - 0% { - background-position: 0% 50%; - } - - 50% { - background-position: 100% 50%; - } - - 100% { - background-position: 0% 50%; - } -} - -.match-card { - transform: translateY(-4px); - box-shadow: 0 12px 48px rgba(218, 165, 32, 0.2), 0 8px 32px rgba(0, 0, 0, 0.4); -} - -.match-background { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - z-index: -1; -} - -.background-image { - width: 100%; - height: 100%; - object-fit: cover; - filter: grayscale(30%) brightness(0.4) contrast(1.2); - transition: all 0.5s ease; -} - -.match-card:hover .background-image { - filter: grayscale(10%) brightness(0.3) contrast(1.4); - transform: scale(1.05); -} - -.image-overlay { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - background: linear-gradient(135deg, - rgba(26, 26, 46, 0.85) 0%, - rgba(0, 0, 0, 0.7) 50%, - rgba(22, 33, 62, 0.85) 100%); -} - -/* Header */ -.match-header { - display: flex; - justify-content: space-between; - align-items: center; - margin-bottom: 20px; -} - -.match-weapon { - display: flex; - align-items: center; - gap: 8px; - color: #daa520; - font-weight: 600; -} - -.weapon-type { - font-size: 14px; - text-transform: uppercase; - letter-spacing: 1px; -} - -/* Status */ -.match-status { - display: flex; - align-items: center; - gap: 8px; - padding: 6px 12px; - border-radius: 20px; - font-size: 12px; - font-weight: 600; - text-transform: uppercase; - letter-spacing: 0.5px; -} - -.status-warning { - background: rgba(34, 197, 94, 0.2); - color: #22c55e; - border: 1px solid #22c55e; -} - -.status-success { - background: rgba(239, 68, 68, 0.2); - color: #ef4444; - border: 1px solid #ef4444; -} - -.status-secondary { - background: rgba(59, 130, 246, 0.2); - color: #3b82f6; - border: 1px solid #3b82f6; -} - -.status-dot { - width: 8px; - height: 8px; - border-radius: 50%; - background: currentColor; - animation: pulse 2s infinite; -} - -@keyframes pulse { - - 0%, - 100% { - opacity: 1; - } - - 50% { - opacity: 0.5; - } -} - -/* Versus Section */ -.match-versus { - display: flex; - align-items: center; - justify-content: space-between; - margin: 24px 0; - position: relative; -} - -.fencer { - flex: 1; - text-align: center; - color: white; -} - -.fencer-name { - font-size: 18px; - font-weight: 700; - margin-bottom: 4px; - color: #daa520; -} - -.fencer-club { - font-size: 12px; - color: #9ca3af; - margin-bottom: 8px; -} - -.score { - font-size: 32px; - font-weight: 900; - color: white; - text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); -} - -.vs-divider { - display: flex; - flex-direction: column; - align-items: center; - gap: 4px; - margin: 0 20px; -} - -.vs-text { - font-size: 14px; - font-weight: 700; - color: #6b7280; - letter-spacing: 2px; -} - -.crossed-swords { - font-size: 20px; - opacity: 0.7; -} - -/* Details */ -.match-details { - display: flex; - flex-direction: column; - gap: 12px; - margin-top: 20px; - padding-top: 20px; - border-top: 1px solid rgba(255, 255, 255, 0.1); -} - -.detail-item { - display: flex; - align-items: center; - gap: 12px; - font-size: 14px; -} - -.detail-item .icon { - font-size: 16px; - width: 20px; - text-align: center; -} - -.detail-item .label { - color: #9ca3af; - font-weight: 500; - min-width: 60px; -} - -.detail-item .value { - color: white; - font-weight: 600; -} - -/* Responsive */ -@media (max-width: 768px) { - .match-card { - padding: 16px; - } - - .match-versus { - flex-direction: column; - gap: 16px; - } - - .vs-divider { - transform: rotate(90deg); - margin: 0; - } - - .fencer { - width: 100%; - } -} - -.combat-arena { - margin-top: 24px; - background: linear-gradient(135deg, - rgba(220, 38, 38, 0.1) 0%, - rgba(0, 0, 0, 0.8) 50%, - rgba(255, 215, 0, 0.1) 100%); - border: 2px solid; - border-image: linear-gradient(45deg, #dc2626, var(--primary-color), #dc2626) 1; - border-radius: var(--border-radius); - padding: 20px; - position: relative; - overflow: hidden; -} - -.combat-arena::before { - content: ""; - position: absolute; - top: -50%; - left: -50%; - width: 200%; - height: 200%; - background: repeating-conic-gradient(from 0deg at 50% 50%, - transparent 0deg 2deg, - rgba(220, 38, 38, 0.05) 2deg 4deg); - animation: rotate 20s linear infinite; - pointer-events: none; -} - -@keyframes rotate { - 0% { - transform: rotate(0deg); - } - - 100% { - transform: rotate(360deg); - } -} - -/* Header Arena */ -.arena-header { - display: flex; - align-items: center; - justify-content: center; - gap: 12px; - margin-bottom: 20px; - position: relative; -} - -.arena-title { - font-family: "Orbitron", monospace; - font-size: 16px; - font-weight: 900; - color: var(--primary-color); - letter-spacing: 3px; - text-shadow: 0 0 10px var(--primary-color), 0 0 20px var(--primary-color), 0 0 30px var(--primary-color); - animation: titleGlow 2s ease-in-out infinite alternate; -} - -@keyframes titleGlow { - from { - text-shadow: 0 0 10px var(--primary-color), 0 0 20px var(--primary-color), 0 0 30px var(--primary-color); - } - - to { - text-shadow: 0 0 20px var(--primary-color), 0 0 30px var(--primary-color), 0 0 40px var(--primary-color); - } -} - -.arena-pulse { - width: 10px; - height: 10px; - background: #dc2626; - border-radius: 50%; - position: relative; - animation: pulse-danger 1s infinite; -} - -.arena-pulse::before { - content: ""; - position: absolute; - top: -5px; - left: -5px; - right: -5px; - bottom: -5px; - background: #dc2626; - border-radius: 50%; - opacity: 0.3; - animation: pulse-ring 1s infinite; -} - -@keyframes pulse-danger { - - 0%, - 100% { - transform: scale(1); - } - - 50% { - transform: scale(1.2); - } -} - -@keyframes pulse-ring { - 0% { - transform: scale(0.8); - opacity: 0.8; - } - - 100% { - transform: scale(2); - opacity: 0; - } -} - -/* Combat Grid */ -.combat-grid { - display: grid; - grid-template-columns: 1fr; - gap: 16px; -} - -.combat-stat { - display: flex; - align-items: center; - gap: 16px; - padding: 16px; - background: linear-gradient(90deg, - rgba(0, 0, 0, 0.8) 0%, - rgba(26, 26, 46, 0.9) 50%, - rgba(0, 0, 0, 0.8) 100%); - border: 1px solid var(--primary-color); - border-radius: var(--border-radius); - position: relative; - transition: all 0.3s ease; - cursor: pointer; -} - -.combat-stat:hover { - transform: translateX(8px); - border-color: var(--primary-color); - box-shadow: 0 4px 20px var(--primary-color), - inset 0 1px 0 rgba(255, 215, 0, 0.1); -} - -/* Icons animés */ -.stat-icon { - position: relative; - display: flex; - align-items: center; - justify-content: center; - width: 48px; - height: 48px; - font-size: 24px; -} - -.location-radar { - position: absolute; - width: 40px; - height: 40px; - border: 2px solid #10b981; - border-radius: 50%; - border-top-color: transparent; - animation: radar-spin 2s linear infinite; -} - -.referee-badge { - position: absolute; - width: 35px; - height: 35px; - background: linear-gradient(45deg, var(--primary-color), #ffed4a); - clip-path: polygon(50% 0%, - 61% 35%, - 98% 35%, - 68% 57%, - 79% 91%, - 50% 70%, - 21% 91%, - 32% 57%, - 2% 35%, - 39% 35%); - animation: badge-pulse 3s ease-in-out infinite; -} - -.time-ring { - position: absolute; - width: 36px; - height: 36px; - border: 3px solid #dc2626; - border-radius: 50%; - border-left-color: transparent; - animation: time-tick 1s linear infinite; -} - -@keyframes radar-spin { - 0% { - transform: rotate(0deg); - } - - 100% { - transform: rotate(360deg); - } -} - -@keyframes badge-pulse { - - 0%, - 100% { - transform: scale(1) rotate(0deg); - } - - 50% { - transform: scale(1.1) rotate(5deg); - } -} - -@keyframes time-tick { - 0% { - transform: rotate(0deg); - } - - 100% { - transform: rotate(360deg); - } -} - -/* Content */ -.stat-content { - flex: 1; - display: flex; - flex-direction: column; - gap: 2px; -} - -.stat-label { - font-family: "Orbitron", monospace; - font-size: 10px; - font-weight: 700; - color: #6b7280; - letter-spacing: 1px; - text-transform: uppercase; -} - -.stat-value { - font-size: 16px; - font-weight: 700; - color: white; - text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); -} - -.stat-sub { - font-size: 11px; - color: #9ca3af; - font-weight: 500; -} - -/* Glows spécifiques */ -.venue .stat-value { - color: #10b981; -} - -.referee .stat-value { - color: var(--primary-color); -} - -.timing .stat-value { - color: #dc2626; -} - -.stat-glow { - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - border-radius: 8px; - opacity: 0; - transition: opacity 0.3s ease; - pointer-events: none; -} - -.combat-stat:hover .stat-glow { - opacity: 1; -} - -.venue-glow { - box-shadow: inset 0 0 20px rgba(16, 185, 129, 0.2); -} - -.referee-glow { - box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.2); -} - -.timing-glow { - box-shadow: inset 0 0 20px rgba(220, 38, 38, 0.2); -} - -/* Responsive */ -@media (min-width: 768px) { - .combat-grid { - grid-template-columns: repeat(3, 1fr); - } - - .combat-stat { - flex-direction: column; - text-align: center; - gap: 12px; - } - - .combat-stat:hover { - transform: translateY(-4px); - } -} - -/* Section Weapons */ -.section-header { - text-align: center; - margin-bottom: 3rem; - position: relative; -} - -.section-title { - font-size: 2.5rem; - font-weight: 300; - letter-spacing: 2px; - color: #333; - margin: 0; - position: relative; - display: inline-block; -} - -.section-title::after { - content: ''; - position: absolute; - bottom: -10px; - left: 50%; - transform: translateX(-50%); - width: 60px; - height: 2px; - background: var(--gradient-color); -} - -.weapons-container, -.diplomes-container { - display: flex; - flex-wrap: wrap; - gap: 20px; - justify-content: center; - padding: 20px; -} - -/* Card Weapon */ -.weapon-card, -.diplomes-card { - position: relative; - background-size: cover; - background-position: center; - border-radius: var(--border-radius); - box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); - width: 400px; - height: 500px; - color: white; - text-align: center; - overflow-y: auto; - overflow-x: hidden; - display: flex; - flex-direction: column; - padding: 20px; - aspect-ratio: 16/9; - transition: box-shadow 0.3s ease; - /* Transition douce pour l'effet de lift */ -} - -.weapon-card:hover, -.diplomes-card:hover { - background-image: none !important; - box-shadow: - 0 8px 25px rgba(0, 0, 0, 0.3), - 0 0 20px rgba(212, 175, 55, 0.3), - inset 0 1px 0 rgba(255, 255, 255, 0.1); - transform: translateY(-2px); - /* Léger lift au hover */ - border: 2px solid var(--primary-color); - background: var(--card-gradient) !important; -} - -.weapon-card:before, -.diplomes-card:before { - content: ''; - position: absolute; - inset: 0; - background-image: inherit; - background-size: cover; - background-position: center; - filter: var(--blur-effect); - opacity: .6; - z-index: 1; - transition: var(--transition-smooth); - /* Courbe plus fluide */ -} - -.weapon-card:hover:before, -.diplomes-card:hover:before { - transform: scale(1.2); - /* Zoom uniquement sur l'image */ - filter: var(--blur-hover); - /* Moins de blur + plus lumineux au hover */ - opacity: .8; - /* Plus visible au hover */ - background-image: none; -} - -.weapon-card:hover:before, -.diplomes-card:hover:before { - animation: metalShine 2s ease-in-out infinite alternate; -} - -@keyframes metalShine { - 0% { - filter: brightness(1.1) contrast(1.2); - } - - 100% { - filter: brightness(1.3) contrast(1.4) saturate(1.1); - } -} - -.weapon-card *, -.diplomes-card * { - position: relative; - z-index: 2; - text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8); -} - -.weapon-card p { - color: white; - font-size: 0.95em; -} - -.diplomes-card h2, -.weapon-card h2 { - position: absolute; - opacity: 1; - transition: opacity 0.3s ease, transform 0.3s ease; - bottom: 50%; - left: 50%; - transform: translate(-50%, 50%); - /* Centrage parfait */ - margin: auto 0; - text-transform: uppercase; - font-size: 1.4em; -} - -.diplomes-card:hover h2, -.weapon-card:hover h2 { - opacity: 0; - transform: translate(-50%, 30%); - /* Glisse vers le haut en disparaissant */ -} - -.diplomes-card p, -.weapon-card p, -.weapon-card ul li, -.diplomes-card ul li { - text-align: start; - opacity: 0; - transform: translateY(-100%); - transition: opacity transform .6s ease-in-out; -} - -.diplomes-card:hover p, -.weapon-card:hover p, -.weapon-card:hover ul li, -.diplomes-card:hover ul li { - opacity: 1; - transform: translateY(0); -} \ No newline at end of file diff --git a/FencerJudgeFront/src/app/components/home/home.component.html b/FencerJudgeFront/src/app/components/home/home.component.html deleted file mode 100644 index aaf0494..0000000 --- a/FencerJudgeFront/src/app/components/home/home.component.html +++ /dev/null @@ -1,277 +0,0 @@ -
-
- Escrime -
-
- -
-
- ⚔️ - {{ latestMatch.weapon }} -
-
- - {{ getMatchStateLabel(latestMatch.state) }} -
-
- -
-
-
- {{ player1?.name }} {{ player1?.firstName }} -
-
{{ player1?.club }}
-
{{ latestMatch.score1 }}
-
- -
- VS -
⚔️
-
- -
-
- {{ player2?.name }} {{ player2?.firstName }} -
-
{{ player2?.club }}
-
{{ latestMatch.score2 }}
-
-
- -
-
- ARENA COMBAT -
-
- -
-
-
-
- 🏛️ -
-
- BATTLEFIELD - {{ latestMatch.city }} - {{ latestMatch.country }} -
-
-
- -
-
-
- ⚖️ -
-
- COMBAT JUDGE - {{ referee?.name }} {{ referee?.firstName }} - OFFICIAL REFEREE -
-
-
- -
-
-
- -
-
- COMBAT START - {{ getTimeUntilMatch() }} - LIVE BATTLE -
-
-
-
-
- 🎯 -
-
- FUN FACT - - Saviez-vous que l'escrime est l'un des sports les plus anciens aux - Jeux Olympiques ? - - Inspiration et tradition au rendez-vous -
-
-
-
-
- -
-
-

Les Armes

-
- -
-
-

Épée

-
    -
  • - Le but de l’épée est de toucher le premier son adversaire avec la pointe de la lame. - La priorité ne s’applique pas comme au fleuret, - c’est-à-dire que les deux épéistes peuvent toucher simultanément : le point leur sera accordé. -
  • -
  • - Toutes les parties du corps comptent, des pieds jusqu’au masque. - C’est le premier qui touche l’autre qui marque le point. -
  • -
  • - Les touches ne sont accordées que si elles sont portées avec la pointe de la lame. - Les touches doivent être portées à l’adversaire avec une pression suffisante. -
  • -
-
- -
-

Fleuret

-
    -
  • - Les touches sont comptabilisées par un système électrique qui détecte les touches sur la veste des escrimeurs. -
  • -
  • - Pour marquer un point, la touche doit être portée sur la partie valable du corps de l’adversaire, qui est délimitée par les règles de l’escrime. - La zone valable est le tronc, ce qui exclut les membres et la tête. -
  • -
  • - Les touches simultanées ne sont pas prises en compte, c’est-à-dire que si les deux escrimeurs touchent leur adversaire en même temps, - l’arbitre dira lequel des deux avait la « priorité » pour pouvoir attribuer le point. -
  • -
-
- -
-

Sabre

-
    -
  • - Le sabre est une arme qui permet des touches rapides et dynamiques. - Les touches sont marquées avec le tranchant et le bout de la lame. -
  • -
  • - Les touches sont valides sur tout le haut du corps, au-dessus de la ceinture jusqu’à la tête. - Les touches sont déterminées par des capteurs électriques sur la cuirasse et le masque de l’escrimeur. -
  • -
  • - Si les deux tireurs touchent en même temps, c’est l’attaquant qui a la priorité du point, sauf si l’adversaire parade et riposte. - Cette règle est quasiment identique à celle du fleuret. -
  • -
-
- -
-

Sabre Laser

-

Les combats au sabre laser suivent généralement des règles similaires à celles de l’escrime artistique. - La pratique du sabre laser se décline en trois disciplines complémentaires : -

-
    -
  • - Combat sportif : Les escrimeurs s’affrontent en duel réglementé dans une arène. - Ils doivent toucher l’adversaire avec leur sabre laser pour accumuler des points en un temps donné. - Le combat sportif exige de la stratégie, de la rapidité et une maîtrise technique. -
  • -
  • - Combat chorégraphié : Cette discipline se pratique à deux ou en groupe. - Les participants exécutent ensemble un combat sous forme de mise en scène préalablement répétée, souvent accompagnée d’une musique appropriée. - Le sens du spectacle prime, et les mouvements doivent être précis et spectaculaires. -
  • -
  • - Kata : Inspiré des arts martiaux, le kata consiste à reproduire un enchaînement de mouvements codifiés seul ou face à un adversaire imaginaire. - Il vise à progresser techniquement et exige rigueur, précision et patience. -
  • -
-
- -
-
- -
-
-

Les diplômes d'arbitrage

-
- -
-
-

départemental

-

Ce diplôme est décemé par la CAI ou la CRA dont - dépend l'arbitre :

-
    -
  • - Âge minimum : 14 ans. -
  • -
  • - Ouvre droit à arbitrer toutes les compétitions - organisées dans le cadre du comité interdépartemental - et/ou du comité régional dont dépend l'arbitre (sous - réserve de l'avis de la CRA dont dépend l'arbitre). -
  • -
  • - Titulaire d'un carton BLANC qui permet d'arrêter un - match à n'importe quel moment pour demander une - assistance du DT et/ou de l'organisateur de la - compétition. Le rôle pédagogique du DT et/ou de - l'organisateur est primordial dans l'accompagnement - des jeunes arbitres. -
  • -
-
- -
-

régional

-

Ce diplôme est décerné par la CRA dont dépend - l'arbitre :

-
    -
  • - Âge minimum : 16 ans -
  • -
  • - Il ouvre droit à arbitrer toutes les compétitions - organisées dans le cadre du Comité régional, -
  • -
  • - Les circuits nationaux, -
  • -
  • - La Fête des Jeunes, -
  • -
  • - Des dérogations ponctuelles peuvent faire l'objet d'une - circulaire. -
  • -
-
- -
-

national

-

Ce diplôme est décerné par la CNA (Commission - Nationale Arbitrage) :

-
    -
  • • Âge minimum : 18 ans
  • -
  • Il ouvre droit à arbitrer toutes les compétitions - organisées dans le cadre du Comité régional,
  • -
  • Les circuits nationaux,
  • -
  • La Fête des Jeunes, les championnats de France M17, - M20, Séniors et Vétérans sur convocation de la CNN
  • -
  • Les circuits européens M17 et U23 organisés sur le - territoire français et à l'étranger.
  • -
-
- -
-

international

-

Ce diplôme est décerné par la Fédération - Internationale d'Escrime (FIE).

-
    -
  • Âge minimum : 20 ans
  • -
  • Il ouvre droit à arbitrer toutes les compétitions. Les - arbitres qui figurent sur la liste restreinte de la FIE - doivent arbitrer des compétitions nationales séniors et - être la référence de notre corps arbitral.
  • -
-
- -
-
- - \ No newline at end of file diff --git a/FencerJudgeFront/src/app/components/home/home.component.spec.ts b/FencerJudgeFront/src/app/components/home/home.component.spec.ts deleted file mode 100644 index 545a43d..0000000 --- a/FencerJudgeFront/src/app/components/home/home.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { HomeComponent } from './home.component'; - -describe('HomeComponent', () => { - let component: HomeComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [HomeComponent] - }) - .compileComponents(); - - fixture = TestBed.createComponent(HomeComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/FencerJudgeFront/src/app/components/home/home.component.ts b/FencerJudgeFront/src/app/components/home/home.component.ts deleted file mode 100644 index c6a3439..0000000 --- a/FencerJudgeFront/src/app/components/home/home.component.ts +++ /dev/null @@ -1,159 +0,0 @@ -import { Component } from '@angular/core'; - -import { MatchesService } from '@services/matches/matches.service'; -import { Matches, MatchState } from '@interfaces/matches'; - -import { PlayerService } from '@services/player/player.service'; -import { Player } from '@interfaces/player'; - -import { RefereeService } from '@services/referee/referee.service'; -import { Referee, RefereeLevel } from '@interfaces/referee'; - -@Component({ - selector: 'app-home', - standalone: false, - templateUrl: './home.component.html', - styleUrl: './home.component.css', -}) -export class HomeComponent { - latestMatch?: Matches; - player1?: Player; - player2?: Player; - referee?: Referee; - MatchState = MatchState; - intervalId?: any; - timeUntilMatch: string | null = null; - - constructor( - private matchesService: MatchesService, - private playerService: PlayerService, - private refereeService: RefereeService - ) {} - - ngOnInit(): void { - this.getLatestMatch(); - } - - ngOnDestroy(): void { - if (this.intervalId) { - clearInterval(this.intervalId); - } - } - - private getLatestMatch(): void { - this.matchesService.getMatches().subscribe((matches) => { - if (matches.length > 0) { - this.latestMatch = matches[matches.length - 1]; - console.log( - '[HomeComponent] 🏁 Dernier match ajouté :', - this.latestMatch - ); - - // Récupération des données liées - this.loadRelatedEntities(this.latestMatch); - - if (this.latestMatch.state === MatchState.NOT_STARTED) { - this.updateTimeUntilMatch(); // initial - this.intervalId = setInterval(() => { - this.updateTimeUntilMatch(); - }, 60000); // chaque minute - } - } else { - console.warn('[HomeComponent] Aucun match disponible'); - } - }); - } - - private updateTimeUntilMatch(): void { - if (!this.latestMatch) return; - - const now = new Date(); - const matchDate = new Date(this.latestMatch.date); - const diffMs = matchDate.getTime() - now.getTime(); - - if (diffMs <= 0) { - this.timeUntilMatch = null; - clearInterval(this.intervalId); - return; - } - - const totalMinutes = Math.floor(diffMs / (1000 * 60)); - const days = Math.floor(totalMinutes / (60 * 24)); - const hours = Math.floor((totalMinutes % (60 * 24)) / 60); - const minutes = totalMinutes % 60; - - let result = ''; - if (days > 0) result += `${days}j `; - if (hours > 0 || days > 0) result += `${hours}h `; - result += `${minutes}min`; - - this.timeUntilMatch = result.trim(); - } - - private loadRelatedEntities(match: Matches): void { - 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!; - }); - } - - 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'; - } - } - - getTimeUntilMatch(): string | null { - if ( - !this.latestMatch || - this.latestMatch.state !== MatchState.NOT_STARTED - ) { - return null; - } - - const now = new Date(); - const matchDate = new Date(this.latestMatch.date); - const diffMs = matchDate.getTime() - now.getTime(); - - if (diffMs <= 0) return null; - - const totalMinutes = Math.floor(diffMs / (1000 * 60)); - const days = Math.floor(totalMinutes / (60 * 24)); - const hours = Math.floor((totalMinutes % (60 * 24)) / 60); - const minutes = totalMinutes % 60; - - let result = ''; - if (days > 0) result += `${days}j `; - if (hours > 0 || days > 0) result += `${hours}h `; - result += `${minutes}min`; - - return result.trim(); - } -} diff --git a/FencerJudgeFront/src/app/components/match/matches-add/matches-add.component.css b/FencerJudgeFront/src/app/components/match/matches-add/matches-add.component.css deleted file mode 100644 index bb537a4..0000000 --- a/FencerJudgeFront/src/app/components/match/matches-add/matches-add.component.css +++ /dev/null @@ -1,18 +0,0 @@ -form fieldset { - background-color: #f8f9fa; /* gris clair */ -} - -form legend { - font-weight: 600; - font-size: 1.1rem; -} - -form label { - font-weight: 500; -} - -form button { - width: 100%; - padding: 0.6rem; - font-size: 1.1rem; -} diff --git a/FencerJudgeFront/src/app/components/match/matches-add/matches-add.component.html b/FencerJudgeFront/src/app/components/match/matches-add/matches-add.component.html deleted file mode 100644 index 130f2cc..0000000 --- a/FencerJudgeFront/src/app/components/match/matches-add/matches-add.component.html +++ /dev/null @@ -1,171 +0,0 @@ -

Ajouter un match

- -
-
- Joueur 1 - -
- - -
- -
- - -
- -
- - -
-
- -
- Joueur 2 - -
- - -
- -
- - -
- -
- - -
-
- -
- Arbitre - -
- - -
- -
- - -
- -
- - -
-
- -
- Match - -
- - -
- -
- - -
- -
- - -
- -
- - -
-
- - -
diff --git a/FencerJudgeFront/src/app/components/match/matches-add/matches-add.component.spec.ts b/FencerJudgeFront/src/app/components/match/matches-add/matches-add.component.spec.ts deleted file mode 100644 index 5cd8289..0000000 --- a/FencerJudgeFront/src/app/components/match/matches-add/matches-add.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { MatchesAddComponent } from './matches-add.component'; - -describe('MatchesAddComponent', () => { - let component: MatchesAddComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [MatchesAddComponent] - }) - .compileComponents(); - - fixture = TestBed.createComponent(MatchesAddComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/FencerJudgeFront/src/app/components/match/matches-add/matches-add.component.ts b/FencerJudgeFront/src/app/components/match/matches-add/matches-add.component.ts deleted file mode 100644 index 77a8a94..0000000 --- a/FencerJudgeFront/src/app/components/match/matches-add/matches-add.component.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { Component } from '@angular/core'; -import { Router } from '@angular/router'; -import { FormsModule } from '@angular/forms'; - -import { MatchesService } from '@services/matches/matches.service'; -import { MatchState } from '@interfaces/matches'; - -import { PlayerService } from '@services/player/player.service'; - -import { RefereeService } from '@services/referee/referee.service'; -import { Referee, RefereeLevel } from '@interfaces/referee'; - -@Component({ - selector: 'app-matches-add', - standalone: false, - templateUrl: './matches-add.component.html', - styleUrl: './matches-add.component.css', -}) -export class MatchesAddComponent { - formData = { - player1Id: 0, - player1FirstName: '', - player1Name: '', - player1Club: '', - - player2Id: 0, - player2FirstName: '', - player2Name: '', - player2Club: '', - - refereeId: 0, - refereeFirstName: '', - refereeName: '', - refereelevel: 0, - - city: '', - country: '', - weapon: '', - date: '', - }; - - constructor( - private matchService: MatchesService, - private playerService: PlayerService, - private refereeService: RefereeService, - private router: Router - ) {} - - onSubmit(): void { - this.playerService - .getOrCreateByName( - this.formData.player1FirstName, - this.formData.player1Name, - this.formData.player1Club - ) - .subscribe((player1) => { - this.formData['player1Id'] = player1.id; - - this.playerService - .getOrCreateByName( - this.formData.player2FirstName, - this.formData.player2Name, - this.formData.player2Club - ) - .subscribe((player2) => { - this.formData['player2Id'] = player2.id; - - this.refereeService - .getOrCreateByName( - this.formData.refereeFirstName, - this.formData.refereeName, - this.formData.refereelevel - ) - .subscribe((referee) => { - this.formData['refereeId'] = referee.id; - - const matchPayload = { - refereeID: referee.id, - player1ID: player1.id, - score1: 0, - player2ID: player2.id, - score2: 0, - country: this.formData.country, - city: this.formData.city, - weapon: this.formData.weapon, - date: new Date(this.formData.date), - state: MatchState.NOT_STARTED, - }; - - this.matchService.create(matchPayload).subscribe(() => { - this.router.navigate(['/matches']); - }); - }); - }); - }); - } -} diff --git a/FencerJudgeFront/src/app/components/match/matches-del/matches-del.component.css b/FencerJudgeFront/src/app/components/match/matches-del/matches-del.component.css deleted file mode 100644 index e69de29..0000000 diff --git a/FencerJudgeFront/src/app/components/match/matches-del/matches-del.component.html b/FencerJudgeFront/src/app/components/match/matches-del/matches-del.component.html deleted file mode 100644 index bae9ddd..0000000 --- a/FencerJudgeFront/src/app/components/match/matches-del/matches-del.component.html +++ /dev/null @@ -1 +0,0 @@ -

matches-del works!

diff --git a/FencerJudgeFront/src/app/components/match/matches-del/matches-del.component.spec.ts b/FencerJudgeFront/src/app/components/match/matches-del/matches-del.component.spec.ts deleted file mode 100644 index 29459b8..0000000 --- a/FencerJudgeFront/src/app/components/match/matches-del/matches-del.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { MatchesDelComponent } from './matches-del.component'; - -describe('MatchesDelComponent', () => { - let component: MatchesDelComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [MatchesDelComponent] - }) - .compileComponents(); - - fixture = TestBed.createComponent(MatchesDelComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/FencerJudgeFront/src/app/components/match/matches-del/matches-del.component.ts b/FencerJudgeFront/src/app/components/match/matches-del/matches-del.component.ts deleted file mode 100644 index b3b9bd4..0000000 --- a/FencerJudgeFront/src/app/components/match/matches-del/matches-del.component.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; - -import { AuthService } from '@services/auth/auth.service'; -import { MatchesService } from '@services/matches/matches.service'; - -@Component({ - selector: 'app-matches-del', - standalone: false, - templateUrl: './matches-del.component.html', - styleUrl: './matches-del.component.css', -}) -export class MatchesDelComponent { - constructor( - private route: ActivatedRoute, - public authService: AuthService, - private router: Router, - private matchService: MatchesService - ) {} - - ngOnInit(): void { - const id = Number(this.route.snapshot.paramMap.get('id')); - - if (!isNaN(id)) { - this.matchService.deleteMatch(id).subscribe({ - next: () => { - console.log(`Match ${id} supprimé`); - this.router.navigate(['/matches']); // redirection après suppression - }, - error: (err) => { - console.error('Erreur lors de la suppression :', err); - }, - }); - } else { - console.error('ID de match invalide'); - } - } -} diff --git a/FencerJudgeFront/src/app/components/match/matches-id/matches-id.component.css b/FencerJudgeFront/src/app/components/match/matches-id/matches-id.component.css deleted file mode 100644 index f517d5c..0000000 --- a/FencerJudgeFront/src/app/components/match/matches-id/matches-id.component.css +++ /dev/null @@ -1,3 +0,0 @@ -.card { - border-left-width: 0.5rem !important; -} diff --git a/FencerJudgeFront/src/app/components/match/matches-id/matches-id.component.html b/FencerJudgeFront/src/app/components/match/matches-id/matches-id.component.html deleted file mode 100644 index 6ce2a75..0000000 --- a/FencerJudgeFront/src/app/components/match/matches-id/matches-id.component.html +++ /dev/null @@ -1,96 +0,0 @@ -
-

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é.

-
- -Delete diff --git a/FencerJudgeFront/src/app/components/match/matches-id/matches-id.component.spec.ts b/FencerJudgeFront/src/app/components/match/matches-id/matches-id.component.spec.ts deleted file mode 100644 index b09ff2d..0000000 --- a/FencerJudgeFront/src/app/components/match/matches-id/matches-id.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -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/match/matches-id/matches-id.component.ts b/FencerJudgeFront/src/app/components/match/matches-id/matches-id.component.ts deleted file mode 100644 index c0ff55a..0000000 --- a/FencerJudgeFront/src/app/components/match/matches-id/matches-id.component.ts +++ /dev/null @@ -1,153 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { Router, ActivatedRoute } from '@angular/router'; -import { AuthService } from '@services/auth/auth.service'; - -import { MatchesService } from '@services/matches/matches.service'; -import { MatchState, Matches } from '@interfaces/matches'; - -import { PlayerService } from '@services/player/player.service'; -import { Player } from '@interfaces/player'; - -import { RefereeService } from '@services/referee/referee.service'; -import { Referee, RefereeLevel } from '@interfaces/referee'; - -import { getMatchStateLabel, getMatchStateColor } from '@utils/getState'; - -@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, - private router: Router - ) {} - - 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(); - } - - goToMatchDel(): void { - this.router.navigate([ - '/matches/del/', - this.route.snapshot.paramMap.get('id'), - ]); - } -} diff --git a/FencerJudgeFront/src/app/components/match/matches/matches.component.css b/FencerJudgeFront/src/app/components/match/matches/matches.component.css deleted file mode 100644 index 2fa4ff6..0000000 --- a/FencerJudgeFront/src/app/components/match/matches/matches.component.css +++ /dev/null @@ -1,8 +0,0 @@ -.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/match/matches/matches.component.html b/FencerJudgeFront/src/app/components/match/matches/matches.component.html deleted file mode 100644 index e7036ad..0000000 --- a/FencerJudgeFront/src/app/components/match/matches/matches.component.html +++ /dev/null @@ -1,53 +0,0 @@ -
-

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/match/matches/matches.component.spec.ts b/FencerJudgeFront/src/app/components/match/matches/matches.component.spec.ts deleted file mode 100644 index 7f7c3e1..0000000 --- a/FencerJudgeFront/src/app/components/match/matches/matches.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -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/match/matches/matches.component.ts b/FencerJudgeFront/src/app/components/match/matches/matches.component.ts deleted file mode 100644 index a1cf3dc..0000000 --- a/FencerJudgeFront/src/app/components/match/matches/matches.component.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { Component } from '@angular/core'; -import { Router } from '@angular/router'; - -import { MatchesService } from '@services/matches/matches.service'; -import { Matches, MatchState } from '@interfaces/matches'; - -import { PlayerService } from '@services/player/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, - private router: Router - ) {} - - 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'; - } - } - - goToMatchDetail(matchId: number): void { - this.router.navigate(['/matches', matchId]); - } -} diff --git a/FencerJudgeFront/src/app/guards/auth.guard.spec.ts b/FencerJudgeFront/src/app/guards/auth.guard.spec.ts deleted file mode 100644 index 4ae275e..0000000 --- a/FencerJudgeFront/src/app/guards/auth.guard.spec.ts +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 2da4546..0000000 --- a/FencerJudgeFront/src/app/guards/auth.guard.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { inject } from '@angular/core'; -import { CanActivateFn, Router } from '@angular/router'; -import { AuthService } from '@services/auth/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/interfaces/matches.ts b/FencerJudgeFront/src/app/interfaces/matches.ts deleted file mode 100644 index 1437a58..0000000 --- a/FencerJudgeFront/src/app/interfaces/matches.ts +++ /dev/null @@ -1,19 +0,0 @@ -export enum MatchState { - ONGOING = 0, - OVER = 1, - NOT_STARTED = 2, -} - -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 deleted file mode 100644 index 954ae9a..0000000 --- a/FencerJudgeFront/src/app/interfaces/models/user.model.ts +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 6f39558..0000000 --- a/FencerJudgeFront/src/app/interfaces/player.ts +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 3b4f0c1..0000000 --- a/FencerJudgeFront/src/app/interfaces/referee.ts +++ /dev/null @@ -1,12 +0,0 @@ -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/auth/auth.service.spec.ts b/FencerJudgeFront/src/app/services/auth/auth.service.spec.ts deleted file mode 100644 index f1251ca..0000000 --- a/FencerJudgeFront/src/app/services/auth/auth.service.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -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/auth.service.ts b/FencerJudgeFront/src/app/services/auth/auth.service.ts deleted file mode 100644 index 522d786..0000000 --- a/FencerJudgeFront/src/app/services/auth/auth.service.ts +++ /dev/null @@ -1,35 +0,0 @@ -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/src/app/services/matches/matches.service.spec.ts b/FencerJudgeFront/src/app/services/matches/matches.service.spec.ts deleted file mode 100644 index 0e9bf15..0000000 --- a/FencerJudgeFront/src/app/services/matches/matches.service.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -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/matches.service.ts b/FencerJudgeFront/src/app/services/matches/matches.service.ts deleted file mode 100644 index bbffd36..0000000 --- a/FencerJudgeFront/src/app/services/matches/matches.service.ts +++ /dev/null @@ -1,107 +0,0 @@ -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, - }, - ]; - private nextMatchId = Math.max(...this.matches.map((m) => m.id)) + 1; - - 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. - } - - 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`); - } - } - - create(match: Omit): Observable { - const newMatch: Matches = { - ...match, - id: this.nextMatchId++, - }; - - this.matches.push(newMatch); - console.log('[MatchesService] Match created:', newMatch); - return of(newMatch); - } - - deleteMatch(id: number): Observable { - const index = this.matches.findIndex((m) => m.id === id); - - if (index !== -1) { - const deletedMatch = this.matches.splice(index, 1)[0]; - console.log(`[MatchesService] Match ${id} supprimé :`, deletedMatch); - - return of(true); - } else { - console.warn(`[MatchesService] Match ${id} introuvable pour suppression`); - return of(false); - } - } -} diff --git a/FencerJudgeFront/src/app/services/player/player.service.spec.ts b/FencerJudgeFront/src/app/services/player/player.service.spec.ts deleted file mode 100644 index 5355445..0000000 --- a/FencerJudgeFront/src/app/services/player/player.service.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -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/player.service.ts b/FencerJudgeFront/src/app/services/player/player.service.ts deleted file mode 100644 index c5f3a1b..0000000 --- a/FencerJudgeFront/src/app/services/player/player.service.ts +++ /dev/null @@ -1,61 +0,0 @@ -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); - } - - getOrCreateByName( - firstName: string, - name: string, - club: string = 'Inconnu' - ): Observable { - const existing = this.players.find( - (p) => - p.firstName.toLowerCase() === firstName.toLowerCase() && - p.name.toLowerCase() === name.toLowerCase() - ); - - if (existing) { - console.log('[PlayerService] Joueur trouvé :', existing); - return of(existing); - } - - const newPlayer: Player = { - id: - this.players.length > 0 - ? Math.max(...this.players.map((p) => p.id)) + 1 - : 1, - firstName, - name, - club, - }; - - this.players.push(newPlayer); - console.log('[PlayerService] Nouveau joueur créé :', newPlayer); - return of(newPlayer); - } -} diff --git a/FencerJudgeFront/src/app/services/referee/referee.service.spec.ts b/FencerJudgeFront/src/app/services/referee/referee.service.spec.ts deleted file mode 100644 index b0f470c..0000000 --- a/FencerJudgeFront/src/app/services/referee/referee.service.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -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/referee.service.ts b/FencerJudgeFront/src/app/services/referee/referee.service.ts deleted file mode 100644 index 8d26a06..0000000 --- a/FencerJudgeFront/src/app/services/referee/referee.service.ts +++ /dev/null @@ -1,73 +0,0 @@ -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); - } - - getOrCreateByName( - firstName: string, - name: string, - level: RefereeLevel - ): Observable { - const existing = this.referees.find( - (r) => - r.firstName.toLowerCase() === firstName.toLowerCase() && - r.name.toLowerCase() === name.toLowerCase() - ); - - if (existing) { - console.log('[RefereeService] Arbitre trouvé :', existing); - return of(existing); - } - - const newPlayer: Referee = { - id: - this.referees.length > 0 - ? Math.max(...this.referees.map((r) => r.id)) + 1 - : 1, - firstName, - name, - level, - }; - - this.referees.push(newPlayer); - console.log('[RefereeService] Nouveau arbitre créé :', newPlayer); - return of(newPlayer); - } -} diff --git a/FencerJudgeFront/src/app/templates/sponsort/sponsort.component.css b/FencerJudgeFront/src/app/templates/sponsort/sponsort.component.css deleted file mode 100644 index 13c800a..0000000 --- a/FencerJudgeFront/src/app/templates/sponsort/sponsort.component.css +++ /dev/null @@ -1,56 +0,0 @@ -@keyframes slides { - from { - transform: translateX(0); - } - to { - transform: translateX(-100%); - } -} - -.logos { - overflow: hidden; - padding: 30px 0px; - white-space: nowrap; - position: relative; -} - -.logos:before, -.logos:after { - position: absolute; - top: 0; - content: ""; - width: 250px; - height: 100%; - z-index: 2; -} - -.logos:before { - left: 0; - background: linear-gradient( - to left, - rgba(255, 255, 255, 0), - rgb(255, 255, 255) - ); -} - -.logos:after { - right: 0; - background: linear-gradient( - to right, - rgba(255, 255, 255, 0), - rgb(255, 255, 255) - ); -} - -.logo_items { - display: inline-block; - animation: 35s slides infinite linear; -} - -.logos:hover .logo_items { - animation-play-state: paused; -} - -.logo_items img { - height: 100px; -} diff --git a/FencerJudgeFront/src/app/templates/sponsort/sponsort.component.html b/FencerJudgeFront/src/app/templates/sponsort/sponsort.component.html deleted file mode 100644 index dd13b28..0000000 --- a/FencerJudgeFront/src/app/templates/sponsort/sponsort.component.html +++ /dev/null @@ -1,44 +0,0 @@ -
-
- - - - - - - -
-
- - - - - - - -
-
diff --git a/FencerJudgeFront/src/app/templates/sponsort/sponsort.component.spec.ts b/FencerJudgeFront/src/app/templates/sponsort/sponsort.component.spec.ts deleted file mode 100644 index 9ca3691..0000000 --- a/FencerJudgeFront/src/app/templates/sponsort/sponsort.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { SponsortComponent } from './sponsort.component'; - -describe('SponsortComponent', () => { - let component: SponsortComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [SponsortComponent] - }) - .compileComponents(); - - fixture = TestBed.createComponent(SponsortComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/FencerJudgeFront/src/app/templates/sponsort/sponsort.component.ts b/FencerJudgeFront/src/app/templates/sponsort/sponsort.component.ts deleted file mode 100644 index 8058d61..0000000 --- a/FencerJudgeFront/src/app/templates/sponsort/sponsort.component.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-sponsort', - standalone: false, - templateUrl: './sponsort.component.html', - styleUrl: './sponsort.component.css' -}) -export class SponsortComponent { - -} diff --git a/FencerJudgeFront/src/app/utils/getState.ts b/FencerJudgeFront/src/app/utils/getState.ts deleted file mode 100644 index c7f141d..0000000 --- a/FencerJudgeFront/src/app/utils/getState.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { MatchState } from '@interfaces/matches'; - -export function 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'; - } -} - -export function 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'; - } -} diff --git a/FencerJudgeFront/src/assets/Logo/favicon.ico b/FencerJudgeFront/src/assets/Logo/favicon.ico deleted file mode 100644 index 7684fbd..0000000 Binary files a/FencerJudgeFront/src/assets/Logo/favicon.ico and /dev/null differ diff --git a/FencerJudgeFront/src/assets/Logo/favicon.png b/FencerJudgeFront/src/assets/Logo/favicon.png deleted file mode 100644 index a3376ab..0000000 Binary files a/FencerJudgeFront/src/assets/Logo/favicon.png and /dev/null differ diff --git a/FencerJudgeFront/src/assets/departements.jpg b/FencerJudgeFront/src/assets/departements.jpg deleted file mode 100644 index 787fc6b..0000000 Binary files a/FencerJudgeFront/src/assets/departements.jpg and /dev/null differ diff --git a/FencerJudgeFront/src/assets/duel.webp b/FencerJudgeFront/src/assets/duel.webp deleted file mode 100644 index 5282448..0000000 Binary files a/FencerJudgeFront/src/assets/duel.webp and /dev/null differ diff --git a/FencerJudgeFront/src/assets/epee_escrime.jpg b/FencerJudgeFront/src/assets/epee_escrime.jpg deleted file mode 100644 index 96b8b68..0000000 Binary files a/FencerJudgeFront/src/assets/epee_escrime.jpg and /dev/null differ diff --git a/FencerJudgeFront/src/assets/fleuret_escrime.jpg b/FencerJudgeFront/src/assets/fleuret_escrime.jpg deleted file mode 100644 index 95b6957..0000000 Binary files a/FencerJudgeFront/src/assets/fleuret_escrime.jpg and /dev/null differ diff --git a/FencerJudgeFront/src/assets/international.jpg b/FencerJudgeFront/src/assets/international.jpg deleted file mode 100644 index 3447190..0000000 Binary files a/FencerJudgeFront/src/assets/international.jpg and /dev/null differ diff --git a/FencerJudgeFront/src/assets/nationnal.jpg b/FencerJudgeFront/src/assets/nationnal.jpg deleted file mode 100644 index a9ed1a7..0000000 Binary files a/FencerJudgeFront/src/assets/nationnal.jpg and /dev/null differ diff --git a/FencerJudgeFront/src/assets/region.png b/FencerJudgeFront/src/assets/region.png deleted file mode 100644 index 3c6daa9..0000000 Binary files a/FencerJudgeFront/src/assets/region.png and /dev/null differ diff --git a/FencerJudgeFront/src/assets/sabre_escrime.jpg b/FencerJudgeFront/src/assets/sabre_escrime.jpg deleted file mode 100644 index 3aa26df..0000000 Binary files a/FencerJudgeFront/src/assets/sabre_escrime.jpg and /dev/null differ diff --git a/FencerJudgeFront/src/assets/sabre_laser_escrime.jpg b/FencerJudgeFront/src/assets/sabre_laser_escrime.jpg deleted file mode 100644 index fc13894..0000000 Binary files a/FencerJudgeFront/src/assets/sabre_laser_escrime.jpg and /dev/null differ diff --git a/FencerJudgeFront/src/index.html b/FencerJudgeFront/src/index.html index 27faadb..381bbb3 100644 --- a/FencerJudgeFront/src/index.html +++ b/FencerJudgeFront/src/index.html @@ -2,7 +2,7 @@ - FencerJudge + FencerJudgeFront diff --git a/FencerJudgeFront/src/styles.css b/FencerJudgeFront/src/styles.css index 5374057..90d4ee0 100644 --- a/FencerJudgeFront/src/styles.css +++ b/FencerJudgeFront/src/styles.css @@ -1,33 +1 @@ /* You can add global styles to this file, and also import other style files */ -.bg-primary-custom { - background-color: #414141; -} - -/* Colors */ -:root { - --primary-color: rgba(212, 175, 55, 0.6); - --gradient-color: linear-gradient(90deg, #d4af37, var(--primary-color)); - --card-gradient: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%), - linear-gradient(135deg, - rgba(64, 64, 64, 0.95) 0%, - rgba(32, 32, 32, 0.98) 50%, - rgba(16, 16, 16, 0.95) 100%); - --h-f-bg: #2c2c2c; -} - -/* Filters */ -:root { - --blur-effect: blur(10px) brightness(1.1) contrast(1.1); - --blur-hover: blur(8px) brightness(1.3); -} - -/* Transitions */ -:root { - --transition-smooth: all 0.6s cubic-bezier(0.4, 0, 0.2, 1); - --transition-quick: all 0.3s ease; -} - -/* Borders */ -:root { - --border-radius: 12px; -} \ No newline at end of file diff --git a/FencerJudgeFront/tsconfig.json b/FencerJudgeFront/tsconfig.json index fca3db7..5525117 100644 --- a/FencerJudgeFront/tsconfig.json +++ b/FencerJudgeFront/tsconfig.json @@ -16,14 +16,7 @@ "moduleResolution": "bundler", "importHelpers": true, "target": "ES2022", - "module": "ES2022", - "baseUrl": "./src", - "paths": { - "@interfaces/*": ["app/interfaces/*"], - "@services/*": ["app/services/*"], - "@guards/*": ["app/guards/*"], - "@utils/*": ["app/utils/*"] - } + "module": "ES2022" }, "angularCompilerOptions": { "enableI18nLegacyMessageIdFormat": false, diff --git a/db.mv.db b/db.mv.db deleted file mode 100644 index 13d536b..0000000 Binary files a/db.mv.db and /dev/null differ diff --git a/db.trace.db b/db.trace.db deleted file mode 100644 index 016cc9c..0000000 --- a/db.trace.db +++ /dev/null @@ -1,48 +0,0 @@ -2025-06-03 09:54:12.514185+02:00 database: close -org.h2.message.DbException: IO Exception: "Closing" -IO Exception: "Closing" [90028-232] - at org.h2.message.DbException.get(DbException.java:212) - at org.h2.mvstore.db.Store.close(Store.java:374) - at org.h2.engine.Database.closeOpenFilesAndUnlock(Database.java:1292) - at org.h2.engine.Database.closeImpl(Database.java:1254) - at org.h2.engine.Database.close(Database.java:1173) - at org.h2.engine.Database.onShutdown(Database.java:1158) - at org.h2.engine.OnExitDatabaseCloser.onShutdown(OnExitDatabaseCloser.java:85) - at org.h2.engine.OnExitDatabaseCloser.run(OnExitDatabaseCloser.java:114) -Caused by: org.h2.jdbc.JdbcSQLNonTransientException: IO Exception: "Closing" -IO Exception: "Closing" [90028-232] - at org.h2.message.DbException.getJdbcSQLException(DbException.java:566) - at org.h2.message.DbException.getJdbcSQLException(DbException.java:489) - ... 8 more -Caused by: org.h2.mvstore.MVStoreException: Reading from file sun.nio.ch.FileChannelImpl@1baeb921 failed at 15775 (length -1), read 0, remaining 24 [2.3.232/1] - at org.h2.mvstore.DataUtils.newMVStoreException(DataUtils.java:996) - at org.h2.mvstore.DataUtils.readFully(DataUtils.java:455) - at org.h2.mvstore.FileStore.readFully(FileStore.java:721) - at org.h2.mvstore.SingleFileStore.readFully(SingleFileStore.java:60) - at org.h2.mvstore.SingleFileStore.readFully(SingleFileStore.java:28) - at org.h2.mvstore.SFChunk.readFully(SFChunk.java:35) - at org.h2.mvstore.Chunk.readToC(Chunk.java:496) - at org.h2.mvstore.FileStore.getToC(FileStore.java:2070) - at org.h2.mvstore.FileStore.rewriteChunks(FileStore.java:1913) - at org.h2.mvstore.FileStore.compactRewrite(FileStore.java:1901) - at org.h2.mvstore.FileStore.rewriteChunks(FileStore.java:1862) - at org.h2.mvstore.FileStore.lambda$compact$0(FileStore.java:879) - at org.h2.mvstore.MVStore.tryExecuteUnderStoreLock(MVStore.java:937) - at org.h2.mvstore.FileStore.compact(FileStore.java:879) - at org.h2.mvstore.RandomAccessStore.compactStore(RandomAccessStore.java:441) - at org.h2.mvstore.FileStore.compactStore(FileStore.java:890) - at org.h2.mvstore.FileStore.stop(FileStore.java:275) - at org.h2.mvstore.MVStore.closeStore(MVStore.java:693) - at org.h2.mvstore.MVStore.close(MVStore.java:643) - at org.h2.mvstore.db.Store.close(Store.java:364) - ... 6 more -Caused by: java.io.IOException: Le périphérique n’est pas prêt - at java.base/sun.nio.ch.FileDispatcherImpl.pread0(Native Method) - at java.base/sun.nio.ch.FileDispatcherImpl.pread(FileDispatcherImpl.java:67) - at java.base/sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:338) - at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:306) - at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:283) - at java.base/sun.nio.ch.FileChannelImpl.readInternal(FileChannelImpl.java:984) - at java.base/sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:964) - at org.h2.mvstore.DataUtils.readFully(DataUtils.java:441) - ... 24 more diff --git a/jpe-controle.iml b/jpe-controle.iml index b081e58..9a5cfce 100644 --- a/jpe-controle.iml +++ b/jpe-controle.iml @@ -4,6 +4,5 @@ -
\ No newline at end of file diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 966ef08..0000000 --- a/package-lock.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "jpe-controle", - "lockfileVersion": 3, - "requires": true, - "packages": {} -}