From 1004f9b4188ea8dad3ceb8b9501a85eafac8fe67 Mon Sep 17 00:00:00 2001 From: jeznorth Date: Wed, 26 Apr 2023 15:46:54 -0700 Subject: [PATCH 1/3] Triage Bug Fixes (#1018) --- .../attachments/list/AttachmentsList.tsx | 15 +++++++++------ app/src/components/surveys/SurveysList.tsx | 16 ++++++++++------ .../features/projects/list/ProjectsListTable.tsx | 8 ++++---- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/app/src/components/attachments/list/AttachmentsList.tsx b/app/src/components/attachments/list/AttachmentsList.tsx index 54c38f5775..d97bcc1a28 100644 --- a/app/src/components/attachments/list/AttachmentsList.tsx +++ b/app/src/components/attachments/list/AttachmentsList.tsx @@ -1,4 +1,3 @@ -import { Paper } from '@material-ui/core'; import Box from '@material-ui/core/Box'; import { grey } from '@material-ui/core/colors'; import Link from '@material-ui/core/Link'; @@ -158,11 +157,15 @@ function AttachmentsTableRow - - No Documents - - + + No Documents + ); } diff --git a/app/src/components/surveys/SurveysList.tsx b/app/src/components/surveys/SurveysList.tsx index 5df8244266..a5c6b291b4 100644 --- a/app/src/components/surveys/SurveysList.tsx +++ b/app/src/components/surveys/SurveysList.tsx @@ -1,4 +1,4 @@ -import { Box, Paper } from '@material-ui/core'; +import Box from '@material-ui/core/Box'; import Link from '@material-ui/core/Link'; import makeStyles from '@material-ui/core/styles/makeStyles'; import Table from '@material-ui/core/Table'; @@ -125,11 +125,15 @@ const SurveysList: React.FC = () => { function NoSurveys() { const classes = useStyles(); return ( - - - No Surveys - - + + No Surveys + ); } diff --git a/app/src/features/projects/list/ProjectsListTable.tsx b/app/src/features/projects/list/ProjectsListTable.tsx index 574c3332d9..dbf9fdcff5 100644 --- a/app/src/features/projects/list/ProjectsListTable.tsx +++ b/app/src/features/projects/list/ProjectsListTable.tsx @@ -147,11 +147,11 @@ const ProjectsListTable: React.FC = (props) => { {project.projectData.project_type} - - + + - - + + {getFormattedDate(DATE_FORMAT.ShortMediumDateFormat, project.projectData.start_date)} From 3eb838d39e2bc9f8b5ada02de849aad5f9f66049 Mon Sep 17 00:00:00 2001 From: Kjartan <35311998+KjartanE@users.noreply.github.com> Date: Thu, 27 Apr 2023 15:40:33 -0700 Subject: [PATCH 2/3] SIMSBIOHUB-27-38: Include First Nations Names in Contact Agency List, Remove 'Feedback' Functionality (#1016) --- app/public/index.html | 2 - .../components/ProjectFundingForm.test.tsx | 30 +- .../projects/create/CreateProjectForm.tsx | 21 +- .../create/CreateProjectPage.test.tsx | 109 +- .../projects/create/CreateProjectPage.tsx | 11 +- .../projects/edit/EditProjectForm.tsx | 14 +- .../view/components/LocationBoundary.tsx | 10 +- app/src/utils/ProjectStepComponents.test.tsx | 238 -- app/src/utils/ProjectStepComponents.tsx | 108 - .../ProjectStepComponents.test.tsx.snap | 2160 ----------------- 10 files changed, 94 insertions(+), 2609 deletions(-) delete mode 100644 app/src/utils/ProjectStepComponents.test.tsx delete mode 100644 app/src/utils/ProjectStepComponents.tsx delete mode 100644 app/src/utils/__snapshots__/ProjectStepComponents.test.tsx.snap diff --git a/app/public/index.html b/app/public/index.html index 776444125c..8639a9b6f7 100644 --- a/app/public/index.html +++ b/app/public/index.html @@ -22,11 +22,9 @@ -
- diff --git a/app/src/features/projects/components/ProjectFundingForm.test.tsx b/app/src/features/projects/components/ProjectFundingForm.test.tsx index 87d373212c..d4d9ba6804 100644 --- a/app/src/features/projects/components/ProjectFundingForm.test.tsx +++ b/app/src/features/projects/components/ProjectFundingForm.test.tsx @@ -2,8 +2,6 @@ import { act, fireEvent, render, waitFor } from '@testing-library/react'; import { IMultiAutocompleteFieldOption } from 'components/fields/MultiAutocompleteFieldVariableSize'; import { Formik } from 'formik'; import React from 'react'; -import { codes } from 'test-helpers/code-helpers'; -import ProjectStepComponents from 'utils/ProjectStepComponents'; import ProjectFundingForm, { IInvestmentActionCategoryOption, IProjectFundingForm, @@ -93,7 +91,12 @@ describe('ProjectFundingForm', () => { validateOnBlur={true} validateOnChange={false} onSubmit={async () => {}}> - {() => } + {() => ( + + )} ); @@ -140,7 +143,12 @@ describe('ProjectFundingForm', () => { validateOnBlur={true} validateOnChange={false} onSubmit={async () => {}}> - {() => } + {() => ( + + )} ); @@ -182,7 +190,12 @@ describe('ProjectFundingForm', () => { validateOnBlur={true} validateOnChange={false} onSubmit={async () => {}}> - {() => } + {() => ( + + )} ); @@ -232,7 +245,12 @@ describe('ProjectFundingForm', () => { validateOnBlur={true} validateOnChange={false} onSubmit={async () => {}}> - {() => } + {() => ( + + )} ); diff --git a/app/src/features/projects/create/CreateProjectForm.tsx b/app/src/features/projects/create/CreateProjectForm.tsx index d11a3abacd..88f5733bb1 100644 --- a/app/src/features/projects/create/CreateProjectForm.tsx +++ b/app/src/features/projects/create/CreateProjectForm.tsx @@ -65,6 +65,19 @@ export const validationProjectYupSchema = ProjectCoordinatorYupSchema.concat(Pro .concat(ProjectFundingFormYupSchema) .concat(ProjectPartnershipsFormYupSchema); +//Fuction to get the list of coordinator agencies from the codeset +export const getCoordinatorAgencyOptions = (codes: IGetAllCodeSetsResponse) => { + const coordinatorAgency = codes?.coordinator_agency?.map((item) => { + return item.name; + }); + + const firstNations = codes?.first_nations?.map((item) => { + return item.name; + }); + + return [...coordinatorAgency, ...firstNations].sort(); +}; + /** * Form for creating a new project. * @@ -148,13 +161,7 @@ const CreateProjectForm: React.FC = (props) => { title="Project Coordinator" summary="Provide the Project Coordinator's contact and agency information." component={ - { - return item.name; - }) || [] - } - /> + }> diff --git a/app/src/features/projects/create/CreateProjectPage.test.tsx b/app/src/features/projects/create/CreateProjectPage.test.tsx index fdd3509269..adfe8cf812 100644 --- a/app/src/features/projects/create/CreateProjectPage.test.tsx +++ b/app/src/features/projects/create/CreateProjectPage.test.tsx @@ -6,6 +6,7 @@ import { render, waitFor } from '@testing-library/react'; +import { CodesContext, ICodesContext } from 'contexts/codesContext'; import { DialogContextProvider } from 'contexts/dialogContext'; import { ProjectDetailsFormInitialValues } from 'features/projects/components/ProjectDetailsForm'; import { ProjectFundingFormInitialValues } from 'features/projects/components/ProjectFundingForm'; @@ -17,9 +18,11 @@ import CreateProjectPage from 'features/projects/create/CreateProjectPage'; import { Feature } from 'geojson'; import { createMemoryHistory } from 'history'; import { useBiohubApi } from 'hooks/useBioHubApi'; +import { DataLoader } from 'hooks/useDataLoader'; import { IGetAllCodeSetsResponse } from 'interfaces/useCodesApi.interface'; import React from 'react'; import { MemoryRouter, Router } from 'react-router'; +import { codes } from 'test-helpers/code-helpers'; const history = createMemoryHistory(); @@ -43,13 +46,21 @@ const mockBiohubApi = ((useBiohubApi as unknown) as jest.Mock +}; + const renderContainer = () => { return render( - - - , - - + + + + , + + + ); }; @@ -99,10 +110,6 @@ describe('CreateProjectPage', () => { }); it('shows the page title', async () => { - mockBiohubApi().codes.getAllCodeSets.mockResolvedValue(({ - coordinator_agency: [{ id: 1, name: 'A Rocha Canada' }] - } as unknown) as IGetAllCodeSetsResponse); - const { findByText } = renderContainer(); const PageTitle = await findByText('Create Project'); @@ -111,10 +118,6 @@ describe('CreateProjectPage', () => { describe('Are you sure? Dialog', () => { it('shows warning dialog if the user clicks the `Cancel and Exit` button', async () => { - mockBiohubApi().codes.getAllCodeSets.mockResolvedValue(({ - coordinator_agency: [{ id: 1, name: 'A Rocha Canada' }] - } as unknown) as IGetAllCodeSetsResponse); - history.push('/home'); history.push('/admin/projects/create'); @@ -132,10 +135,6 @@ describe('CreateProjectPage', () => { }); it('calls history.push() if the user clicks `Yes`', async () => { - mockBiohubApi().codes.getAllCodeSets.mockResolvedValue(({ - coordinator_agency: [{ id: 1, name: 'A Rocha Canada' }] - } as unknown) as IGetAllCodeSetsResponse); - history.push('/home'); history.push('/admin/projects/create'); @@ -151,10 +150,6 @@ describe('CreateProjectPage', () => { }); it('does nothing if the user clicks `No`', async () => { - mockBiohubApi().codes.getAllCodeSets.mockResolvedValue(({ - coordinator_agency: [{ id: 1, name: 'A Rocha Canada' }] - } as unknown) as IGetAllCodeSetsResponse); - history.push('/home'); history.push('/admin/projects/create'); @@ -176,23 +171,7 @@ describe('CreateProjectPage', () => { }); describe('Delete Draft Button', () => { - it('does not display delete draft button if not in draft', async () => { - const { queryByText } = render( - - - - ); - - await waitFor(() => { - expect(queryByText('Delete Draft', { exact: false })).not.toBeInTheDocument(); - }); - }); - it('does display delete draft button if in draft', async () => { - mockBiohubApi().codes.getAllCodeSets.mockResolvedValue(({ - coordinator_agency: [{ id: 1, name: 'A Rocha Canada' }] - } as unknown) as IGetAllCodeSetsResponse); - mockBiohubApi().draft.getDraft.mockResolvedValue({ id: 1, name: 'My draft', @@ -214,9 +193,11 @@ describe('CreateProjectPage', () => { }); const { queryAllByText } = render( - - - + + + + + ); await waitFor(() => { @@ -225,10 +206,6 @@ describe('CreateProjectPage', () => { }); it('displays a Delete draft Yes/No Dialog', async () => { - mockBiohubApi().codes.getAllCodeSets.mockResolvedValue(({ - coordinator_agency: [{ id: 1, name: 'A Rocha Canada' }] - } as unknown) as IGetAllCodeSetsResponse); - mockBiohubApi().draft.getDraft.mockResolvedValue({ id: 1, name: 'My draft', @@ -250,9 +227,11 @@ describe('CreateProjectPage', () => { }); const { getByText, findAllByText } = render( - - - + + + + + ); const deleteButton = await findAllByText('Delete Draft', { exact: false }); @@ -265,10 +244,6 @@ describe('CreateProjectPage', () => { }); it('closes dialog on No click', async () => { - mockBiohubApi().codes.getAllCodeSets.mockResolvedValue(({ - coordinator_agency: [{ id: 1, name: 'A Rocha Canada' }] - } as unknown) as IGetAllCodeSetsResponse); - mockBiohubApi().draft.getDraft.mockResolvedValue({ id: 1, name: 'My draft', @@ -290,9 +265,11 @@ describe('CreateProjectPage', () => { }); const { getByText, findAllByText, getByTestId, queryByText } = render( - - - + + + + + ); const deleteButton = await findAllByText('Delete Draft', { exact: false }); @@ -312,10 +289,6 @@ describe('CreateProjectPage', () => { }); it('deletes draft on Yes click', async () => { - mockBiohubApi().codes.getAllCodeSets.mockResolvedValue(({ - coordinator_agency: [{ id: 1, name: 'A Rocha Canada' }] - } as unknown) as IGetAllCodeSetsResponse); - mockBiohubApi().draft.getDraft.mockResolvedValue({ id: 1, name: 'My draft', @@ -337,9 +310,11 @@ describe('CreateProjectPage', () => { }); const { getByText, findAllByText, getByTestId } = render( - - - + + + + + ); const deleteButton = await findAllByText('Delete Draft', { exact: false }); @@ -360,10 +335,6 @@ describe('CreateProjectPage', () => { }); it('preloads draft data and populates on form fields', async () => { - mockBiohubApi().codes.getAllCodeSets.mockResolvedValue(({ - coordinator_agency: [{ id: 1, name: 'A Rocha Canada' }] - } as unknown) as IGetAllCodeSetsResponse); - mockBiohubApi().draft.getDraft.mockResolvedValue({ id: 1, name: 'My draft', @@ -385,9 +356,11 @@ describe('CreateProjectPage', () => { }); const { getByDisplayValue } = render( - - - + + + + + ); await waitFor(() => { diff --git a/app/src/features/projects/create/CreateProjectPage.tsx b/app/src/features/projects/create/CreateProjectPage.tsx index 36c195f610..5481669ae2 100644 --- a/app/src/features/projects/create/CreateProjectPage.tsx +++ b/app/src/features/projects/create/CreateProjectPage.tsx @@ -6,10 +6,12 @@ import Paper from '@material-ui/core/Paper'; import { Theme } from '@material-ui/core/styles/createMuiTheme'; import makeStyles from '@material-ui/core/styles/makeStyles'; import Typography from '@material-ui/core/Typography'; +import assert from 'assert'; import EditDialog from 'components/dialog/EditDialog'; import { IErrorDialogProps } from 'components/dialog/ErrorDialog'; import YesNoDialog from 'components/dialog/YesNoDialog'; import { CreateProjectDraftI18N, CreateProjectI18N, DeleteProjectDraftI18N } from 'constants/i18n'; +import { CodesContext } from 'contexts/codesContext'; import { DialogContext } from 'contexts/dialogContext'; import ProjectDraftForm, { IProjectDraftForm, @@ -78,9 +80,10 @@ const CreateProjectPage: React.FC = () => { const [enableCancelCheck, setEnableCancelCheck] = useState(true); const dialogContext = useContext(DialogContext); + const codesContext = useContext(CodesContext); - const codesDataLoader = useDataLoader(() => biohubApi.codes.getAllCodeSets()); - codesDataLoader.load(); + const codes = codesContext.codesDataLoader.data; + assert(codesContext.codesDataLoader.data); const draftId = Number(queryParams.draftId); @@ -268,7 +271,7 @@ const CreateProjectPage: React.FC = () => { history.push(`/admin/projects/`); }; - if (!codesDataLoader.data || (draftId && !draftDataLoader.data)) { + if (!codes || (draftId && !draftDataLoader.data)) { return ; } @@ -337,7 +340,7 @@ const CreateProjectPage: React.FC = () => { diff --git a/app/src/features/projects/edit/EditProjectForm.tsx b/app/src/features/projects/edit/EditProjectForm.tsx index 66ae754833..4160a43bee 100644 --- a/app/src/features/projects/edit/EditProjectForm.tsx +++ b/app/src/features/projects/edit/EditProjectForm.tsx @@ -13,7 +13,11 @@ import ProjectIUCNForm from '../components/ProjectIUCNForm'; import ProjectLocationForm from '../components/ProjectLocationForm'; import ProjectObjectivesForm from '../components/ProjectObjectivesForm'; import ProjectPartnershipsForm from '../components/ProjectPartnershipsForm'; -import { initialProjectFieldData, validationProjectYupSchema } from '../create/CreateProjectForm'; +import { + getCoordinatorAgencyOptions, + initialProjectFieldData, + validationProjectYupSchema +} from '../create/CreateProjectForm'; const useStyles = makeStyles((theme: Theme) => ({ actionButton: { @@ -125,13 +129,7 @@ const EditProjectForm: React.FC = (props) => { title="Project Coordinator" summary="Provide the Project Coordinator's contact and agency information." component={ - { - return item.name; - }) || [] - } - /> + }> diff --git a/app/src/features/projects/view/components/LocationBoundary.tsx b/app/src/features/projects/view/components/LocationBoundary.tsx index a0893566ce..4a032a7b2d 100644 --- a/app/src/features/projects/view/components/LocationBoundary.tsx +++ b/app/src/features/projects/view/components/LocationBoundary.tsx @@ -18,10 +18,9 @@ import { ProjectRoleGuard } from 'components/security/Guards'; import { H2ButtonToolbar } from 'components/toolbar/ActionToolbars'; import { EditLocationBoundaryI18N } from 'constants/i18n'; import { PROJECT_ROLE, SYSTEM_ROLE } from 'constants/roles'; -import { CodesContext } from 'contexts/codesContext'; import { DialogContext } from 'contexts/dialogContext'; import { ProjectContext } from 'contexts/projectContext'; -import { +import ProjectLocationForm, { IProjectLocationForm, ProjectLocationFormInitialValues, ProjectLocationFormYupSchema @@ -33,7 +32,6 @@ import { IGetProjectForUpdateResponseLocation, UPDATE_GET_ENTITIES } from 'inter import { LatLngBoundsExpression } from 'leaflet'; import React, { useCallback, useContext, useEffect, useState } from 'react'; import { calculateUpdatedMapBounds } from 'utils/mapBoundaryUploadHelpers'; -import ProjectStepComponents from 'utils/ProjectStepComponents'; const useStyles = makeStyles((theme: Theme) => createStyles({ @@ -71,15 +69,11 @@ const LocationBoundary = () => { const biohubApi = useBiohubApi(); - const codesContext = useContext(CodesContext); const projectContext = useContext(ProjectContext); - // Codes data must be loaded by a parent before this component is rendered - assert(codesContext.codesDataLoader.data); // Project data must be loaded by a parent before this component is rendered assert(projectContext.projectDataLoader.data); - const codes = codesContext.codesDataLoader.data; const projectData = projectContext.projectDataLoader.data.projectData; const dialogContext = useContext(DialogContext); @@ -192,7 +186,7 @@ const LocationBoundary = () => { dialogTitle={EditLocationBoundaryI18N.editTitle} open={openEditDialog} component={{ - element: , + element: , initialValues: locationFormData, validationSchema: ProjectLocationFormYupSchema }} diff --git a/app/src/utils/ProjectStepComponents.test.tsx b/app/src/utils/ProjectStepComponents.test.tsx deleted file mode 100644 index dd637e8610..0000000000 --- a/app/src/utils/ProjectStepComponents.test.tsx +++ /dev/null @@ -1,238 +0,0 @@ -import { render, waitFor } from '@testing-library/react'; -import { - ProjectCoordinatorInitialValues, - ProjectCoordinatorYupSchema -} from 'features/projects/components/ProjectCoordinatorForm'; -import { - ProjectDetailsFormInitialValues, - ProjectDetailsFormYupSchema -} from 'features/projects/components/ProjectDetailsForm'; -import { - ProjectFundingFormInitialValues, - ProjectFundingFormYupSchema -} from 'features/projects/components/ProjectFundingForm'; -import { ProjectIUCNFormInitialValues, ProjectIUCNFormYupSchema } from 'features/projects/components/ProjectIUCNForm'; -import { - ProjectLocationFormInitialValues, - ProjectLocationFormYupSchema -} from 'features/projects/components/ProjectLocationForm'; -import { - ProjectObjectivesFormInitialValues, - ProjectObjectivesFormYupSchema -} from 'features/projects/components/ProjectObjectivesForm'; -import { - ProjectPartnershipsFormInitialValues, - ProjectPartnershipsFormYupSchema -} from 'features/projects/components/ProjectPartnershipsForm'; -import { Formik } from 'formik'; -import React from 'react'; -import { codes } from 'test-helpers/code-helpers'; -import ProjectStepComponents from './ProjectStepComponents'; - -const handleSaveAndNext = jest.fn(); - -jest.spyOn(console, 'debug').mockImplementation(() => {}); - -describe('ProjectStepComponents', () => { - it('renders the project contact', () => { - const { asFragment } = render( - { - handleSaveAndNext(values); - }}> - {() => } - - ); - - expect(asFragment()).toMatchSnapshot(); - }); - - it('renders the project details with the codes values', () => { - const { asFragment } = render( - {}}> - {() => } - - ); - - expect(asFragment()).toMatchSnapshot(); - }); - - it('renders the project details without the codes values', () => { - const { asFragment } = render( - {}}> - {() => ( - - )} - - ); - - expect(asFragment()).toMatchSnapshot(); - }); - - it('renders the project objectives', () => { - const { asFragment } = render( - {}}> - {() => } - - ); - - expect(asFragment()).toMatchSnapshot(); - }); - - it('renders the project IUCN with the codes values', () => { - const { asFragment } = render( - {}}> - {() => } - - ); - - expect(asFragment()).toMatchSnapshot(); - }); - - it('renders the project IUCN without the codes values', () => { - const { asFragment } = render( - {}}> - {() => ( - - )} - - ); - - expect(asFragment()).toMatchSnapshot(); - }); - - it('renders the project funding with the codes values', () => { - const { asFragment } = render( - {}}> - {() => } - - ); - - expect(asFragment()).toMatchSnapshot(); - }); - - it('renders the project funding without the codes values', () => { - const { asFragment } = render( - {}}> - {() => ( - - )} - - ); - - expect(asFragment()).toMatchSnapshot(); - }); - - it('renders the project partnerships with the codes values', () => { - const { asFragment } = render( - {}}> - {() => } - - ); - - expect(asFragment()).toMatchSnapshot(); - }); - - it('renders the project partnerships without the codes values', () => { - const { asFragment } = render( - {}}> - {() => ( - - )} - - ); - - expect(asFragment()).toMatchSnapshot(); - }); - - it('renders the project location', async () => { - const { asFragment } = render( - {}}> - {() => } - - ); - - await waitFor(() => { - expect(asFragment()).toMatchSnapshot(); - }); - }); -}); diff --git a/app/src/utils/ProjectStepComponents.tsx b/app/src/utils/ProjectStepComponents.tsx deleted file mode 100644 index 65d0b40108..0000000000 --- a/app/src/utils/ProjectStepComponents.tsx +++ /dev/null @@ -1,108 +0,0 @@ -import ProjectCoordinatorForm from 'features/projects/components/ProjectCoordinatorForm'; -import ProjectDetailsForm from 'features/projects/components/ProjectDetailsForm'; -import ProjectFundingForm from 'features/projects/components/ProjectFundingForm'; -import ProjectIUCNForm from 'features/projects/components/ProjectIUCNForm'; -import ProjectLocationForm from 'features/projects/components/ProjectLocationForm'; -import ProjectObjectivesForm from 'features/projects/components/ProjectObjectivesForm'; -import ProjectPartnershipsForm from 'features/projects/components/ProjectPartnershipsForm'; -import { IGetAllCodeSetsResponse } from 'interfaces/useCodesApi.interface'; -import React from 'react'; - -export interface IProjectStepComponentsProps { - component: string; - codes: IGetAllCodeSetsResponse; -} - -/** - * Determine the appropriate component to return for the project step - * - * @return {*} - */ -const ProjectStepComponents: React.FC = (props) => { - const { component, codes } = props; - - return ( - <> - {component === 'ProjectCoordinator' && ( - { - return item.name; - }) || [] - } - /> - )} - - {component === 'ProjectDetails' && ( - { - return { value: item.id, label: item.name }; - }) || [] - } - activity={ - codes?.activity?.map((item) => { - return { value: item.id, label: item.name }; - }) || [] - } - /> - )} - - {component === 'ProjectObjectives' && } - - {component === 'ProjectLocation' && } - - {component === 'ProjectIUCN' && ( - { - return { value: item.id, label: item.name }; - }) || [] - } - subClassifications1={ - codes?.iucn_conservation_action_level_2_subclassification?.map((item) => { - return { value: item.id, iucn1_id: item.iucn1_id, label: item.name }; - }) || [] - } - subClassifications2={ - codes?.iucn_conservation_action_level_3_subclassification?.map((item) => { - return { value: item.id, iucn2_id: item.iucn2_id, label: item.name }; - }) || [] - } - /> - )} - - {component === 'ProjectFunding' && ( - { - return { value: item.id, label: item.name }; - }) || [] - } - investment_action_category={ - codes?.investment_action_category?.map((item) => { - return { value: item.id, fs_id: item.fs_id, label: item.name }; - }) || [] - } - /> - )} - - {component === 'ProjectPartnerships' && ( - { - return { value: item.id, label: item.name }; - }) || [] - } - stakeholder_partnerships={ - codes?.funding_source?.map((item) => { - return { value: item.name, label: item.name }; - }) || [] - } - /> - )} - - ); -}; - -export default ProjectStepComponents; diff --git a/app/src/utils/__snapshots__/ProjectStepComponents.test.tsx.snap b/app/src/utils/__snapshots__/ProjectStepComponents.test.tsx.snap deleted file mode 100644 index 983f9765ab..0000000000 --- a/app/src/utils/__snapshots__/ProjectStepComponents.test.tsx.snap +++ /dev/null @@ -1,2160 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`ProjectStepComponents renders the project IUCN with the codes values 1`] = ` - -
-
-
- -
-
-
-
-`; - -exports[`ProjectStepComponents renders the project IUCN without the codes values 1`] = ` - -
-
-
- -
-
-
-
-`; - -exports[`ProjectStepComponents renders the project contact 1`] = ` - -
-
-
-
- -
- - -
-
-
-
-
- -
- - -
-
-
-
-
- -
- - -
-
-
-
- -
-
-
-
- - Share Contact Details - -

- Do you want the project contact's name and email address visible to the public? -

-
-
- - -

-

-
-
-
-
-
-`; - -exports[`ProjectStepComponents renders the project details with the codes values 1`] = ` - -
-
-
-
- -
- - -
-
-
-
-
- -
-
- - ​ - -
- - - -
-
-
-
- -
-
-
-
-
- -
- - -
-
-
-
-
- -
- - -
-
-
-
-
-
-
-
-`; - -exports[`ProjectStepComponents renders the project details without the codes values 1`] = ` - -
-
-
-
- -
- - -
-
-
-
-
- -
-
- - ​ - -
- - - -
-
-
-
- -
-
-
-
-
- -
- - -
-
-
-
-
- -
- - -
-
-
-
-
-
-
-
-`; - -exports[`ProjectStepComponents renders the project funding with the codes values 1`] = ` - -
-
- -
-
-
    -
-
-
-
-
-`; - -exports[`ProjectStepComponents renders the project funding without the codes values 1`] = ` - -
-
- -
-
-
    -
-
-
-
-
-`; - -exports[`ProjectStepComponents renders the project location 1`] = ` - -
-
-

- Define Project Boundary -

-

- Import or select a boundary from existing map layers. To select an existing boundary, choose a map layer below and click a boundary on the map. -

-
-
- -
-
- -
-
- - ​ - -
- - - -
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
- -
-

- Describe the location of this project -

-
- -
-