mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
fix(FinancialStatements): Hide filtering by branches/warehouses if the feature is not enabled.
This commit is contained in:
@@ -7,6 +7,8 @@ import {
|
||||
CashFlowStatementDimensionsPanelProvider,
|
||||
useCashFlowStatementDimensionsPanelContext,
|
||||
} from './CashFlowStatementDimensionsPanelProvider';
|
||||
import { useFeatureCan } from '@/hooks/state';
|
||||
import { Features } from '@/constants';
|
||||
|
||||
/**
|
||||
* Cash flow statement dismension panel.
|
||||
@@ -28,15 +30,21 @@ function CashFlowStatementDimensionsPanelContent() {
|
||||
// Fetches the branches list.
|
||||
const { branches } = useCashFlowStatementDimensionsPanelContext();
|
||||
|
||||
const { featureCan } = useFeatureCan();
|
||||
|
||||
const isBranchesFeatureCan = featureCan(Features.Branches);
|
||||
|
||||
return (
|
||||
<Row>
|
||||
<Col xs={4}>
|
||||
<FormGroup
|
||||
label={intl.get('branches_multi_select.label')}
|
||||
className={Classes.FILL}
|
||||
>
|
||||
<BranchMultiSelect name={'branchesIds'} branches={branches} />
|
||||
</FormGroup>
|
||||
{isBranchesFeatureCan && (
|
||||
<FormGroup
|
||||
label={intl.get('branches_multi_select.label')}
|
||||
className={Classes.FILL}
|
||||
>
|
||||
<BranchMultiSelect name={'branchesIds'} branches={branches} />
|
||||
</FormGroup>
|
||||
)}
|
||||
</Col>
|
||||
</Row>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user