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

@@ -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,