From d8b076d1050e0b2325a4549ced9befd2c67bce18 Mon Sep 17 00:00:00 2001 From: rstubryan Date: Thu, 6 Nov 2025 17:12:30 +0700 Subject: [PATCH] feat(FE-170,175): enhance RecordingForm and RecordingTable with approval logic and UI improvements --- .../production/recording/RecordingTable.tsx | 121 +++++++++++++----- .../recording/form/RecordingForm.tsx | 65 +++++++--- 2 files changed, 131 insertions(+), 55 deletions(-) diff --git a/src/components/pages/production/recording/RecordingTable.tsx b/src/components/pages/production/recording/RecordingTable.tsx index 0c1f47d9..a5d3ec48 100644 --- a/src/components/pages/production/recording/RecordingTable.tsx +++ b/src/components/pages/production/recording/RecordingTable.tsx @@ -51,6 +51,16 @@ const RowOptionsMenu = ({ const isLayingCategory = props.row.original.project_flock_category === 'LAYING'; + const isRecordingApproved = (recording: Recording) => { + return ( + recording.approval?.action === 'APPROVED' && + recording.approval?.step_name === 'Disetujui' && + recording.approval?.step_number === 3 + ); + }; + + const isApproved = isRecordingApproved(props.row.original); + return ( - + {!isApproved && ( + + )} + {!isApproved && ( + + )} )} - {type !== 'edit' && initialValues && ( + {type === 'detail' && initialValues && ( + )} + + {type === 'edit' && ( + <> + + + + )} + + {type === 'add' && ( <> - )} {recordingFormErrorMessage && (