From 9edff20872dd3508fb228697e45fdbb79180f821 Mon Sep 17 00:00:00 2001 From: Thomas Bouquet <thomas.bouquet@student-cs.fr> Date: Sat, 6 Mar 2021 17:53:54 +0100 Subject: [PATCH] - des dons ds le classement + sprint != participant --- back/src/controllers/equipe.controller.js | 2 ++ front/src/components/Classement/ClassementEquipe.js | 6 +++--- front/src/components/Classement/ClassementIndividuel.js | 6 +++--- front/src/components/Classement/ClassementSprint.js | 6 +++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/back/src/controllers/equipe.controller.js b/back/src/controllers/equipe.controller.js index 881a69d0..2bc78849 100644 --- a/back/src/controllers/equipe.controller.js +++ b/back/src/controllers/equipe.controller.js @@ -28,8 +28,10 @@ function getClassementEquipe(req, res) { if (data.id in leader_team) { if (leader_team[data.id].participants.indexOf(data.partId) == -1) { leader_team[data.id].participants.unshift(data.partId); + if (data.id != 'sprint') { leader_team[data.id].nbParticipant += 1; } + } leader_team[data.id].score += data.score; leader_team[data.id].nbScores += 1; } else { diff --git a/front/src/components/Classement/ClassementEquipe.js b/front/src/components/Classement/ClassementEquipe.js index d62d8641..f2e0d673 100644 --- a/front/src/components/Classement/ClassementEquipe.js +++ b/front/src/components/Classement/ClassementEquipe.js @@ -22,7 +22,7 @@ export default function ClassEquipe() { rank: i++, association: item.name, distance: item.score, - dons: Math.trunc(item.score*eventData.argentParMetre)+" €", + //dons: Math.trunc(item.score*eventData.argentParMetre)+" €", relais: item.nbScores, rameurs: item.nbParticipant }, @@ -52,12 +52,12 @@ export default function ClassEquipe() { sort: 'disabled', width: 100, }, - { + /*{ label: 'Dons rapportés', field: 'dons', sort: 'disabled', width: 100, - }, + },*/ { label: 'Nombre de relais', field: 'relais', diff --git a/front/src/components/Classement/ClassementIndividuel.js b/front/src/components/Classement/ClassementIndividuel.js index d22640f0..c377209e 100644 --- a/front/src/components/Classement/ClassementIndividuel.js +++ b/front/src/components/Classement/ClassementIndividuel.js @@ -24,7 +24,7 @@ export default function ClassIndiv() { nom: item.name, assos: item.equipes.join(", "), distance: item.score, - dons: Math.trunc(item.score*eventData.argentParMetre)+" €", + //dons: Math.trunc(item.score*eventData.argentParMetre)+" €", sessions: item.nbScores }, ), @@ -59,12 +59,12 @@ export default function ClassIndiv() { sort: 'disabled', width: 100, }, - { + /*{ label: 'Dons rapportés', field: 'dons', sort: 'disabled', width: 100, - }, + },*/ { label: 'Sessions', field: 'sessions', diff --git a/front/src/components/Classement/ClassementSprint.js b/front/src/components/Classement/ClassementSprint.js index fbacd145..223751b4 100644 --- a/front/src/components/Classement/ClassementSprint.js +++ b/front/src/components/Classement/ClassementSprint.js @@ -22,7 +22,7 @@ export default function ClassSprint() { rank: i++, association: item.name, distance: item.score, - dons: Math.trunc(item.score*eventData.argentParMetre)+" €" + //dons: Math.trunc(item.score*eventData.argentParMetre)+" €" }, ) ); @@ -50,12 +50,12 @@ export default function ClassSprint() { sort: 'disabled', width: 100, }, - { + /*{ label: 'Dons rapportés', field: 'dons', sort: 'disabled', width: 100, - }, + },*/ ], rows: data}) } -- GitLab