mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
BIG-5: add switching between compact and medium row size.
This commit is contained in:
@@ -12,6 +12,7 @@ import { useHistory } from 'react-router-dom';
|
|||||||
import {
|
import {
|
||||||
AdvancedFilterPopover,
|
AdvancedFilterPopover,
|
||||||
DashboardFilterButton,
|
DashboardFilterButton,
|
||||||
|
DashboardRowsHeightButton,
|
||||||
FormattedMessage as T,
|
FormattedMessage as T,
|
||||||
} from 'components';
|
} from 'components';
|
||||||
|
|
||||||
@@ -22,6 +23,8 @@ import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
|||||||
import withDialogActions from 'containers/Dialog/withDialogActions';
|
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||||
import withManualJournalsActions from './withManualJournalsActions';
|
import withManualJournalsActions from './withManualJournalsActions';
|
||||||
import withManualJournals from './withManualJournals';
|
import withManualJournals from './withManualJournals';
|
||||||
|
import withSettingsActions from '../../Settings/withSettingsActions';
|
||||||
|
import withSettings from '../../Settings/withSettings';
|
||||||
|
|
||||||
import { If, DashboardActionViewsList } from 'components';
|
import { If, DashboardActionViewsList } from 'components';
|
||||||
|
|
||||||
@@ -36,6 +39,12 @@ function ManualJournalActionsBar({
|
|||||||
|
|
||||||
// #withManualJournals
|
// #withManualJournals
|
||||||
manualJournalsFilterConditions,
|
manualJournalsFilterConditions,
|
||||||
|
|
||||||
|
// #withSettings
|
||||||
|
manualJournalsTableSize,
|
||||||
|
|
||||||
|
// #withSettingsActions
|
||||||
|
addSetting,
|
||||||
}) {
|
}) {
|
||||||
// History context.
|
// History context.
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
@@ -62,6 +71,11 @@ function ManualJournalActionsBar({
|
|||||||
refresh();
|
refresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Handle table row size change.
|
||||||
|
const handleTableRowSizeChange = (size) => {
|
||||||
|
addSetting('manual_journal', 'tableSize', size);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DashboardActionsBar>
|
<DashboardActionsBar>
|
||||||
<NavbarGroup>
|
<NavbarGroup>
|
||||||
@@ -119,6 +133,12 @@ function ManualJournalActionsBar({
|
|||||||
icon={<Icon icon="file-export-16" iconSize={16} />}
|
icon={<Icon icon="file-export-16" iconSize={16} />}
|
||||||
text={<T id={'export'} />}
|
text={<T id={'export'} />}
|
||||||
/>
|
/>
|
||||||
|
<NavbarDivider />
|
||||||
|
<DashboardRowsHeightButton
|
||||||
|
initialValue={manualJournalsTableSize}
|
||||||
|
onChange={handleTableRowSizeChange}
|
||||||
|
/>
|
||||||
|
<NavbarDivider />
|
||||||
</NavbarGroup>
|
</NavbarGroup>
|
||||||
<NavbarGroup align={Alignment.RIGHT}>
|
<NavbarGroup align={Alignment.RIGHT}>
|
||||||
<Button
|
<Button
|
||||||
@@ -134,7 +154,11 @@ function ManualJournalActionsBar({
|
|||||||
export default compose(
|
export default compose(
|
||||||
withDialogActions,
|
withDialogActions,
|
||||||
withManualJournalsActions,
|
withManualJournalsActions,
|
||||||
|
withSettingsActions,
|
||||||
withManualJournals(({ manualJournalsTableState }) => ({
|
withManualJournals(({ manualJournalsTableState }) => ({
|
||||||
manualJournalsFilterConditions: manualJournalsTableState.filterRoles,
|
manualJournalsFilterConditions: manualJournalsTableState.filterRoles,
|
||||||
})),
|
})),
|
||||||
|
withSettings(({ manualJournalsSettings }) => ({
|
||||||
|
manualJournalsTableSize: manualJournalsSettings?.tableSize,
|
||||||
|
})),
|
||||||
)(ManualJournalActionsBar);
|
)(ManualJournalActionsBar);
|
||||||
|
|||||||
@@ -8,16 +8,17 @@ import {
|
|||||||
Switch,
|
Switch,
|
||||||
Alignment,
|
Alignment,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
import { FormattedMessage as T } from 'components';
|
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
|
|
||||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
||||||
import {
|
import {
|
||||||
If,
|
If,
|
||||||
Icon,
|
Icon,
|
||||||
|
FormattedMessage as T,
|
||||||
DashboardActionViewsList,
|
DashboardActionViewsList,
|
||||||
AdvancedFilterPopover,
|
AdvancedFilterPopover,
|
||||||
DashboardFilterButton,
|
DashboardFilterButton,
|
||||||
|
DashboardRowsHeightButton,
|
||||||
} from 'components';
|
} from 'components';
|
||||||
|
|
||||||
import { useCustomersListContext } from './CustomersListProvider';
|
import { useCustomersListContext } from './CustomersListProvider';
|
||||||
@@ -26,6 +27,8 @@ import { useRefreshCustomers } from 'hooks/query/customers';
|
|||||||
import withCustomers from './withCustomers';
|
import withCustomers from './withCustomers';
|
||||||
import withCustomersActions from './withCustomersActions';
|
import withCustomersActions from './withCustomersActions';
|
||||||
import withAlertActions from 'containers/Alert/withAlertActions';
|
import withAlertActions from 'containers/Alert/withAlertActions';
|
||||||
|
import withSettingsActions from '../../Settings/withSettingsActions';
|
||||||
|
import withSettings from '../../Settings/withSettings';
|
||||||
|
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
|
|
||||||
@@ -43,6 +46,12 @@ function CustomerActionsBar({
|
|||||||
|
|
||||||
// #withAlertActions
|
// #withAlertActions
|
||||||
openAlert,
|
openAlert,
|
||||||
|
|
||||||
|
// #withSettings
|
||||||
|
customersTableSize,
|
||||||
|
|
||||||
|
// #withSettingsActions
|
||||||
|
addSetting,
|
||||||
}) {
|
}) {
|
||||||
// History context.
|
// History context.
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
@@ -74,7 +83,14 @@ function CustomerActionsBar({
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Handle click a refresh customers
|
// Handle click a refresh customers
|
||||||
const handleRefreshBtnClick = () => { refresh(); };
|
const handleRefreshBtnClick = () => {
|
||||||
|
refresh();
|
||||||
|
};
|
||||||
|
|
||||||
|
// Handle table row size change.
|
||||||
|
const handleTableRowSizeChange = (size) => {
|
||||||
|
addSetting('customer', 'tableSize', size);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DashboardActionsBar>
|
<DashboardActionsBar>
|
||||||
@@ -130,6 +146,12 @@ function CustomerActionsBar({
|
|||||||
icon={<Icon icon="file-export-16" iconSize={16} />}
|
icon={<Icon icon="file-export-16" iconSize={16} />}
|
||||||
text={<T id={'export'} />}
|
text={<T id={'export'} />}
|
||||||
/>
|
/>
|
||||||
|
<NavbarDivider />
|
||||||
|
<DashboardRowsHeightButton
|
||||||
|
initialValue={customersTableSize}
|
||||||
|
onChange={handleTableRowSizeChange}
|
||||||
|
/>
|
||||||
|
<NavbarDivider />
|
||||||
<Switch
|
<Switch
|
||||||
labelElement={<T id={'inactive'} />}
|
labelElement={<T id={'inactive'} />}
|
||||||
defaultChecked={accountsInactiveMode}
|
defaultChecked={accountsInactiveMode}
|
||||||
@@ -149,10 +171,14 @@ function CustomerActionsBar({
|
|||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
withCustomersActions,
|
withCustomersActions,
|
||||||
|
withSettingsActions,
|
||||||
withCustomers(({ customersSelectedRows, customersTableState }) => ({
|
withCustomers(({ customersSelectedRows, customersTableState }) => ({
|
||||||
customersSelectedRows,
|
customersSelectedRows,
|
||||||
accountsInactiveMode: customersTableState.inactiveMode,
|
accountsInactiveMode: customersTableState.inactiveMode,
|
||||||
customersFilterConditions: customersTableState.filterRoles,
|
customersFilterConditions: customersTableState.filterRoles,
|
||||||
})),
|
})),
|
||||||
|
// withSettings(({ }) => ({
|
||||||
|
// customersTableSize:
|
||||||
|
// })),
|
||||||
withAlertActions,
|
withAlertActions,
|
||||||
)(CustomerActionsBar);
|
)(CustomerActionsBar);
|
||||||
|
|||||||
@@ -9,16 +9,17 @@ import {
|
|||||||
Alignment,
|
Alignment,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
import { FormattedMessage as T } from 'components';
|
|
||||||
|
|
||||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
||||||
import withDialogActions from 'containers/Dialog/withDialogActions';
|
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
If,
|
If,
|
||||||
|
DashboardRowsHeightButton,
|
||||||
DashboardActionViewsList,
|
DashboardActionViewsList,
|
||||||
DashboardFilterButton,
|
DashboardFilterButton,
|
||||||
AdvancedFilterPopover,
|
AdvancedFilterPopover,
|
||||||
|
FormattedMessage as T,
|
||||||
} from 'components';
|
} from 'components';
|
||||||
|
|
||||||
import { useRefreshExpenses } from 'hooks/query/expenses';
|
import { useRefreshExpenses } from 'hooks/query/expenses';
|
||||||
@@ -27,6 +28,9 @@ import { useExpensesListContext } from './ExpensesListProvider';
|
|||||||
import withExpensesActions from './withExpensesActions';
|
import withExpensesActions from './withExpensesActions';
|
||||||
import withExpenses from './withExpenses';
|
import withExpenses from './withExpenses';
|
||||||
|
|
||||||
|
import withSettingsActions from '../../Settings/withSettingsActions';
|
||||||
|
import withSettings from '../../Settings/withSettings';
|
||||||
|
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,6 +42,12 @@ function ExpensesActionsBar({
|
|||||||
|
|
||||||
// #withExpenses
|
// #withExpenses
|
||||||
expensesFilterConditions,
|
expensesFilterConditions,
|
||||||
|
|
||||||
|
// #withSettings
|
||||||
|
expensesTableSize,
|
||||||
|
|
||||||
|
// #withSettingsActions
|
||||||
|
addSetting,
|
||||||
}) {
|
}) {
|
||||||
// History context.
|
// History context.
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
@@ -67,6 +77,11 @@ function ExpensesActionsBar({
|
|||||||
const handleRefreshBtnClick = () => {
|
const handleRefreshBtnClick = () => {
|
||||||
refresh();
|
refresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Handle table row size change.
|
||||||
|
const handleTableRowSizeChange = (size) => {
|
||||||
|
addSetting('expense', 'tableSize', size);
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<DashboardActionsBar>
|
<DashboardActionsBar>
|
||||||
<NavbarGroup>
|
<NavbarGroup>
|
||||||
@@ -124,6 +139,12 @@ function ExpensesActionsBar({
|
|||||||
icon={<Icon icon="file-export-16" iconSize={16} />}
|
icon={<Icon icon="file-export-16" iconSize={16} />}
|
||||||
text={<T id={'export'} />}
|
text={<T id={'export'} />}
|
||||||
/>
|
/>
|
||||||
|
<NavbarDivider />
|
||||||
|
<DashboardRowsHeightButton
|
||||||
|
initialValue={expensesTableSize}
|
||||||
|
onChange={handleTableRowSizeChange}
|
||||||
|
/>
|
||||||
|
<NavbarDivider />
|
||||||
</NavbarGroup>
|
</NavbarGroup>
|
||||||
<NavbarGroup align={Alignment.RIGHT}>
|
<NavbarGroup align={Alignment.RIGHT}>
|
||||||
<Button
|
<Button
|
||||||
@@ -139,7 +160,11 @@ function ExpensesActionsBar({
|
|||||||
export default compose(
|
export default compose(
|
||||||
withDialogActions,
|
withDialogActions,
|
||||||
withExpensesActions,
|
withExpensesActions,
|
||||||
|
withSettingsActions,
|
||||||
withExpenses(({ expensesTableState }) => ({
|
withExpenses(({ expensesTableState }) => ({
|
||||||
expensesFilterConditions: expensesTableState.filterRoles,
|
expensesFilterConditions: expensesTableState.filterRoles,
|
||||||
})),
|
})),
|
||||||
|
withSettings(({ expenseSettings }) => ({
|
||||||
|
expensesTableSize: expenseSettings?.tableSize,
|
||||||
|
})),
|
||||||
)(ExpensesActionsBar);
|
)(ExpensesActionsBar);
|
||||||
|
|||||||
@@ -10,18 +10,22 @@ import {
|
|||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
|
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
import { FormattedMessage as T } from 'components';
|
|
||||||
|
|
||||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
||||||
import {
|
import {
|
||||||
If,
|
If,
|
||||||
|
FormattedMessage as T,
|
||||||
DashboardActionViewsList,
|
DashboardActionViewsList,
|
||||||
DashboardFilterButton,
|
DashboardFilterButton,
|
||||||
AdvancedFilterPopover,
|
AdvancedFilterPopover,
|
||||||
|
DashboardRowsHeightButton,
|
||||||
} from 'components';
|
} from 'components';
|
||||||
|
|
||||||
import withBillsActions from './withBillsActions';
|
import withBillsActions from './withBillsActions';
|
||||||
import withBills from './withBills';
|
import withBills from './withBills';
|
||||||
|
import withSettingsActions from 'containers/Settings/withSettingsActions';
|
||||||
|
import withSettings from 'containers/Settings/withSettings';
|
||||||
|
|
||||||
import { useBillsListContext } from './BillsListProvider';
|
import { useBillsListContext } from './BillsListProvider';
|
||||||
import { useRefreshBills } from 'hooks/query/bills';
|
import { useRefreshBills } from 'hooks/query/bills';
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
@@ -35,6 +39,12 @@ function BillActionsBar({
|
|||||||
|
|
||||||
// #withBills
|
// #withBills
|
||||||
billsConditionsRoles,
|
billsConditionsRoles,
|
||||||
|
|
||||||
|
// #withSettings
|
||||||
|
billsTableSize,
|
||||||
|
|
||||||
|
// #withSettingsActions
|
||||||
|
addSetting,
|
||||||
}) {
|
}) {
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
|
||||||
@@ -60,6 +70,11 @@ function BillActionsBar({
|
|||||||
refresh();
|
refresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Handle table row size change.
|
||||||
|
const handleTableRowSizeChange = (size) => {
|
||||||
|
addSetting('bill', 'tableSize', size);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DashboardActionsBar>
|
<DashboardActionsBar>
|
||||||
<NavbarGroup>
|
<NavbarGroup>
|
||||||
@@ -116,6 +131,13 @@ function BillActionsBar({
|
|||||||
icon={<Icon icon={'file-export-16'} iconSize={'16'} />}
|
icon={<Icon icon={'file-export-16'} iconSize={'16'} />}
|
||||||
text={<T id={'export'} />}
|
text={<T id={'export'} />}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<NavbarDivider />
|
||||||
|
<DashboardRowsHeightButton
|
||||||
|
initialValue={billsTableSize}
|
||||||
|
onChange={handleTableRowSizeChange}
|
||||||
|
/>
|
||||||
|
<NavbarDivider />
|
||||||
</NavbarGroup>
|
</NavbarGroup>
|
||||||
<NavbarGroup align={Alignment.RIGHT}>
|
<NavbarGroup align={Alignment.RIGHT}>
|
||||||
<Button
|
<Button
|
||||||
@@ -130,7 +152,11 @@ function BillActionsBar({
|
|||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
withBillsActions,
|
withBillsActions,
|
||||||
|
withSettingsActions,
|
||||||
withBills(({ billsTableState }) => ({
|
withBills(({ billsTableState }) => ({
|
||||||
billsConditionsRoles: billsTableState.filterRoles,
|
billsConditionsRoles: billsTableState.filterRoles,
|
||||||
})),
|
})),
|
||||||
|
withSettings(({ billPaymentSettings }) => ({
|
||||||
|
billsTableSize: billPaymentSettings?.tableSize, // fix to bill
|
||||||
|
})),
|
||||||
)(BillActionsBar);
|
)(BillActionsBar);
|
||||||
|
|||||||
@@ -10,19 +10,23 @@ import {
|
|||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
|
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
import { FormattedMessage as T } from 'components';
|
|
||||||
|
|
||||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
||||||
import {
|
import {
|
||||||
If,
|
If,
|
||||||
|
FormattedMessage as T,
|
||||||
DashboardActionViewsList,
|
DashboardActionViewsList,
|
||||||
DashboardFilterButton,
|
DashboardFilterButton,
|
||||||
AdvancedFilterPopover,
|
AdvancedFilterPopover,
|
||||||
|
DashboardRowsHeightButton,
|
||||||
} from 'components';
|
} from 'components';
|
||||||
|
|
||||||
import withPaymentMade from './withPaymentMade';
|
import withPaymentMade from './withPaymentMade';
|
||||||
import withPaymentMadeActions from './withPaymentMadeActions';
|
import withPaymentMadeActions from './withPaymentMadeActions';
|
||||||
|
|
||||||
|
import withSettingsActions from 'containers/Settings/withSettingsActions';
|
||||||
|
import withSettings from 'containers/Settings/withSettings';
|
||||||
|
|
||||||
import { usePaymentMadesListContext } from './PaymentMadesListProvider';
|
import { usePaymentMadesListContext } from './PaymentMadesListProvider';
|
||||||
import { useRefreshPaymentMades } from 'hooks/query/paymentMades';
|
import { useRefreshPaymentMades } from 'hooks/query/paymentMades';
|
||||||
|
|
||||||
@@ -36,7 +40,13 @@ function PaymentMadeActionsBar({
|
|||||||
setPaymentMadesTableState,
|
setPaymentMadesTableState,
|
||||||
|
|
||||||
// #withPaymentMades
|
// #withPaymentMades
|
||||||
paymentMadesFilterConditions
|
paymentMadesFilterConditions,
|
||||||
|
|
||||||
|
// #withSettings
|
||||||
|
paymentMadesTableSize,
|
||||||
|
|
||||||
|
// #withSettingsActions
|
||||||
|
addSetting,
|
||||||
}) {
|
}) {
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
|
||||||
@@ -60,6 +70,12 @@ function PaymentMadeActionsBar({
|
|||||||
const handleRefreshBtnClick = () => {
|
const handleRefreshBtnClick = () => {
|
||||||
refresh();
|
refresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Handle table row size change.
|
||||||
|
const handleTableRowSizeChange = (size) => {
|
||||||
|
addSetting('payment_made', 'tableSize', size);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DashboardActionsBar>
|
<DashboardActionsBar>
|
||||||
<NavbarGroup>
|
<NavbarGroup>
|
||||||
@@ -114,6 +130,13 @@ function PaymentMadeActionsBar({
|
|||||||
icon={<Icon icon={'file-export-16'} iconSize={'16'} />}
|
icon={<Icon icon={'file-export-16'} iconSize={'16'} />}
|
||||||
text={<T id={'export'} />}
|
text={<T id={'export'} />}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<NavbarDivider />
|
||||||
|
<DashboardRowsHeightButton
|
||||||
|
initialValue={paymentMadesTableSize}
|
||||||
|
onChange={handleTableRowSizeChange}
|
||||||
|
/>
|
||||||
|
<NavbarDivider />
|
||||||
</NavbarGroup>
|
</NavbarGroup>
|
||||||
<NavbarGroup align={Alignment.RIGHT}>
|
<NavbarGroup align={Alignment.RIGHT}>
|
||||||
<Button
|
<Button
|
||||||
@@ -128,7 +151,11 @@ function PaymentMadeActionsBar({
|
|||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
withPaymentMadeActions,
|
withPaymentMadeActions,
|
||||||
|
withSettingsActions,
|
||||||
withPaymentMade(({ paymentMadesTableState }) => ({
|
withPaymentMade(({ paymentMadesTableState }) => ({
|
||||||
paymentMadesFilterConditions: paymentMadesTableState.filterRoles,
|
paymentMadesFilterConditions: paymentMadesTableState.filterRoles,
|
||||||
})),
|
})),
|
||||||
|
withSettings(({ billPaymentSettings }) => ({
|
||||||
|
paymentMadesTableSize: billPaymentSettings?.tableSize,
|
||||||
|
})),
|
||||||
)(PaymentMadeActionsBar);
|
)(PaymentMadeActionsBar);
|
||||||
|
|||||||
@@ -9,19 +9,23 @@ import {
|
|||||||
Alignment,
|
Alignment,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
import { FormattedMessage as T } from 'components';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
FormattedMessage as T,
|
||||||
AdvancedFilterPopover,
|
AdvancedFilterPopover,
|
||||||
If,
|
If,
|
||||||
DashboardActionViewsList,
|
DashboardActionViewsList,
|
||||||
DashboardFilterButton,
|
DashboardFilterButton,
|
||||||
|
DashboardRowsHeightButton,
|
||||||
} from 'components';
|
} from 'components';
|
||||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
||||||
|
|
||||||
import withEstimatesActions from './withEstimatesActions';
|
import withEstimatesActions from './withEstimatesActions';
|
||||||
import withEstimates from './withEstimates';
|
import withEstimates from './withEstimates';
|
||||||
|
|
||||||
|
import withSettingsActions from 'containers/Settings/withSettingsActions';
|
||||||
|
import withSettings from 'containers/Settings/withSettings';
|
||||||
|
|
||||||
import { useEstimatesListContext } from './EstimatesListProvider';
|
import { useEstimatesListContext } from './EstimatesListProvider';
|
||||||
import { useRefreshEstimates } from 'hooks/query/estimates';
|
import { useRefreshEstimates } from 'hooks/query/estimates';
|
||||||
|
|
||||||
@@ -36,6 +40,12 @@ function EstimateActionsBar({
|
|||||||
|
|
||||||
// #withEstimates
|
// #withEstimates
|
||||||
estimatesFilterRoles,
|
estimatesFilterRoles,
|
||||||
|
|
||||||
|
// #withSettings
|
||||||
|
estimatesTableSize,
|
||||||
|
|
||||||
|
// #withSettingsActions
|
||||||
|
addSetting,
|
||||||
}) {
|
}) {
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
|
||||||
@@ -61,6 +71,11 @@ function EstimateActionsBar({
|
|||||||
refresh();
|
refresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Handle table row size change.
|
||||||
|
const handleTableRowSizeChange = (size) => {
|
||||||
|
addSetting('estimate', 'tableSize', size);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DashboardActionsBar>
|
<DashboardActionsBar>
|
||||||
<NavbarGroup>
|
<NavbarGroup>
|
||||||
@@ -118,7 +133,14 @@ function EstimateActionsBar({
|
|||||||
icon={<Icon icon={'file-export-16'} iconSize={'16'} />}
|
icon={<Icon icon={'file-export-16'} iconSize={'16'} />}
|
||||||
text={<T id={'export'} />}
|
text={<T id={'export'} />}
|
||||||
/>
|
/>
|
||||||
|
<NavbarDivider />
|
||||||
|
<DashboardRowsHeightButton
|
||||||
|
initialValue={estimatesTableSize}
|
||||||
|
onChange={handleTableRowSizeChange}
|
||||||
|
/>
|
||||||
|
<NavbarDivider />
|
||||||
</NavbarGroup>
|
</NavbarGroup>
|
||||||
|
|
||||||
<NavbarGroup align={Alignment.RIGHT}>
|
<NavbarGroup align={Alignment.RIGHT}>
|
||||||
<Button
|
<Button
|
||||||
className={Classes.MINIMAL}
|
className={Classes.MINIMAL}
|
||||||
@@ -132,7 +154,11 @@ function EstimateActionsBar({
|
|||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
withEstimatesActions,
|
withEstimatesActions,
|
||||||
|
withSettingsActions,
|
||||||
withEstimates(({ estimatesTableState }) => ({
|
withEstimates(({ estimatesTableState }) => ({
|
||||||
estimatesFilterRoles: estimatesTableState.filterRoles,
|
estimatesFilterRoles: estimatesTableState.filterRoles,
|
||||||
})),
|
})),
|
||||||
|
withSettings(({ estimatesSettings }) => ({
|
||||||
|
estimatesTableSize: estimatesSettings?.tableSize,
|
||||||
|
})),
|
||||||
)(EstimateActionsBar);
|
)(EstimateActionsBar);
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import {
|
|||||||
FormattedMessage as T,
|
FormattedMessage as T,
|
||||||
AdvancedFilterPopover,
|
AdvancedFilterPopover,
|
||||||
DashboardFilterButton,
|
DashboardFilterButton,
|
||||||
|
DashboardRowsHeightButton,
|
||||||
} from 'components';
|
} from 'components';
|
||||||
|
|
||||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
||||||
@@ -22,6 +23,8 @@ import { If, DashboardActionViewsList } from 'components';
|
|||||||
import { useRefreshInvoices } from 'hooks/query/invoices';
|
import { useRefreshInvoices } from 'hooks/query/invoices';
|
||||||
import { useInvoicesListContext } from './InvoicesListProvider';
|
import { useInvoicesListContext } from './InvoicesListProvider';
|
||||||
|
|
||||||
|
import withSettingsActions from 'containers/Settings/withSettingsActions';
|
||||||
|
import withSettings from 'containers/Settings/withSettings';
|
||||||
import withInvoiceActions from './withInvoiceActions';
|
import withInvoiceActions from './withInvoiceActions';
|
||||||
import withInvoices from './withInvoices';
|
import withInvoices from './withInvoices';
|
||||||
|
|
||||||
@@ -36,6 +39,12 @@ function InvoiceActionsBar({
|
|||||||
|
|
||||||
// #withInvoices
|
// #withInvoices
|
||||||
invoicesFilterRoles,
|
invoicesFilterRoles,
|
||||||
|
|
||||||
|
// #withSettings
|
||||||
|
invoicesTableSize,
|
||||||
|
|
||||||
|
// #withSettingsActions
|
||||||
|
addSetting,
|
||||||
}) {
|
}) {
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
|
||||||
@@ -60,6 +69,11 @@ function InvoiceActionsBar({
|
|||||||
refresh();
|
refresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Handle table row size change.
|
||||||
|
const handleTableRowSizeChange = (size) => {
|
||||||
|
addSetting('invoice', 'tableSize', size);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DashboardActionsBar>
|
<DashboardActionsBar>
|
||||||
<NavbarGroup>
|
<NavbarGroup>
|
||||||
@@ -114,6 +128,12 @@ function InvoiceActionsBar({
|
|||||||
icon={<Icon icon={'file-export-16'} iconSize={'16'} />}
|
icon={<Icon icon={'file-export-16'} iconSize={'16'} />}
|
||||||
text={<T id={'export'} />}
|
text={<T id={'export'} />}
|
||||||
/>
|
/>
|
||||||
|
<NavbarDivider />
|
||||||
|
<DashboardRowsHeightButton
|
||||||
|
initialValue={invoicesTableSize}
|
||||||
|
onChange={handleTableRowSizeChange}
|
||||||
|
/>
|
||||||
|
<NavbarDivider />
|
||||||
</NavbarGroup>
|
</NavbarGroup>
|
||||||
<NavbarGroup align={Alignment.RIGHT}>
|
<NavbarGroup align={Alignment.RIGHT}>
|
||||||
<Button
|
<Button
|
||||||
@@ -128,7 +148,11 @@ function InvoiceActionsBar({
|
|||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
withInvoiceActions,
|
withInvoiceActions,
|
||||||
|
withSettingsActions,
|
||||||
withInvoices(({ invoicesTableState }) => ({
|
withInvoices(({ invoicesTableState }) => ({
|
||||||
invoicesFilterRoles: invoicesTableState.filterRoles,
|
invoicesFilterRoles: invoicesTableState.filterRoles,
|
||||||
})),
|
})),
|
||||||
|
withSettings(({ invoiceSettings }) => ({
|
||||||
|
invoicesTableSize: invoiceSettings?.tableSize,
|
||||||
|
})),
|
||||||
)(InvoiceActionsBar);
|
)(InvoiceActionsBar);
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import {
|
|||||||
DashboardFilterButton,
|
DashboardFilterButton,
|
||||||
AdvancedFilterPopover,
|
AdvancedFilterPopover,
|
||||||
FormattedMessage as T,
|
FormattedMessage as T,
|
||||||
|
DashboardRowsHeightButton,
|
||||||
} from 'components';
|
} from 'components';
|
||||||
|
|
||||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
||||||
@@ -23,6 +24,9 @@ import { If, DashboardActionViewsList } from 'components';
|
|||||||
import withPaymentReceivesActions from './withPaymentReceivesActions';
|
import withPaymentReceivesActions from './withPaymentReceivesActions';
|
||||||
import withPaymentReceives from './withPaymentReceives';
|
import withPaymentReceives from './withPaymentReceives';
|
||||||
|
|
||||||
|
import withSettingsActions from 'containers/Settings/withSettingsActions';
|
||||||
|
import withSettings from 'containers/Settings/withSettings';
|
||||||
|
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
import { usePaymentReceivesListContext } from './PaymentReceiptsListProvider';
|
import { usePaymentReceivesListContext } from './PaymentReceiptsListProvider';
|
||||||
import { useRefreshPaymentReceive } from 'hooks/query/paymentReceives';
|
import { useRefreshPaymentReceive } from 'hooks/query/paymentReceives';
|
||||||
@@ -35,7 +39,13 @@ function PaymentReceiveActionsBar({
|
|||||||
setPaymentReceivesTableState,
|
setPaymentReceivesTableState,
|
||||||
|
|
||||||
// #withPaymentReceives
|
// #withPaymentReceives
|
||||||
paymentFilterConditions
|
paymentFilterConditions,
|
||||||
|
|
||||||
|
// #withSettings
|
||||||
|
paymentReceivesTableSize,
|
||||||
|
|
||||||
|
// #withSettingsActions
|
||||||
|
addSetting,
|
||||||
}) {
|
}) {
|
||||||
// History context.
|
// History context.
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
@@ -61,6 +71,11 @@ function PaymentReceiveActionsBar({
|
|||||||
refresh();
|
refresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Handle table row size change.
|
||||||
|
const handleTableRowSizeChange = (size) => {
|
||||||
|
addSetting('payment_receive', 'tableSize', size);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DashboardActionsBar>
|
<DashboardActionsBar>
|
||||||
<NavbarGroup>
|
<NavbarGroup>
|
||||||
@@ -115,6 +130,13 @@ function PaymentReceiveActionsBar({
|
|||||||
icon={<Icon icon={'file-export-16'} iconSize={'16'} />}
|
icon={<Icon icon={'file-export-16'} iconSize={'16'} />}
|
||||||
text={<T id={'export'} />}
|
text={<T id={'export'} />}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<NavbarDivider />
|
||||||
|
<DashboardRowsHeightButton
|
||||||
|
initialValue={paymentReceivesTableSize}
|
||||||
|
onChange={handleTableRowSizeChange}
|
||||||
|
/>
|
||||||
|
<NavbarDivider />
|
||||||
</NavbarGroup>
|
</NavbarGroup>
|
||||||
<NavbarGroup align={Alignment.RIGHT}>
|
<NavbarGroup align={Alignment.RIGHT}>
|
||||||
<Button
|
<Button
|
||||||
@@ -129,8 +151,12 @@ function PaymentReceiveActionsBar({
|
|||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
withPaymentReceivesActions,
|
withPaymentReceivesActions,
|
||||||
|
withSettingsActions,
|
||||||
withPaymentReceives(({ paymentReceivesTableState }) => ({
|
withPaymentReceives(({ paymentReceivesTableState }) => ({
|
||||||
paymentReceivesTableState,
|
paymentReceivesTableState,
|
||||||
paymentFilterConditions: paymentReceivesTableState.filterRoles,
|
paymentFilterConditions: paymentReceivesTableState.filterRoles,
|
||||||
})),
|
})),
|
||||||
|
withSettings(({ paymentReceiveSettings }) => ({
|
||||||
|
paymentReceivesTableSize: paymentReceiveSettings?.tableSize,
|
||||||
|
})),
|
||||||
)(PaymentReceiveActionsBar);
|
)(PaymentReceiveActionsBar);
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import {
|
|||||||
AdvancedFilterPopover,
|
AdvancedFilterPopover,
|
||||||
DashboardFilterButton,
|
DashboardFilterButton,
|
||||||
FormattedMessage as T,
|
FormattedMessage as T,
|
||||||
|
DashboardRowsHeightButton,
|
||||||
} from 'components';
|
} from 'components';
|
||||||
|
|
||||||
import { If, DashboardActionViewsList } from 'components';
|
import { If, DashboardActionViewsList } from 'components';
|
||||||
@@ -22,6 +23,9 @@ import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
|||||||
import withReceiptsActions from './withReceiptsActions';
|
import withReceiptsActions from './withReceiptsActions';
|
||||||
import withReceipts from './withReceipts';
|
import withReceipts from './withReceipts';
|
||||||
|
|
||||||
|
import withSettingsActions from 'containers/Settings/withSettingsActions';
|
||||||
|
import withSettings from 'containers/Settings/withSettings';
|
||||||
|
|
||||||
import { useReceiptsListContext } from './ReceiptsListProvider';
|
import { useReceiptsListContext } from './ReceiptsListProvider';
|
||||||
import { useRefreshReceipts } from 'hooks/query/receipts';
|
import { useRefreshReceipts } from 'hooks/query/receipts';
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
@@ -35,6 +39,12 @@ function ReceiptActionsBar({
|
|||||||
|
|
||||||
// #withReceipts
|
// #withReceipts
|
||||||
receiptsFilterConditions,
|
receiptsFilterConditions,
|
||||||
|
|
||||||
|
// #withSettings
|
||||||
|
receiptsTableSize,
|
||||||
|
|
||||||
|
// #withSettingsActions
|
||||||
|
addSetting,
|
||||||
}) {
|
}) {
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
|
||||||
@@ -60,6 +70,11 @@ function ReceiptActionsBar({
|
|||||||
refresh();
|
refresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Handle table row size change.
|
||||||
|
const handleTableRowSizeChange = (size) => {
|
||||||
|
addSetting('receipt', 'tableSize', size);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DashboardActionsBar>
|
<DashboardActionsBar>
|
||||||
<NavbarGroup>
|
<NavbarGroup>
|
||||||
@@ -117,6 +132,13 @@ function ReceiptActionsBar({
|
|||||||
icon={<Icon icon={'file-export-16'} iconSize={'16'} />}
|
icon={<Icon icon={'file-export-16'} iconSize={'16'} />}
|
||||||
text={<T id={'export'} />}
|
text={<T id={'export'} />}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<NavbarDivider />
|
||||||
|
<DashboardRowsHeightButton
|
||||||
|
initialValue={receiptsTableSize}
|
||||||
|
onChange={handleTableRowSizeChange}
|
||||||
|
/>
|
||||||
|
<NavbarDivider />
|
||||||
</NavbarGroup>
|
</NavbarGroup>
|
||||||
<NavbarGroup align={Alignment.RIGHT}>
|
<NavbarGroup align={Alignment.RIGHT}>
|
||||||
<Button
|
<Button
|
||||||
@@ -131,7 +153,11 @@ function ReceiptActionsBar({
|
|||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
withReceiptsActions,
|
withReceiptsActions,
|
||||||
|
withSettingsActions,
|
||||||
withReceipts(({ receiptTableState }) => ({
|
withReceipts(({ receiptTableState }) => ({
|
||||||
receiptsFilterConditions: receiptTableState.filterRoles,
|
receiptsFilterConditions: receiptTableState.filterRoles,
|
||||||
})),
|
})),
|
||||||
|
withSettings(({ receiptSettings }) => ({
|
||||||
|
receiptsTableSize: receiptSettings?.tableSize,
|
||||||
|
})),
|
||||||
)(ReceiptActionsBar);
|
)(ReceiptActionsBar);
|
||||||
|
|||||||
@@ -8,14 +8,15 @@ import {
|
|||||||
Switch,
|
Switch,
|
||||||
Alignment,
|
Alignment,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
import { FormattedMessage as T } from 'components';
|
|
||||||
|
|
||||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
||||||
import Icon from 'components/Icon';
|
import Icon from 'components/Icon';
|
||||||
import {
|
import {
|
||||||
If,
|
If,
|
||||||
|
FormattedMessage as T,
|
||||||
DashboardActionViewsList,
|
DashboardActionViewsList,
|
||||||
DashboardFilterButton,
|
DashboardFilterButton,
|
||||||
|
DashboardRowsHeightButton,
|
||||||
AdvancedFilterPopover,
|
AdvancedFilterPopover,
|
||||||
} from 'components';
|
} from 'components';
|
||||||
|
|
||||||
@@ -26,6 +27,9 @@ import { useHistory } from 'react-router-dom';
|
|||||||
import withVendorsActions from './withVendorsActions';
|
import withVendorsActions from './withVendorsActions';
|
||||||
import withVendors from './withVendors';
|
import withVendors from './withVendors';
|
||||||
|
|
||||||
|
import withSettingsActions from '../../Settings/withSettingsActions';
|
||||||
|
import withSettings from '../../Settings/withSettings';
|
||||||
|
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,6 +42,12 @@ function VendorActionsBar({
|
|||||||
// #withVendorActions
|
// #withVendorActions
|
||||||
setVendorsTableState,
|
setVendorsTableState,
|
||||||
vendorsInactiveMode,
|
vendorsInactiveMode,
|
||||||
|
|
||||||
|
// #withSettings
|
||||||
|
vendorsTableSize,
|
||||||
|
|
||||||
|
// #withSettingsActions
|
||||||
|
addSetting,
|
||||||
}) {
|
}) {
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
|
||||||
@@ -68,6 +78,9 @@ function VendorActionsBar({
|
|||||||
refresh();
|
refresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleTableRowSizeChange = (size) => {
|
||||||
|
addSetting('vendor', 'tableSize', size);
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<DashboardActionsBar>
|
<DashboardActionsBar>
|
||||||
<NavbarGroup>
|
<NavbarGroup>
|
||||||
@@ -117,6 +130,12 @@ function VendorActionsBar({
|
|||||||
icon={<Icon icon="file-export-16" iconSize={16} />}
|
icon={<Icon icon="file-export-16" iconSize={16} />}
|
||||||
text={<T id={'export'} />}
|
text={<T id={'export'} />}
|
||||||
/>
|
/>
|
||||||
|
<NavbarDivider />
|
||||||
|
<DashboardRowsHeightButton
|
||||||
|
initialValue={vendorsTableSize}
|
||||||
|
onChange={handleTableRowSizeChange}
|
||||||
|
/>
|
||||||
|
<NavbarDivider />
|
||||||
<Switch
|
<Switch
|
||||||
labelElement={<T id={'inactive'} />}
|
labelElement={<T id={'inactive'} />}
|
||||||
defaultChecked={vendorsInactiveMode}
|
defaultChecked={vendorsInactiveMode}
|
||||||
@@ -136,8 +155,12 @@ function VendorActionsBar({
|
|||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
withVendorsActions,
|
withVendorsActions,
|
||||||
|
withSettingsActions,
|
||||||
withVendors(({ vendorsTableState }) => ({
|
withVendors(({ vendorsTableState }) => ({
|
||||||
vendorsInactiveMode: vendorsTableState.inactiveMode,
|
vendorsInactiveMode: vendorsTableState.inactiveMode,
|
||||||
vendorsFilterConditions: vendorsTableState.filterRoles,
|
vendorsFilterConditions: vendorsTableState.filterRoles,
|
||||||
})),
|
})),
|
||||||
|
// withSettings(({ }) => ({
|
||||||
|
// vendorsTableSize:
|
||||||
|
// })),
|
||||||
)(VendorActionsBar);
|
)(VendorActionsBar);
|
||||||
|
|||||||
Reference in New Issue
Block a user