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

@@ -8,6 +8,7 @@ import { RESOURCES_TYPES } from '@/constants/resourcesTypes';
import { AbilitySubject, SaleEstimateAction } from '@/constants/abilityOption';
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
import { DRAWERS } from '@/constants/drawers';
/**
* Estimate universal search item select action.
@@ -21,7 +22,7 @@ function EstimateUniversalSearchSelectComponent({
openDrawer,
}) {
if (resourceType === RESOURCES_TYPES.ESTIMATE) {
openDrawer('estimate-detail-drawer', { estimateId: resourceId });
openDrawer(DRAWERS.ESTIMATE_DETAILS, { estimateId: resourceId });
}
return null;
}

View File

@@ -21,6 +21,7 @@ import { ActionsMenu, useEstiamtesTableColumns } from './components';
import { useEstimatesListContext } from './EstimatesListProvider';
import { useMemorizedColumnsWidths } from '@/hooks';
import { compose } from '@/utils';
import { DRAWERS } from '@/constants/drawers';
/**
* Estimates datatable.
@@ -86,7 +87,7 @@ function EstimatesDataTable({
// Handle view detail estimate.
const handleViewDetailEstimate = ({ id }) => {
openDrawer('estimate-detail-drawer', { estimateId: id });
openDrawer(DRAWERS.ESTIMATE_DETAILS, { estimateId: id });
};
// Handle print estimate.
@@ -96,7 +97,7 @@ function EstimatesDataTable({
// Handle cell click.
const handleCellClick = (cell, event) => {
openDrawer('estimate-detail-drawer', { estimateId: cell.row.original.id });
openDrawer(DRAWERS.ESTIMATE_DETAILS, { estimateId: cell.row.original.id });
};
// Local storage memorizing columns widths.