mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-26 00:05:45 +00:00
refactor(FE): Fix form reset and selection handling in
SalesOrderFormModal
This commit is contained in:
@@ -394,7 +394,7 @@ const SalesOrderFormModal = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
formik.setFieldValue('sales_order', updatedProducts);
|
formik.setFieldValue('sales_order', updatedProducts);
|
||||||
console.log(formik.values);
|
setSelectedMarketingProduct(null);
|
||||||
nextButtonHandler();
|
nextButtonHandler();
|
||||||
},
|
},
|
||||||
[memoSalesOrder, nextButtonHandler]
|
[memoSalesOrder, nextButtonHandler]
|
||||||
@@ -418,6 +418,15 @@ const SalesOrderFormModal = ({
|
|||||||
if (modalAction === 'add' || modalAction === 'edit') {
|
if (modalAction === 'add' || modalAction === 'edit') {
|
||||||
setCurrentModalAction(modalAction);
|
setCurrentModalAction(modalAction);
|
||||||
formModal.openModal();
|
formModal.openModal();
|
||||||
|
|
||||||
|
if (modalAction === 'add') {
|
||||||
|
formik.resetForm();
|
||||||
|
setStep(1);
|
||||||
|
setSelectedMarketingProduct(null);
|
||||||
|
setSelectedDeliveryProduct(null);
|
||||||
|
setFormErrorMessage('');
|
||||||
|
setFormErrorList([]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, [modalAction]);
|
}, [modalAction]);
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ const DeliveryOrderProductTable = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<tr className='border-b border-t border-tools-table-outline border-base-content/5'>
|
<tr className='border-b border-tools-table-outline border-base-content/5'>
|
||||||
<th className='w-1/3 text-start not-first:font-medium text-base-content/50 text-sm px-4 py-3'>
|
<th className='w-1/3 text-start not-first:font-medium text-base-content/50 text-sm px-4 py-3'>
|
||||||
Label
|
Label
|
||||||
</th>
|
</th>
|
||||||
|
|||||||
Reference in New Issue
Block a user