fix(webapp): no default branch for customer/vendor opening balance branch

This commit is contained in:
Ahmed Bouhuolia
2023-06-28 18:07:47 +02:00
parent 7fbe51ddf2
commit 8d990ae85d
18 changed files with 100 additions and 293 deletions

View File

@@ -1,16 +1,15 @@
// @ts-nocheck
import React from 'react';
import intl from 'react-intl-universal';
import { Button, Alignment, NavbarGroup, Classes } from '@blueprintjs/core';
import { Alignment, NavbarGroup, Classes } from '@blueprintjs/core';
import { useSetPrimaryBranchToForm } from './utils';
import { useFeatureCan } from '@/hooks/state';
import { Features } from '@/constants';
import {
Icon,
BranchSelect,
FeatureCan,
FormTopbar,
DetailsBarSkeletonBase,
FormBranchSelectButton,
} from '@/components';
import { useExpenseFormContext } from './ExpenseFormPageProvider';
@@ -51,19 +50,9 @@ function ExpenseFormSelectBranch() {
<BranchSelect
name={'branch_id'}
branches={branches}
input={ExpenseBranchSelectButton}
input={FormBranchSelectButton}
popoverProps={{ minimal: true }}
/>
);
}
function ExpenseBranchSelectButton({ label }) {
return (
<Button
text={intl.get('expense.branch_button.label', { label })}
minimal={true}
small={true}
icon={<Icon icon={'branch-16'} iconSize={16} />}
fill={false}
/>
);
}