mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-22 15:50:32 +00:00
BIG-123: alert delete showing in vendor & customer.
This commit is contained in:
@@ -35,7 +35,7 @@ function BillTransactionDeleteAlert({
|
|||||||
deleteLandedCostMutate(BillId)
|
deleteLandedCostMutate(BillId)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
AppToaster.show({
|
AppToaster.show({
|
||||||
message: intl.get('bill.action.delete_successfully.landed_cost'),
|
message: intl.get('landed_cost.action.delete.success_message'),
|
||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
closeAlert(name);
|
closeAlert(name);
|
||||||
@@ -56,7 +56,11 @@ function BillTransactionDeleteAlert({
|
|||||||
onConfirm={handleConfirmLandedCostDelete}
|
onConfirm={handleConfirmLandedCostDelete}
|
||||||
loading={isLoading}
|
loading={isLoading}
|
||||||
>
|
>
|
||||||
<p><T id={`Once your delete this located landed cost, you won't be able to restore it later, Are your sure you want to delete this transaction?`}/></p>
|
<p>
|
||||||
|
<T
|
||||||
|
id={`Once your delete this located landed cost, you won't be able to restore it later, Are your sure you want to delete this transaction?`}
|
||||||
|
/>
|
||||||
|
</p>
|
||||||
</Alert>
|
</Alert>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ import { transformErrors } from 'containers/Customers/utils';
|
|||||||
|
|
||||||
import withAlertStoreConnect from 'containers/Alert/withAlertStoreConnect';
|
import withAlertStoreConnect from 'containers/Alert/withAlertStoreConnect';
|
||||||
import withAlertActions from 'containers/Alert/withAlertActions';
|
import withAlertActions from 'containers/Alert/withAlertActions';
|
||||||
|
import withDrawerActions from 'containers/Drawer/withDrawerActions';
|
||||||
|
|
||||||
import { useDeleteCustomer } from 'hooks/query';
|
import { useDeleteCustomer } from 'hooks/query';
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Customer delete alert.
|
* Customer delete alert.
|
||||||
*/
|
*/
|
||||||
@@ -24,12 +24,11 @@ function CustomerDeleteAlert({
|
|||||||
|
|
||||||
// #withAlertActions
|
// #withAlertActions
|
||||||
closeAlert,
|
closeAlert,
|
||||||
}) {
|
|
||||||
|
|
||||||
const {
|
// #withDrawerActions
|
||||||
mutateAsync: deleteCustomerMutate,
|
closeDrawer,
|
||||||
isLoading
|
}) {
|
||||||
} = useDeleteCustomer();
|
const { mutateAsync: deleteCustomerMutate, isLoading } = useDeleteCustomer();
|
||||||
|
|
||||||
// handle cancel delete alert.
|
// handle cancel delete alert.
|
||||||
const handleCancelDeleteAlert = () => {
|
const handleCancelDeleteAlert = () => {
|
||||||
@@ -44,10 +43,17 @@ function CustomerDeleteAlert({
|
|||||||
message: intl.get('the_customer_has_been_deleted_successfully'),
|
message: intl.get('the_customer_has_been_deleted_successfully'),
|
||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
|
closeDrawer('customer-details-drawer');
|
||||||
})
|
})
|
||||||
.catch(({ response: { data: { errors } } }) => {
|
.catch(
|
||||||
|
({
|
||||||
|
response: {
|
||||||
|
data: { errors },
|
||||||
|
},
|
||||||
|
}) => {
|
||||||
transformErrors(errors);
|
transformErrors(errors);
|
||||||
})
|
},
|
||||||
|
)
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
closeAlert(name);
|
closeAlert(name);
|
||||||
});
|
});
|
||||||
@@ -76,4 +82,5 @@ function CustomerDeleteAlert({
|
|||||||
export default compose(
|
export default compose(
|
||||||
withAlertStoreConnect(),
|
withAlertStoreConnect(),
|
||||||
withAlertActions,
|
withAlertActions,
|
||||||
|
withDrawerActions,
|
||||||
)(CustomerDeleteAlert);
|
)(CustomerDeleteAlert);
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { useDeleteVendor } from 'hooks/query';
|
|||||||
|
|
||||||
import withAlertStoreConnect from 'containers/Alert/withAlertStoreConnect';
|
import withAlertStoreConnect from 'containers/Alert/withAlertStoreConnect';
|
||||||
import withAlertActions from 'containers/Alert/withAlertActions';
|
import withAlertActions from 'containers/Alert/withAlertActions';
|
||||||
|
import withDrawerActions from 'containers/Drawer/withDrawerActions';
|
||||||
|
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
|
|
||||||
@@ -24,8 +25,10 @@ function VendorDeleteAlert({
|
|||||||
|
|
||||||
// #withAlertActions
|
// #withAlertActions
|
||||||
closeAlert,
|
closeAlert,
|
||||||
}) {
|
|
||||||
|
|
||||||
|
// #withDrawerActions
|
||||||
|
closeDrawer,
|
||||||
|
}) {
|
||||||
const { mutateAsync: deleteVendorMutate, isLoading } = useDeleteVendor();
|
const { mutateAsync: deleteVendorMutate, isLoading } = useDeleteVendor();
|
||||||
|
|
||||||
// Handle cancel delete the vendor.
|
// Handle cancel delete the vendor.
|
||||||
@@ -41,6 +44,7 @@ function VendorDeleteAlert({
|
|||||||
message: intl.get('the_vendor_has_been_deleted_successfully'),
|
message: intl.get('the_vendor_has_been_deleted_successfully'),
|
||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
|
closeDrawer('vendor-details-drawer');
|
||||||
})
|
})
|
||||||
.catch(
|
.catch(
|
||||||
({
|
({
|
||||||
@@ -79,4 +83,5 @@ function VendorDeleteAlert({
|
|||||||
export default compose(
|
export default compose(
|
||||||
withAlertStoreConnect(),
|
withAlertStoreConnect(),
|
||||||
withAlertActions,
|
withAlertActions,
|
||||||
|
withDrawerActions,
|
||||||
)(VendorDeleteAlert);
|
)(VendorDeleteAlert);
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ function CustomerDetailsActionsBar({
|
|||||||
|
|
||||||
const handleDeleteCustomer = () => {
|
const handleDeleteCustomer = () => {
|
||||||
openAlert(`customer-delete`, { contactId: customerId });
|
openAlert(`customer-delete`, { contactId: customerId });
|
||||||
closeDrawer('customer-details-drawer');
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleEditContact = () => {
|
const handleEditContact = () => {
|
||||||
history.push(`/customers/${customerId}/edit`);
|
history.push(`/customers/${customerId}/edit`);
|
||||||
closeDrawer('customer-details-drawer');
|
closeDrawer('customer-details-drawer');
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ function VendorDetailsActionsBar({
|
|||||||
// Handle delete vendor.
|
// Handle delete vendor.
|
||||||
const onDeleteContact = () => {
|
const onDeleteContact = () => {
|
||||||
openAlert(`vendor-delete`, { contactId: vendorId });
|
openAlert(`vendor-delete`, { contactId: vendorId });
|
||||||
closeDrawer('vendor-details-drawer');
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleNewInvoiceClick = () => {
|
const handleNewInvoiceClick = () => {
|
||||||
|
|||||||
@@ -1370,6 +1370,7 @@
|
|||||||
"filter.value": "قيمة",
|
"filter.value": "قيمة",
|
||||||
"payment_made.empty_status.title": "المنشأة لم تدفع اي اموال إلي الموردين ، إلي حد الأن!.",
|
"payment_made.empty_status.title": "المنشأة لم تدفع اي اموال إلي الموردين ، إلي حد الأن!.",
|
||||||
"estimate.delete.error.estimate_converted_to_invoice":"لا يمكن حذف عملية عرض اسعار الذي تم تحويلها إلي فاتورة بيع.",
|
"estimate.delete.error.estimate_converted_to_invoice":"لا يمكن حذف عملية عرض اسعار الذي تم تحويلها إلي فاتورة بيع.",
|
||||||
|
"landed_cost.action.delete.success_message": "The landed cost has been deleted successfully.",
|
||||||
|
|
||||||
"items.option.only_active": "Only active",
|
"items.option.only_active": "Only active",
|
||||||
"items.option_all_items.hint": "جميع الاصناف ، بما في ذلك تلك الاصناف لديها رصيد صفر.",
|
"items.option_all_items.hint": "جميع الاصناف ، بما في ذلك تلك الاصناف لديها رصيد صفر.",
|
||||||
|
|||||||
@@ -1358,7 +1358,6 @@
|
|||||||
"vendors.option_without_zero_balance": "Vendors without zero-balance",
|
"vendors.option_without_zero_balance": "Vendors without zero-balance",
|
||||||
"vendors.option_without_zero_balance.hint": "Include vendors and exclude that ones have zero-balance.",
|
"vendors.option_without_zero_balance.hint": "Include vendors and exclude that ones have zero-balance.",
|
||||||
"vendors.option_with_transactions": "Vendors with transactions",
|
"vendors.option_with_transactions": "Vendors with transactions",
|
||||||
"vendors.option_with_transactions.hint": "Include vendors that onces have transactions on the given date period only."
|
"vendors.option_with_transactions.hint": "Include vendors that onces have transactions on the given date period only.",
|
||||||
|
"landed_cost.action.delete.success_message": "The landed cost has been deleted successfully."
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user