Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
fix(adddiagnosismodal and datepickerwithlabelformgroups): required field
Browse files Browse the repository at this point in the history
Added required fields to diagnosis name and date

fix #1926
  • Loading branch information
nwmandel committed Mar 21, 2020
1 parent 8afecaa commit b4100f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/input/DatePickerWithLabelFormGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ interface Props {
value: Date | undefined
isEditable?: boolean
onChange?: (date: Date) => void
isRequired?: boolean
}

const DatePickerWithLabelFormGroup = (props: Props) => {
const { onChange, label, name, isEditable, value } = props
const { onChange, label, name, isEditable, value, isRequired } = props
const id = `${name}DatePicker`
return (
<div className="form-group">
<Label text={label} htmlFor={id} />
<Label text={label} htmlFor={id} isRequired={isRequired} />
<DateTimePicker
dateFormat="MM/dd/yyyy"
dateFormatCalendar="LLLL yyyy"
Expand Down
2 changes: 2 additions & 0 deletions src/patients/diagnoses/AddDiagnosisModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const AddDiagnosisModal = (props: Props) => {
placeholder={t('patient.diagnoses.diagnosisName')}
value={diagnosis.name}
onChange={onNameChange}
isRequired
/>
</div>
</div>
Expand All @@ -75,6 +76,7 @@ const AddDiagnosisModal = (props: Props) => {
value={new Date(diagnosis.diagnosisDate)}
isEditable
onChange={onDiagnosisDateChange}
isRequired
/>
</div>
</div>
Expand Down

0 comments on commit b4100f5

Please sign in to comment.