mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
fix: Abilities keys.
This commit is contained in:
@@ -14,10 +14,7 @@ import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||
import withAlertsActions from 'containers/Alert/withAlertActions';
|
||||
|
||||
import { safeCallback } from 'utils';
|
||||
import {
|
||||
Account_Abilities,
|
||||
AbilitySubject,
|
||||
} from '../../../common/abilityOption';
|
||||
import { AccountAction, AbilitySubject } from '../../../common/abilityOption';
|
||||
|
||||
import { compose } from 'utils';
|
||||
import { useAccountDrawerContext } from './AccountDrawerProvider';
|
||||
@@ -57,7 +54,7 @@ function AccountDrawerActionBar({
|
||||
return (
|
||||
<DashboardActionsBar>
|
||||
<NavbarGroup>
|
||||
<Can I={Account_Abilities.Edit} a={AbilitySubject.Account}>
|
||||
<Can I={AccountAction.Edit} a={AbilitySubject.Account}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon="pen-18" />}
|
||||
@@ -73,7 +70,7 @@ function AccountDrawerActionBar({
|
||||
/>
|
||||
<NavbarDivider />
|
||||
</Can>
|
||||
<Can I={Account_Abilities.Delete} a={AbilitySubject.Account}>
|
||||
<Can I={AccountAction.Delete} a={AbilitySubject.Account}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon={'trash-16'} iconSize={16} />}
|
||||
|
||||
@@ -18,8 +18,8 @@ import withDrawerActions from 'containers/Drawer/withDrawerActions';
|
||||
|
||||
import { Can, If, Icon, FormattedMessage as T } from 'components';
|
||||
import {
|
||||
Bill_Abilities,
|
||||
Payment_Made_Abilities,
|
||||
BillAction,
|
||||
PaymentMadeAction,
|
||||
AbilitySubject,
|
||||
} from '../../../common/abilityOption';
|
||||
|
||||
@@ -58,7 +58,7 @@ function BillDetailActionsBar({
|
||||
return (
|
||||
<DashboardActionsBar>
|
||||
<NavbarGroup>
|
||||
<Can I={Bill_Abilities.Edit} a={AbilitySubject.Bill}>
|
||||
<Can I={BillAction.Edit} a={AbilitySubject.Bill}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon="pen-18" />}
|
||||
@@ -67,10 +67,7 @@ function BillDetailActionsBar({
|
||||
/>
|
||||
<NavbarDivider />
|
||||
</Can>
|
||||
<Can
|
||||
I={Payment_Made_Abilities.Create}
|
||||
a={AbilitySubject.PaymentMade}
|
||||
>
|
||||
<Can I={PaymentMadeAction.Create} a={AbilitySubject.PaymentMade}>
|
||||
<If condition={bill.is_open && !bill.is_fully_paid}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
@@ -81,7 +78,7 @@ function BillDetailActionsBar({
|
||||
</If>
|
||||
<NavbarDivider />
|
||||
</Can>
|
||||
<Can I={Bill_Abilities.Delete} a={AbilitySubject.Bill}>
|
||||
<Can I={BillAction.Delete} a={AbilitySubject.Bill}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon={'trash-16'} iconSize={16} />}
|
||||
|
||||
@@ -6,10 +6,7 @@ import { Can, FormattedMessage as T } from 'components';
|
||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
||||
import { useCashflowTransactionDrawerContext } from './CashflowTransactionDrawerProvider';
|
||||
import withAlertsActions from 'containers/Alert/withAlertActions';
|
||||
import {
|
||||
AbilitySubject,
|
||||
Cashflow_Abilities,
|
||||
} from '../../../common/abilityOption';
|
||||
import { AbilitySubject, CashflowAction } from '../../../common/abilityOption';
|
||||
import { compose } from 'utils';
|
||||
|
||||
/**
|
||||
@@ -27,7 +24,7 @@ function CashflowTransactionDrawerActionBar({
|
||||
};
|
||||
|
||||
return (
|
||||
<Can I={Cashflow_Abilities.Delete} a={AbilitySubject.Cashflow}>
|
||||
<Can I={CashflowAction.Delete} a={AbilitySubject.Cashflow}>
|
||||
<DashboardActionsBar>
|
||||
<NavbarGroup>
|
||||
<Button
|
||||
|
||||
@@ -24,11 +24,11 @@ import withDrawerActions from 'containers/Drawer/withDrawerActions';
|
||||
import { Can, Icon, FormattedMessage as T } from 'components';
|
||||
import {
|
||||
AbilitySubject,
|
||||
Invoice_Abilities,
|
||||
Estimate_Abilities,
|
||||
Receipt_Abilities,
|
||||
Payment_Receive_Abilities,
|
||||
Customer_Abilities,
|
||||
SaleInvoiceAction,
|
||||
SaleEstimateAction,
|
||||
SaleReceiptAction,
|
||||
PaymentReceiveAction,
|
||||
CustomerAction,
|
||||
} from '../../../common/abilityOption';
|
||||
import { compose } from 'utils';
|
||||
|
||||
@@ -81,19 +81,19 @@ function CustomerDetailsActionsBar({
|
||||
<Popover
|
||||
content={
|
||||
<Menu>
|
||||
<Can I={Invoice_Abilities.Create} a={AbilitySubject.Invoice}>
|
||||
<Can I={SaleInvoiceAction.Create} a={AbilitySubject.Invoice}>
|
||||
<MenuItem
|
||||
text={<T id={'customer.drawer.action.new_invoice'} />}
|
||||
onClick={handleNewInvoiceClick}
|
||||
/>
|
||||
</Can>
|
||||
<Can I={Estimate_Abilities.Create} a={AbilitySubject.Estimate}>
|
||||
<Can I={SaleEstimateAction.Create} a={AbilitySubject.Estimate}>
|
||||
<MenuItem
|
||||
text={<T id={'customer.drawer.action.new_estimate'} />}
|
||||
onClick={handleNewEstimateClick}
|
||||
/>
|
||||
</Can>
|
||||
<Can I={Receipt_Abilities.Create} a={AbilitySubject.Receipt}>
|
||||
<Can I={SaleReceiptAction.Create} a={AbilitySubject.Receipt}>
|
||||
<MenuItem
|
||||
text={<T id={'customer.drawer.action.new_receipt'} />}
|
||||
onClick={handleNewReceiptClick}
|
||||
@@ -101,7 +101,7 @@ function CustomerDetailsActionsBar({
|
||||
</Can>
|
||||
|
||||
<Can
|
||||
I={Payment_Receive_Abilities.Create}
|
||||
I={PaymentReceiveAction.Create}
|
||||
a={AbilitySubject.PaymentReceive}
|
||||
>
|
||||
<MenuItem
|
||||
@@ -123,7 +123,7 @@ function CustomerDetailsActionsBar({
|
||||
</Popover>
|
||||
|
||||
<NavbarDivider />
|
||||
<Can I={Customer_Abilities.Edit} a={AbilitySubject.Customer}>
|
||||
<Can I={CustomerAction.Edit} a={AbilitySubject.Customer}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon="pen-18" />}
|
||||
@@ -132,7 +132,7 @@ function CustomerDetailsActionsBar({
|
||||
/>
|
||||
<NavbarDivider />
|
||||
</Can>
|
||||
<Can I={Customer_Abilities.Delete} a={AbilitySubject.Customer}>
|
||||
<Can I={CustomerAction.Delete} a={AbilitySubject.Customer}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon={'trash-16'} iconSize={16} />}
|
||||
|
||||
@@ -15,7 +15,7 @@ import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||
import withAlertsActions from 'containers/Alert/withAlertActions';
|
||||
import withDrawerActions from 'containers/Drawer/withDrawerActions';
|
||||
import {
|
||||
Estimate_Abilities,
|
||||
SaleEstimateAction,
|
||||
AbilitySubject,
|
||||
} from '../../../common/abilityOption';
|
||||
|
||||
@@ -63,7 +63,7 @@ function EstimateDetailActionsBar({
|
||||
return (
|
||||
<DashboardActionsBar>
|
||||
<NavbarGroup>
|
||||
<Can I={Estimate_Abilities.Edit} a={AbilitySubject.Estimate}>
|
||||
<Can I={SaleEstimateAction.Edit} a={AbilitySubject.Estimate}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon="pen-18" />}
|
||||
@@ -72,7 +72,7 @@ function EstimateDetailActionsBar({
|
||||
/>
|
||||
<NavbarDivider />
|
||||
</Can>
|
||||
<Can I={Estimate_Abilities.View} a={AbilitySubject.Estimate}>
|
||||
<Can I={SaleEstimateAction.View} a={AbilitySubject.Estimate}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon="print-16" />}
|
||||
@@ -80,7 +80,7 @@ function EstimateDetailActionsBar({
|
||||
onClick={handlePrintEstimate}
|
||||
/>
|
||||
</Can>
|
||||
<Can I={Estimate_Abilities.Delete} a={AbilitySubject.Estimate}>
|
||||
<Can I={SaleEstimateAction.Delete} a={AbilitySubject.Estimate}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon={'trash-16'} iconSize={16} />}
|
||||
|
||||
@@ -9,10 +9,7 @@ import {
|
||||
NavbarDivider,
|
||||
} from '@blueprintjs/core';
|
||||
import { Can, FormattedMessage as T } from 'components';
|
||||
import {
|
||||
Expense_Abilities,
|
||||
AbilitySubject,
|
||||
} from '../../../common/abilityOption';
|
||||
import { ExpenseAction, AbilitySubject } from '../../../common/abilityOption';
|
||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
||||
import withAlertsActions from 'containers/Alert/withAlertActions';
|
||||
import withDrawerActions from 'containers/Drawer/withDrawerActions';
|
||||
@@ -47,7 +44,7 @@ function ExpenseDrawerActionBar({
|
||||
return (
|
||||
<DashboardActionsBar>
|
||||
<NavbarGroup>
|
||||
<Can I={Expense_Abilities.Edit} a={AbilitySubject.Expense}>
|
||||
<Can I={ExpenseAction.Edit} a={AbilitySubject.Expense}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon="pen-18" />}
|
||||
@@ -56,7 +53,7 @@ function ExpenseDrawerActionBar({
|
||||
/>
|
||||
<NavbarDivider />
|
||||
</Can>
|
||||
<Can I={Expense_Abilities.Delete} a={AbilitySubject.Expense}>
|
||||
<Can I={ExpenseAction.Delete} a={AbilitySubject.Expense}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon="trash-16" iconSize={16} />}
|
||||
|
||||
@@ -9,7 +9,7 @@ import withAlertsActions from 'containers/Alert/withAlertActions';
|
||||
|
||||
import { Icon, FormattedMessage as T, Can } from 'components';
|
||||
import {
|
||||
Inventory_Adjustment_Abilities,
|
||||
InventoryAdjustmentAction,
|
||||
AbilitySubject,
|
||||
} from '../../../common/abilityOption';
|
||||
|
||||
@@ -31,8 +31,8 @@ function InventoryAdjustmentDetailActionsBar({
|
||||
|
||||
return (
|
||||
<Can
|
||||
I={Inventory_Adjustment_Abilities.Delete}
|
||||
a={AbilitySubject.Inventory_Adjustment}
|
||||
I={InventoryAdjustmentAction.Delete}
|
||||
a={AbilitySubject.InventoryAdjustment}
|
||||
>
|
||||
<DashboardActionsBar>
|
||||
<NavbarGroup>
|
||||
|
||||
@@ -18,8 +18,8 @@ import withDrawerActions from 'containers/Drawer/withDrawerActions';
|
||||
|
||||
import { If, Can, Icon, FormattedMessage as T } from 'components';
|
||||
import {
|
||||
Invoice_Abilities,
|
||||
Payment_Receive_Abilities,
|
||||
SaleInvoiceAction,
|
||||
PaymentReceiveAction,
|
||||
AbilitySubject,
|
||||
} from '../../../common/abilityOption';
|
||||
|
||||
@@ -83,7 +83,7 @@ function InvoiceDetailActionsBar({
|
||||
return (
|
||||
<DashboardActionsBar>
|
||||
<NavbarGroup>
|
||||
<Can I={Invoice_Abilities.Edit} a={AbilitySubject.Invoice}>
|
||||
<Can I={SaleInvoiceAction.Edit} a={AbilitySubject.Invoice}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon="pen-18" />}
|
||||
@@ -93,7 +93,7 @@ function InvoiceDetailActionsBar({
|
||||
|
||||
<NavbarDivider />
|
||||
</Can>
|
||||
<Can I={Payment_Receive_Abilities.Create} a={AbilitySubject.PaymentReceive}>
|
||||
<Can I={PaymentReceiveAction.Create} a={AbilitySubject.PaymentReceive}>
|
||||
<If condition={invoice.is_delivered && !invoice.is_fully_paid}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
@@ -104,7 +104,7 @@ function InvoiceDetailActionsBar({
|
||||
</If>
|
||||
<NavbarDivider />
|
||||
</Can>
|
||||
<Can I={Invoice_Abilities.View} a={AbilitySubject.Invoice}>
|
||||
<Can I={SaleInvoiceAction.View} a={AbilitySubject.Invoice}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon="print-16" />}
|
||||
@@ -112,7 +112,7 @@ function InvoiceDetailActionsBar({
|
||||
onClick={handlePrintInvoice}
|
||||
/>
|
||||
</Can>
|
||||
<Can I={Invoice_Abilities.Delete} a={AbilitySubject.Invoice}>
|
||||
<Can I={SaleInvoiceAction.Delete} a={AbilitySubject.Invoice}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon={'trash-16'} iconSize={16} />}
|
||||
@@ -122,7 +122,7 @@ function InvoiceDetailActionsBar({
|
||||
/>
|
||||
<NavbarDivider />
|
||||
</Can>
|
||||
<Can I={Invoice_Abilities.BadDebt} a={AbilitySubject.Invoice}>
|
||||
<Can I={SaleInvoiceAction.Writeoff} a={AbilitySubject.Invoice}>
|
||||
<BadDebtMenuItem
|
||||
payload={{
|
||||
onBadDebt: handleBadDebtInvoice,
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
||||
|
||||
import { useItemDetailDrawerContext } from './ItemDetailDrawerProvider';
|
||||
import { Item_Abilities, AbilitySubject } from '../../../common/abilityOption';
|
||||
import { ItemAction, AbilitySubject } from '../../../common/abilityOption';
|
||||
|
||||
import withAlertsActions from 'containers/Alert/withAlertActions';
|
||||
import withDrawerActions from 'containers/Drawer/withDrawerActions';
|
||||
@@ -48,7 +48,7 @@ function ItemDetailActionsBar({
|
||||
return (
|
||||
<DashboardActionsBar>
|
||||
<NavbarGroup>
|
||||
<Can I={Item_Abilities.Edit} a={AbilitySubject.Item}>
|
||||
<Can I={ItemAction.Edit} a={AbilitySubject.Item}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon="pen-18" />}
|
||||
@@ -58,7 +58,7 @@ function ItemDetailActionsBar({
|
||||
|
||||
<NavbarDivider />
|
||||
</Can>
|
||||
<Can I={Item_Abilities.Delete} a={AbilitySubject.Item}>
|
||||
<Can I={ItemAction.Delete} a={AbilitySubject.Item}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon={'trash-16'} iconSize={16} />}
|
||||
|
||||
@@ -16,7 +16,7 @@ import withDrawerActions from 'containers/Drawer/withDrawerActions';
|
||||
|
||||
import { useManualJournalDrawerContext } from './ManualJournalDrawerProvider';
|
||||
import {
|
||||
Manual_Journal_Abilities,
|
||||
ManualJournalAction,
|
||||
AbilitySubject,
|
||||
} from '../../../common/abilityOption';
|
||||
|
||||
@@ -49,7 +49,7 @@ function ManualJournalDrawerActionBar({
|
||||
return (
|
||||
<DashboardActionsBar>
|
||||
<NavbarGroup>
|
||||
<Can I={Manual_Journal_Abilities.Edit} a={AbilitySubject.ManualJournal}>
|
||||
<Can I={ManualJournalAction.Edit} a={AbilitySubject.ManualJournal}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon="pen-18" />}
|
||||
@@ -58,10 +58,7 @@ function ManualJournalDrawerActionBar({
|
||||
/>
|
||||
<NavbarDivider />
|
||||
</Can>
|
||||
<Can
|
||||
I={Manual_Journal_Abilities.Delete}
|
||||
a={AbilitySubject.ManualJournal}
|
||||
>
|
||||
<Can I={ManualJournalAction.Delete} a={AbilitySubject.ManualJournal}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon="trash-16" iconSize={16} />}
|
||||
|
||||
@@ -18,7 +18,7 @@ import withDrawerActions from 'containers/Drawer/withDrawerActions';
|
||||
|
||||
import { Can, Icon, FormattedMessage as T } from 'components';
|
||||
import {
|
||||
Payment_Made_Abilities,
|
||||
PaymentMadeAction,
|
||||
AbilitySubject,
|
||||
} from '../../../common/abilityOption';
|
||||
import { compose } from 'utils';
|
||||
@@ -51,7 +51,7 @@ function PaymentMadeDetailActionsBar({
|
||||
return (
|
||||
<DashboardActionsBar>
|
||||
<NavbarGroup>
|
||||
<Can I={Payment_Made_Abilities.Edit} a={AbilitySubject.PaymentMade}>
|
||||
<Can I={PaymentMadeAction.Edit} a={AbilitySubject.PaymentMade}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon="pen-18" />}
|
||||
@@ -60,7 +60,7 @@ function PaymentMadeDetailActionsBar({
|
||||
/>
|
||||
<NavbarDivider />
|
||||
</Can>
|
||||
<Can I={Payment_Made_Abilities.Delete} a={AbilitySubject.PaymentMade}>
|
||||
<Can I={PaymentMadeAction.Delete} a={AbilitySubject.PaymentMade}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon={'trash-16'} iconSize={16} />}
|
||||
|
||||
@@ -17,7 +17,10 @@ import withAlertsActions from 'containers/Alert/withAlertActions';
|
||||
import withDrawerActions from 'containers/Drawer/withDrawerActions';
|
||||
|
||||
import { Can, Icon, FormattedMessage as T, MoreMenuItems } from 'components';
|
||||
import { Payment_Receive_Abilities, AbilitySubject } from '../../../common/abilityOption';
|
||||
import {
|
||||
PaymentReceiveAction,
|
||||
AbilitySubject,
|
||||
} from '../../../common/abilityOption';
|
||||
|
||||
import { compose } from 'utils';
|
||||
|
||||
@@ -58,7 +61,7 @@ function PaymentReceiveActionsBar({
|
||||
return (
|
||||
<DashboardActionsBar>
|
||||
<NavbarGroup>
|
||||
<Can I={Payment_Receive_Abilities.Edit} a={AbilitySubject.PaymentReceive}>
|
||||
<Can I={PaymentReceiveAction.Edit} a={AbilitySubject.PaymentReceive}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon="pen-18" />}
|
||||
@@ -67,7 +70,7 @@ function PaymentReceiveActionsBar({
|
||||
/>
|
||||
<NavbarDivider />
|
||||
</Can>
|
||||
<Can I={Payment_Receive_Abilities.Delete} a={AbilitySubject.PaymentReceive}>
|
||||
<Can I={PaymentReceiveAction.Delete} a={AbilitySubject.PaymentReceive}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon={'trash-16'} iconSize={16} />}
|
||||
|
||||
@@ -17,7 +17,7 @@ import withDrawerActions from 'containers/Drawer/withDrawerActions';
|
||||
import { Can, Icon, FormattedMessage as T, MoreMenuItems } from 'components';
|
||||
import { useReceiptDetailDrawerContext } from './ReceiptDetailDrawerProvider';
|
||||
import {
|
||||
Receipt_Abilities,
|
||||
SaleReceiptAction,
|
||||
AbilitySubject,
|
||||
} from '../../../common/abilityOption';
|
||||
|
||||
@@ -58,7 +58,7 @@ function ReceiptDetailActionBar({
|
||||
return (
|
||||
<DashboardActionsBar>
|
||||
<NavbarGroup>
|
||||
<Can I={Receipt_Abilities.Edit} a={AbilitySubject.Receipt}>
|
||||
<Can I={SaleReceiptAction.Edit} a={AbilitySubject.Receipt}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon="pen-18" />}
|
||||
@@ -67,7 +67,7 @@ function ReceiptDetailActionBar({
|
||||
/>
|
||||
<NavbarDivider />
|
||||
</Can>
|
||||
<Can I={Receipt_Abilities.View} a={AbilitySubject.Receipt}>
|
||||
<Can I={SaleReceiptAction.View} a={AbilitySubject.Receipt}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon="print-16" />}
|
||||
@@ -75,7 +75,7 @@ function ReceiptDetailActionBar({
|
||||
onClick={safeCallback(onPrintReceipt)}
|
||||
/>
|
||||
</Can>
|
||||
<Can I={Receipt_Abilities.Delete} a={AbilitySubject.Receipt}>
|
||||
<Can I={SaleReceiptAction.Delete} a={AbilitySubject.Receipt}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon={'trash-16'} iconSize={16} />}
|
||||
|
||||
@@ -23,9 +23,9 @@ import withDrawerActions from 'containers/Drawer/withDrawerActions';
|
||||
import { Can, Icon, FormattedMessage as T } from 'components';
|
||||
import {
|
||||
AbilitySubject,
|
||||
Invoice_Abilities,
|
||||
Payment_Made_Abilities,
|
||||
Vendor_Abilities,
|
||||
SaleInvoiceAction,
|
||||
PaymentMadeAction,
|
||||
VendorAction,
|
||||
} from '../../../common/abilityOption';
|
||||
import { safeCallback, compose } from 'utils';
|
||||
|
||||
@@ -69,16 +69,13 @@ function VendorDetailsActionsBar({
|
||||
<Popover
|
||||
content={
|
||||
<Menu>
|
||||
<Can I={Invoice_Abilities.Create} a={AbilitySubject.Invoice}>
|
||||
<Can I={SaleInvoiceAction.Create} a={AbilitySubject.Invoice}>
|
||||
<MenuItem
|
||||
text={<T id={'vendor.drawer.action.new_invoice'} />}
|
||||
onClick={handleNewInvoiceClick}
|
||||
/>
|
||||
</Can>
|
||||
<Can
|
||||
I={Payment_Made_Abilities.Create}
|
||||
a={AbilitySubject.PaymentMade}
|
||||
>
|
||||
<Can I={PaymentMadeAction.Create} a={AbilitySubject.PaymentMade}>
|
||||
<MenuItem
|
||||
text={<T id={'vendor.drawer.action.new_payment'} />}
|
||||
onClick={handleNewPaymentClick}
|
||||
@@ -97,7 +94,7 @@ function VendorDetailsActionsBar({
|
||||
/>
|
||||
</Popover>
|
||||
<NavbarDivider />
|
||||
<Can I={Vendor_Abilities.Edit} a={AbilitySubject.Vendor}>
|
||||
<Can I={VendorAction.Edit} a={AbilitySubject.Vendor}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon="pen-18" />}
|
||||
@@ -106,7 +103,7 @@ function VendorDetailsActionsBar({
|
||||
/>
|
||||
<NavbarDivider />
|
||||
</Can>
|
||||
<Can I={Vendor_Abilities.Delete} a={AbilitySubject.Vendor}>
|
||||
<Can I={VendorAction.Delete} a={AbilitySubject.Vendor}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon={'trash-16'} iconSize={16} />}
|
||||
|
||||
Reference in New Issue
Block a user