@@ -14,7 +14,7 @@ import {
1414} from '@mui/material' ;
1515import { Box } from '@mui/system' ;
1616import { Control , Controller , FieldErrors , UseFormHandleSubmit , UseFormSetValue , UseFormWatch } from 'react-hook-form' ;
17- import { Assembly , Manufacturer , MaterialType , ReimbursementRequest , Unit } from 'shared' ;
17+ import { Assembly , Manufacturer , MaterialType , Unit } from 'shared' ;
1818import ReactHookTextField from '../../../../../components/ReactHookTextField' ;
1919import { MaterialFormInput } from './MaterialForm' ;
2020import NERFormModal from '../../../../../components/NERFormModal' ;
@@ -44,7 +44,6 @@ export interface MaterialFormViewProps {
4444 setValue : UseFormSetValue < MaterialFormInput > ;
4545 copyFromExistingBomAction ?: React . ReactNode ;
4646 fromRRForm ?: boolean ;
47- reimbursementRequests ?: any [ ] ;
4847}
4948
5049const manufacturersToAutocomplete = ( manufacturer : Manufacturer ) : { label : string ; id : string } => {
@@ -70,8 +69,7 @@ const MaterialFormView: React.FC<MaterialFormViewProps> = ({
7069 watch,
7170 createManufacturer,
7271 setValue,
73- fromRRForm = false ,
74- reimbursementRequests = [ ]
72+ fromRRForm = false
7573} ) => {
7674 const [ additionalDetailsOpen , setAdditionalDetailsOpen ] = useState ( ! fromRRForm ) ;
7775
@@ -506,105 +504,30 @@ const MaterialFormView: React.FC<MaterialFormViewProps> = ({
506504 ) }
507505 </ Grid >
508506 </ Grid >
509- < Grid item xs = { 12 } >
510- < Grid item xs = { 12 } mt = { 2 } >
511- < FormControl fullWidth >
512- < Controller
513- name = "reimbursementRequestId"
514- control = { control }
515- defaultValue = { control . _defaultValues . reimbursementRequestId }
516- render = { ( { field } ) => (
517- < TextField
518- { ...field }
519- select
520- variant = "outlined"
521- error = { ! ! errors . reimbursementRequestId }
522- helperText = { errors . reimbursementRequestId ?. message }
523- SelectProps = { {
524- displayEmpty : true ,
525- renderValue : ( selected ) =>
526- selected ? (
527- reimbursementRequests . find ( ( rr ) => rr . reimbursementRequestId === selected ) ?. identifier
528- ) : (
529- < Typography sx = { { fontSize : '1rem' , color : 'lightgray' , opacity : 0.6 } } >
530- Select Corresponding Reimbursement Request Number
531- </ Typography >
532- )
533- } }
534- >
535- { reimbursementRequests . map ( ( rr : ReimbursementRequest ) => (
536- < MenuItem key = { rr . reimbursementRequestId } value = { rr . reimbursementRequestId } >
537- { rr . identifier }
538- </ MenuItem >
539- ) ) }
540- </ TextField >
541- ) }
542- />
543- </ FormControl >
544- </ Grid >
545- < Box display = { 'flex' } justifyContent = { 'flex-end' } mt = { 2 } >
546- < FormControl fullWidth >
547- < Controller
548- name = "assemblyId"
549- control = { control }
550- defaultValue = { control . _defaultValues . assemblyId }
551- render = { ( { field } ) => (
552- < TextField
553- { ...field }
554- select
555- variant = "outlined"
556- error = { ! ! errors . assemblyId }
557- helperText = { errors . assemblyId ?. message }
558- SelectProps = { {
559- displayEmpty : true ,
560- renderValue : ( selected ) =>
561- selected ? (
562- assemblies ?. find ( ( a ) => a . assemblyId === selected ) ?. name
563- ) : (
564- < Typography sx = { { fontSize : '1rem' , color : 'lightgray' , opacity : 0.6 } } >
565- Enter Assembly Details
566- </ Typography >
567- )
568- } }
569- >
570- { assemblies ?. map ( ( assembly ) => (
571- < MenuItem key = { assembly . assemblyId } value = { assembly . assemblyId } >
572- { assembly . name }
573- </ MenuItem >
574- ) ) }
575- </ TextField >
576- ) }
577- />
578- </ FormControl >
579- </ Box >
580- </ Grid >
581- { submitText === 'Add' && (
507+ { /*submitText === 'Add' && (
582508 <Grid item xs={12} sx={{ pl: 0, pr: 0 }}>
583509 <Box
584510 sx={{
585511 pt: 1
586512 }}
587513 >
588- { /* <Button
514+ <Button
589515 variant="contained"
590516 disableElevation
591- onClick={() => {
592- setBomConfirmOpen(true);
593- }}
517+ onClick={() => {}}
594518 sx={{
595519 mx: 0,
596- my: 1,
597520 textTransform: 'none',
598521 bgcolor: '#EF4345',
599522 color: (t) => t.palette.getContrastText('#EF4345'),
600523 '&:hover': { bgcolor: (t) => t.palette.error.dark }
601524 }}
602525 >
603526 COPY FROM EXISTING BOM
604- </Button> */ }
527+ </Button>
605528 </Box>
606529 </Grid>
607- ) }
530+ )*/ }
608531 </ NERFormModal >
609532 ) ;
610533} ;
0 commit comments