diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 000000000..194b0c659 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,16 @@ +name: pull-request +on: + pull_request: + branches: [main, staging, release/**] +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + - name: Install modules + run: yarn + - name: Test + run: yarn run jest --ci diff --git a/.jest/setEnvVars.js b/.jest/setEnvVars.js index f148eb1be..8d2b37bde 100644 --- a/.jest/setEnvVars.js +++ b/.jest/setEnvVars.js @@ -1,2 +1,2 @@ process.env.NODE_ENV = "test"; -process.env.NEXT_PUBLIC_API_BASE_URL = "https://test.wrirestorationmarketplace.cubeapis.com"; +process.env.NEXT_PUBLIC_API_BASE_URL = "https://new-wri-staging.wri-restoration-marketplace-api.com"; diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 000000000..603606bc9 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +18.17.0 diff --git a/src/admin/components/ResourceTabs/InformationTab/components/ProjectInformationAside/HighLevelMetrics.tsx b/src/admin/components/ResourceTabs/InformationTab/components/ProjectInformationAside/HighLevelMetrics.tsx index d7b65969d..ee72b1cfe 100644 --- a/src/admin/components/ResourceTabs/InformationTab/components/ProjectInformationAside/HighLevelMetrics.tsx +++ b/src/admin/components/ResourceTabs/InformationTab/components/ProjectInformationAside/HighLevelMetrics.tsx @@ -26,7 +26,10 @@ const HighLevelMetics: FC = () => { - + + + + diff --git a/src/admin/components/ResourceTabs/InformationTab/components/SiteInformationAside/HighLevelMetrics.tsx b/src/admin/components/ResourceTabs/InformationTab/components/SiteInformationAside/HighLevelMetrics.tsx index 6311dbeb2..d6fa709eb 100644 --- a/src/admin/components/ResourceTabs/InformationTab/components/SiteInformationAside/HighLevelMetrics.tsx +++ b/src/admin/components/ResourceTabs/InformationTab/components/SiteInformationAside/HighLevelMetrics.tsx @@ -24,7 +24,10 @@ const HighLevelMetics: FC = () => { - + + + + diff --git a/src/admin/modules/nurseries/components/NurseriesList.tsx b/src/admin/modules/nurseries/components/NurseriesList.tsx index 0465fe5d2..17f64de3a 100644 --- a/src/admin/modules/nurseries/components/NurseriesList.tsx +++ b/src/admin/modules/nurseries/components/NurseriesList.tsx @@ -1,10 +1,11 @@ import { Divider, Stack, Typography } from "@mui/material"; -import { FC, useState } from "react"; +import { FC } from "react"; import { AutocompleteInput, Datagrid, DateField, EditButton, + FunctionField, List, ReferenceInput, SearchInput, @@ -19,15 +20,17 @@ import ListActions from "@/admin/components/Actions/ListActions"; import ExportProcessingAlert from "@/admin/components/Alerts/ExportProcessingAlert"; import CustomBulkDeleteWithConfirmButton from "@/admin/components/Buttons/CustomBulkDeleteWithConfirmButton"; import CustomDeleteWithConfirmButton from "@/admin/components/Buttons/CustomDeleteWithConfirmButton"; +import FrameworkSelectionDialog, { useFrameworkExport } from "@/admin/components/Dialogs/FrameworkSelectionDialog"; import { getCountriesOptions } from "@/constants/options/countries"; +import { useFrameworkChoices } from "@/constants/options/frameworks"; import { getChangeRequestStatusOptions, getStatusOptions } from "@/constants/options/status"; -import { fetchGetV2AdminENTITYExportFRAMEWORK } from "@/generated/apiComponents"; -import { downloadFileBlob } from "@/utils/network"; import { optionToChoices } from "@/utils/options"; import modules from "../.."; const NurseryDataGrid: FC = () => { + const frameworkChoices = useFrameworkChoices(); + return ( }> @@ -41,6 +44,15 @@ const NurseryDataGrid: FC = () => { + + frameworkChoices.find((framework: any) => framework.id === record?.framework_key)?.name ?? + record?.framework_key + } + sortable={false} + /> @@ -51,7 +63,7 @@ const NurseryDataGrid: FC = () => { }; export const NurseriesList: FC = () => { - const [exporting, setExporting] = useState(false); + const frameworkChoices = useFrameworkChoices(); const filters = [ , @@ -68,6 +80,7 @@ export const NurseriesList: FC = () => { > , + , , { ]; - const handleExport = () => { - setExporting(true); - - fetchGetV2AdminENTITYExportFRAMEWORK({ - pathParams: { - entity: "nurseries", - framework: "terrafund" - } - }) - .then((response: any) => { - downloadFileBlob(response, "Nurseries - terrafund.csv"); - }) - .finally(() => setExporting(false)); - }; + const { exporting, openExportDialog, frameworkDialogProps } = useFrameworkExport("nurseries"); return ( <> @@ -112,10 +112,12 @@ export const NurseriesList: FC = () => { - } filters={filters}> + } filters={filters}> + + ); diff --git a/src/admin/modules/nurseryReports/components/NurseryReportsList.tsx b/src/admin/modules/nurseryReports/components/NurseryReportsList.tsx index f4c14d185..15c08c148 100644 --- a/src/admin/modules/nurseryReports/components/NurseryReportsList.tsx +++ b/src/admin/modules/nurseryReports/components/NurseryReportsList.tsx @@ -1,10 +1,11 @@ import { Divider, Stack, Typography } from "@mui/material"; -import { FC, useState } from "react"; +import { FC } from "react"; import { AutocompleteInput, Datagrid, DateField, EditButton, + FunctionField, List, ReferenceInput, SearchInput, @@ -17,15 +18,17 @@ import { import ListActions from "@/admin/components/Actions/ListActions"; import ExportProcessingAlert from "@/admin/components/Alerts/ExportProcessingAlert"; import CustomBulkDeleteWithConfirmButton from "@/admin/components/Buttons/CustomBulkDeleteWithConfirmButton"; +import FrameworkSelectionDialog, { useFrameworkExport } from "@/admin/components/Dialogs/FrameworkSelectionDialog"; import { getCountriesOptions } from "@/constants/options/countries"; +import { useFrameworkChoices } from "@/constants/options/frameworks"; import { getChangeRequestStatusOptions, getReportStatusOptions } from "@/constants/options/status"; -import { fetchGetV2AdminENTITYExportFRAMEWORK } from "@/generated/apiComponents"; -import { downloadFileBlob } from "@/utils/network"; import { optionToChoices } from "@/utils/options"; import modules from "../.."; const NurseryReportDataGrid: FC = () => { + const frameworkChoices = useFrameworkChoices(); + return ( }> @@ -41,6 +44,15 @@ const NurseryReportDataGrid: FC = () => { + + frameworkChoices.find((framework: any) => framework.id === record?.framework_key)?.name ?? + record?.framework_key + } + sortable={false} + /> @@ -48,7 +60,7 @@ const NurseryReportDataGrid: FC = () => { }; export const NurseryReportsList: FC = () => { - const [exporting, setExporting] = useState(false); + const frameworkChoices = useFrameworkChoices(); const filters = [ , @@ -77,6 +89,7 @@ export const NurseryReportsList: FC = () => { , , + , , { /> ]; - const handleExport = () => { - setExporting(true); - - fetchGetV2AdminENTITYExportFRAMEWORK({ - pathParams: { - entity: "nursery-reports", - framework: "terrafund" - } - }) - .then((response: any) => { - downloadFileBlob(response, "Nursery Reports - terrafund.csv"); - }) - .finally(() => setExporting(false)); - }; + const { exporting, openExportDialog, frameworkDialogProps } = useFrameworkExport("nursery-reports"); return ( <> @@ -109,10 +109,12 @@ export const NurseryReportsList: FC = () => { - } filters={filters}> + } filters={filters}> + + ); diff --git a/src/components/elements/Cards/FundingCard/__snapshots__/FundingCard.stories.storyshot b/src/components/elements/Cards/FundingCard/__snapshots__/FundingCard.stories.storyshot index d64d5ab9f..5ea8b0618 100644 --- a/src/components/elements/Cards/FundingCard/__snapshots__/FundingCard.stories.storyshot +++ b/src/components/elements/Cards/FundingCard/__snapshots__/FundingCard.stories.storyshot @@ -41,7 +41,7 @@ exports[`Storyshots Components/Elements/Cards/FundingCard Default 1`] = ` Location:

London, United Kingdom @@ -54,10 +54,10 @@ exports[`Storyshots Components/Elements/Cards/FundingCard Default 1`] = ` The funding application is designed for restoration projects in Africa. This application provides an opportunity for project developers to seek financial support for their restoration initiatives across the African continent.

@@ -72,11 +78,7 @@ const ProjectCard = ({ project, onDelete, title, children, className, ...rest }:
{t("Framework")}:  - {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}
diff --git a/src/components/elements/ImageGallery/__snapshots__/ImageGallery.stories.storyshot b/src/components/elements/ImageGallery/__snapshots__/ImageGallery.stories.storyshot index 5f71ff116..38fa4a4b6 100644 --- a/src/components/elements/ImageGallery/__snapshots__/ImageGallery.stories.storyshot +++ b/src/components/elements/ImageGallery/__snapshots__/ImageGallery.stories.storyshot @@ -31,6 +31,14 @@ exports[`Storyshots Components/Elements/ImageGallery Default 1`] = ` > Show All

+
@@ -69,6 +77,14 @@ exports[`Storyshots Components/Elements/ImageGallery Default 1`] = `
+ @@ -144,11 +178,29 @@ exports[`Storyshots Components/Elements/ImageGallery Default 1`] = ` onMouseEnter={[Function]} onTouchStart={[Function]} target="_blank" - /> + > +
+
@@ -209,11 +261,29 @@ exports[`Storyshots Components/Elements/ImageGallery Default 1`] = ` onMouseEnter={[Function]} onTouchStart={[Function]} target="_blank" - /> + > +
+
@@ -264,6 +334,14 @@ exports[`Storyshots Components/Elements/ImageGallery Default 1`] = `
+
@@ -274,11 +352,29 @@ exports[`Storyshots Components/Elements/ImageGallery Default 1`] = ` onMouseEnter={[Function]} onTouchStart={[Function]} target="_blank" - /> + > +
+
@@ -339,11 +435,29 @@ exports[`Storyshots Components/Elements/ImageGallery Default 1`] = ` onMouseEnter={[Function]} onTouchStart={[Function]} target="_blank" - /> + > +
+
@@ -394,6 +508,14 @@ exports[`Storyshots Components/Elements/ImageGallery Default 1`] = `
+
@@ -404,11 +526,29 @@ exports[`Storyshots Components/Elements/ImageGallery Default 1`] = ` onMouseEnter={[Function]} onTouchStart={[Function]} target="_blank" - /> + > +
+
@@ -469,11 +609,29 @@ exports[`Storyshots Components/Elements/ImageGallery Default 1`] = ` onMouseEnter={[Function]} onTouchStart={[Function]} target="_blank" - /> + > +
+
@@ -534,11 +692,29 @@ exports[`Storyshots Components/Elements/ImageGallery Default 1`] = ` onMouseEnter={[Function]} onTouchStart={[Function]} target="_blank" - /> + > +
+
@@ -589,6 +765,14 @@ exports[`Storyshots Components/Elements/ImageGallery Default 1`] = `
+
@@ -599,11 +783,29 @@ exports[`Storyshots Components/Elements/ImageGallery Default 1`] = ` onMouseEnter={[Function]} onTouchStart={[Function]} target="_blank" - /> + > +
+
@@ -654,6 +856,14 @@ exports[`Storyshots Components/Elements/ImageGallery Default 1`] = `
+
@@ -664,11 +874,29 @@ exports[`Storyshots Components/Elements/ImageGallery Default 1`] = ` onMouseEnter={[Function]} onTouchStart={[Function]} target="_blank" - /> + > +
+
@@ -723,7 +951,16 @@ exports[`Storyshots Components/Elements/ImageGallery Default 1`] = `
+ > +
+

+ > +

+

+ > +

+
diff --git a/src/components/elements/Inputs/BooleanInput/__snapshots__/BooleanInput.stories.storyshot b/src/components/elements/Inputs/BooleanInput/__snapshots__/BooleanInput.stories.storyshot index 7cfac736f..dfc1cdbb4 100644 --- a/src/components/elements/Inputs/BooleanInput/__snapshots__/BooleanInput.stories.storyshot +++ b/src/components/elements/Inputs/BooleanInput/__snapshots__/BooleanInput.stories.storyshot @@ -53,6 +53,7 @@ exports[`Storyshots Components/Elements/Inputs/BooleanInput Default 1`] = ` className="flex flex-row-reverse items-center justify-end gap-3 " id=":re:" label="Yes" + onChange={[Function]} type="radio" /> @@ -86,6 +87,7 @@ exports[`Storyshots Components/Elements/Inputs/BooleanInput Default 1`] = ` className="flex flex-row-reverse items-center justify-end gap-3 " id=":rg:" label="No" + onChange={[Function]} type="radio" /> diff --git a/src/components/elements/Inputs/ConditionalInput/ConditionalInput.stories.tsx b/src/components/elements/Inputs/ConditionalInput/ConditionalInput.stories.tsx index 1e9d57f16..c5e99b25d 100644 --- a/src/components/elements/Inputs/ConditionalInput/ConditionalInput.stories.tsx +++ b/src/components/elements/Inputs/ConditionalInput/ConditionalInput.stories.tsx @@ -16,7 +16,8 @@ type Story = StoryObj; export const Default: Story = { render: args => { const formHook = useForm(); - return ; + const onChangeCapture = () => {}; + return ; }, args: { name: "conditional-field", diff --git a/src/components/elements/Inputs/ConditionalInput/__snapshots__/ConditionalInput.stories.storyshot b/src/components/elements/Inputs/ConditionalInput/__snapshots__/ConditionalInput.stories.storyshot index b8b201302..aa443fce1 100644 --- a/src/components/elements/Inputs/ConditionalInput/__snapshots__/ConditionalInput.stories.storyshot +++ b/src/components/elements/Inputs/ConditionalInput/__snapshots__/ConditionalInput.stories.storyshot @@ -54,6 +54,7 @@ Array [ className="flex flex-row-reverse items-center justify-end gap-3 " id=":rl:" label="Yes" + onChange={[Function]} type="radio" /> @@ -87,6 +88,7 @@ Array [ className="flex flex-row-reverse items-center justify-end gap-3 " id=":rn:" label="No" + onChange={[Function]} type="radio" /> diff --git a/src/components/elements/Inputs/Dropdown/__snapshots__/Dropdown.stories.storyshot b/src/components/elements/Inputs/Dropdown/__snapshots__/Dropdown.stories.storyshot index 7afb98a12..48ed83dc6 100644 --- a/src/components/elements/Inputs/Dropdown/__snapshots__/Dropdown.stories.storyshot +++ b/src/components/elements/Inputs/Dropdown/__snapshots__/Dropdown.stories.storyshot @@ -42,6 +42,14 @@ exports[`Storyshots Components/Elements/Inputs/Dropdown Multi Select 1`] = ` > placeholder +
@@ -89,6 +97,14 @@ exports[`Storyshots Components/Elements/Inputs/Dropdown Multi Select With Other > placeholder +
@@ -136,6 +152,14 @@ exports[`Storyshots Components/Elements/Inputs/Dropdown Single Select 1`] = ` > placeholder +
@@ -183,6 +207,14 @@ exports[`Storyshots Components/Elements/Inputs/Dropdown Single Select With Other > placeholder +
diff --git a/src/components/elements/Inputs/InputElements/InputLabel.tsx b/src/components/elements/Inputs/InputElements/InputLabel.tsx index 17e50defa..1248094c8 100644 --- a/src/components/elements/Inputs/InputElements/InputLabel.tsx +++ b/src/components/elements/Inputs/InputElements/InputLabel.tsx @@ -1,7 +1,7 @@ import { useT } from "@transifex/react"; import classNames from "classnames"; import { isNumber } from "lodash"; -import { HTMLProps } from "react"; +import { forwardRef, HTMLProps, RefObject } from "react"; import { When } from "react-if"; import StatusPill from "@/components/elements/StatusPill/StatusPill"; @@ -16,7 +16,7 @@ export interface InputLabelProps extends HTMLProps { suffixLabelView?: boolean; } -const InputLabel = (props: InputLabelProps) => { +export default forwardRef(function InputLabel(props: InputLabelProps, ref) { const t = useT(); const { feedbackRequired, @@ -32,6 +32,7 @@ const InputLabel = (props: InputLabelProps) => { {...labelProps} + ref={ref as RefObject} as="label" variant={labelVariant ?? "text-bold-body-300"} className={classNames("mr-2 inline uppercase", className)} @@ -46,6 +47,4 @@ const InputLabel = (props: InputLabelProps) => { ); -}; - -export default InputLabel; +}); diff --git a/src/components/elements/Inputs/LanguageDropdown/__snapshots__/LanguagesDropdown.stories.storyshot b/src/components/elements/Inputs/LanguageDropdown/__snapshots__/LanguagesDropdown.stories.storyshot index 62b79263b..aaa73a5c6 100644 --- a/src/components/elements/Inputs/LanguageDropdown/__snapshots__/LanguagesDropdown.stories.storyshot +++ b/src/components/elements/Inputs/LanguageDropdown/__snapshots__/LanguagesDropdown.stories.storyshot @@ -19,11 +19,27 @@ exports[`Storyshots Components/Elements/Inputs/LanguagesDropdown Default 1`] = ` onMouseDown={[Function]} type="button" > +
English +
diff --git a/src/components/elements/Inputs/RadioGroup/__snapshots__/RadioGroup.stories.storyshot b/src/components/elements/Inputs/RadioGroup/__snapshots__/RadioGroup.stories.storyshot index fb42745a4..11a8a76e6 100644 --- a/src/components/elements/Inputs/RadioGroup/__snapshots__/RadioGroup.stories.storyshot +++ b/src/components/elements/Inputs/RadioGroup/__snapshots__/RadioGroup.stories.storyshot @@ -44,6 +44,7 @@ exports[`Storyshots Components/Elements/Inputs/RadioGroup Default 1`] = ` className="flex flex-row-reverse items-center justify-end gap-3 " id=":r1g:" label="Yes" + onChange={[Function]} type="radio" /> @@ -77,6 +78,7 @@ exports[`Storyshots Components/Elements/Inputs/RadioGroup Default 1`] = ` className="flex flex-row-reverse items-center justify-end gap-3 " id=":r1i:" label="No" + onChange={[Function]} type="radio" /> diff --git a/src/components/elements/LandingPage/__snapshots__/AlternatingSection.stories.storyshot b/src/components/elements/LandingPage/__snapshots__/AlternatingSection.stories.storyshot index d505d787e..6aabb122e 100644 --- a/src/components/elements/LandingPage/__snapshots__/AlternatingSection.stories.storyshot +++ b/src/components/elements/LandingPage/__snapshots__/AlternatingSection.stories.storyshot @@ -44,7 +44,7 @@ exports[`Storyshots Components/Elements/LandingPage/AlternatingSection Left 1`] className="flex justify-center bg-background md:w-[50%]" >
image
image @@ -32,7 +32,7 @@ exports[`Storyshots Components/Elements/SelectImageList Condensed 1`] = ` className="aspect-square h-[6.375rem] rounded-lg bg-cover bg-center transition-all duration-200" style={ Object { - "backgroundImage": "url('https://test.wrirestorationmarketplace.cubeapis.com/images/V2/sustainable-development-goals/good-health-and-well-being@2x.png')", + "backgroundImage": "url('https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/sustainable-development-goals/good-health-and-well-being@2x.png')", } } /> @@ -52,7 +52,7 @@ exports[`Storyshots Components/Elements/SelectImageList Condensed 1`] = ` className="aspect-square h-[6.375rem] rounded-lg bg-cover bg-center transition-all duration-200" style={ Object { - "backgroundImage": "url('https://test.wrirestorationmarketplace.cubeapis.com/images/V2/sustainable-development-goals/quality-education@2x.png')", + "backgroundImage": "url('https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/sustainable-development-goals/quality-education@2x.png')", } } /> @@ -72,7 +72,7 @@ exports[`Storyshots Components/Elements/SelectImageList Condensed 1`] = ` className="aspect-square h-[6.375rem] rounded-lg bg-cover bg-center transition-all duration-200" style={ Object { - "backgroundImage": "url('https://test.wrirestorationmarketplace.cubeapis.com/images/V2/sustainable-development-goals/affordable-and-clean-energy@2x.png')", + "backgroundImage": "url('https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/sustainable-development-goals/affordable-and-clean-energy@2x.png')", } } /> @@ -92,7 +92,7 @@ exports[`Storyshots Components/Elements/SelectImageList Condensed 1`] = ` className="aspect-square h-[6.375rem] rounded-lg bg-cover bg-center transition-all duration-200" style={ Object { - "backgroundImage": "url('https://test.wrirestorationmarketplace.cubeapis.com/images/V2/sustainable-development-goals/climate-action@2x.png')", + "backgroundImage": "url('https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/sustainable-development-goals/climate-action@2x.png')", } } /> @@ -119,7 +119,7 @@ exports[`Storyshots Components/Elements/SelectImageList Default 1`] = ` className="border-4 border-neutral-900 aspect-square h-[6.375rem] rounded-lg bg-cover bg-center transition-all duration-200" style={ Object { - "backgroundImage": "url('https://test.wrirestorationmarketplace.cubeapis.com/images/V2/sustainable-development-goals/no_poverty@2x.png')", + "backgroundImage": "url('https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/sustainable-development-goals/no_poverty@2x.png')", } } /> @@ -139,7 +139,7 @@ exports[`Storyshots Components/Elements/SelectImageList Default 1`] = ` className="border-4 border-neutral-900 aspect-square h-[6.375rem] rounded-lg bg-cover bg-center transition-all duration-200" style={ Object { - "backgroundImage": "url('https://test.wrirestorationmarketplace.cubeapis.com/images/V2/sustainable-development-goals/good-health-and-well-being@2x.png')", + "backgroundImage": "url('https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/sustainable-development-goals/good-health-and-well-being@2x.png')", } } /> @@ -159,7 +159,7 @@ exports[`Storyshots Components/Elements/SelectImageList Default 1`] = ` className="border-4 border-neutral-900 aspect-square h-[6.375rem] rounded-lg bg-cover bg-center transition-all duration-200" style={ Object { - "backgroundImage": "url('https://test.wrirestorationmarketplace.cubeapis.com/images/V2/sustainable-development-goals/quality-education@2x.png')", + "backgroundImage": "url('https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/sustainable-development-goals/quality-education@2x.png')", } } /> @@ -179,7 +179,7 @@ exports[`Storyshots Components/Elements/SelectImageList Default 1`] = ` className="border-4 border-neutral-900 aspect-square h-[6.375rem] rounded-lg bg-cover bg-center transition-all duration-200" style={ Object { - "backgroundImage": "url('https://test.wrirestorationmarketplace.cubeapis.com/images/V2/sustainable-development-goals/affordable-and-clean-energy@2x.png')", + "backgroundImage": "url('https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/sustainable-development-goals/affordable-and-clean-energy@2x.png')", } } /> @@ -199,7 +199,7 @@ exports[`Storyshots Components/Elements/SelectImageList Default 1`] = ` className="border-4 border-neutral-900 aspect-square h-[6.375rem] rounded-lg bg-cover bg-center transition-all duration-200" style={ Object { - "backgroundImage": "url('https://test.wrirestorationmarketplace.cubeapis.com/images/V2/sustainable-development-goals/climate-action@2x.png')", + "backgroundImage": "url('https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/sustainable-development-goals/climate-action@2x.png')", } } /> diff --git a/src/components/elements/Table/__snapshots__/Table.stories.storyshot b/src/components/elements/Table/__snapshots__/Table.stories.storyshot index 1d2763868..e2ef42969 100644 --- a/src/components/elements/Table/__snapshots__/Table.stories.storyshot +++ b/src/components/elements/Table/__snapshots__/Table.stories.storyshot @@ -13,6 +13,14 @@ exports[`Storyshots Components/Elements/Table Default 1`] = `
+
Show All

+
@@ -94,6 +110,14 @@ exports[`Storyshots Components/Elements/Table Default 1`] = ` onClick={[Function]} > Funding source +
Funding amount +
+

+

+

+

+

+

+

+

+

+

+ > +
+

+ > +

+

+ > +

+
diff --git a/src/components/elements/Tabs/Default/TabButton.tsx b/src/components/elements/Tabs/Default/TabButton.tsx index 876496f3b..97e284389 100644 --- a/src/components/elements/Tabs/Default/TabButton.tsx +++ b/src/components/elements/Tabs/Default/TabButton.tsx @@ -1,5 +1,5 @@ import classNames from "classnames"; -import { ButtonHTMLAttributes, DetailedHTMLProps } from "react"; +import { ButtonHTMLAttributes, DetailedHTMLProps, forwardRef } from "react"; import { When } from "react-if"; import Text from "@/components/elements/Text/Text"; @@ -16,39 +16,35 @@ export interface TabButtonProps extends DetailedHTMLProps { - return ( - - ); -}; +export const TabButton = forwardRef( + ({ index, item, lastItem, selected, className, textVariant, ...buttonProps }: TabButtonProps, ref) => { + // @ts-ignore + buttonProps["ref"] = ref; + return ( + + ); + } +); diff --git a/src/components/elements/Text/Text.tsx b/src/components/elements/Text/Text.tsx index 1d36ee0f7..0baac7c40 100644 --- a/src/components/elements/Text/Text.tsx +++ b/src/components/elements/Text/Text.tsx @@ -1,6 +1,6 @@ import cn from "classnames"; import _ from "lodash"; -import { HTMLProps, ReactNode } from "react"; +import { ForwardedRef, forwardRef, HTMLProps, LegacyRef, ReactElement, ReactNode } from "react"; import { TextVariants } from "@/types/common"; @@ -13,7 +13,7 @@ export type TextProps = HTMLProps & { capitalize?: boolean; }; -function Text(props: TextProps): JSX.Element { +function Text(props: TextProps, ref: ForwardedRef): JSX.Element { const { as: As, className, children, variant, capitalize, containHtml, ...rest } = props; const Component = As || "p"; @@ -23,6 +23,7 @@ function Text(props: TextProps): JSX.Element { return ( (props: TextProps): JSX.Element { ); } else return ( - + {typeof children === "string" ? _.unescape(children) : children} ); } -export default Text; +export default forwardRef(Text) as (p: TextProps & { ref?: LegacyRef }) => ReactElement; diff --git a/src/components/extensive/ActionTracker/cards/__snapshots__/ApplicationsCard.stories.storyshot b/src/components/extensive/ActionTracker/cards/__snapshots__/ApplicationsCard.stories.storyshot index 786fab0dc..024613e50 100644 --- a/src/components/extensive/ActionTracker/cards/__snapshots__/ApplicationsCard.stories.storyshot +++ b/src/components/extensive/ActionTracker/cards/__snapshots__/ApplicationsCard.stories.storyshot @@ -258,24 +258,6 @@ exports[`Storyshots Components/Extensive/ActionTracker/ApplicationsCard Default > TerraFund for AFR100: Landscapes - Expression of Interest (Enterprises)

-
-
-

- Rejected -

-

TerraFund for AFR100: Landscapes - Expression of Interest (Enterprises)

+
+
+

+ More info requested +

+

- Awaiting Review + Awaiting approval

diff --git a/src/components/extensive/List/List.tsx b/src/components/extensive/List/List.tsx index 09bb7a9e7..3ccc82ef0 100644 --- a/src/components/extensive/List/List.tsx +++ b/src/components/extensive/List/List.tsx @@ -38,7 +38,7 @@ const List = , U>({ {startListElement ? {startListElement} : <>} {items.map((item, i, array) => ( - + {render(item, i, array)} {dividerComponent} diff --git a/src/components/extensive/Pagination/__snapshots__/PerPageSelector.stories.storyshot b/src/components/extensive/Pagination/__snapshots__/PerPageSelector.stories.storyshot index fcfc894f3..efcc498c7 100644 --- a/src/components/extensive/Pagination/__snapshots__/PerPageSelector.stories.storyshot +++ b/src/components/extensive/Pagination/__snapshots__/PerPageSelector.stories.storyshot @@ -35,7 +35,16 @@ exports[`Storyshots Components/Elements/Table/PerPageSelector Default 1`] = `
+ > +
+

+

+ +
+
+`; + +exports[`Storyshots Components/Extensive/WorkdayCollapse Default 1`] = ` +
+
+ +
+
+`; + +exports[`Storyshots Components/Extensive/WorkdayCollapse In Progress Green 1`] = ` +
+
+ +
+
+`; + +exports[`Storyshots Components/Extensive/WorkdayCollapse Not Started Green 1`] = ` +
+
+ +
+
+`; + +exports[`Storyshots Components/Extensive/WorkdayCollapse Variant Narrow 1`] = ` +
+
+ +
+
+`; diff --git a/src/components/generic/Layout/__snapshots__/MainLayout.stories.storyshot b/src/components/generic/Layout/__snapshots__/MainLayout.stories.storyshot index f6702a91d..e2244bb59 100644 --- a/src/components/generic/Layout/__snapshots__/MainLayout.stories.storyshot +++ b/src/components/generic/Layout/__snapshots__/MainLayout.stories.storyshot @@ -13,6 +13,14 @@ exports[`Storyshots Components/Generic/Layouts/MainLayout Default 1`] = `
+
@@ -34,11 +42,27 @@ exports[`Storyshots Components/Generic/Layouts/MainLayout Default 1`] = ` onMouseDown={[Function]} type="button" > +
English +
@@ -103,6 +127,14 @@ exports[`Storyshots Components/Generic/Layouts/MainLayout Default 1`] = `
+
+
English +
@@ -139,7 +187,16 @@ exports[`Storyshots Components/Generic/Layouts/MainLayout Default 1`] = ` className="flex items-center justify-center rounded-full hover:bg-opacity-60 tour-menu-button block lg:hidden" disabled={false} onClick={[Function]} - /> + > +
+
+
@@ -28,11 +36,27 @@ exports[`Storyshots Components/Generic/Navbar Logged In 1`] = ` onMouseDown={[Function]} type="button" > +
English +
@@ -74,6 +98,14 @@ exports[`Storyshots Components/Generic/Navbar Logged In 1`] = `
+
+
English +
@@ -110,7 +158,16 @@ exports[`Storyshots Components/Generic/Navbar Logged In 1`] = ` className="flex items-center justify-center rounded-full hover:bg-opacity-60 tour-menu-button block lg:hidden" disabled={false} onClick={[Function]} - /> + > +
+ `; @@ -122,6 +179,14 @@ exports[`Storyshots Components/Generic/Navbar Logged Out 1`] = `
+
@@ -143,11 +208,27 @@ exports[`Storyshots Components/Generic/Navbar Logged Out 1`] = ` onMouseDown={[Function]} type="button" > +
English +
@@ -212,6 +293,14 @@ exports[`Storyshots Components/Generic/Navbar Logged Out 1`] = `
+
+
English +
@@ -248,7 +353,16 @@ exports[`Storyshots Components/Generic/Navbar Logged Out 1`] = ` className="flex items-center justify-center rounded-full hover:bg-opacity-60 tour-menu-button block lg:hidden" disabled={false} onClick={[Function]} - /> + > +
+
`; diff --git a/src/constants/options/__snapshots__/landTenure.test.ts.snap b/src/constants/options/__snapshots__/landTenure.test.ts.snap index 9b813c2d1..b55686087 100644 --- a/src/constants/options/__snapshots__/landTenure.test.ts.snap +++ b/src/constants/options/__snapshots__/landTenure.test.ts.snap @@ -4,42 +4,42 @@ exports[`snapShot test getLandTenureOptions 1`] = ` [ { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/land-tenures/public.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/land-tenures/public.png", }, "title": "Public", "value": "public", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/land-tenures/private.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/land-tenures/private.png", }, "title": "Private", "value": "private", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/land-tenures/indigenous.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/land-tenures/indigenous.png", }, "title": "Indigenous", "value": "indigenous", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/land-tenures/communal.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/land-tenures/communal.png", }, "title": "Communal", "value": "communal", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/land-tenures/national-protected-area.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/land-tenures/national-protected-area.png", }, "title": "National Protected Area", "value": "national-protected-area", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/land-tenures/other.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/land-tenures/other.png", }, "title": "Other", "value": "other", diff --git a/src/constants/options/__snapshots__/restorationInterventionTypes.test.ts.snap b/src/constants/options/__snapshots__/restorationInterventionTypes.test.ts.snap index e72ebdcc9..6fce06118 100644 --- a/src/constants/options/__snapshots__/restorationInterventionTypes.test.ts.snap +++ b/src/constants/options/__snapshots__/restorationInterventionTypes.test.ts.snap @@ -4,63 +4,63 @@ exports[`snapShot test getRestorationInterventionTypeOptions 1`] = ` [ { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/restoration-methods/agroforestry@2x.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/restoration-methods/agroforestry@2x.png", }, "title": "Agroforestry", "value": "agroforestry", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/restoration-methods/applied_nucleation_tree_island@2x.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/restoration-methods/applied_nucleation_tree_island@2x.png", }, "title": "Applied Nucleation", "value": "applied-nucleation", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/restoration-methods/assisted_natural@2x.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/restoration-methods/assisted_natural@2x.png", }, "title": "Assisted Natural Regeneration", "value": "assisted-natural-regeneration", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/restoration-methods/direct_seeding@2x.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/restoration-methods/direct_seeding@2x.png", }, "title": "Direct Seeding", "value": "direct-seeding", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/restoration-methods/enrichment_planting@2x.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/restoration-methods/enrichment_planting@2x.png", }, "title": "Enrichment Planting", "value": "enrichment-planting", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/restoration-methods/mangrove@2x.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/restoration-methods/mangrove@2x.png", }, "title": "Mangrove Restoration", "value": "mangrove-restoration", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/restoration-methods/reforestation@2x.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/restoration-methods/reforestation@2x.png", }, "title": "Reforestation", "value": "reforestation", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/restoration-methods/riparian@2x.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/restoration-methods/riparian@2x.png", }, "title": "Riparian Restoration", "value": "riparian-restoration", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/restoration-methods/silvopasture@2x.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/restoration-methods/silvopasture@2x.png", }, "title": "Silvopasture", "value": "silvopasture", diff --git a/src/constants/options/__snapshots__/status.test.ts.snap b/src/constants/options/__snapshots__/status.test.ts.snap index 47df3e24e..af9d78dc5 100644 --- a/src/constants/options/__snapshots__/status.test.ts.snap +++ b/src/constants/options/__snapshots__/status.test.ts.snap @@ -6,10 +6,6 @@ exports[`snapShot getStatusOptions 1`] = ` "title": "Draft", "value": "started", }, - { - "title": "Rejected", - "value": "rejected", - }, { "title": "Approved", "value": "approved", diff --git a/src/constants/options/__snapshots__/sustainableDevelopmentGoals.test.ts.snap b/src/constants/options/__snapshots__/sustainableDevelopmentGoals.test.ts.snap index 73d313f82..4b737eee6 100644 --- a/src/constants/options/__snapshots__/sustainableDevelopmentGoals.test.ts.snap +++ b/src/constants/options/__snapshots__/sustainableDevelopmentGoals.test.ts.snap @@ -4,119 +4,119 @@ exports[`snapShot test sustainableDevelopmentGoalsOptions 1`] = ` [ { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/sustainable-development-goals/no_poverty@2x.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/sustainable-development-goals/no_poverty@2x.png", }, "title": "No Poverty", "value": "no-poverty", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/sustainable-development-goals/zero_hunger@2x.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/sustainable-development-goals/zero_hunger@2x.png", }, "title": "Zero Hunger", "value": "zero-hunger", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/sustainable-development-goals/good-health-and-well-being@2x.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/sustainable-development-goals/good-health-and-well-being@2x.png", }, "title": "Good Health and Well-being", "value": "good-health-and-well-being", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/sustainable-development-goals/quality-education@2x.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/sustainable-development-goals/quality-education@2x.png", }, "title": "Quality Education", "value": "quality-education", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/sustainable-development-goals/gender-equality@2x.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/sustainable-development-goals/gender-equality@2x.png", }, "title": "Gender Equality", "value": "gender-equality", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/sustainable-development-goals/clean-water-and-sanitation@2x.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/sustainable-development-goals/clean-water-and-sanitation@2x.png", }, "title": "Clean Water and Sanitation", "value": "clean-water-and-sanitation", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/sustainable-development-goals/affordable-and-clean-energy@2x.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/sustainable-development-goals/affordable-and-clean-energy@2x.png", }, "title": "Affordable and Clean Energy", "value": "affordable-and-clean-energy", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/sustainable-development-goals/decent-work-and-economic-growth@2x.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/sustainable-development-goals/decent-work-and-economic-growth@2x.png", }, "title": "Decent Work and Economic Growth", "value": "decent-work-and-economic-growth", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/sustainable-development-goals/industry-innovation-and-infrastructure@2x.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/sustainable-development-goals/industry-innovation-and-infrastructure@2x.png", }, "title": "Industry, Innovation, and Infrastructure", "value": "industry-innovation-and-infrastructure", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/sustainable-development-goals/reduced-inequalities@2x.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/sustainable-development-goals/reduced-inequalities@2x.png", }, "title": "Reduced Inequalities", "value": "reduced-inequalities", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/sustainable-development-goals/sustainable-cities-and-communities@2x.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/sustainable-development-goals/sustainable-cities-and-communities@2x.png", }, "title": "Sustainable Cities and Communities", "value": "sustainable-cities-and-communities", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/sustainable-development-goals/responsible-consumption-and-production@2x.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/sustainable-development-goals/responsible-consumption-and-production@2x.png", }, "title": "Responsible Consumption and Production", "value": "responsible-consumption-and-production", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/sustainable-development-goals/climate-action@2x.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/sustainable-development-goals/climate-action@2x.png", }, "title": "Climate Action", "value": "climate-action", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/sustainable-development-goals/life-below-water@2x.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/sustainable-development-goals/life-below-water@2x.png", }, "title": "Life Below Water", "value": "life-below-water", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/sustainable-development-goals/life-on-land@2x.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/sustainable-development-goals/life-on-land@2x.png", }, "title": "Life on Land", "value": "life-on-land", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/sustainable-development-goals/peace-justice-and-strong-institutions@2x.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/sustainable-development-goals/peace-justice-and-strong-institutions@2x.png", }, "title": "Peace, Justice, and Strong Institutions", "value": "peace-justice-and-strong-institutions", }, { "meta": { - "image_url": "https://test.wrirestorationmarketplace.cubeapis.com/images/V2/sustainable-development-goals/partnerships-for-the-goals@2x.png", + "image_url": "https://new-wri-staging.wri-restoration-marketplace-api.com/images/V2/sustainable-development-goals/partnerships-for-the-goals@2x.png", }, "title": "Partnerships for the Goals", "value": "partnerships-for-the-goals", diff --git a/src/context/modal.provider.test.tsx b/src/context/modal.provider.test.tsx index 95354fc2f..6ca8538a1 100644 --- a/src/context/modal.provider.test.tsx +++ b/src/context/modal.provider.test.tsx @@ -1,4 +1,5 @@ import { renderHook } from "@testing-library/react"; +import { act } from "react-dom/test-utils"; import { wait } from "@/utils/test-utils"; @@ -12,7 +13,7 @@ describe("Modal context provider", () => { wrapper: props => {props.children} }); - result.current.openModal(Modal); + act(() => result.current.openModal(Modal)); await wait(200); expect(result.current.modalOpen).toEqual(true); @@ -24,10 +25,10 @@ describe("Modal context provider", () => { wrapper: props => {props.children} }); - result.current.openModal(Modal); + act(() => result.current.openModal(Modal)); await wait(200); - result.current.closeModal(); + act(() => result.current.closeModal()); await wait(200); expect(result.current.modalOpen).toEqual(false); @@ -38,7 +39,7 @@ describe("Modal context provider", () => { wrapper: props => {props.children} }); - result.current.setModalContent(Modal); + act(() => result.current.setModalContent(Modal)); await wait(200); expect(result.current.modalContent).toEqual(Modal); diff --git a/src/hooks/useGetCustomFormSteps/__snapshots__/useGetCustomFormSteps.stories.storyshot b/src/hooks/useGetCustomFormSteps/__snapshots__/useGetCustomFormSteps.stories.storyshot index 5d9041557..b0167205e 100644 --- a/src/hooks/useGetCustomFormSteps/__snapshots__/useGetCustomFormSteps.stories.storyshot +++ b/src/hooks/useGetCustomFormSteps/__snapshots__/useGetCustomFormSteps.stories.storyshot @@ -237,6 +237,14 @@ exports[`Storyshots Components/Extensive/Form/Wizard With Get Form Step Hook 1`] +
@@ -279,6 +287,14 @@ exports[`Storyshots Components/Extensive/Form/Wizard With Get Form Step Hook 1`] +
@@ -385,6 +401,14 @@ exports[`Storyshots Components/Extensive/Form/Wizard With Get Form Step Hook 1`] +
@@ -789,16 +813,25 @@ exports[`Storyshots Components/Extensive/Form/Wizard With Get Form Step Hook 1`]
+ > +
+

- Upload File (File format: PDF max. 5MB) + Upload File (File format: PDF max. 10MB)

{ const { getReportingWindow } = useGetReportingWindow(); return getReportingWindow(due_date, "bi-annually"); }); - expect(result.current).toBe("November - April 2023"); + expect(result.current).toBe("October - March 2023"); }); test("Test `quarterly` window", () => { @@ -20,6 +20,6 @@ describe("Test useGetReportingWindow hook", () => { const { getReportingWindow } = useGetReportingWindow(); return getReportingWindow(due_date, "quarterly"); }); - expect(result.current).toBe("February - April 2023"); + expect(result.current).toBe("January - March 2023"); }); }); diff --git a/src/pages/nursery/[uuid]/index.page.tsx b/src/pages/nursery/[uuid]/index.page.tsx index 2560abd40..364552260 100644 --- a/src/pages/nursery/[uuid]/index.page.tsx +++ b/src/pages/nursery/[uuid]/index.page.tsx @@ -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} diff --git a/src/pages/project/[uuid]/index.page.tsx b/src/pages/project/[uuid]/index.page.tsx index 4b9d7bce0..8036db1b8 100644 --- a/src/pages/project/[uuid]/index.page.tsx +++ b/src/pages/project/[uuid]/index.page.tsx @@ -109,7 +109,7 @@ const ProjectDetailPage = () => { isPPC ? t("Priceless Planet Coalition") : isHBF - ? "HBF" + ? "Harit Bharat Fund" : isTerrafund ? t("TerraFund") : reportingFramework.name diff --git a/src/pages/project/[uuid]/tabs/Overview.tsx b/src/pages/project/[uuid]/tabs/Overview.tsx index a1c11230d..40556f5f4 100644 --- a/src/pages/project/[uuid]/tabs/Overview.tsx +++ b/src/pages/project/[uuid]/tabs/Overview.tsx @@ -52,7 +52,11 @@ const ProjectOverviewTab = ({ project }: ProjectOverviewTabProps) => {

- + { 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 })); diff --git a/src/pages/site/[uuid]/tabs/Overview.tsx b/src/pages/site/[uuid]/tabs/Overview.tsx index 1f4836071..ceb781a50 100644 --- a/src/pages/site/[uuid]/tabs/Overview.tsx +++ b/src/pages/site/[uuid]/tabs/Overview.tsx @@ -90,7 +90,11 @@ const SiteOverviewTab = ({ site }: SiteOverviewTabProps) => { >
- +