@@ -2,12 +2,12 @@ import React, {useEffect, useState} from 'react';
22import GenericForm from "../shared/GenericForm" ;
33import { fetchInternalTypeByFormType } from "../../api/internalTypeApi" ;
44import { ProgramAndNeedSatisfierField } from "./ProgramAndNeedSatisfierField" ;
5- import FieldGroup from '../shared/FieldGroup' ;
65import { fetchCharacteristics } from '../../api/characteristicApi' ;
76import { getInstancesInClass } from '../../api/dynamicFormApi' ;
87import { Box } from '@mui/material' ;
98import { Loading } from '../shared' ;
109import SelectField from '../shared/fields/SelectField' ;
10+ import { CapacityField } from '../shared/CapacityField' ;
1111
1212export default function ProgramOccurrenceForm ( ) {
1313 const formType = 'programOccurrence' ;
@@ -51,13 +51,12 @@ export default function ProgramOccurrenceForm() {
5151 } else if ( implementation . optionsFromClass ?. endsWith ( '#NeedSatisfier' ) ) {
5252 return "" ;
5353 } else if ( implementation . label === 'Capacity' ) {
54- return < FieldGroup component = { implementation . fieldType . type } key = { `${ type } _${ id } ` }
55- label = { implementation . label } required = { required } inputProps = { { min : 0 } }
56- value = { fields [ `${ type } _${ id } ` ] } onChange = { handleChange ( `${ type } _${ id } ` ) } /> ;
54+ return < CapacityField fields = { fields } handleChange = { handleChange }
55+ capacityFieldId = { characteristics [ 'Capacity' ] . _id } /> ;
5756 } else if ( implementation . label === 'Occupancy' ) {
5857 return '' ; // Not editable by the user
5958 } else if ( implementation . label === "Occurrence Status" ) {
60- const statusFieldKey = `characteristic_${ characteristics [ 'Occurrence Status' ] ? ._id } ` ;
59+ const statusFieldKey = `characteristic_${ characteristics [ 'Occurrence Status' ] . _id } ` ;
6160 if ( ! statusFieldKey || ! statusOptions ) {
6261 return < Box minWidth = { "350px" } > < Loading message = "" /> </ Box > ;
6362 }
0 commit comments