Skip to content

Commit

Permalink
feat!: Add ONC-ACB Certification Id to basic Listing edit page
Browse files Browse the repository at this point in the history
OCD-4821
  • Loading branch information
tmy1313 authored Mar 4, 2025
1 parent 24e7894 commit d3b5cda
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/app/components/listing/listing-edit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ import { getDisplayDateFormat } from 'services/date-util';
import { ListingContext, UserContext } from 'shared/contexts';

const validationSchema = yup.object({
acbCertificationId: yup.string()
.max(250, 'ONC-ACB Certification Id must be 250 characters or less'),
certifyingBody: yup.string()
.required('ONC-ACB is required'),
productCode: yup.string()
Expand Down Expand Up @@ -180,6 +182,7 @@ function ChplListingEdit({
payload: {
listing: {
...listing,
acbCertificationId: formik.values.acbCertificationId,
certificationEvents: selectedStatuses,
certifyingBody: acbs.find((acb) => acb.name === formik.values.certifyingBody),
testingLabs: selectedAtls.map((atl) => ({ testingLab: atl })),
Expand All @@ -198,6 +201,7 @@ function ChplListingEdit({

formik = useFormik({
initialValues: {
acbCertificationId: listing.acbCertificationId ?? '',
certifyingBody: listing.certifyingBody.name ?? '',
productCode: listing.chplProductNumber.split('.')[4],
versionCode: listing.chplProductNumber.split('.')[5],
Expand Down Expand Up @@ -422,6 +426,16 @@ function ChplListingEdit({
&& (
<Typography>{listing.certifyingBody.name}</Typography>
)}
<ChplTextField
id="acb-certification-id"
name="acbCertificationId"
label="ONC-ACB Certification Id"
value={formik.values.acbCertificationId}
onChange={formik.handleChange}
onBlur={formik.handleBlur}
error={formik.touched.acbCertificationId && !!formik.errors.acbCertificationId}
helperText={formik.touched.acbCertificationId && formik.errors.acbCertificationId}
/>
</Box>
<Divider />
<Box pt={4} display="flex" gridGap={8} flexDirection="column">
Expand Down

0 comments on commit d3b5cda

Please sign in to comment.