mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
refactor(FE-319): Use approval step 2 and remove grading button
This commit is contained in:
@@ -112,7 +112,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
return (
|
return (
|
||||||
recording?.approval?.action === 'APPROVED' &&
|
recording?.approval?.action === 'APPROVED' &&
|
||||||
recording?.approval?.step_name === 'Disetujui' &&
|
recording?.approval?.step_name === 'Disetujui' &&
|
||||||
recording?.approval?.step_number === 3
|
recording?.approval?.step_number === 2
|
||||||
);
|
);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@@ -2914,78 +2914,6 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
>
|
>
|
||||||
Submit
|
Submit
|
||||||
</Button>
|
</Button>
|
||||||
{/*{isLayingCategory && (
|
|
||||||
<Tooltip
|
|
||||||
content={
|
|
||||||
hasConsumableEggs
|
|
||||||
? 'Lanjut ke proses grading untuk telur konsumsi baik'
|
|
||||||
: 'Hanya bisa melanjutkan ke grading jika ada Telur Konsumsi Baik'
|
|
||||||
}
|
|
||||||
position='left'
|
|
||||||
color={hasConsumableEggs ? 'info' : 'warning'}
|
|
||||||
>
|
|
||||||
<Button
|
|
||||||
type='button'
|
|
||||||
color='info'
|
|
||||||
className='px-4'
|
|
||||||
isLoading={formik.isSubmitting}
|
|
||||||
disabled={
|
|
||||||
hasExceededStock ||
|
|
||||||
!formik.isValid ||
|
|
||||||
formik.isSubmitting ||
|
|
||||||
!hasConsumableEggs
|
|
||||||
}
|
|
||||||
onClick={async () => {
|
|
||||||
if (!formik.isValid) {
|
|
||||||
await formik.validateForm();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
setRecordingFormErrorMessage('');
|
|
||||||
formik.setSubmitting(true);
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (isLayingCategory) {
|
|
||||||
const layingValues =
|
|
||||||
formik.values as RecordingLayingFormValues;
|
|
||||||
const layingPayload =
|
|
||||||
createLayingPayload(layingValues);
|
|
||||||
|
|
||||||
const recordingData =
|
|
||||||
await createRecordingHandlerWithRedirect(
|
|
||||||
layingPayload as CreateLayingRecordingPayload,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
|
|
||||||
if (recordingData?.id) {
|
|
||||||
toast.success(
|
|
||||||
'Recording berhasil disimpan! Mengalihkan ke form Grading...'
|
|
||||||
);
|
|
||||||
setTimeout(() => {
|
|
||||||
router.push(
|
|
||||||
`/production/recording/grading/add?recording_id=${recordingData.id}`
|
|
||||||
);
|
|
||||||
}, 1000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
toast.error(
|
|
||||||
'Gagal membuat recording. Silakan coba lagi.'
|
|
||||||
);
|
|
||||||
} finally {
|
|
||||||
formik.setSubmitting(false);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Icon
|
|
||||||
icon='material-symbols:egg'
|
|
||||||
width={24}
|
|
||||||
height={24}
|
|
||||||
/>
|
|
||||||
Next Step: Grading
|
|
||||||
</Button>
|
|
||||||
</Tooltip>
|
|
||||||
)}*/}
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user