diff --git a/src/app/components/listing/details/listing-information/listing-information-edit.jsx b/src/app/components/listing/details/listing-information/listing-information-edit.jsx index 13cda3753a..61f2e947b4 100755 --- a/src/app/components/listing/details/listing-information/listing-information-edit.jsx +++ b/src/app/components/listing/details/listing-information/listing-information-edit.jsx @@ -1,17 +1,23 @@ import React, { useContext, useEffect, useState } from 'react'; import { + Box, Button, + Card, CircularProgress, + Divider, + IconButton, MenuItem, Table, TableBody, TableCell, TableHead, TableRow, + Typography, makeStyles, } from '@material-ui/core'; import { useFormik } from 'formik'; import * as yup from 'yup'; +import { Delete, Add } from '@material-ui/icons'; import { useFetchAcbs } from 'api/acbs'; import { useFetchAtls } from 'api/atls'; @@ -23,6 +29,9 @@ import { utilStyles } from 'themes'; const useStyles = makeStyles({ ...utilStyles, + tableCards: { + width: '100%', + }, }); const validationSchema = yup.object({ @@ -244,247 +253,274 @@ function ChplListingInformationEdit() { return ( <> - CHPL Product Number - { getPrefix() } - - - - { getSuffix() } - - { listing.certificationEvents?.length > 0 + + CHPL Product Number: + + + { getPrefix() } + + + + { getSuffix() } + + + + { listing.certificationEvents?.length > 0 && ( <> - - - - Certification Status - Effective Date - Reason for Status Change - Action - - - - { listing.certificationEvents - .sort((a, b) => (a.eventDay < b.eventDay ? 1 : -1)) - .map((ce, idx, vals) => ( - - - { ce.status.name } - { idx !== listing.certificationEvents.length - 1 && ce.status.name === vals[idx + 1].status.name + +
+ + + Certification Status + Effective Date + Reason for Status Change + Action + + + + { listing.certificationEvents + .sort((a, b) => (a.eventDay < b.eventDay ? 1 : -1)) + .map((ce, idx, vals) => ( + + + { ce.status.name } + { idx !== listing.certificationEvents.length - 1 && ce.status.name === vals[idx + 1].status.name && ( <>
Certification Status must differ from previous Status )} - { idx === 0 && mayCauseSuspension(ce.status.name) + { idx === 0 && mayCauseSuspension(ce.status.name) && ( <>
Setting this product to this status may trigger a ban by ONC )} - { idx === 0 && ce.status.name === 'Terminated by ONC' + { idx === 0 && ce.status.name === 'Terminated by ONC' && ( <>
Setting this product to this status will cause the developer to be marked as "Under Certification Ban" )} - { idx === 0 && ce.status.name === 'Suspended by ONC' + { idx === 0 && ce.status.name === 'Suspended by ONC' && ( <>
Setting this product to this status will cause the developer to be marked as "Suspended by ONC" )} - { idx === 0 && ce.status.name === 'Withdrawn by Developer' + { idx === 0 && ce.status.name === 'Withdrawn by Developer' && ( <>
Be sure this product is not under surveillance or soon to be under surveillance, otherwise use the status "Withdrawn by Developer Under Surveillance/Review" )} -
- - { getDisplayDateFormat(ce.eventDay) } - - - { ce.reason } - - - - -
- ))} -
-
+ + + { getDisplayDateFormat(ce.eventDay) } + + + { ce.reason } + + + handleItemRemoval('certificationEvents', ce)}> + + + + + ))} + + + )} - { !addingStatus + { !addingStatus && ( )} - { addingStatus + { addingStatus && ( <> - - { certificationStatuses.map((item) => ( - { item.name } - ))} - - - + + + { certificationStatuses.map((item) => ( + { item.name } + ))} + + + + )} - { hasAnyRole(['ROLE_ADMIN', 'ROLE_ONC']) + + { hasAnyRole(['ROLE_ADMIN', 'ROLE_ONC']) && ( - - { acbOptions.map((item) => ( - { item } - ))} - + <> + ONC-ACB : + + { acbOptions.map((item) => ( + { item } + ))} + + )} - { listing.testingLabs?.length > 0 + { listing.testingLabs?.length > 0 && ( <> - - - - Testing Lab - Action - - - - { listing.testingLabs - .sort((a, b) => (a.testingLabName < b.testingLabName ? -1 : 1)) - .map((atl) => ( - - - { atl.testingLabName } - - - - - - ))} - -
+ Testing : + + + + + Testing Lab + Action + + + + { listing.testingLabs + .sort((a, b) => (a.testingLabName < b.testingLabName ? -1 : 1)) + .map((atl) => ( + + + { atl.testingLabName } + + + handleItemRemoval('oncAtls', atl)} + > + + + + + ))} + +
+
)} - { !addingAtl + { !addingAtl && ( )} - { addingAtl + { addingAtl && ( <> { item } ))} - - + + + + )} - - - - - + Standards & Disclosers : + + Real World Testing : + + + + + + + + + + +
); }