diff --git a/src/common/drawers.js b/src/common/drawers.js index b42c44b9f..5ec6d05a2 100644 --- a/src/common/drawers.js +++ b/src/common/drawers.js @@ -16,4 +16,6 @@ export const DRAWERS = { QUICK_CREATE_ITEM: 'quick-create-item', CREDIT_NOTE_DETAIL_DRAWER: 'credit-note-detail-drawer', VENDOR_CREDIT_DETAIL_DRAWER: 'vendor-credit-detail-drawer', + REFUND_CREDIT_NOTE_DETAIL_DRAWER:'refund-credit-detail-drawer', + REFUND_VENDOR_CREDIT_DETAIL_DRAWER:'refund-vendor-detail-drawer' }; diff --git a/src/components/Customers/CustomerDrawerLink.js b/src/components/Customers/CustomerDrawerLink.js new file mode 100644 index 000000000..e99c20244 --- /dev/null +++ b/src/components/Customers/CustomerDrawerLink.js @@ -0,0 +1,25 @@ +import React from 'react'; +import * as R from 'ramda'; + +import { ButtonLink } from 'components'; +import withDrawerActions from 'containers/Drawer/withDrawerActions'; + +function CustomerDrawerLinkComponent({ + // #ownProps + children, + customerId, + + // #withDrawerActions + openDrawer, +}) { + // Handle view customer drawer. + const handleCustomerDrawer = () => { + openDrawer('customer-details-drawer', { customerId }); + }; + + return {children}; +} + +export const CustomerDrawerLink = R.compose(withDrawerActions)( + CustomerDrawerLinkComponent, +); diff --git a/src/components/Customers/index.js b/src/components/Customers/index.js new file mode 100644 index 000000000..124141b39 --- /dev/null +++ b/src/components/Customers/index.js @@ -0,0 +1 @@ +export * from './CustomerDrawerLink'; diff --git a/src/components/DrawersContainer.js b/src/components/DrawersContainer.js index b7c0e8fe6..e508519bd 100644 --- a/src/components/DrawersContainer.js +++ b/src/components/DrawersContainer.js @@ -19,6 +19,8 @@ import QuickCreateItemDrawer from '../containers/Drawers/QuickCreateItemDrawer'; import QuickWriteVendorDrawer from '../containers/Drawers/QuickWriteVendorDrawer'; import CreditNoteDetailDrawer from '../containers/Drawers/CreditNoteDetailDrawer'; import VendorCreditDetailDrawer from '../containers/Drawers/VendorCreditDetailDrawer'; +import RefundCreditNoteDetailDrawer from '../containers/Drawers/RefundCreditNoteDetailDrawer'; +import RefundVendorCreditDetailDrawer from '../containers/Drawers/RefundVendorCreditDetailDrawer'; import { DRAWERS } from 'common/drawers'; @@ -51,6 +53,12 @@ export default function DrawersContainer() { + + ); } diff --git a/src/components/Vendors/VendorDrawerLink.js b/src/components/Vendors/VendorDrawerLink.js new file mode 100644 index 000000000..91b528e6f --- /dev/null +++ b/src/components/Vendors/VendorDrawerLink.js @@ -0,0 +1,23 @@ +import React from 'react'; +import * as R from 'ramda'; + +import { ButtonLink } from 'components'; +import withDrawerActions from 'containers/Drawer/withDrawerActions'; + +function VendorDrawerLinkComponent({ + // #ownProps + children, + vendorId, + + // #withDrawerActions + openDrawer, +}) { + // Handle view customer drawer. + const handleVendorDrawer = () => { + openDrawer('vendor-details-drawer', { vendorId }); + }; + + return {children}; +} + +export const VendorDrawerLink = R.compose(withDrawerActions)(VendorDrawerLinkComponent); diff --git a/src/components/Vendors/index.js b/src/components/Vendors/index.js new file mode 100644 index 000000000..8f9cc7544 --- /dev/null +++ b/src/components/Vendors/index.js @@ -0,0 +1 @@ +export * from './VendorDrawerLink' \ No newline at end of file diff --git a/src/components/index.js b/src/components/index.js index feb3f934c..04a2b4138 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -92,6 +92,8 @@ export * from './TextStatus'; export * from './Tags'; export * from './CommercialDoc'; export * from './Card'; +export * from './Customers' +export * from './Vendors' const Hint = FieldHint; diff --git a/src/containers/Accounting/JournalsLanding/components.js b/src/containers/Accounting/JournalsLanding/components.js index 79207ca15..1384e3a87 100644 --- a/src/containers/Accounting/JournalsLanding/components.js +++ b/src/containers/Accounting/JournalsLanding/components.js @@ -179,6 +179,7 @@ export const ActionsMenu = ({ /> + } diff --git a/src/containers/Accounting/MakeJournal/MakeJournalFormFloatingActions.js b/src/containers/Accounting/MakeJournal/MakeJournalFormFloatingActions.js index a95429551..469f722d1 100644 --- a/src/containers/Accounting/MakeJournal/MakeJournalFormFloatingActions.js +++ b/src/containers/Accounting/MakeJournal/MakeJournalFormFloatingActions.js @@ -151,6 +151,7 @@ export default function MakeJournalFloatingAction() { disabled={isSubmitting} intent={Intent.PRIMARY} onClick={handleSubmitPublishBtnClick} + style={{ minWidth: '85px' }} text={} /> {}); + .catch(() => {}) + .finally(() => { + closeAlert(name); + }); }; return ( @@ -65,4 +72,5 @@ function RefundCreditNoteDeleteAlert({ export default compose( withAlertStoreConnect(), withAlertActions, + withDrawerActions, )(RefundCreditNoteDeleteAlert); diff --git a/src/containers/Alerts/VendorCeditNotes/RefundVendorCreditDeleteAlert.js b/src/containers/Alerts/VendorCeditNotes/RefundVendorCreditDeleteAlert.js index 526d92bfb..4e17eb2ec 100644 --- a/src/containers/Alerts/VendorCeditNotes/RefundVendorCreditDeleteAlert.js +++ b/src/containers/Alerts/VendorCeditNotes/RefundVendorCreditDeleteAlert.js @@ -7,6 +7,7 @@ import { useDeleteRefundVendorCredit } from 'hooks/query'; import withAlertActions from 'containers/Alert/withAlertActions'; import withAlertStoreConnect from 'containers/Alert/withAlertStoreConnect'; +import withDrawerActions from 'containers/Drawer/withDrawerActions'; import { compose } from 'utils'; @@ -20,6 +21,9 @@ function RefundVendorCreditDeleteAlert({ payload: { vendorCreditId }, // #withAlertActions closeAlert, + + // #withDrawerActions + closeDrawer, }) { const { mutateAsync: deleteRefundVendorCreditMutate, isLoading } = useDeleteRefundVendorCredit(); @@ -39,9 +43,12 @@ function RefundVendorCreditDeleteAlert({ ), intent: Intent.SUCCESS, }); - closeAlert(name); + closeDrawer('refund-vendor-detail-drawer'); }) - .catch(() => {}); + .catch(() => {}) + .finally(() => { + closeAlert(name); + }); }; return ( @@ -67,4 +74,5 @@ function RefundVendorCreditDeleteAlert({ export default compose( withAlertStoreConnect(), withAlertActions, + withDrawerActions, )(RefundVendorCreditDeleteAlert); diff --git a/src/containers/CashFlow/AccountTransactions/utils.js b/src/containers/CashFlow/AccountTransactions/utils.js index 59f8b43ea..567422ea6 100644 --- a/src/containers/CashFlow/AccountTransactions/utils.js +++ b/src/containers/CashFlow/AccountTransactions/utils.js @@ -71,6 +71,14 @@ export const handleCashFlowTransactionType = (reference, openDrawer) => { return openDrawer('payment-made-detail-drawer', { paymentMadeId: reference.reference_id, }); + case 'RefundCreditNote': + return openDrawer('refund-credit-detail-drawer', { + refundTransactionId: reference.reference_id, + }); + case 'RefundVendorCredit': + return openDrawer('refund-vendor-detail-drawer', { + refundTransactionId: reference.reference_id, + }); default: return openDrawer('cashflow-transaction-drawer', { diff --git a/src/containers/CashFlow/CashFlowAccounts/CashflowAccountsGrid.js b/src/containers/CashFlow/CashFlowAccounts/CashflowAccountsGrid.js index cf06161b9..dc6104046 100644 --- a/src/containers/CashFlow/CashFlowAccounts/CashflowAccountsGrid.js +++ b/src/containers/CashFlow/CashFlowAccounts/CashflowAccountsGrid.js @@ -271,6 +271,7 @@ function CashflowAccountContextMenu({ + } diff --git a/src/containers/Customers/CustomersLanding/components.js b/src/containers/Customers/CustomersLanding/components.js index 9d878bbf4..2eacc0103 100644 --- a/src/containers/Customers/CustomersLanding/components.js +++ b/src/containers/Customers/CustomersLanding/components.js @@ -63,6 +63,7 @@ export function ActionsMenu({ + } text={intl.get('delete_customer')} diff --git a/src/containers/Dialogs/RefundVendorCreditDialog/RefundVendorCreditFloatingActions.js b/src/containers/Dialogs/RefundVendorCreditDialog/RefundVendorCreditFloatingActions.js index 02b6a80cd..8ab4496ad 100644 --- a/src/containers/Dialogs/RefundVendorCreditDialog/RefundVendorCreditFloatingActions.js +++ b/src/containers/Dialogs/RefundVendorCreditDialog/RefundVendorCreditFloatingActions.js @@ -33,7 +33,7 @@ function RefundVendorCreditFloatingActions({