Skip to content

Commit

Permalink
Merge pull request #235 from wri/feat/TM-911-seedings-counts
Browse files Browse the repository at this point in the history
[TM-911] Display seeding counts on project, site and their report admin pages
  • Loading branch information
roguenet authored Jun 6, 2024
2 parents e6c481a + 17cd802 commit 3c98194
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
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

0 comments on commit 3c98194

Please sign in to comment.