From 2630e0235d921abcd5936ac5dd0175d25c17d13d Mon Sep 17 00:00:00 2001 From: elforjani13 <39470382+elforjani13@users.noreply.github.com> Date: Thu, 25 Nov 2021 13:02:09 +0200 Subject: [PATCH] feat: add cashflow & vendor ability. --- .../AccountTransactions/components.js | 32 ++++--- .../CashFlowAccountsActionsBar.js | 49 ++++++---- .../CashFlowAccounts/CashflowAccountsGrid.js | 92 +++++++++++-------- .../CashflowTransactionDrawerActionBar.js | 31 ++++--- .../VendorsLanding/VendorActionsBar.js | 13 ++- 5 files changed, 127 insertions(+), 90 deletions(-) diff --git a/src/containers/CashFlow/AccountTransactions/components.js b/src/containers/CashFlow/AccountTransactions/components.js index 528d6afe2..78dae22d5 100644 --- a/src/containers/CashFlow/AccountTransactions/components.js +++ b/src/containers/CashFlow/AccountTransactions/components.js @@ -4,9 +4,13 @@ import intl from 'react-intl-universal'; import { Intent, Menu, MenuItem, MenuDivider } from '@blueprintjs/core'; import { MaterialProgressBar } from 'components'; -import { FormatDateCell, If, Icon } from 'components'; +import { Can, FormatDateCell, If, Icon } from 'components'; import { useAccountTransactionsContext } from './AccountTransactionsProvider'; import { TRANSACRIONS_TYPE } from 'common/cashflowOptions'; +import { + AbilitySubject, + Cashflow_Abilities, +} from '../../../common/abilityOption'; import { safeCallback } from 'utils'; export function ActionsMenu({ @@ -20,15 +24,17 @@ export function ActionsMenu({ text={intl.get('view_details')} onClick={safeCallback(onViewDetails, original)} /> - - - } - /> - + + + + } + /> + + ); } @@ -83,7 +89,7 @@ export function useAccountTransactionsColumns() { className: 'deposit', textOverview: true, align: 'right', - clickable: true + clickable: true, }, { id: 'withdrawal', @@ -93,7 +99,7 @@ export function useAccountTransactionsColumns() { width: 150, textOverview: true, align: 'right', - clickable: true + clickable: true, }, { id: 'running_balance', @@ -103,7 +109,7 @@ export function useAccountTransactionsColumns() { width: 150, textOverview: true, align: 'right', - clickable: true + clickable: true, }, { id: 'balance', diff --git a/src/containers/CashFlow/CashFlowAccounts/CashFlowAccountsActionsBar.js b/src/containers/CashFlow/CashFlowAccounts/CashFlowAccountsActionsBar.js index cb9e86b84..68420cfb4 100644 --- a/src/containers/CashFlow/CashFlowAccounts/CashFlowAccountsActionsBar.js +++ b/src/containers/CashFlow/CashFlowAccounts/CashFlowAccountsActionsBar.js @@ -7,8 +7,12 @@ import { Alignment, Switch, } from '@blueprintjs/core'; -import { Icon, FormattedMessage as T } from 'components'; +import { Can, Icon, FormattedMessage as T } from 'components'; import { useRefreshCashflowAccounts } from 'hooks/query'; +import { + Cashflow_Abilities, + AbilitySubject, +} from '../../../common/abilityOption'; import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar'; @@ -56,19 +60,22 @@ function CashFlowAccountsActionsBar({ return ( -