feat: financial report numbers format dropdown.

This commit is contained in:
a.bouhuolia
2021-01-18 20:08:08 +02:00
parent 10ab8f4711
commit 1fb523b5ff
36 changed files with 550 additions and 373 deletions

View File

@@ -13,19 +13,25 @@ import classNames from 'classnames';
import Icon from 'components/Icon';
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
import NumberFormatDropdown from 'components/NumberFormatDropdown';
import withProfitLossActions from './withProfitLossActions';
import withProfitLoss from './withProfitLoss';
import { compose } from 'utils';
import { compose, saveInvoke } from 'utils';
function ProfitLossActionsBar({
// #withProfitLoss
profitLossSheetFilter,
profitLossSheetLoading,
// #withProfitLossActions
toggleProfitLossSheetFilter,
refreshProfitLossSheet,
// #ownProps
numberFormat,
onNumberFormatSubmit,
}) {
const handleFilterClick = () => {
toggleProfitLossSheetFilter();
@@ -34,6 +40,10 @@ function ProfitLossActionsBar({
const handleRecalcReport = () => {
refreshProfitLossSheet(true);
};
// Handle number format submit.
const handleNumberFormatSubmit = (values) => {
saveInvoke(onNumberFormatSubmit, values);
};
return (
<DashboardActionsBar>
@@ -61,6 +71,25 @@ function ProfitLossActionsBar({
/>
<NavbarDivider />
<Popover
content={
<NumberFormatDropdown
numberFormat={numberFormat}
onSubmit={handleNumberFormatSubmit}
submitDisabled={profitLossSheetLoading}
/>
}
minimal={true}
interactionKind={PopoverInteractionKind.CLICK}
position={Position.BOTTOM_LEFT}
>
<Button
className={classNames(Classes.MINIMAL, 'button--filter')}
text={<T id={'format'} />}
icon={<Icon icon="numbers" width={23} height={16} />}
/>
</Popover>
<Popover
// content={}
interactionKind={PopoverInteractionKind.CLICK}