Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIMSBIOHUB 343 - Incorrect date overlap error in sampling methods #1144

Merged
merged 4 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/src/features/surveys/components/EditSamplingMethod.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface IEditSamplingMethodProps {

export const SamplingSiteMethodYupSchema = yup.object({
method_lookup_id: yup.number().required(),
description: yup.string().required(),
description: yup.string(),
periods: yup
.array(
yup.object({
Expand All @@ -27,7 +27,7 @@ export const SamplingSiteMethodYupSchema = yup.object({
.required('End date is required')
})
)
.hasUniqueDateRanges('Periods cannot overlap', 'start_date', 'end_state')
.hasUniqueDateRanges('Periods cannot overlap', 'start_date', 'end_date')
.min(1, 'At least one time period is required')
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@

// create complete, navigate back to observations page
history.push(`/admin/projects/${surveyContext.projectId}/surveys/${surveyContext.surveyId}/observations`);
surveyContext.sampleSiteDataLoader.refresh(surveyContext.projectId, surveyContext.surveyId);

Check warning on line 123 in app/src/features/surveys/observations/sampling-sites/edit/SamplingSiteEditPage.tsx

View check run for this annotation

Codecov / codecov/patch

app/src/features/surveys/observations/sampling-sites/edit/SamplingSiteEditPage.tsx#L123

Added line #L123 was not covered by tests
} catch (error) {
showCreateErrorDialog({
dialogTitle: CreateSamplingSiteI18N.createErrorTitle,
Expand Down
Loading