mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 23:00:34 +00:00
feat: remove SET_DASHBOARD_REQUEST_LOADING reducer.
feat: fix dropdown filter. feat: fix fetch resource data.
This commit is contained in:
@@ -35,6 +35,9 @@ function AccountsActionsBar({
|
||||
// #withAccountsActions
|
||||
addAccountsTableQueries,
|
||||
|
||||
// #withAccounts
|
||||
accountsTableQuery,
|
||||
|
||||
selectedRows = [],
|
||||
onFilterChanged,
|
||||
onBulkDelete,
|
||||
@@ -42,7 +45,9 @@ function AccountsActionsBar({
|
||||
onBulkActivate,
|
||||
onBulkInactive,
|
||||
}) {
|
||||
const [filterCount, setFilterCount] = useState(0);
|
||||
const [filterCount, setFilterCount] = useState(
|
||||
accountsTableQuery?.filter_roles?.length || 0,
|
||||
);
|
||||
|
||||
const onClickNewAccount = () => {
|
||||
openDialog('account-form', {});
|
||||
@@ -54,9 +59,10 @@ function AccountsActionsBar({
|
||||
|
||||
const filterDropdown = FilterDropdown({
|
||||
fields: resourceFields,
|
||||
initialConditions: accountsTableQuery.filter_roles,
|
||||
initialCondition: {
|
||||
fieldKey: 'name',
|
||||
compatator: 'contains',
|
||||
comparator: 'contains',
|
||||
value: '',
|
||||
},
|
||||
onFilterChange: (filterConditions) => {
|
||||
@@ -171,8 +177,9 @@ const withAccountsActionsBar = connect(mapStateToProps);
|
||||
export default compose(
|
||||
withAccountsActionsBar,
|
||||
withDialogActions,
|
||||
withAccounts(({ accountsViews }) => ({
|
||||
withAccounts(({ accountsViews, accountsTableQuery }) => ({
|
||||
accountsViews,
|
||||
accountsTableQuery,
|
||||
})),
|
||||
withResourceDetail(({ resourceFields }) => ({
|
||||
resourceFields,
|
||||
|
||||
@@ -51,11 +51,10 @@ function NormalCell({ cell }) {
|
||||
|
||||
function BalanceCell({ cell }) {
|
||||
const account = cell.row.original;
|
||||
const { balance = null } = account;
|
||||
|
||||
return balance ? (
|
||||
return (account.amount) ? (
|
||||
<span>
|
||||
<Money amount={balance.amount} currency={balance.currency_code} />
|
||||
<Money amount={account.amount} currency={'USD'} />
|
||||
</span>
|
||||
) : (
|
||||
<span class="placeholder">—</span>
|
||||
@@ -245,7 +244,7 @@ function AccountsDataTable({
|
||||
{
|
||||
id: 'balance',
|
||||
Header: formatMessage({ id: 'balance' }),
|
||||
accessor: 'balance',
|
||||
accessor: 'amount',
|
||||
Cell: BalanceCell,
|
||||
width: 150,
|
||||
},
|
||||
@@ -268,11 +267,7 @@ function AccountsDataTable({
|
||||
);
|
||||
|
||||
const selectionColumn = useMemo(
|
||||
() => ({
|
||||
minWidth: 40,
|
||||
width: 40,
|
||||
maxWidth: 40,
|
||||
}),
|
||||
() => ({ minWidth: 45, width: 45, maxWidth: 45 }),
|
||||
[],
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user