diff --git a/client/src/containers/projects/custom-project/header/index.tsx b/client/src/containers/projects/custom-project/header/index.tsx
index c1f2e2d2..b27c0fcb 100644
--- a/client/src/containers/projects/custom-project/header/index.tsx
+++ b/client/src/containers/projects/custom-project/header/index.tsx
@@ -6,7 +6,7 @@ import { useSession } from "next-auth/react";
import { cn } from "@/lib/utils";
-import { projectsUIState } from "@/app/projects/[id]/store";
+import { projectsUIState } from "@/app/projects/store";
import AuthDialog from "@/containers/auth/dialog";
import CustomProjectParameters from "@/containers/projects/custom-project/header/parameters";
diff --git a/client/src/containers/projects/custom-project/header/parameters/index.tsx b/client/src/containers/projects/custom-project/header/parameters/index.tsx
index 91e25f9f..1282bad8 100644
--- a/client/src/containers/projects/custom-project/header/parameters/index.tsx
+++ b/client/src/containers/projects/custom-project/header/parameters/index.tsx
@@ -26,6 +26,7 @@ export const PROJECT_PARAMETERS = [
key: FILTER_KEYS[3],
label: "Project size",
className: "w-[125px]",
+ disabled: false,
options: [
{
label: COST_TYPE_SELECTOR.NPV,
@@ -41,6 +42,7 @@ export const PROJECT_PARAMETERS = [
key: FILTER_KEYS[2],
label: "Carbon pricing type",
className: "w-[195px]",
+ disabled: true,
options: [
{
label: PROJECT_PRICE_TYPE.MARKET_PRICE,
@@ -81,6 +83,7 @@ export default function CustomProjectParameters() {
onValueChange={(v) => {
handleParameters(v, parameter.key);
}}
+ disabled={parameter.disabled}
>
diff --git a/client/src/containers/projects/custom-project/index.tsx b/client/src/containers/projects/custom-project/index.tsx
index 0b081132..d37fdddb 100644
--- a/client/src/containers/projects/custom-project/index.tsx
+++ b/client/src/containers/projects/custom-project/index.tsx
@@ -1,16 +1,18 @@
"use client";
import { FC } from "react";
+import { CustomProject as CustomProjectEntity } from "@shared/entities/custom-project.entity";
import { motion } from "framer-motion";
import { useAtomValue } from "jotai";
import { LAYOUT_TRANSITIONS } from "@/app/(overview)/constants";
-import {
- costDetailsFilterAtom,
- projectsUIState,
-} from "@/app/projects/[id]/store";
+import { costDetailsFilterAtom, projectsUIState } from "@/app/projects/store";
import AnnualProjectCashFlow from "@/containers/projects/custom-project/annual-project-cash-flow";
+import {
+ getBreakdownYears,
+ parseYearlyBreakdownForChart,
+} from "@/containers/projects/custom-project/annual-project-cash-flow/utils";
import ProjectCost from "@/containers/projects/custom-project/cost";
import CostDetails from "@/containers/projects/custom-project/cost-details";
import { parseCostDetailsForTable } from "@/containers/projects/custom-project/cost-details/table/utils";
@@ -23,34 +25,27 @@ import { useCustomProjectFilters } from "@/containers/projects/url-store";
import { useSidebar } from "@/components/ui/sidebar";
-// Temporary use of mock data until we decide on state management
-const {
- country,
- projectSize,
- projectLength,
- ecosystem,
- activity,
- lossRate,
- carbonRevenuesToCover,
- initialCarbonPrice,
- emissionFactors,
- totalProjectCost,
- summary,
- costDetails,
- leftover,
-} = mockData.data;
+// Temporary use of mock data until response from API is ready
+const { costDetails, leftover } = mockData.data;
const costDetailsData = {
total: parseCostDetailsForTable(costDetails.total),
npv: parseCostDetailsForTable(costDetails.npv),
};
export const SUMMARY_SIDEBAR_WIDTH = 460;
-const CustomProject: FC = () => {
+
+interface CustomProjectProps {
+ data: InstanceType;
+}
+
+const CustomProject: FC = ({ data }) => {
const [{ costRangeSelector }] = useCustomProjectFilters();
const costDetailsRangeSelector = useAtomValue(costDetailsFilterAtom);
const { projectSummaryOpen } = useAtomValue(projectsUIState);
const { open: navOpen } = useSidebar();
- const projectCostProps = totalProjectCost[costRangeSelector];
+ // TODO: should be replaced with correct type when available;
+ const output = data.output as any;
+ const projectCostProps = output.totalProjectCost[costRangeSelector];
const costDetailsProps = costDetailsData[costDetailsRangeSelector];
const leftOverProps = leftover[costRangeSelector];
@@ -76,27 +71,33 @@ const CustomProject: FC = () => {
transition={LAYOUT_TRANSITIONS}
className="overflow-hidden"
>
-
+
);
diff --git a/client/src/containers/projects/custom-project/left-over/index.tsx b/client/src/containers/projects/custom-project/left-over/index.tsx
index 2a3d8229..4cf858d4 100644
--- a/client/src/containers/projects/custom-project/left-over/index.tsx
+++ b/client/src/containers/projects/custom-project/left-over/index.tsx
@@ -2,6 +2,8 @@ import { FC } from "react";
import { renderCurrency } from "@/lib/format";
+import { CUSTOM_PROJECT_OUTPUTS } from "@/constants/tooltip";
+
import { Card, CardContent, CardHeader } from "@/components/ui/card";
import { Graph, GraphLegend } from "@/components/ui/graph";
import { Label } from "@/components/ui/label";
@@ -22,9 +24,8 @@ const LeftOver: FC = ({ total, leftover, opex }) => {
htmlFor="totalProjectCost"
className="text-md font-medium"
tooltip={{
- title: "Total project cost",
- content:
- "Refers to the summary of Capital Expenditure and Operating Expenditure",
+ title: "Leftover after OpEx",
+ content: CUSTOM_PROJECT_OUTPUTS.LEFTOVER_AFTER_OPEX,
}}
>
Leftover after OpEx
diff --git a/client/src/containers/projects/custom-project/summary/index.tsx b/client/src/containers/projects/custom-project/summary/index.tsx
index ba763cab..813780bf 100644
--- a/client/src/containers/projects/custom-project/summary/index.tsx
+++ b/client/src/containers/projects/custom-project/summary/index.tsx
@@ -4,11 +4,12 @@ import { type CustomProjectSummary } from "@shared/dtos/custom-projects/custom-p
import { useSetAtom } from "jotai";
import { XIcon } from "lucide-react";
-import { projectsUIState } from "@/app/projects/[id]/store";
+import { projectsUIState } from "@/app/projects/store";
+
+import { PROJECT_SUMMARY } from "@/constants/tooltip";
import { SUMMARY_SIDEBAR_WIDTH } from "@/containers/projects/custom-project";
-import FileEdit from "@/components/icons/file-edit";
import { Button } from "@/components/ui/button";
import InfoButton from "@/components/ui/info-button";
import Metric from "@/components/ui/metric";
@@ -71,9 +72,7 @@ const ProjectSummary: FC = ({ data }) => {
>
{key}
-
- tooltip.content
-
+
{PROJECT_SUMMARY[key]}
= ({ data }) => {
Calculations based on project setup parameters. For new calculations,
edit project details.
-
+ {/* TODO: Uncomment when feature is available */}
+ {/*
Edit Project
-
+ */}
);
diff --git a/shared/dtos/custom-projects/custom-project-output.dto.ts b/shared/dtos/custom-projects/custom-project-output.dto.ts
index 2649e9d6..5ed4c768 100644
--- a/shared/dtos/custom-projects/custom-project-output.dto.ts
+++ b/shared/dtos/custom-projects/custom-project-output.dto.ts
@@ -41,7 +41,7 @@ export type CustomProjectCostDetails = {
longTermProjectOperatingCost: number;
};
-export type OutputCostNames = [
+export type OutputCostNames = keyof [
"opexTotalCostPlan",
"capexTotalCostPlan",
"totalCostPlan",