BC-17 feat: customer/vendor drawer of readonly details.

This commit is contained in:
a.bouhuolia
2021-09-09 11:56:06 +02:00
parent 6fd47aa884
commit 7b968a43ef
24 changed files with 738 additions and 25 deletions

View File

@@ -2,7 +2,7 @@ import React, { useEffect } from 'react';
import 'style/pages/Customers/List.scss';
import { DashboardContentTable, DashboardPageContent } from 'components';
import { DashboardPageContent } from 'components';
import CustomersActionsBar from './CustomersActionsBar';
import CustomersViewsTabs from './CustomersViewsTabs';

View File

@@ -92,12 +92,12 @@ function CustomersTable({
// Handle view detail contact.
const handleViewDetailCustomer = ({ id }) => {
openDrawer('contact-detail-drawer', { contactId: id });
openDrawer('contact-detail-drawer', { customerId: id });
};
// Handle cell click.
const handleCellClick = (cell, event) => {
openDrawer('contact-detail-drawer', { contactId: cell.row.original.id });
openDrawer('customer-details-drawer', { customerId: cell.row.original.id });
};
if (isEmptyStatus) {

View File

@@ -3,14 +3,23 @@ import intl from 'react-intl-universal';
import { RESOURCES_TYPES } from '../../common/resourcesTypes';
import withDrawerActions from '../Drawer/withDrawerActions';
function CustomerUniversalSearchSelectComponent({ resourceType, resourceId }) {
function CustomerUniversalSearchSelectComponent({
resourceType,
resourceId,
onAction,
// #withDrawerActions
openDrawer,
}) {
if (resourceType === RESOURCES_TYPES.CUSTOMER) {
openDrawer('customer-details-drawer', { customerId: resourceId });
onAction && onAction();
}
return null;
}
const CustomerUniversalSearchSelectAction = withDrawerActions(
CustomerUniversalSearchSelectComponent
CustomerUniversalSearchSelectComponent,
);
/**
@@ -19,6 +28,7 @@ const CustomerUniversalSearchSelectAction = withDrawerActions(
* @returns
*/
const customersToSearch = (contact) => ({
id: contact.id,
text: contact.display_name,
label: contact.formatted_balance,
reference: contact,