Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #500 from WildMeOrg/cdx-26-patch2
Browse files Browse the repository at this point in the history
cdx-26-patch-2
  • Loading branch information
naknomum authored Jul 14, 2023
2 parents fe0227c + ece11f0 commit a5dd4bc
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions src/pages/reportSighting/ReportForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export default function ReportForm({
.map(data => ({ ...data, labelId: data.label }));
const encountersRequired = encounterFieldSchemas
.filter(
schema => schema.customField && schema.required && !customEncounterFormValues[schema.name],
schema => sightingType === 'one' && schema.customField && schema.required && !customEncounterFormValues[schema.name],
)
.map(data => ({ ...data, labelId: data.label }));
const requiredCustomFields = sightingsRequired.concat(encountersRequired);
Expand Down Expand Up @@ -368,20 +368,26 @@ export default function ReportForm({
categories={customSightingCategories}
fieldSchema={requiredCustomSightingSchemas}
/>
<FieldCollections
formValues={encounterFormValues}
setFormValues={setEncounterFormValues}
categories={defaultEncounterCategories}
fieldSchema={requiredDefaultEncounterFieldSchemas}
/>
<FieldCollections
formValues={customEncounterFormValues}
setFormValues={setCustomEncounterFormValues}
categories={customEncounterCategories}
fieldSchema={requiredCustomEncounterFieldSchemas}
/>
</>
)}
{
!optional && sightingType === 'one' && (
<>
<FieldCollections
formValues={encounterFormValues}
setFormValues={setEncounterFormValues}
categories={defaultEncounterCategories}
fieldSchema={requiredDefaultEncounterFieldSchemas}
/>
<FieldCollections
formValues={customEncounterFormValues}
setFormValues={setCustomEncounterFormValues}
categories={customEncounterCategories}
fieldSchema={requiredCustomEncounterFieldSchemas}
/>
</>
)
}

{optional && (
<>
Expand Down

0 comments on commit a5dd4bc

Please sign in to comment.