diff --git a/packages/webapp/src/components/DrawersContainer.tsx b/packages/webapp/src/components/DrawersContainer.tsx index 88fc83397..344c4712d 100644 --- a/packages/webapp/src/components/DrawersContainer.tsx +++ b/packages/webapp/src/components/DrawersContainer.tsx @@ -26,6 +26,7 @@ import ChangeSubscriptionPlanDrawer from '@/containers/Subscriptions/drawers/Cha import { InvoiceCustomizeDrawer } from '@/containers/Sales/Invoices/InvoiceCustomize/InvoiceCustomizeDrawer'; import { EstimateCustomizeDrawer } from '@/containers/Sales/Estimates/EstimateCustomize/EstimateCustomizeDrawer'; import { ReceiptCustomizeDrawer } from '@/containers/Sales/Receipts/ReceiptCustomize/ReceiptCustomizeDrawer'; +import { CreditNoteCustomizeDrawer } from '@/containers/Sales/CreditNotes/CreditNoteCustomize/CreditNoteCustomizeDrawer'; import { DRAWERS } from '@/constants/drawers'; /** @@ -70,6 +71,7 @@ export default function DrawersContainer() { + ); } diff --git a/packages/webapp/src/constants/drawers.ts b/packages/webapp/src/constants/drawers.ts index 82a4c7967..43bca2f59 100644 --- a/packages/webapp/src/constants/drawers.ts +++ b/packages/webapp/src/constants/drawers.ts @@ -29,4 +29,5 @@ export enum DRAWERS { ESTIMATE_CUSTOMIZE = 'ESTIMATE_CUSTOMIZE', PAYMENT_RECEIPT_CUSTOMIZE = 'PAYMENT_RECEIPT_CUSTOMIZE', RECEIPT_CUSTOMIZE = 'RECEIPT_CUSTOMIZE', + CREDIT_NOTE_CUSTOMIZE = 'CREDIT_NOTE_CUSTOMIZE' } diff --git a/packages/webapp/src/containers/Purchases/CreditNotes/CreditNotesLanding/VendorsCreditNoteActionsBar.tsx b/packages/webapp/src/containers/Purchases/CreditNotes/CreditNotesLanding/VendorsCreditNoteActionsBar.tsx index 5ad2f4edf..75bbcacd6 100644 --- a/packages/webapp/src/containers/Purchases/CreditNotes/CreditNotesLanding/VendorsCreditNoteActionsBar.tsx +++ b/packages/webapp/src/containers/Purchases/CreditNotes/CreditNotesLanding/VendorsCreditNoteActionsBar.tsx @@ -8,6 +8,11 @@ import { NavbarGroup, Intent, Alignment, + Menu, + MenuItem, + Popover, + PopoverInteractionKind, + Position, } from '@blueprintjs/core'; import { Icon, @@ -30,9 +35,11 @@ import withSettingsActions from '@/containers/Settings/withSettingsActions'; import withVendorsCreditNotes from './withVendorsCreditNotes'; import withDialogActions from '@/containers/Dialog/withDialogActions'; import withVendorActions from './withVendorActions'; +import withDrawerActions from '@/containers/Drawer/withDrawerActions'; import { compose } from '@/utils'; import { DialogsName } from '@/constants/dialogs'; +import { DRAWERS } from '@/constants/drawers'; /** * Vendors Credit note table actions bar. @@ -54,6 +61,9 @@ function VendorsCreditNoteActionsBar({ // #withDialogActions openDialog, + + // #withDrawerActions + openDrawer, }) { const history = useHistory(); @@ -92,6 +102,10 @@ function VendorsCreditNoteActionsBar({ const handlePrintBtnClick = () => { downloadExportPdf({ resource: 'VendorCredit' }); }; + // Handle the customize button click. + const handleCustomizeBtnClick = () => { + openDrawer(DRAWERS.CREDIT_NOTE_DETAILS); + }; return ( @@ -152,6 +166,25 @@ function VendorsCreditNoteActionsBar({ + + + + } + > +