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

@@ -22,6 +22,7 @@ import { useItemsListContext } from './ItemsListProvider';
import { useItemsTableColumns, ItemsActionMenuList } from './components';
import { useMemorizedColumnsWidths } from '@/hooks';
import { compose } from '@/utils';
import { DRAWERS } from '@/constants/drawers';
/**
* Items datatable.
@@ -108,7 +109,7 @@ function ItemsDataTable({
// Handle view detail item.
const handleViewDetailItem = ({ id }) => {
openDrawer('item-detail-drawer', { itemId: id });
openDrawer(DRAWERS.ITEM_DETAILS, { itemId: id });
};
// Cannot continue in case the items has empty status.
@@ -118,7 +119,7 @@ function ItemsDataTable({
// Handle cell click.
const handleCellClick = (cell, event) => {
openDrawer('item-detail-drawer', { itemId: cell.row.original.id });
openDrawer(DRAWERS.ITEM_DETAILS, { itemId: cell.row.original.id });
};
return (

View File

@@ -4,6 +4,8 @@ import intl from 'react-intl-universal';
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
import { RESOURCES_TYPES } from '@/constants/resourcesTypes';
import { DRAWERS } from '@/constants/drawers';
import { AbilitySubject, ItemAction } from '@/constants/abilityOption';
/**
@@ -19,7 +21,7 @@ function ItemUniversalSearchSelectComponent({
openDrawer,
}) {
if (resourceType === RESOURCES_TYPES.ITEM) {
openDrawer('item-detail-drawer', { itemId: resourceId });
openDrawer(DRAWERS.ITEM_DETAILS, { itemId: resourceId });
onAction && onAction();
}
return null;