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

@@ -23,6 +23,7 @@ import withDrawerActions from '@/containers/Drawer/withDrawerActions';
import withSettings from '@/containers/Settings/withSettings';
import { compose } from '@/utils';
import { DRAWERS } from '@/constants/drawers';
/**
* Vendors table.
@@ -93,12 +94,12 @@ function VendorsTable({
// Handle view detail item.
const handleViewDetailVendor = ({ id }) => {
openDrawer('vendor-detail-drawer', { vendorId: id });
openDrawer(DRAWERS.VENDOR_DETAILS, { vendorId: id });
};
// Handle cell click.
const handleCellClick = (cell, event) => {
openDrawer('vendor-detail-drawer', { vendorId: cell.row.original.id });
openDrawer(DRAWERS.VENDOR_DETAILS, { vendorId: cell.row.original.id });
};
// Local storage memorizing columns widths.

View File

@@ -4,6 +4,7 @@ import intl from 'react-intl-universal';
import { RESOURCES_TYPES } from '@/constants/resourcesTypes';
import { AbilitySubject, VendorAction } from '@/constants/abilityOption';
import withDrawerActions from '../Drawer/withDrawerActions';
import { DRAWERS } from '@/constants/drawers';
/**
* Vendor univesal search item select action.
@@ -17,7 +18,7 @@ function VendorUniversalSearchSelectComponent({
openDrawer,
}) {
if (resourceType === RESOURCES_TYPES.VENDOR) {
openDrawer('vendor-detail-drawer', { vendorId: resourceId });
openDrawer(DRAWERS.VENDOR_DETAILS, { vendorId: resourceId });
onAction && onAction();
}
return null;