mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 07:10:33 +00:00
feat(customer): add contact duplicate.
This commit is contained in:
@@ -29,6 +29,8 @@ function CustomersTable({
|
||||
|
||||
// #withAlerts
|
||||
openAlert,
|
||||
// #withDialogActions
|
||||
openDialog,
|
||||
}) {
|
||||
const history = useHistory();
|
||||
|
||||
@@ -66,6 +68,10 @@ function CustomersTable({
|
||||
history.push(`/customers/${customer.id}/edit`);
|
||||
};
|
||||
|
||||
const handleContactDuplicate = ({ id }) => {
|
||||
openDialog('contact-duplicate', { contactId: id });
|
||||
};
|
||||
|
||||
if (isEmptyStatus) {
|
||||
return <CustomersEmptyStatus />;
|
||||
}
|
||||
@@ -95,6 +101,7 @@ function CustomersTable({
|
||||
payload={{
|
||||
onDelete: handleCustomerDelete,
|
||||
onEdit: handleCustomerEdit,
|
||||
onDuplicate: handleContactDuplicate,
|
||||
}}
|
||||
ContextMenu={ActionsMenu}
|
||||
/>
|
||||
|
||||
@@ -18,7 +18,7 @@ import { useIntl } from 'react-intl';
|
||||
*/
|
||||
export function ActionsMenu({
|
||||
row: { original },
|
||||
payload: { onEdit, onDelete },
|
||||
payload: { onEdit, onDelete ,onDuplicate },
|
||||
}) {
|
||||
const { formatMessage } = useIntl();
|
||||
|
||||
@@ -34,6 +34,11 @@ export function ActionsMenu({
|
||||
text={formatMessage({ id: 'edit_customer' })}
|
||||
onClick={safeCallback(onEdit, original)}
|
||||
/>
|
||||
<MenuItem
|
||||
icon={<Icon icon="duplicate-18" />}
|
||||
text={formatMessage({ id: 'duplicate' })}
|
||||
onClick={safeCallback(onDuplicate, original)}
|
||||
/>
|
||||
<MenuItem
|
||||
icon={<Icon icon="trash-16" iconSize={16} />}
|
||||
text={formatMessage({ id: 'delete_customer' })}
|
||||
|
||||
Reference in New Issue
Block a user