mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 14:20:31 +00:00
fix: Abilities keys.
This commit is contained in:
@@ -30,10 +30,7 @@ import withCustomersActions from './withCustomersActions';
|
||||
import withAlertActions from 'containers/Alert/withAlertActions';
|
||||
import withSettingsActions from '../../Settings/withSettingsActions';
|
||||
import withSettings from '../../Settings/withSettings';
|
||||
import {
|
||||
Customer_Abilities,
|
||||
AbilitySubject,
|
||||
} from '../../../common/abilityOption';
|
||||
import { CustomerAction, AbilitySubject } from '../../../common/abilityOption';
|
||||
|
||||
import { compose } from 'utils';
|
||||
|
||||
@@ -108,7 +105,7 @@ function CustomerActionsBar({
|
||||
onChange={handleTabChange}
|
||||
/>
|
||||
<NavbarDivider />
|
||||
<Can I={Customer_Abilities.Create} a={AbilitySubject.Item}>
|
||||
<Can I={CustomerAction.Create} a={AbilitySubject.Item}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon={'plus'} />}
|
||||
@@ -157,7 +154,7 @@ function CustomerActionsBar({
|
||||
onChange={handleTableRowSizeChange}
|
||||
/>
|
||||
<NavbarDivider />
|
||||
<Can I={Customer_Abilities.Edit} a={AbilitySubject.Customer}>
|
||||
<Can I={CustomerAction.Edit} a={AbilitySubject.Customer}>
|
||||
<Switch
|
||||
labelElement={<T id={'inactive'} />}
|
||||
defaultChecked={accountsInactiveMode}
|
||||
|
||||
@@ -3,10 +3,7 @@ import { Button, Intent } from '@blueprintjs/core';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { EmptyStatus } from 'components';
|
||||
import { Can, FormattedMessage as T } from 'components';
|
||||
import {
|
||||
AbilitySubject,
|
||||
Customer_Abilities,
|
||||
} from '../../../common/abilityOption';
|
||||
import { AbilitySubject, CustomerAction } from '../../../common/abilityOption';
|
||||
|
||||
export default function CustomersEmptyStatus() {
|
||||
const history = useHistory();
|
||||
@@ -21,7 +18,7 @@ export default function CustomersEmptyStatus() {
|
||||
}
|
||||
action={
|
||||
<>
|
||||
<Can I={Customer_Abilities.Create} a={AbilitySubject.Customer}>
|
||||
<Can I={CustomerAction.Create} a={AbilitySubject.Customer}>
|
||||
<Button
|
||||
intent={Intent.PRIMARY}
|
||||
large={true}
|
||||
|
||||
@@ -5,10 +5,7 @@ import clsx from 'classnames';
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
import { Can, Icon, Money, If, AvaterCell } from 'components';
|
||||
import {
|
||||
Customer_Abilities,
|
||||
AbilitySubject,
|
||||
} from '../../../common/abilityOption';
|
||||
import { CustomerAction, AbilitySubject } from '../../../common/abilityOption';
|
||||
|
||||
import { safeCallback } from 'utils';
|
||||
|
||||
@@ -33,7 +30,7 @@ export function ActionsMenu({
|
||||
text={intl.get('view_details')}
|
||||
onClick={safeCallback(onViewDetails, original)}
|
||||
/>
|
||||
<Can I={Customer_Abilities.Edit} a={AbilitySubject.Customer}>
|
||||
<Can I={CustomerAction.Edit} a={AbilitySubject.Customer}>
|
||||
<MenuDivider />
|
||||
|
||||
<MenuItem
|
||||
@@ -42,14 +39,14 @@ export function ActionsMenu({
|
||||
onClick={safeCallback(onEdit, original)}
|
||||
/>
|
||||
</Can>
|
||||
<Can I={Customer_Abilities.Create} a={AbilitySubject.Customer}>
|
||||
<Can I={CustomerAction.Create} a={AbilitySubject.Customer}>
|
||||
<MenuItem
|
||||
icon={<Icon icon="duplicate-16" />}
|
||||
text={intl.get('duplicate')}
|
||||
onClick={safeCallback(onDuplicate, original)}
|
||||
/>
|
||||
</Can>
|
||||
<Can I={Customer_Abilities.Edit} a={AbilitySubject.Customer}>
|
||||
<Can I={CustomerAction.Edit} a={AbilitySubject.Customer}>
|
||||
<If condition={original.active}>
|
||||
<MenuItem
|
||||
text={intl.get('inactivate_customer')}
|
||||
@@ -65,7 +62,7 @@ export function ActionsMenu({
|
||||
/>
|
||||
</If>
|
||||
</Can>
|
||||
<Can I={Customer_Abilities.Delete} a={AbilitySubject.Customer}>
|
||||
<Can I={CustomerAction.Delete} a={AbilitySubject.Customer}>
|
||||
<MenuItem
|
||||
icon={<Icon icon="trash-16" iconSize={16} />}
|
||||
text={intl.get('delete_customer')}
|
||||
|
||||
Reference in New Issue
Block a user