fix: multi-select branches error.

This commit is contained in:
a.bouhuolia
2022-02-16 16:56:35 +02:00
parent 953d37b20f
commit 3b642540f1
4 changed files with 8 additions and 19 deletions

View File

@@ -50,17 +50,11 @@ const branchItemRenderer = (
const branchSelectProps = {
itemPredicate: branchItemPredicate,
itemRenderer: branchItemRenderer,
valueAccessor: 'id',
labelAccessor: 'name',
tagRenderer: 'name',
valueAccessor: (item) => item.id,
labelAccessor: (item) => item.label,
tagRenderer: (item) => item.name,
};
export function BranchesMultiSelect({ branches, ...rest }) {
return (
<FMultiSelect
items={branches}
{...branchSelectProps}
{...rest}
/>
);
return <FMultiSelect items={branches} {...branchSelectProps} {...rest} />;
}

View File

@@ -41,7 +41,6 @@ function BalanceSheetHeader({
...pageFilter,
fromDate: moment(pageFilter.fromDate).toDate(),
toDate: moment(pageFilter.toDate).toDate(),
branches_id: [],
},
defaultValues,
);
@@ -89,7 +88,7 @@ function BalanceSheetHeader({
/>
<Tab
id="dimensions"
title={<T id={'dimensions'} />}
title={'dimensions'}
panel={<BalanceSheetHeaderDimensionsPanel />}
/>
</Tabs>

View File

@@ -14,10 +14,8 @@ function BalanceSheetHeaderDimensionsPanel() {
return (
<div>
<BranchesMultiSelect
name={'branches_id'}
name={'branchesIds'}
branches={branches}
input={BranchMulitSelectButton}
// onItemSelect={}
popoverProps={{ minimal: true }}
/>
</div>
@@ -25,7 +23,3 @@ function BalanceSheetHeaderDimensionsPanel() {
}
export default BalanceSheetHeaderDimensionsPanel;
function BranchMulitSelectButton() {
return <Button text={'Button'} minimal={true} />;
}

View File

@@ -29,6 +29,8 @@ export const getDefaultBalanceSheetQuery = () => ({
// Percentage columns.
percentageOfColumn: false,
percentageOfRow: false,
branchesIds: [],
});
/**