diff --git a/client/src/containers/Alerts/Estimates/EstimateApproveAlert.js b/client/src/containers/Alerts/Estimates/EstimateApproveAlert.js index affd3136e..53cd9f52a 100644 --- a/client/src/containers/Alerts/Estimates/EstimateApproveAlert.js +++ b/client/src/containers/Alerts/Estimates/EstimateApproveAlert.js @@ -21,9 +21,6 @@ function EstimateApproveAlert({ isOpen, payload: { estimateId }, - // #withEstimateActions - requestApproveEstimate, - // #withAlertActions closeAlert, }) { @@ -59,7 +56,6 @@ function EstimateApproveAlert({ } confirmButtonText={} - icon="trash" intent={Intent.WARNING} isOpen={isOpen} loading={isLoading} diff --git a/client/src/containers/Alerts/Estimates/EstimateDeleteAlert.js b/client/src/containers/Alerts/Estimates/EstimateDeleteAlert.js index 491a97ce9..b09f38a23 100644 --- a/client/src/containers/Alerts/Estimates/EstimateDeleteAlert.js +++ b/client/src/containers/Alerts/Estimates/EstimateDeleteAlert.js @@ -31,12 +31,12 @@ function EstimateDeleteAlert({ const { mutateAsync: deleteEstimateMutate, isLoading } = useDeleteEstimate(); // handle cancel delete alert. - const handleCancelEstimateDelete = () => { + const handleAlertCancel = () => { closeAlert(name); }; // handle confirm delete estimate - const handleConfirmEstimateDelete = useCallback(() => { + const handleAlertConfirm = () => { deleteEstimateMutate(estimateId) .then(() => { AppToaster.show({ @@ -50,7 +50,7 @@ function EstimateDeleteAlert({ .finally(() => { closeAlert(name); }); - }, [deleteEstimateMutate, name, closeAlert, formatMessage, estimateId]); + }; return (

{ + const handleAlertCancel = () => { closeAlert(name); }; // Handle confirm estimate delivered. - const handleConfirmEstimateDelivered = useCallback(() => { + const handleAlertConfirm = () => { deliverEstimateMutate(estimateId) .then(() => { AppToaster.show({ @@ -41,14 +40,13 @@ function EstimateDeliveredAlert({ id: 'the_estimate_has_been_delivered_successfully', }), intent: Intent.SUCCESS, - }); - queryCache.invalidateQueries('estimates-table'); + }) }) .catch((error) => {}) .finally(() => { closeAlert(name); }); - }, [estimateId, deliverEstimateMutate, formatMessage]); + }; return ( } intent={Intent.WARNING} isOpen={isOpen} - onCancel={handleCancelDeliveredEstimate} - onConfirm={handleConfirmEstimateDelivered} + onCancel={handleAlertCancel} + onConfirm={handleAlertConfirm} loading={isLoading} >

diff --git a/client/src/containers/Purchases/Bills/BillForm/BillFloatingActions.js b/client/src/containers/Purchases/Bills/BillForm/BillFloatingActions.js index 93d233caf..ad421fdac 100644 --- a/client/src/containers/Purchases/Bills/BillForm/BillFloatingActions.js +++ b/client/src/containers/Purchases/Bills/BillForm/BillFloatingActions.js @@ -83,7 +83,6 @@ export default function BillFloatingActions() { disabled={isSubmitting} loading={isSubmitting} intent={Intent.PRIMARY} - type="submit" onClick={handleSubmitOpenBtnClick} text={} /> @@ -116,7 +115,6 @@ export default function BillFloatingActions() { - - - - - ); -} - -export default compose( - withItems(({ itemsCurrentPage }) => ({ - itemsCurrentPage, - })), -)(EntriesItemsTable); diff --git a/client/src/containers/Sales/Estimates/EstimateForm/EstimateFloatingActions.js b/client/src/containers/Sales/Estimates/EstimateForm/EstimateFloatingActions.js index 96e9bbd75..0351a910e 100644 --- a/client/src/containers/Sales/Estimates/EstimateForm/EstimateFloatingActions.js +++ b/client/src/containers/Sales/Estimates/EstimateForm/EstimateFloatingActions.js @@ -27,7 +27,8 @@ export default function EstimateFloatingActions() { // Handle submit & deliver button click. const handleSubmitDeliverBtnClick = (event) => { - setSubmitPayload({ redirect: true, deliver: true, }); + setSubmitPayload({ redirect: true, deliver: true }); + submitForm(); }; // Handle submit, deliver & new button click. @@ -77,7 +78,6 @@ export default function EstimateFloatingActions() { disabled={isSubmitting} loading={isSubmitting} intent={Intent.PRIMARY} - type="submit" onClick={handleSubmitDeliverBtnClick} text={} /> @@ -105,12 +105,12 @@ export default function EstimateFloatingActions() { /> + {/* ----------- Save As Draft ----------- */}