From 5c3e341080456739040fb3122d9fdb118384cf31 Mon Sep 17 00:00:00 2001 From: mgaseta <105936322+mgaseta@users.noreply.github.com> Date: Thu, 16 Jan 2025 09:27:36 -0300 Subject: [PATCH] fix: 1740 inaccurate data being shown in review form (#1814) --- .../src/components/FavouriteActivities/index.tsx | 13 +++++-------- .../ParentTreeStep/index.tsx | 2 +- .../Seedlot/SeedlotReview/SeedlotReviewContent.tsx | 12 +++++------- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/frontend/src/components/FavouriteActivities/index.tsx b/frontend/src/components/FavouriteActivities/index.tsx index 76f1dde13..197ab213a 100644 --- a/frontend/src/components/FavouriteActivities/index.tsx +++ b/frontend/src/components/FavouriteActivities/index.tsx @@ -36,7 +36,7 @@ const FavouriteActivities = ({ isConsep }: FavouriteActivitiesProps) => { @@ -80,13 +80,10 @@ const FavouriteActivities = ({ isConsep }: FavouriteActivitiesProps) => { activities by clicking on the heart icon inside each page" /> ) : favActQuery.data.filter((fav) => fav.isConsep === isConsep).map((favObject) => ( - - - - + )) ) } diff --git a/frontend/src/components/SeedlotRegistrationSteps/ParentTreeStep/index.tsx b/frontend/src/components/SeedlotRegistrationSteps/ParentTreeStep/index.tsx index 64e20e65c..aa37fbf90 100644 --- a/frontend/src/components/SeedlotRegistrationSteps/ParentTreeStep/index.tsx +++ b/frontend/src/components/SeedlotRegistrationSteps/ParentTreeStep/index.tsx @@ -369,7 +369,7 @@ const ParentTreeStep = ({ isReviewDisplay, isReviewRead }: ParentTreeStepProps) } - Genetic worth and percent of Tested parent tree contribution + Genetic worth and percent of tested parent tree contribution { diff --git a/frontend/src/views/Seedlot/SeedlotReview/SeedlotReviewContent.tsx b/frontend/src/views/Seedlot/SeedlotReview/SeedlotReviewContent.tsx index d7f1ad4d2..a05b7eee4 100644 --- a/frontend/src/views/Seedlot/SeedlotReview/SeedlotReviewContent.tsx +++ b/frontend/src/views/Seedlot/SeedlotReview/SeedlotReviewContent.tsx @@ -145,7 +145,7 @@ const SeedlotReviewContent = () => { areaOfUseData, isFetchingData, seedlotData, - calculatedValues, + genWorthInfoItems, seedlotSpecies, popSizeAndDiversityConfig } = useContext(ClassAContext); @@ -282,16 +282,14 @@ const SeedlotReviewContent = () => { .forEach((genWorthKey) => { if (genWorthVals[genWorthKey].value) { const upperCaseCode = genWorthKey.toUpperCase(); - const traitIndex = calculatedValues.map( - (trait) => trait.traitCode - ).indexOf(upperCaseCode); seedlotReviewGeneticWorth.push({ traitCode: upperCaseCode, calculatedValue: Number(genWorthVals[genWorthKey].value), - // Use the same percentage value, since users can't edit it testedParentTreePerc: - calculatedValues[traitIndex] - ? calculatedValues[traitIndex].testedParentTreePerc + genWorthInfoItems[genWorthKey] + // Dividing by 100 since the current value is in percentage and we need + // to submit the real value + ? Number(genWorthInfoItems[genWorthKey][1].value) / 100 : 0 }); }