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 ( + } text={intl.get('delete_currency')} @@ -51,8 +52,6 @@ export const ActionsCell = (props) => { }; export function useCurrenciesTableColumns() { - - return useMemo( () => [ { @@ -69,7 +68,7 @@ export function useCurrenciesTableColumns() { { Header: intl.get('currency_sign'), width: 120, - accessor: 'currency_sign' + accessor: 'currency_sign', }, { id: 'actions', diff --git a/src/containers/Purchases/Bills/BillsLanding/components.js b/src/containers/Purchases/Bills/BillsLanding/components.js index ebd1771d0..4da4aa53f 100644 --- a/src/containers/Purchases/Bills/BillsLanding/components.js +++ b/src/containers/Purchases/Bills/BillsLanding/components.js @@ -83,6 +83,7 @@ export function ActionsMenu({ onClick={safeCallback(onAllocateLandedCost, original)} /> + + + + + + ({ diff --git a/src/containers/Sales/PaymentReceives/PaymentsLanding/components.js b/src/containers/Sales/PaymentReceives/PaymentsLanding/components.js index de95d270a..c679f95e6 100644 --- a/src/containers/Sales/PaymentReceives/PaymentsLanding/components.js +++ b/src/containers/Sales/PaymentReceives/PaymentsLanding/components.js @@ -41,6 +41,7 @@ export function ActionsMenu({ /> + + + } text={intl.get('delete_vendor')} From e9797fd9a0cc94ad5db07a8924edc00910492250 Mon Sep 17 00:00:00 2001 From: elforjani13 <39470382+elforjani13@users.noreply.github.com> Date: Sat, 1 Jan 2022 10:27:32 +0200 Subject: [PATCH 3/5] BIG-214 Min width submit button on edit mode. --- .../Accounting/MakeJournal/MakeJournalFormFloatingActions.js | 1 + src/containers/Expenses/ExpenseForm/ExpenseFloatingActions.js | 3 ++- src/containers/Purchases/Bills/BillForm/BillFloatingActions.js | 3 ++- .../CreditNoteForm/VendorCreditNoteFloatingActions.js | 1 + .../PaymentMades/PaymentForm/PaymentMadeFloatingActions.js | 1 + .../CreditNotes/CreditNoteForm/CreditNoteFloatingActions.js | 3 ++- .../Sales/Estimates/EstimateForm/EstimateFloatingActions.js | 2 +- .../Sales/Invoices/InvoiceForm/InvoiceFloatingActions.js | 1 + .../PaymentReceiveForm/PaymentReceiveFloatingActions.js | 1 + .../Sales/Receipts/ReceiptForm/ReceiptFormFloatingActions.js | 1 + 10 files changed, 13 insertions(+), 4 deletions(-) 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={} /> { - setSubmitPayload({ redirect: true, publish: true}); + setSubmitPayload({ redirect: true, publish: true }); submitForm(); }; @@ -152,6 +152,7 @@ export default function ExpenseFloatingFooter() { loading={isSubmitting} intent={Intent.PRIMARY} onClick={handleSubmitPublishBtnClick} + style={{ minWidth: '85px' }} text={} /> { - setSubmitPayload({ redirect: false, status: false, }); + setSubmitPayload({ redirect: false, status: false }); submitForm(); }; @@ -149,6 +149,7 @@ export default function BillFloatingActions() { loading={isSubmitting} intent={Intent.PRIMARY} onClick={handleSubmitOpenBtnClick} + style={{ minWidth: '85px' }} text={} /> } /> : } /> { - setSubmitPayload({ redirect: true, open: false }); + setSubmitPayload({ redirect: true, open: false }); submitForm(); }; @@ -147,6 +147,7 @@ export default function CreditNoteFloatingActions() { loading={isSubmitting} intent={Intent.PRIMARY} onClick={handleSubmitOpenBtnClick} + style={{ minWidth: '85px' }} text={} /> { history.goBack(); - }; const handleClearBtnClick = (event) => { @@ -149,6 +148,7 @@ export default function EstimateFloatingActions() { disabled={isSubmitting} intent={Intent.PRIMARY} onClick={handleSubmitDeliverBtnClick} + style={{ minWidth: '85px' }} text={} /> } /> : } /> } /> Date: Sat, 1 Jan 2022 11:00:08 +0200 Subject: [PATCH 4/5] BIG-225 Optimize style of refund vendor form. --- .../RefundVendorCreditFloatingActions.js | 2 +- .../RefundVendorCreditFormFields.js | 6 ------ .../CreditNotes/CreditNotesLanding/components.js | 2 +- .../pages/RefundVendorCredit/RefundVendorCredit.scss | 10 +++------- 4 files changed, 5 insertions(+), 15 deletions(-) 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({