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

fix: correct date validation for disabled fields #7240

Merged
merged 2 commits into from
Apr 3, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
fix: removing console logs
kathleenkhy committed Apr 3, 2024
commit 3b987598762dd4cf3fd81112fe4b8a9edf03af46
6 changes: 0 additions & 6 deletions frontend/src/templates/Field/Date/DateField.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useCallback, useMemo } from 'react'
import { Controller, useFormContext } from 'react-hook-form'
import { useParams } from 'react-router-dom'

import { DATE_DISPLAY_FORMAT, DATE_PARSE_FORMAT } from '~shared/constants/dates'
import { FormColorTheme } from '~shared/types'
@@ -33,16 +32,11 @@ export const DateField = ({
colorTheme = FormColorTheme.Blue,
...fieldContainerProps
}: DateFieldProps): JSX.Element => {
console.log('disable validaton', disableRequiredValidation)
const validationRules = useMemo(
() => createDateValidationRules(schema, disableRequiredValidation),
[schema, disableRequiredValidation],
)

console.log('validation rules', validationRules)
const { submissionId } = useParams()
console.log('submission id', submissionId)

const isDateUnavailable = useCallback(
(date: Date) => {
const { selectedDateValidation } = schema.dateValidation

Unchanged files with check annotations Beta

OGP_FORMSG_REPO,
} from '~constants/links'
import {
LANDING_PAYMENTS_ROUTE,

Check warning on line 43 in frontend/src/pages/Landing/Home/LandingPage.tsx

GitHub Actions / frontend_lint

'LANDING_PAYMENTS_ROUTE' is defined but never used
LOGIN_ROUTE,
TOU_ROUTE,
} from '~constants/routes'