mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
refactor(FE-441): Display '-' for empty/zero numeric fields
This commit is contained in:
@@ -1570,7 +1570,10 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
||||
<td className='py-3 font-medium'>FCR</td>
|
||||
<td className='text-center py-3'>
|
||||
<span className='font-semibold'>
|
||||
{formatNumber(initialValues.fcr_value || 0)}
|
||||
{initialValues.fcr_value &&
|
||||
initialValues.fcr_value > 0
|
||||
? formatNumber(initialValues.fcr_value)
|
||||
: '-'}
|
||||
</span>
|
||||
</td>
|
||||
<td className='text-center py-3 text-gray-600'>-</td>
|
||||
@@ -1579,18 +1582,27 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
||||
<td className='py-3 font-medium'>Feed Intake (KG)</td>
|
||||
<td className='text-center py-3'>
|
||||
<span className='font-semibold'>
|
||||
{formatNumber(initialValues.feed_intake || 0)}
|
||||
{initialValues.feed_intake &&
|
||||
initialValues.feed_intake > 0
|
||||
? formatNumber(initialValues.feed_intake)
|
||||
: '-'}
|
||||
</span>
|
||||
</td>
|
||||
<td className='text-center py-3 text-gray-600'>
|
||||
{formatNumber(initialValues.feed_intake_std || 0)}
|
||||
{initialValues.feed_intake_std &&
|
||||
initialValues.feed_intake_std > 0
|
||||
? formatNumber(initialValues.feed_intake_std)
|
||||
: '-'}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td className='py-3 font-medium'>Cum. Intake (KG)</td>
|
||||
<td className='text-center py-3'>
|
||||
<span className='font-semibold'>
|
||||
{formatNumber(initialValues.cum_intake || 0)}
|
||||
{initialValues.cum_intake &&
|
||||
initialValues.cum_intake > 0
|
||||
? formatNumber(initialValues.cum_intake)
|
||||
: '-'}
|
||||
</span>
|
||||
</td>
|
||||
<td className='text-center py-3 text-gray-600'>-</td>
|
||||
@@ -1643,33 +1655,45 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
||||
<tr>
|
||||
<td className='text-center py-3 border-r border-gray-100'>
|
||||
<span className='font-semibold'>
|
||||
{formatNumber(initialValues.hand_day || 0)}
|
||||
{initialValues.hand_day &&
|
||||
initialValues.hand_day > 0
|
||||
? formatNumber(initialValues.hand_day)
|
||||
: '-'}
|
||||
</span>
|
||||
</td>
|
||||
<td className='text-center py-3 border-r border-gray-200 text-gray-600'>
|
||||
{initialValues.hand_day_std !== undefined
|
||||
{initialValues.hand_day_std !== undefined &&
|
||||
initialValues.hand_day_std > 0
|
||||
? `${initialValues.hand_day_std}%`
|
||||
: '-'}
|
||||
</td>
|
||||
<td className='text-center py-3 border-r border-gray-100'>
|
||||
<span className='font-semibold'>
|
||||
{formatNumber(
|
||||
initialValues.total_depletion_qty || 0
|
||||
)}
|
||||
{initialValues.total_depletion_qty &&
|
||||
initialValues.total_depletion_qty > 0
|
||||
? formatNumber(initialValues.total_depletion_qty)
|
||||
: '-'}
|
||||
</span>
|
||||
</td>
|
||||
<td className='text-center py-3 text-gray-600'>
|
||||
{initialValues.cum_depletion_rate?.toFixed(2) || '-'}
|
||||
{initialValues.cum_depletion_rate &&
|
||||
initialValues.cum_depletion_rate > 0
|
||||
? initialValues.cum_depletion_rate.toFixed(2)
|
||||
: '-'}
|
||||
</td>
|
||||
</tr>
|
||||
<tr className='border-b border-gray-200'>
|
||||
<td className='text-center py-3 border-r border-gray-100'>
|
||||
<span className='font-semibold'>
|
||||
{formatNumber(initialValues.hand_house || 0)}
|
||||
{initialValues.hand_house &&
|
||||
initialValues.hand_house > 0
|
||||
? formatNumber(initialValues.hand_house)
|
||||
: '-'}
|
||||
</span>
|
||||
</td>
|
||||
<td className='text-center py-3 border-r border-gray-200 text-gray-600'>
|
||||
{initialValues.hand_house_std !== undefined
|
||||
{initialValues.hand_house_std !== undefined &&
|
||||
initialValues.hand_house_std > 0
|
||||
? `${initialValues.hand_house_std}%`
|
||||
: '-'}
|
||||
</td>
|
||||
@@ -1691,7 +1715,10 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
||||
colSpan={2}
|
||||
className='text-center py-3 font-semibold'
|
||||
>
|
||||
{formatNumber(initialValues.total_chick_qty || 0)}
|
||||
{initialValues.total_chick_qty &&
|
||||
initialValues.total_chick_qty > 0
|
||||
? formatNumber(initialValues.total_chick_qty)
|
||||
: '-'}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -1727,11 +1754,17 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
||||
<td className='py-3 font-medium'>Egg Mesh</td>
|
||||
<td className='text-center py-3'>
|
||||
<span className='font-semibold'>
|
||||
{formatNumber(initialValues.egg_mesh || 0)}
|
||||
{initialValues.egg_mesh &&
|
||||
initialValues.egg_mesh > 0
|
||||
? formatNumber(initialValues.egg_mesh)
|
||||
: '-'}
|
||||
</span>
|
||||
</td>
|
||||
<td className='text-center py-3 text-gray-600'>
|
||||
{formatNumber(initialValues.egg_mesh_std || 0)}
|
||||
{initialValues.egg_mesh_std &&
|
||||
initialValues.egg_mesh_std > 0
|
||||
? formatNumber(initialValues.egg_mesh_std)
|
||||
: '-'}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1740,11 +1773,17 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
||||
</td>
|
||||
<td className='text-center py-3'>
|
||||
<span className='font-semibold'>
|
||||
{formatNumber(initialValues.egg_weight || 0)}
|
||||
{initialValues.egg_weight &&
|
||||
initialValues.egg_weight > 0
|
||||
? formatNumber(initialValues.egg_weight)
|
||||
: '-'}
|
||||
</span>
|
||||
</td>
|
||||
<td className='text-center py-3 text-gray-600'>
|
||||
{formatNumber(initialValues.egg_weight_std || 0)}
|
||||
{initialValues.egg_weight_std &&
|
||||
initialValues.egg_weight_std > 0
|
||||
? formatNumber(initialValues.egg_weight_std)
|
||||
: '-'}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user