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

[MERGE] merge 'main' into 'staging' post HH release #227

Merged
merged 8 commits into from
May 30, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ const HighLevelMetics: FC = () => {
</Labeled>
</When>
<When condition={record?.framework_key === "ppc"}>
<Labeled label="Workdays Created" sx={inlineLabelSx}>
<NumberField source="workday_count" emptyText="0" />
</Labeled>
<Labeled label="Self Reported Workdays Created" sx={inlineLabelSx}>
<Labeled label="Workdays Created (Old Calculation)" sx={inlineLabelSx}>
<NumberField source="self_reported_workday_count" emptyText="0" />
</Labeled>
<Labeled label="Workdays Created (New Calculation)" sx={inlineLabelSx}>
<NumberField source="workday_count" emptyText="0" />
</Labeled>
</When>
<Labeled label="Trees Planted" sx={inlineLabelSx}>
<NumberField source="trees_planted_count" emptyText="0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ const HighLevelMetics: FC = () => {
<Box paddingX={3.75} paddingY={2}>
<Stack gap={3}>
<When condition={isPPC}>
<Labeled label="Total Number Of Workdays Created" sx={inlineLabelSx}>
<NumberField source="workday_count" emptyText="0" />
</Labeled>
<Labeled label="Self Reported Workdays Created" sx={inlineLabelSx}>
<Labeled label="Workdays Created (Old Calculation)" sx={inlineLabelSx}>
<NumberField source="self_reported_workday_count" emptyText="0" />
</Labeled>
<Labeled label="Workdays Created (New Calculation)" sx={inlineLabelSx}>
<NumberField source="workday_count" emptyText="0" />
</Labeled>
</When>
<Labeled label="Total Number Of Trees Planted" sx={inlineLabelSx}>
<NumberField source="trees_planted_count" emptyText="0" />
Expand Down
12 changes: 7 additions & 5 deletions src/components/elements/Cards/ProjectCard/ProjectCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ const ProjectCard = ({ project, onDelete, title, children, className, ...rest }:
);
};

const frameworkNames: { [key: string]: string } = {
ppc: "Priceless Planet Coalition",
hbf: "Harit Bharat Fund",
terrafund: "TerraFund"
};

return (
<Paper {...rest} className={classNames(className, "p-0")}>
<div className="flex items-center gap-4 border-b border-neutral-100 px-8 py-6">
Expand All @@ -72,11 +78,7 @@ const ProjectCard = ({ project, onDelete, title, children, className, ...rest }:
<div className="flex">
<Text variant="text-bold-subtitle-500">{t("Framework")}:&#160;</Text>
<Text variant="text-light-subtitle-400" className="capitalize">
{project.framework_key === "ppc"
? t("Priceless Planet Coalition")
: project.framework_key === "terrafund"
? t("TerraFund")
: project.framework_key}
{frameworkNames[project.framework_key] ? t(frameworkNames[project.framework_key]) : project.framework_key}
</Text>
</div>
<div className="flex">
Expand Down
2 changes: 1 addition & 1 deletion src/pages/nursery/[uuid]/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const NurseryDetailPage = () => {
nursery.framework_key === "ppc"
? t("Priceless Planet Coalition")
: nursery.framework_key === "hbf"
? "HBF"
? "Harit Bharat Fund"
: t("TerraFund")
]}
hasBackButton={false}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/project/[uuid]/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const ProjectDetailPage = () => {
isPPC
? t("Priceless Planet Coalition")
: isHBF
? "HBF"
? "Harit Bharat Fund"
: isTerrafund
? t("TerraFund")
: reportingFramework.name
Expand Down
6 changes: 5 additions & 1 deletion src/pages/project/[uuid]/tabs/Overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ const ProjectOverviewTab = ({ project }: ProjectOverviewTabProps) => {
<div className="flex w-full flex-wrap gap-6">
<If condition={isPPC}>
<Then>
<GoalProgressCard label={t("Workday (PPC)")} value={project.workday_count} className="w-[170px]" />
<GoalProgressCard
label={t("Workday (PPC)")}
value={project.self_reported_workday_count}
className="w-[170px]"
/>
</Then>
<Else>
<GoalProgressCard
Expand Down
2 changes: 1 addition & 1 deletion src/pages/site/[uuid]/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const SiteDetailPage = () => {

const subtitles = [
`${t("Organisation")}: ${site.organisation?.name}`,
isPPC ? t("Priceless Planet Coalition") : isHBF ? "HBF" : t("TerraFund")
isPPC ? t("Priceless Planet Coalition") : isHBF ? "Harit Bharat Fund" : t("TerraFund")
];
if (isPPC) {
subtitles.push(t("Site ID: {id}", { id: site.ppc_external_id }));
Expand Down
6 changes: 5 additions & 1 deletion src/pages/site/[uuid]/tabs/Overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ const SiteOverviewTab = ({ site }: SiteOverviewTabProps) => {
>
<div className="flex w-full flex-wrap gap-6">
<When condition={isPPC}>
<GoalProgressCard label={t("Workday Count (PPC)")} value={site.workday_count} className="w-[170px]" />
<GoalProgressCard
label={t("Workday Count (PPC)")}
value={site.self_reported_workday_count}
className="w-[170px]"
/>
</When>
<GoalProgressCard
label={t("Hectares Restored Goal")}
Expand Down