From fac9d5fa42865ba46c87d0b9fc5d612fce8e1b5b Mon Sep 17 00:00:00 2001 From: rstubryan Date: Wed, 5 Nov 2025 13:13:46 +0700 Subject: [PATCH] feat(FE-170,174): update validation messages and labels for egg product fields in RecordingForm --- .../recording/form/RecordingForm.schema.ts | 6 +- .../recording/form/RecordingForm.tsx | 138 ++++++++---------- 2 files changed, 61 insertions(+), 83 deletions(-) diff --git a/src/components/pages/production/recording/form/RecordingForm.schema.ts b/src/components/pages/production/recording/form/RecordingForm.schema.ts index 383d4164..d468610e 100644 --- a/src/components/pages/production/recording/form/RecordingForm.schema.ts +++ b/src/components/pages/production/recording/form/RecordingForm.schema.ts @@ -109,9 +109,9 @@ const DepletionObjectSchema: Yup.ObjectSchema = Yup.object({ const EggObjectSchema: Yup.ObjectSchema = Yup.object({ product_warehouse_id: Yup.number() - .required('Produk telur wajib diisi!') - .min(1, 'Produk telur wajib diisi!') - .typeError('Produk telur harus berupa angka!'), + .required('Kondisi telur wajib diisi!') + .min(1, 'Kondisi telur wajib diisi!') + .typeError('Kondisi telur harus berupa angka!'), qty: Yup.number() .required('Jumlah telur wajib diisi!') .min(1, 'Jumlah telur tidak boleh 0!') diff --git a/src/components/pages/production/recording/form/RecordingForm.tsx b/src/components/pages/production/recording/form/RecordingForm.tsx index a0ade3fb..cffa2222 100644 --- a/src/components/pages/production/recording/form/RecordingForm.tsx +++ b/src/components/pages/production/recording/form/RecordingForm.tsx @@ -1179,86 +1179,64 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => { body: 'flex flex-col gap-6', }} > -
- {(type as 'add' | 'edit' | 'detail') === 'detail' ? null : ( - <> - +
+ <> + - + - - - )} - - {(type as 'add' | 'edit' | 'detail') === 'detail' && - formik.values.project_flock_kandang && ( -
- -
- {formik.values.project_flock_kandang.label} -
-
- )} + +
@@ -1970,7 +1948,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => { )} - Produk Telur + Kondisi Telur { ); }} options={depletionProducts} - placeholder='Pilih Produk Telur' + placeholder='Pilih Kondisi Telur' isLoading={isLoadingEggProducts} isError={ isRepeaterInputError(