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

@@ -11,10 +11,12 @@ import {
import { useWarehouseDetailDrawerContext } from './WarehouseTransferDetailDrawerProvider';
import { DrawerActionsBar, Icon, FormattedMessage as T } from '@/components';
import withDialogActions from '@/containers/Dialog/withDialogActions';
import withAlertsActions from '@/containers/Alert/withAlertActions';
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
import { DRAWERS } from '@/constants/drawers';
import { compose } from '@/utils';
/**
@@ -34,7 +36,7 @@ function WarehouseTransferDetailActionsBar({
// Handle edit warehosue transfer.
const handleEditWarehosueTransfer = () => {
history.push(`/warehouses-transfers/${warehouseTransferId}/edit`);
closeDrawer('warehouse-transfer-detail-drawer');
closeDrawer(DRAWERS.WAREHOUSE_TRANSFER_DETAILS);
};
// Handle delete warehouse transfer.

View File

@@ -3,6 +3,7 @@ import React from 'react';
import intl from 'react-intl-universal';
import { useWarehouseTransfer } from '@/hooks/query';
import { DrawerHeaderContent, DrawerLoading } from '@/components';
import { DRAWERS } from '@/constants/drawers';
const WarehouseTransferDetailDrawerContext = React.createContext();
@@ -27,7 +28,7 @@ function WarehouseTransferDetailDrawerProvider({
return (
<DrawerLoading loading={isWarehouseTransferLoading}>
<DrawerHeaderContent
name="warehouse-transfer-detail-drawer"
name={DRAWERS.WAREHOUSE_TRANSFER_DETAILS}
title={intl.get('warehouse_transfer.drawer.title', {
number: warehouseTransfer.transaction_number
? `(${warehouseTransfer.transaction_number})`