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

[TM-911] Display seeding counts on project, site and their report admin pages #235

Merged
merged 1 commit into from
Jun 6, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ const HighLevelMetics: FC = () => {
<Labeled label="Trees Planted" sx={inlineLabelSx}>
<NumberField source="trees_planted_count" emptyText="0" />
</Labeled>
<When condition={record?.framework_key === "ppc"}>
<Labeled label="Seeds Planted" sx={inlineLabelSx}>
<NumberField source="seeds_planted_count" emptyText="0" />
</Labeled>
</When>
</Stack>
</Card>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const HighLevelMetics: FC = () => {
};

const isTerraFund = record.framework_key === "terrafund";
const isPPC = record.framework_key === "ppc";
const workdaysType = resource === "projectReport" ? "Project" : resource === "siteReport" ? "Site" : null;

return (
Expand Down Expand Up @@ -48,6 +49,14 @@ const HighLevelMetics: FC = () => {
emptyText="0"
/>
</Labeled>
<When condition={isPPC && (resource === "projectReport" || resource === "siteReport")}>
<Labeled label="Total Number Of Seeds Planted" sx={inlineLabelSx}>
<NumberField
source={record.seeds_planted_count ? "trees_planted_count" : "total_seeds_planted_count"}
emptyText="0"
/>
</Labeled>
</When>
<When condition={isTerraFund}>
<Labeled label="Total Number Of Seedlings" sx={inlineLabelSx}>
<NumberField source="seedlings_grown" emptyText="0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ const HighLevelMetics: FC = () => {
<Labeled label="Total Number Of Trees Planted" sx={inlineLabelSx} className="label-field-aside">
<NumberField source="trees_planted_count" emptyText="0" />
</Labeled>
<When condition={isPPC}>
<Labeled label="Total Number Of Seeds Planted" sx={inlineLabelSx} className="label-field-aside">
<NumberField source="seeds_planted_count" emptyText="0" />
</Labeled>
</When>
<Labeled label="Hectares Under Restoration" sx={inlineLabelSx} className="label-field-aside">
<NumberField source="hectares_to_restore_goal" emptyText="0" />
</Labeled>
Expand Down