Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 1740 inaccurate data being shown in review form #1814

Merged
merged 4 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading