Skip to content

Commit

Permalink
Merge pull request #563 from masslight/fix-form-field
Browse files Browse the repository at this point in the history
Employee/Provider details form field bug
  • Loading branch information
AykhanAhmadli authored Nov 8, 2024
2 parents 588fc3a + 206cedf commit d1eda18
Showing 1 changed file with 56 additions and 54 deletions.
110 changes: 56 additions & 54 deletions packages/telemed-ehr/app/src/components/EmployeeInformationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -499,61 +499,63 @@ export default function EmployeeInformationForm({
Add New State Qualification
</AccordionSummary>
<AccordionDetails>
<Grid container direction={'row'} spacing={1}>
<Grid item xs={4}>
<Autocomplete
options={displaystates}
getOptionLabel={(option: string) => option}
renderInput={(params) => (
<TextField
{...params}
label="State"
error={errors.state}
required
helperText={errors.state ? 'Please select a state' : null}
/>
)}
value={newLicenseState || null}
onChange={(event, value) => setNewLicenseState(value || undefined)}
/>
</Grid>
<Grid item xs={4}>
<Autocomplete
options={Object.keys(PractitionerQualificationCodesLabels)}
getOptionLabel={(option: string) => option}
renderInput={(params) => (
<TextField
{...params}
label="Qualification"
error={errors.qualification}
required
helperText={errors.qualification ? 'Please select a qualification' : null}
/>
)}
value={newLicenseCode || null}
onChange={(event, value) => setNewLicenseCode(value || undefined)}
/>
</Grid>
<Grid item xs={4} alignContent={'center'}>
<Button
variant="contained"
endIcon={<AddIcon />}
sx={{ textTransform: 'none', fontWeight: 'bold', borderRadius: 28 }}
onClick={handleAddLicense}
fullWidth
>
Add
</Button>
<form>
<Grid container direction={'row'} spacing={1}>
<Grid item xs={4}>
<Autocomplete
options={displaystates}
getOptionLabel={(option: string) => option}
renderInput={(params) => (
<TextField
{...params}
label="State"
error={errors.state}
required
helperText={errors.state ? 'Please select a state' : null}
/>
)}
value={newLicenseState || null}
onChange={(event, value) => setNewLicenseState(value || undefined)}
/>
</Grid>
<Grid item xs={4}>
<Autocomplete
options={Object.keys(PractitionerQualificationCodesLabels)}
getOptionLabel={(option: string) => option}
renderInput={(params) => (
<TextField
{...params}
label="Qualification"
error={errors.qualification}
required
helperText={errors.qualification ? 'Please select a qualification' : null}
/>
)}
value={newLicenseCode || null}
onChange={(event, value) => setNewLicenseCode(value || undefined)}
/>
</Grid>
<Grid item xs={4} alignContent={'center'}>
<Button
variant="contained"
endIcon={<AddIcon />}
sx={{ textTransform: 'none', fontWeight: 'bold', borderRadius: 28 }}
fullWidth
onClick={handleAddLicense}
>
Add
</Button>
</Grid>
{errors.duplicateLicense && (
<Typography
color="error"
variant="body2"
mt={1}
mx={1}
>{`License already exists.`}</Typography>
)}
</Grid>
{errors.duplicateLicense && (
<Typography
color="error"
variant="body2"
mt={1}
mx={1}
>{`License already exists.`}</Typography>
)}
</Grid>
</form>
</AccordionDetails>
</Accordion>
</Box>
Expand Down

0 comments on commit d1eda18

Please sign in to comment.