diff --git a/client/src/components/Details/index.js b/client/src/components/Details/index.js
index c96252136..e427336ee 100644
--- a/client/src/components/Details/index.js
+++ b/client/src/components/Details/index.js
@@ -1,6 +1,5 @@
import React from 'react';
import classNames from 'classnames';
-import { Col, Row } from 'components';
import 'style/components/Details.scss';
@@ -22,7 +21,7 @@ export function DetailsMenu({ children, vertical = false }) {
/**
* Detail item vertical .
*/
-export function DetailItemVER({ label, children }) {
+export function DetailItem({ label, children }) {
return (
{label}
@@ -30,17 +29,3 @@ export function DetailItemVER({ label, children }) {
);
}
-
-/**
- * Detail item horizontal .
- */
-export function DetailItemHOR({ label, children }) {
- return (
-
-
- {label}
-
- {children}
-
- );
-}
diff --git a/client/src/components/DrawersContainer.js b/client/src/components/DrawersContainer.js
index acc556105..83af86bcd 100644
--- a/client/src/components/DrawersContainer.js
+++ b/client/src/components/DrawersContainer.js
@@ -12,6 +12,8 @@ import ReceiptDetailDrawer from 'containers/Drawers/ReceiptDetailDrawer';
import PaymentReceiveDetailDrawer from 'containers/Drawers/PaymentReceiveDetailDrawer';
import PaymentMadeDetailDrawer from 'containers/Drawers/PaymentMadeDetailDrawer';
import EstimateDetailDrawer from '../containers/Drawers/EstimateDetailDrawer';
+import ItemDetailDrawer from '../containers/Drawers/ItemDetailDrawer';
+import ContactDetailDrawer from '../containers/Drawers/ContactDetailDrawer';
export default function DrawersContainer() {
return (
@@ -29,6 +31,8 @@ export default function DrawersContainer() {
+
+
);
}
diff --git a/client/src/containers/Alerts/Customers/CustomerDeleteAlert.js b/client/src/containers/Alerts/Customers/CustomerDeleteAlert.js
index 2b826a9d7..3be974cd6 100644
--- a/client/src/containers/Alerts/Customers/CustomerDeleteAlert.js
+++ b/client/src/containers/Alerts/Customers/CustomerDeleteAlert.js
@@ -20,7 +20,7 @@ function CustomerDeleteAlert({
// #withAlertStoreConnect
isOpen,
- payload: { customerId },
+ payload: { contactId },
// #withAlertActions
closeAlert,
@@ -38,7 +38,7 @@ function CustomerDeleteAlert({
// handle confirm delete customer.
const handleConfirmDeleteCustomer = useCallback(() => {
- deleteCustomerMutate(customerId)
+ deleteCustomerMutate(contactId)
.then(() => {
AppToaster.show({
message: intl.get('the_customer_has_been_deleted_successfully'),
@@ -51,7 +51,7 @@ function CustomerDeleteAlert({
.finally(() => {
closeAlert(name);
});
- }, [deleteCustomerMutate, customerId, closeAlert, name]);
+ }, [deleteCustomerMutate, contactId, closeAlert, name]);
return (
{
- deleteVendorMutate(vendorId)
+ deleteVendorMutate(contactId)
.then(() => {
AppToaster.show({
message: intl.get('the_vendor_has_been_deleted_successfully'),
@@ -54,7 +54,7 @@ function VendorDeleteAlert({
.finally(() => {
closeAlert(name);
});
- }, [deleteVendorMutate, name, closeAlert, vendorId]);
+ }, [deleteVendorMutate, name, closeAlert, contactId]);
return (
{
- openAlert('customer-delete', { customerId: customer.id });
+ const handleCustomerDelete = ({ id }) => {
+ openAlert('customer-delete', { contactId: id });
};
// Handle the customer edit action.
@@ -85,6 +90,11 @@ function CustomersTable({
openAlert('contact-activate', { contactId: id, service: contact_service });
};
+ // Handle view detail contact.
+ const handleViewDetailCustomer = ({ id }) => {
+ openDrawer('contact-detail-drawer', { contactId: id });
+ };
+
if (isEmptyStatus) {
return ;
}
@@ -117,6 +127,7 @@ function CustomersTable({
onDuplicate: handleContactDuplicate,
onInactivate: handleInactiveCustomer,
onActivate: handleActivateCustomer,
+ onViewDetails: handleViewDetailCustomer,
}}
ContextMenu={ActionsMenu}
/>
@@ -127,5 +138,6 @@ export default compose(
withAlertsActions,
withDialogActions,
withCustomersActions,
+ withDrawerActions,
withCustomers(({ customersTableState }) => ({ customersTableState })),
)(CustomersTable);
diff --git a/client/src/containers/Customers/CustomersLanding/components.js b/client/src/containers/Customers/CustomersLanding/components.js
index 2c29c2112..8b23d3bbd 100644
--- a/client/src/containers/Customers/CustomersLanding/components.js
+++ b/client/src/containers/Customers/CustomersLanding/components.js
@@ -18,13 +18,21 @@ import intl from 'react-intl-universal';
*/
export function ActionsMenu({
row: { original },
- payload: { onEdit, onDelete, onDuplicate, onInactivate, onActivate },
+ payload: {
+ onEdit,
+ onDelete,
+ onDuplicate,
+ onInactivate,
+ onActivate,
+ onViewDetails,
+ },
}) {
return (