From 7426ae09a95a3784578605dd7b2bdd7b0feffb30 Mon Sep 17 00:00:00 2001 From: elforjani3 Date: Thu, 26 Aug 2021 00:22:47 +0200 Subject: [PATCH] feat: inventory adjustment detail. --- client/src/common/drawers.js | 7 +-- client/src/components/DrawersContainer.js | 4 ++ .../InventoryAdjustmentDetail.js | 25 ++++++++ .../InventoryAdjustmentDetailActionsBar.js | 53 ++++++++++++++++ .../InventoryAdjustmentDetailHeader.js | 61 +++++++++++++++++++ .../InventoryAdjustmentDetailTable.js | 30 +++++++++ .../InventoryAdjustmentDrawerContent.js | 15 +++++ .../InventoryAdjustmentDrawerProvider.js | 42 +++++++++++++ .../InventoryAdjustmentDetailDrawer/index.js | 35 +++++++++++ .../InventoryAdjustmentDetailDrawer/utils.js | 37 +++++++++++ .../InventoryAdjustmentTable.js | 10 +++ .../InventoryAdjustments/components.js | 3 +- .../src/hooks/query/inventoryAdjustments.js | 17 ++++++ client/src/lang/en/index.json | 3 +- .../InventoryAdjustmentDrawer.module.scss | 22 +++++++ 15 files changed, 358 insertions(+), 6 deletions(-) create mode 100644 client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/InventoryAdjustmentDetail.js create mode 100644 client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/InventoryAdjustmentDetailActionsBar.js create mode 100644 client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/InventoryAdjustmentDetailHeader.js create mode 100644 client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/InventoryAdjustmentDetailTable.js create mode 100644 client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/InventoryAdjustmentDrawerContent.js create mode 100644 client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/InventoryAdjustmentDrawerProvider.js create mode 100644 client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/index.js create mode 100644 client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/utils.js create mode 100644 client/src/style/components/Drawers/InventoryAdjustmentDrawer.module.scss diff --git a/client/src/common/drawers.js b/client/src/common/drawers.js index 987215b9f..af7978a77 100644 --- a/client/src/common/drawers.js +++ b/client/src/common/drawers.js @@ -1,5 +1,3 @@ - - export const DRAWERS = { ESTIMATE_DRAWER: 'estimate-drawer', MANUAL_JOURNAL_DRAWER: 'journal-drawer', @@ -8,5 +6,6 @@ export const DRAWERS = { PAYMENT_RECEIVE_DRAWER: 'payment-receive-drawer', ACCOUNT_DRAWER: 'account-drawer', JOURNAL_DRAWER: 'journal-drawer', - EXPENSE_DRAWER: 'expense-drawer' -}; \ No newline at end of file + EXPENSE_DRAWER: 'expense-drawer', + INVENTORY_ADJUSTMENT_DRAWER: 'inventory-adjustment-drawer', +}; diff --git a/client/src/components/DrawersContainer.js b/client/src/components/DrawersContainer.js index ea5010e6b..d37ccb8f6 100644 --- a/client/src/components/DrawersContainer.js +++ b/client/src/components/DrawersContainer.js @@ -14,6 +14,7 @@ import PaymentMadeDetailDrawer from 'containers/Drawers/PaymentMadeDetailDrawer' import EstimateDetailDrawer from '../containers/Drawers/EstimateDetailDrawer'; import ItemDetailDrawer from '../containers/Drawers/ItemDetailDrawer'; import ContactDetailDrawer from '../containers/Drawers/ContactDetailDrawer'; +import InventoryAdjustmentDetailDrawer from '../containers/Drawers/InventoryAdjustmentDetailDrawer'; import { DRAWERS } from 'common/drawers'; @@ -34,6 +35,9 @@ export default function DrawersContainer() { + ); } diff --git a/client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/InventoryAdjustmentDetail.js b/client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/InventoryAdjustmentDetail.js new file mode 100644 index 000000000..3e6476f07 --- /dev/null +++ b/client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/InventoryAdjustmentDetail.js @@ -0,0 +1,25 @@ +import React from 'react'; +import clsx from 'classnames'; + +import { Card } from 'components'; + +import InventoryAdjustmentDetailActionsBar from './InventoryAdjustmentDetailActionsBar'; +import InventoryAdjustmentDetailHeader from './InventoryAdjustmentDetailHeader'; +import InventoryAdjustmentDetailTable from './InventoryAdjustmentDetailTable'; + +import InventoryAdjustmentDrawerCls from 'style/components/Drawers/InventoryAdjustmentDrawer.module.scss'; + +/** + * Inventory adjustment detail + */ +export default function InventoryAdjustmentDetail() { + return ( +
+ + + + + +
+ ); +} diff --git a/client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/InventoryAdjustmentDetailActionsBar.js b/client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/InventoryAdjustmentDetailActionsBar.js new file mode 100644 index 000000000..f054fb2ec --- /dev/null +++ b/client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/InventoryAdjustmentDetailActionsBar.js @@ -0,0 +1,53 @@ +import React from 'react'; + +import { Button, NavbarGroup, Classes, Intent } from '@blueprintjs/core'; +import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar'; + +import { useInventoryAdjustmentDrawerContext } from './InventoryAdjustmentDrawerProvider'; + +import withAlertsActions from 'containers/Alert/withAlertActions'; +import withDrawerActions from 'containers/Drawer/withDrawerActions'; + +import { Icon, FormattedMessage as T } from 'components'; + +import { compose } from 'utils'; + +/** + * Inventory adjustment detail actions bar. + */ +function InventoryAdjustmentDetailActionsBar({ + // #withAlertsActions + openAlert, + + // #withDrawerActions + closeDrawer, +}) { + const { inventoryId } = useInventoryAdjustmentDrawerContext(); + + // Handle delete inventory adjustment. + const handleDeleteInventoryAdjustment = () => { + openAlert('inventory-adjustment-delete', { + inventoryId, + }); + closeDrawer('inventory-adjustment-drawer'); + }; + + return ( + + +