mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
refactor(FE): Move movement error to top and remove isValid check
This commit is contained in:
@@ -814,6 +814,16 @@ const MovementForm = ({ type = 'add', initialValues }: MovementFormProps) => {
|
|||||||
onReset={formik.handleReset}
|
onReset={formik.handleReset}
|
||||||
className='w-full mt-8 flex flex-col gap-6'
|
className='w-full mt-8 flex flex-col gap-6'
|
||||||
>
|
>
|
||||||
|
{movementFormErrorMessage && (
|
||||||
|
<div role='alert' className='alert alert-error'>
|
||||||
|
<Icon
|
||||||
|
icon='material-symbols:error-outline'
|
||||||
|
width={24}
|
||||||
|
height={24}
|
||||||
|
/>
|
||||||
|
<span>{movementFormErrorMessage}</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
{/* Top card - Movement details */}
|
{/* Top card - Movement details */}
|
||||||
<Card
|
<Card
|
||||||
title='Detail Movement'
|
title='Detail Movement'
|
||||||
@@ -1747,7 +1757,6 @@ const MovementForm = ({ type = 'add', initialValues }: MovementFormProps) => {
|
|||||||
disabled={
|
disabled={
|
||||||
hasInvalidQty ||
|
hasInvalidQty ||
|
||||||
hasExceededStock ||
|
hasExceededStock ||
|
||||||
!formik.isValid ||
|
|
||||||
formik.isSubmitting ||
|
formik.isSubmitting ||
|
||||||
(formik.values.source_warehouse_id ===
|
(formik.values.source_warehouse_id ===
|
||||||
formik.values.destination_warehouse_id &&
|
formik.values.destination_warehouse_id &&
|
||||||
@@ -1760,17 +1769,6 @@ const MovementForm = ({ type = 'add', initialValues }: MovementFormProps) => {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{movementFormErrorMessage && (
|
|
||||||
<div role='alert' className='alert alert-error'>
|
|
||||||
<Icon
|
|
||||||
icon='material-symbols:error-outline'
|
|
||||||
width={24}
|
|
||||||
height={24}
|
|
||||||
/>
|
|
||||||
<span>{movementFormErrorMessage}</span>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in New Issue
Block a user