Skip to content

Commit a651f0e

Browse files
committed
fixup! validation
1 parent 2ee8d87 commit a651f0e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

site/src/components/WorkspaceStats/WorkspaceScheduleForm.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import Checkbox from "@material-ui/core/Checkbox"
22
import FormControl from "@material-ui/core/FormControl"
33
import FormControlLabel from "@material-ui/core/FormControlLabel"
44
import FormGroup from "@material-ui/core/FormGroup"
5+
import FormHelperText from "@material-ui/core/FormHelperText"
56
import FormLabel from "@material-ui/core/FormLabel"
67
import makeStyles from "@material-ui/core/styles/makeStyles"
78
import TextField from "@material-ui/core/TextField"
@@ -88,8 +89,8 @@ export const WorkspaceScheduleForm: React.FC<WorkspaceScheduleFormProps> = ({ on
8889
friday: true,
8990
saturday: false,
9091

91-
startTime: "",
92-
ttl: 0,
92+
startTime: "09:30",
93+
ttl: 120,
9394
},
9495
onSubmit,
9596
validationSchema,
@@ -110,7 +111,7 @@ export const WorkspaceScheduleForm: React.FC<WorkspaceScheduleFormProps> = ({ on
110111
variant="standard"
111112
/>
112113

113-
<FormControl component="fieldset">
114+
<FormControl component="fieldset" error={Boolean(form.errors.monday)}>
114115
<FormLabel className={styles.daysOfWeekLabel} component="legend">
115116
{Language.daysOfWeekLabel}
116117
</FormLabel>
@@ -194,6 +195,7 @@ export const WorkspaceScheduleForm: React.FC<WorkspaceScheduleFormProps> = ({ on
194195
label={Language.daySaturdayLabel}
195196
/>
196197
</FormGroup>
198+
{form.errors.monday && <FormHelperText>{Language.errorNoDayOfWeek}</FormHelperText>}
197199
</FormControl>
198200

199201
<TextField

0 commit comments

Comments
 (0)