fix(webapp): use all drawers name from common enum object

This commit is contained in:
Ahmed Bouhuolia
2023-06-14 19:51:14 +02:00
parent 01c27b56ef
commit d1a09e3b15
99 changed files with 286 additions and 186 deletions

View File

@@ -24,6 +24,7 @@ import { useCustomersListContext } from './CustomersListProvider';
import { useMemorizedColumnsWidths } from '@/hooks';
import { compose } from '@/utils';
import { DRAWERS } from '@/constants/drawers';
/**
* Customers table.
@@ -108,12 +109,12 @@ function CustomersTable({
// Handle view detail contact.
const handleViewDetailCustomer = ({ id }) => {
openDrawer('customer-detail-drawer', { customerId: id });
openDrawer(DRAWERS.CUSTOMER_DETAILS, { customerId: id });
};
// Handle cell click.
const handleCellClick = (cell, event) => {
openDrawer('customer-detail-drawer', { customerId: cell.row.original.id });
openDrawer(DRAWERS.CUSTOMER_DETAILS, { customerId: cell.row.original.id });
};
if (isEmptyStatus) {

View File

@@ -2,9 +2,11 @@
import intl from 'react-intl-universal';
import { AbilitySubject, CustomerAction } from '@/constants/abilityOption';
import { RESOURCES_TYPES } from '@/constants/resourcesTypes';
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
import { RESOURCES_TYPES } from '@/constants/resourcesTypes';
import { DRAWERS } from '@/constants/drawers';
function CustomerUniversalSearchSelectComponent({
resourceType,
resourceId,
@@ -14,7 +16,7 @@ function CustomerUniversalSearchSelectComponent({
openDrawer,
}) {
if (resourceType === RESOURCES_TYPES.CUSTOMER) {
openDrawer('customer-detail-drawer', { customerId: resourceId });
openDrawer(DRAWERS.CUSTOMER_DETAILS, { customerId: resourceId });
onAction && onAction();
}
return null;