From ee6f4028ebe7878034aacd55a2086acf97e03f20 Mon Sep 17 00:00:00 2001
From: elforjani13 <39470382+elforjani13@users.noreply.github.com>
Date: Thu, 30 Dec 2021 21:33:18 +0200
Subject: [PATCH 1/5] BIG-232 customer and vendor drawer link.
---
.../Customers/CustomerDrawerLink.js | 25 +++++++++++++++++++
src/components/Customers/index.js | 1 +
src/components/Vendors/VendorDrawerLink.js | 23 +++++++++++++++++
src/components/Vendors/index.js | 1 +
src/components/index.js | 2 ++
.../Drawers/BillDrawer/BillDetailHeader.js | 5 +++-
.../CreditNoteDetailHeader.js | 5 +++-
.../EstimateDetailHeader.js | 5 +++-
.../InvoiceDetailHeader.js | 5 ++--
.../PaymentMadeDetailHeader.js | 5 +++-
.../PaymentReceiveDetailHeader.js | 5 +++-
.../ReceiptDetailHeader.js | 5 +++-
.../VendorCreditDetailHeader.js | 5 +++-
13 files changed, 83 insertions(+), 9 deletions(-)
create mode 100644 src/components/Customers/CustomerDrawerLink.js
create mode 100644 src/components/Customers/index.js
create mode 100644 src/components/Vendors/VendorDrawerLink.js
create mode 100644 src/components/Vendors/index.js
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/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/Drawers/BillDrawer/BillDetailHeader.js b/src/containers/Drawers/BillDrawer/BillDetailHeader.js
index f002ac457..0ce3dc3b0 100644
--- a/src/containers/Drawers/BillDrawer/BillDetailHeader.js
+++ b/src/containers/Drawers/BillDrawer/BillDetailHeader.js
@@ -12,6 +12,7 @@ import {
Col,
CommercialDocHeader,
CommercialDocTopHeader,
+ VendorDrawerLink,
} from 'components';
import { useBillDrawerContext } from './BillDrawerProvider';
@@ -45,7 +46,9 @@ export default function BillDetailHeader() {
- {bill.vendor?.display_name}
+
+ {bill.vendor?.display_name}
+
{defaultTo(bill.bill_number, '-')}
diff --git a/src/containers/Drawers/CreditNoteDetailDrawer/CreditNoteDetailHeader.js b/src/containers/Drawers/CreditNoteDetailDrawer/CreditNoteDetailHeader.js
index 1b630d40b..ead8b8243 100644
--- a/src/containers/Drawers/CreditNoteDetailDrawer/CreditNoteDetailHeader.js
+++ b/src/containers/Drawers/CreditNoteDetailDrawer/CreditNoteDetailHeader.js
@@ -13,6 +13,7 @@ import {
ButtonLink,
CommercialDocHeader,
CommercialDocTopHeader,
+ CustomerDrawerLink,
} from 'components';
import { useCreditNoteDetailDrawerContext } from './CreditNoteDetailDrawerProvider';
@@ -48,7 +49,9 @@ export default function CreditNoteDetailHeader() {
- {creditNote.customer?.display_name}
+
+ {creditNote.customer?.display_name}
+
- {estimate.customer?.display_name}
+
+ {estimate.customer?.display_name}
+
-
+
{invoice.customer?.display_name}
-
+
diff --git a/src/containers/Drawers/PaymentMadeDetailDrawer/PaymentMadeDetailHeader.js b/src/containers/Drawers/PaymentMadeDetailDrawer/PaymentMadeDetailHeader.js
index 20af0d818..6e36411f5 100644
--- a/src/containers/Drawers/PaymentMadeDetailDrawer/PaymentMadeDetailHeader.js
+++ b/src/containers/Drawers/PaymentMadeDetailDrawer/PaymentMadeDetailHeader.js
@@ -11,6 +11,7 @@ import {
CommercialDocHeader,
CommercialDocTopHeader,
ButtonLink,
+ VendorDrawerLink,
} from 'components';
import { usePaymentMadeDetailContext } from './PaymentMadeDetailProvider';
@@ -38,7 +39,9 @@ export default function PaymentMadeDetailHeader() {
children={defaultTo(paymentMade.payment_number, '-')}
/>
- {paymentMade.vendor?.display_name}
+
+ {paymentMade.vendor?.display_name}
+
- {paymentReceive.customer?.display_name}
+
+ {paymentReceive.customer?.display_name}
+
- {receipt.customer?.display_name}
+
+ {receipt.customer?.display_name}
+
- {vendorCredit.vendor?.display_name}
+
+ {vendorCredit.vendor?.display_name}
+
Date: Thu, 30 Dec 2021 21:54:32 +0200
Subject: [PATCH 2/5] BIG-225 Add menu divider before delete on contextMenu.
---
src/containers/Accounting/JournalsLanding/components.js | 1 +
.../CashFlow/CashFlowAccounts/CashflowAccountsGrid.js | 1 +
src/containers/Customers/CustomersLanding/components.js | 1 +
.../BillDrawer/BillPaymentTransactions/components.js | 3 ++-
.../InvoicePaymentTransactions/components.js | 3 ++-
.../BillPaymentTransactions/components.js | 3 ++-
.../EstimatePaymentTransactions/components.js | 3 ++-
.../InvoicePaymentTransactions/components.js | 3 ++-
.../ReceiptPaymentTransactions/components.js | 3 ++-
src/containers/Expenses/ExpensesLanding/components.js | 1 +
src/containers/Items/components.js | 1 +
src/containers/Preferences/Currencies/components.js | 7 +++----
src/containers/Purchases/Bills/BillsLanding/components.js | 1 +
.../Purchases/CreditNotes/CreditNotesLanding/components.js | 1 +
.../Purchases/PaymentMades/PaymentsLanding/components.js | 1 +
.../Sales/CreditNotes/CreditNotesLanding/components.js | 1 +
.../Sales/Estimates/EstimatesLanding/components.js | 1 +
.../Sales/Invoices/InvoicesLanding/components.js | 1 +
.../PaymentReceiveForm/PaymentReceiveForm.js | 2 +-
.../Sales/PaymentReceives/PaymentsLanding/components.js | 1 +
.../Sales/Receipts/ReceiptsLanding/components.js | 1 +
src/containers/Vendors/VendorsLanding/components.js | 1 +
22 files changed, 30 insertions(+), 11 deletions(-)
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/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/Drawers/BillDrawer/BillPaymentTransactions/components.js b/src/containers/Drawers/BillDrawer/BillPaymentTransactions/components.js
index 62fd6983d..36ed3e7dc 100644
--- a/src/containers/Drawers/BillDrawer/BillPaymentTransactions/components.js
+++ b/src/containers/Drawers/BillDrawer/BillPaymentTransactions/components.js
@@ -1,6 +1,6 @@
import React from 'react';
import intl from 'react-intl-universal';
-import { Intent, Menu, MenuItem } from '@blueprintjs/core';
+import { Intent, Menu, MenuItem, MenuDivider } from '@blueprintjs/core';
import clsx from 'classnames';
import { CLASSES } from '../../../../common/classes';
import { Can, FormatDateCell, Icon } from '../../../../components';
@@ -27,6 +27,7 @@ export function ActionsMenu({
/>
+
+
+
+
+
+
+
}
text={intl.get('delete_expense')}
diff --git a/src/containers/Items/components.js b/src/containers/Items/components.js
index e4bf09d98..5de8e29ff 100644
--- a/src/containers/Items/components.js
+++ b/src/containers/Items/components.js
@@ -140,6 +140,7 @@ export function ItemsActionMenuList({
+
}
diff --git a/src/containers/Preferences/Currencies/components.js b/src/containers/Preferences/Currencies/components.js
index 431628b27..2c25b607a 100644
--- a/src/containers/Preferences/Currencies/components.js
+++ b/src/containers/Preferences/Currencies/components.js
@@ -5,6 +5,7 @@ import {
Button,
Position,
MenuItem,
+ MenuDivider,
Intent,
} from '@blueprintjs/core';
import intl from 'react-intl-universal';
@@ -18,7 +19,6 @@ export function ActionMenuList({
row: { original },
payload: { onEditCurrency, onDeleteCurrency },
}) {
-
return (