From 406befc21b7d3cbca4d09d7de994dceef01a7069 Mon Sep 17 00:00:00 2001 From: rstubryan Date: Wed, 28 Jan 2026 13:43:46 +0700 Subject: [PATCH 01/53] refactor(FE): Refine input component styles and error UI --- src/components/input/FileInput.tsx | 18 +++++++++++------- src/components/input/TextInput.tsx | 8 ++++---- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/components/input/FileInput.tsx b/src/components/input/FileInput.tsx index 5f3a8610..f285f687 100644 --- a/src/components/input/FileInput.tsx +++ b/src/components/input/FileInput.tsx @@ -41,7 +41,7 @@ const FileInput = ({ return (
@@ -49,7 +49,7 @@ const FileInput = ({
); }; diff --git a/src/components/input/TextInput.tsx b/src/components/input/TextInput.tsx index 2365d73d..89d4f059 100644 --- a/src/components/input/TextInput.tsx +++ b/src/components/input/TextInput.tsx @@ -102,7 +102,7 @@ const TextInput = ({ {inputPrefix && (
Date: Wed, 28 Jan 2026 14:14:44 +0700 Subject: [PATCH 02/53] refactor(FE): Move form error alerts to bottom of forms --- .../inventory/movement/form/MovementForm.tsx | 40 ++++++++++--------- .../form/ProductCategoryForm.tsx | 28 +++++++------ .../master-data/product/form/ProductForm.tsx | 29 ++++++++------ .../recording/form/RecordingForm.tsx | 34 ++++++++-------- .../uniformity/form/UniformityForm.tsx | 40 ++++++++++--------- .../order/PurchaseOrderAcceptApprovalForm.tsx | 40 ++++++++++--------- .../order/PurchaseOrderStaffApprovalForm.tsx | 40 ++++++++++--------- .../form/request/PurchaseRequestForm.tsx | 40 ++++++++++--------- 8 files changed, 154 insertions(+), 137 deletions(-) diff --git a/src/components/pages/inventory/movement/form/MovementForm.tsx b/src/components/pages/inventory/movement/form/MovementForm.tsx index ff3edbfc..ef4bc3bb 100644 --- a/src/components/pages/inventory/movement/form/MovementForm.tsx +++ b/src/components/pages/inventory/movement/form/MovementForm.tsx @@ -1263,25 +1263,6 @@ const MovementForm = ({ type = 'add', initialValues }: MovementFormProps) => { onReset={formik.handleReset} className='w-full mt-8 flex flex-col gap-6' > - {movementFormErrorMessage && ( -
- - {movementFormErrorMessage} -
- )} - - {/* Error List Alert */} - {formErrorList.length > 0 && ( - setFormErrorList([])} - /> - )} - {/* Top card - Movement details */} { )} +
+ {movementFormErrorMessage && ( +
+ + {movementFormErrorMessage} +
+ )} + + {/* Error List Alert */} + {formErrorList.length > 0 && ( + setFormErrorList([])} + /> + )} +
+ {/* Action buttons */}
{type !== 'detail' && ( diff --git a/src/components/pages/master-data/product-category/form/ProductCategoryForm.tsx b/src/components/pages/master-data/product-category/form/ProductCategoryForm.tsx index 1e61879c..b75795b1 100644 --- a/src/components/pages/master-data/product-category/form/ProductCategoryForm.tsx +++ b/src/components/pages/master-data/product-category/form/ProductCategoryForm.tsx @@ -159,19 +159,6 @@ const ProductCategoryForm = ({ onReset={formik.handleReset} className='w-full mt-8 flex flex-col gap-6' > - {formErrorMessage && ( -
- - {formErrorMessage} -
- )} - - -
)} +
+ {formErrorMessage && ( +
+ + {formErrorMessage} +
+ )} + + +
+ {type !== 'detail' && (
{ onReset={formik.handleReset} className='w-full mt-8 flex flex-col gap-6' > - {productFormErrorMessage && ( -
- - {productFormErrorMessage} -
- )} - - -
{ )}
)} + +
+ {productFormErrorMessage && ( +
+ + {productFormErrorMessage} +
+ )} + + +
+ {type !== 'detail' && (
{ onSubmit={handleFormSubmit} className='w-full mt-8 flex flex-col gap-6' > - {recordingFormErrorMessage && ( -
- - {recordingFormErrorMessage} -
- )} - - {/* Error List Alert */} - {formErrorList.length > 0 && ( - - )} - {/* Basic Info Card */} {(type === 'add' || type === 'edit') && ( { )} +
+ {recordingFormErrorMessage && ( +
+ + {recordingFormErrorMessage} +
+ )} + + {/* Error List Alert */} + {formErrorList.length > 0 && ( + + )} +
+ {/* Action buttons */}
{/* Left side - Detail & Edit actions */} diff --git a/src/components/pages/production/uniformity/form/UniformityForm.tsx b/src/components/pages/production/uniformity/form/UniformityForm.tsx index e6b0657d..8d62f09e 100644 --- a/src/components/pages/production/uniformity/form/UniformityForm.tsx +++ b/src/components/pages/production/uniformity/form/UniformityForm.tsx @@ -511,25 +511,6 @@ const UniformityForm = ({

Informasi Umum

- {uniformityFormErrorMessage && ( -
- - {uniformityFormErrorMessage} -
- )} - - {/* Error List Alert */} - {formErrorList.length > 0 && ( - setFormErrorList([])} - /> - )} - +
+ {uniformityFormErrorMessage && ( +
+ + {uniformityFormErrorMessage} +
+ )} + + {/* Error List Alert */} + {formErrorList.length > 0 && ( + setFormErrorList([])} + /> + )} +
+ {!isNextStep && (