@@ -9,6 +9,7 @@ import TextField from "@material-ui/core/TextField"
9
9
import { useFormik } from "formik"
10
10
import React from "react"
11
11
import * as Yup from "yup"
12
+ import { FieldErrors } from "../../api/errors"
12
13
import { getFormHelpers } from "../../util/formUtils"
13
14
import { FormFooter } from "../FormFooter/FormFooter"
14
15
import { FullPageForm } from "../FullPageForm/FullPageForm"
@@ -32,6 +33,7 @@ export const Language = {
32
33
}
33
34
34
35
export interface WorkspaceScheduleFormProps {
36
+ fieldErrors ?: FieldErrors
35
37
isLoading : boolean
36
38
onCancel : ( ) => void
37
39
onSubmit : ( values : WorkspaceScheduleFormValues ) => void
@@ -92,7 +94,12 @@ export const validationSchema = Yup.object({
92
94
ttl : Yup . number ( ) . min ( 0 ) . integer ( ) ,
93
95
} )
94
96
95
- export const WorkspaceScheduleForm : React . FC < WorkspaceScheduleFormProps > = ( { isLoading, onCancel, onSubmit } ) => {
97
+ export const WorkspaceScheduleForm : React . FC < WorkspaceScheduleFormProps > = ( {
98
+ fieldErrors,
99
+ isLoading,
100
+ onCancel,
101
+ onSubmit,
102
+ } ) => {
96
103
const styles = useStyles ( )
97
104
98
105
const form = useFormik < WorkspaceScheduleFormValues > ( {
@@ -111,7 +118,7 @@ export const WorkspaceScheduleForm: React.FC<WorkspaceScheduleFormProps> = ({ is
111
118
onSubmit,
112
119
validationSchema,
113
120
} )
114
- const formHelpers = getFormHelpers < WorkspaceScheduleFormValues > ( form )
121
+ const formHelpers = getFormHelpers < WorkspaceScheduleFormValues > ( form , fieldErrors )
115
122
116
123
const checkboxes : Array < { value : boolean ; name : string ; label : string } > = [
117
124
{ value : form . values . sunday , name : "sunday" , label : Language . daySundayLabel } ,
0 commit comments