feat(warehouseTransfer): add warehouseTransfer.

This commit is contained in:
elforjani13
2022-01-23 14:07:23 +02:00
parent a958c6088a
commit 13da985864
43 changed files with 1787 additions and 10 deletions

View File

@@ -0,0 +1,74 @@
import React from 'react';
import { useHistory } from 'react-router-dom';
import {
Button,
NavbarGroup,
Classes,
NavbarDivider,
Intent,
} from '@blueprintjs/core';
import { useWarehouseDetailDrawerContext } from './WarehouseTransferDetailDrawerProvider';
import {
DrawerActionsBar,
Can,
Icon,
FormattedMessage as T,
If,
} from 'components';
import withDialogActions from 'containers/Dialog/withDialogActions';
import withAlertsActions from 'containers/Alert/withAlertActions';
import withDrawerActions from 'containers/Drawer/withDrawerActions';
import { compose } from 'utils';
/**
* Warehouse transfer detail actions bar.
*/
function WarehouseTransferDetailActionsBar({
// #withAlertsActions
openAlert,
// #withDrawerActions
closeDrawer,
}) {
const history = useHistory();
// Handle edit warehosue transfer.
const handleEditWarehosueTransfer = () => {
// history.push(`/warehouse-transfers/${warehouseTransferId}/edit`);
closeDrawer('warehouse-transfer-detail-drawer');
};
// Handle delete warehouse transfer.
const handleDeletetWarehosueTransfer = () => {
// openAlert('warehouse-transfer-delete', { warehouseTransferId });
};
return (
<DrawerActionsBar>
<NavbarGroup>
<Button
className={Classes.MINIMAL}
icon={<Icon icon="pen-18" />}
text={<T id={'warehouse_transfer.action.edit_warehouse_transfer'} />}
onClick={handleEditWarehosueTransfer}
/>
<NavbarDivider />
<Button
className={Classes.MINIMAL}
icon={<Icon icon={'trash-16'} iconSize={16} />}
text={<T id={'delete'} />}
intent={Intent.DANGER}
onClick={handleDeletetWarehosueTransfer}
/>
</NavbarGroup>
</DrawerActionsBar>
);
}
export default compose(
withDialogActions,
withAlertsActions,
withDrawerActions,
)(WarehouseTransferDetailActionsBar);