Skip to content

Commit

Permalink
fix: 1740 inaccurate data being shown in review form (#1814)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgaseta authored Jan 16, 2025
1 parent f610f48 commit 5c3e341
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
13 changes: 5 additions & 8 deletions frontend/src/components/FavouriteActivities/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const FavouriteActivities = ({ isConsep }: FavouriteActivitiesProps) => {
<Row
className={
`favourite-activities ${windowSize.innerWidth < MEDIUM_SCREEN_WIDTH
? 'favourite-activities-sm-padding' : 'favourite-activities-padding'}
? 'favourite-activities-sm-padding' : 'favourite-activities-padding'}
${!isConsep && 'favourite-activities-with-background'}`
}
>
Expand Down Expand Up @@ -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) => (
<Column>
<FavouriteCard
key={favObject.type}
favObject={favObject}
/>
</Column>

<FavouriteCard
key={favObject.type}
favObject={favObject}
/>
))
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ const ParentTreeStep = ({ isReviewDisplay, isReviewRead }: ParentTreeStepProps)
}
<Row className="info-section-sub-title">
<Column>
Genetic worth and percent of Tested parent tree contribution
Genetic worth and percent of tested parent tree contribution
</Column>
</Row>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ const SeedlotReviewContent = () => {
areaOfUseData,
isFetchingData,
seedlotData,
calculatedValues,
genWorthInfoItems,
seedlotSpecies,
popSizeAndDiversityConfig
} = useContext(ClassAContext);
Expand Down Expand Up @@ -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
});
}
Expand Down

0 comments on commit 5c3e341

Please sign in to comment.