Skip to content

Commit eec34f2

Browse files
authored
Merge pull request #3433 from Northeastern-Electric-Racing/revert-3391-#2789-JoshuaSharma-CRcomments
Revert "#2789 Joshua Sharma CR additional comments field optional"
2 parents af9d274 + 3ffa5e3 commit eec34f2

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/frontend/src/pages/ChangeRequestDetailPage/ReviewChangeRequest.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface ReviewChangeRequestProps {
1919
}
2020

2121
export interface FormInput {
22-
reviewNotes?: string;
22+
reviewNotes: string;
2323
accepted: boolean;
2424
psId?: string;
2525
}
@@ -45,7 +45,7 @@ const ReviewChangeRequest: React.FC<ReviewChangeRequestProps> = ({
4545
await mutateAsync({
4646
reviewerId: auth.user?.userId,
4747
crId,
48-
reviewNotes: reviewNotes ?? '',
48+
reviewNotes,
4949
accepted,
5050
psId
5151
}).catch((error) => {

src/frontend/src/pages/ChangeRequestDetailPage/ReviewChangeRequestView.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ interface ReviewChangeRequestViewProps {
3939
}
4040

4141
const schema = yup.object().shape({
42-
reviewNotes: yup.string(),
42+
reviewNotes: yup.string().required(),
4343
accepted: yup.boolean().required(),
4444
psId: yup.string().optional()
4545
});
@@ -169,6 +169,7 @@ const ReviewChangeRequestsView: React.FC<ReviewChangeRequestViewProps> = ({
169169
<Controller
170170
name="reviewNotes"
171171
control={control}
172+
rules={{ required: true }}
172173
render={({ field: { onChange, value } }) => (
173174
<>
174175
<Typography
@@ -182,6 +183,7 @@ const ReviewChangeRequestsView: React.FC<ReviewChangeRequestViewProps> = ({
182183
<TextField
183184
multiline
184185
rows={4}
186+
required
185187
variant="outlined"
186188
id="reviewNotes-input"
187189
autoComplete="off"
@@ -244,12 +246,14 @@ const ReviewChangeRequestsView: React.FC<ReviewChangeRequestViewProps> = ({
244246
<Controller
245247
name="reviewNotes"
246248
control={control}
249+
rules={{ required: true }}
247250
render={({ field: { onChange, value } }) => (
248251
<>
249252
<Typography>{'Additional Comments'}</Typography>
250253
<TextField
251254
multiline
252255
rows={4}
256+
required
253257
id="reviewNotes-input"
254258
autoComplete="off"
255259
onChange={onChange}

0 commit comments

Comments
 (0)