From 56326cc8d242b121eecf195dd4370224780dac97 Mon Sep 17 00:00:00 2001 From: rstubryan Date: Mon, 26 Jan 2026 09:41:50 +0700 Subject: [PATCH] refactor(FE): Disable product select until kandang chosen --- .../pages/production/recording/form/RecordingForm.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/pages/production/recording/form/RecordingForm.tsx b/src/components/pages/production/recording/form/RecordingForm.tsx index 24f862d7..4603832c 100644 --- a/src/components/pages/production/recording/form/RecordingForm.tsx +++ b/src/components/pages/production/recording/form/RecordingForm.tsx @@ -2444,7 +2444,11 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => { ); }} options={unifiedStockProducts} - placeholder='Pilih Produk' + placeholder={ + !formik.values.project_flock_kandang_id + ? 'Pilih kandang terlebih dahulu' + : 'Pilih Produk' + } isLoading={isLoadingStockProducts} onMenuScrollToBottom={loadMoreStockProducts} isError={ @@ -2465,7 +2469,10 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => { wrapper: 'w-full min-w-48', }} isSearchable - isDisabled={type === 'detail'} + isDisabled={ + type === 'detail' || + !formik.values.project_flock_kandang_id + } isClearable={type !== 'detail'} startAdornment={ stock.product_warehouse_id