diff --git a/client/src/containers/projects/form/setup/conservation-project-details/t2-national-emission-factors.tsx b/client/src/containers/projects/form/setup/conservation-project-details/t2-national-emission-factors.tsx
index 17680e47..2143b597 100644
--- a/client/src/containers/projects/form/setup/conservation-project-details/t2-national-emission-factors.tsx
+++ b/client/src/containers/projects/form/setup/conservation-project-details/t2-national-emission-factors.tsx
@@ -23,18 +23,21 @@ export default function T2NationalEmissionFactors() {
countryCode,
}).queryKey;
- const { data } = client.customProjects.getActivityTypesDefaults.useQuery(
- queryKey,
- { query: { ecosystem, countryCode } },
- {
+ const { data, isSuccess } =
+ client.customProjects.getActivityTypesDefaults.useQuery(
queryKey,
- enabled: !!ecosystem && !!countryCode,
- select: (response) => {
- const { data } = response.body;
- return data[activity as ACTIVITY.CONSERVATION].emissionFactor.tier2;
+ { query: { ecosystem, countryCode } },
+ {
+ queryKey,
+ enabled: !!ecosystem && !!countryCode,
+ select: (response) => {
+ const { data } = response.body;
+ return data[activity as ACTIVITY.CONSERVATION].emissionFactor.tier2;
+ },
},
- },
- );
+ );
+
+ if (!isSuccess) return null;
return (
diff --git a/client/src/containers/projects/form/setup/restoration-project-detail/index.tsx b/client/src/containers/projects/form/setup/restoration-project-detail/index.tsx
index be4f1f06..0183c849 100644
--- a/client/src/containers/projects/form/setup/restoration-project-detail/index.tsx
+++ b/client/src/containers/projects/form/setup/restoration-project-detail/index.tsx
@@ -47,18 +47,19 @@ export default function RestorationProjectDetails() {
countryCode,
}).queryKey;
- const { data } = client.customProjects.getActivityTypesDefaults.useQuery(
- queryKey,
- { query: { ecosystem, countryCode } },
- {
+ const { data, isSuccess } =
+ client.customProjects.getActivityTypesDefaults.useQuery(
queryKey,
- enabled: !!ecosystem && !!countryCode,
- select: (response) => {
- const { data } = response.body;
- return data[activity as ACTIVITY.RESTORATION].sequestrationRate;
+ { query: { ecosystem, countryCode } },
+ {
+ queryKey,
+ enabled: !!ecosystem && !!countryCode,
+ select: (response) => {
+ const { data } = response.body;
+ return data[activity as ACTIVITY.RESTORATION].sequestrationRate;
+ },
},
- },
- );
+ );
const RESTORATION_ACTIVITY_OPTIONS = Object.values(
RESTORATION_ACTIVITY_SUBTYPE,
@@ -179,81 +180,88 @@ export default function RestorationProjectDetails() {
(
-
-
- Project Specific Emission Factor
-
-
-
+ render={({ field }) => {
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
+ const { value, ...restField } = field;
+
+ return (
+
+
+ Planting Success Rate
+
+
+
+ {
+ form.setValue(
+ "parameters.plantingSuccessRate",
+ Number(v.target.value),
+ );
+ }}
+ readOnly
+ defaultValue={80}
+ disabled
+ />
+
+
+
+
+ );
+ }}
+ />
+
+ <>
+ {tierSelector === SEQUESTRATION_RATE_TIER_TYPES.TIER_1 &&
+ isSuccess && (
+
+
+ IPCC default value
+
+
{
- form.setValue(
- "parameters.plantingSuccessRate",
- Number(v.target.value),
- );
- // await form.trigger("parameters.plantingSuccessRate");
- }}
- readOnly
+ className="w-full pr-32 text-muted-foreground"
disabled
+ readOnly
+ value={data?.tier1}
/>
-
-
-
- )}
- />
-
- <>
- {tierSelector === SEQUESTRATION_RATE_TIER_TYPES.TIER_1 && (
-
-
- IPCC default value
-
-
-
-
- )}
- {tierSelector === SEQUESTRATION_RATE_TIER_TYPES.TIER_2 && (
-
-
- Country-specific rate
-
-
-
+ )}
+ {tierSelector === SEQUESTRATION_RATE_TIER_TYPES.TIER_2 &&
+ isSuccess && (
+
+
+ Country-specific rate
+
+
+
+
-
- )}
+ )}
{tierSelector === SEQUESTRATION_RATE_TIER_TYPES.TIER_3 && (