mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 20:30:33 +00:00
fix(*): hide/customizer report.
This commit is contained in:
@@ -69,9 +69,9 @@ function CustomersBalanceSummaryActionsBar({
|
||||
icon={<Icon icon="cog-16" iconSize={16} />}
|
||||
text={
|
||||
isFilterDrawerOpen ? (
|
||||
<T id={'customize_report'} />
|
||||
) : (
|
||||
<T id={'hide_customizer'} />
|
||||
) : (
|
||||
<T id={'customize_report'} />
|
||||
)
|
||||
}
|
||||
onClick={handleFilterToggleClick}
|
||||
|
||||
@@ -15,16 +15,16 @@ import Icon from 'components/Icon';
|
||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
||||
import NumberFormatDropdown from 'components/NumberFormatDropdown';
|
||||
|
||||
import { useCustomersTranscationsContext } from './CustomersTranscationsProvider';
|
||||
import { useCustomersTransactionsContext } from './CustomersTransactionsProvider';
|
||||
import withCustomersTransactions from './withCustomersTransactions';
|
||||
import withCustomersTransactionsActions from './withCustomersTransactionsActions';
|
||||
|
||||
import { compose, saveInvoke } from 'utils';
|
||||
|
||||
/**
|
||||
* Customers transcations actions bar.
|
||||
* Customers transactions actions bar.
|
||||
*/
|
||||
function CustomersTranscationsActionsBar({
|
||||
function CustomersTransactionsActionsBar({
|
||||
// #ownProps
|
||||
numberFormat,
|
||||
onNumberFormatSubmit,
|
||||
@@ -38,7 +38,7 @@ function CustomersTranscationsActionsBar({
|
||||
const {
|
||||
isCustomersTransactionsLoading,
|
||||
CustomersTransactionsRefetch,
|
||||
} = useCustomersTranscationsContext();
|
||||
} = useCustomersTransactionsContext();
|
||||
|
||||
// Handle filter toggle click.
|
||||
const handleFilterToggleClick = () => {
|
||||
@@ -70,9 +70,9 @@ function CustomersTranscationsActionsBar({
|
||||
icon={<Icon icon="cog-16" iconSize={16} />}
|
||||
text={
|
||||
isFilterDrawerOpen ? (
|
||||
<T id={'customize_report'} />
|
||||
) : (
|
||||
<T id={'hide_customizer'} />
|
||||
) : (
|
||||
<T id={'customize_report'} />
|
||||
)
|
||||
}
|
||||
onClick={handleFilterToggleClick}
|
||||
@@ -132,4 +132,4 @@ export default compose(
|
||||
isFilterDrawerOpen: customersTransactionsDrawerFilter,
|
||||
})),
|
||||
withCustomersTransactionsActions,
|
||||
)(CustomersTranscationsActionsBar);
|
||||
)(CustomersTransactionsActionsBar);
|
||||
@@ -1,42 +0,0 @@
|
||||
import React, { createContext, useContext, useMemo } from 'react';
|
||||
import FinancialReportPage from '../FinancialReportPage';
|
||||
import { useCustomersTranscationsReport } from 'hooks/query';
|
||||
import { transformFilterFormToQuery } from '../common';
|
||||
|
||||
const CustomersTranscationsContext = createContext();
|
||||
|
||||
/**
|
||||
* Customers transcations provider.
|
||||
*/
|
||||
function CustomersTranscationsProvider({ filter, ...props }) {
|
||||
const query = useMemo(() => transformFilterFormToQuery(filter), [
|
||||
filter,
|
||||
]);
|
||||
|
||||
// fetches the customers transcations.
|
||||
const {
|
||||
data: customersTransactions,
|
||||
isFetching: isCustomersTransactionsFetching,
|
||||
isLoading: isCustomersTransactionsLoading,
|
||||
refetch: CustomersTransactionsRefetch,
|
||||
} = useCustomersTranscationsReport(query, { keepPreviousData: true });
|
||||
|
||||
const provider = {
|
||||
customersTransactions,
|
||||
isCustomersTransactionsFetching,
|
||||
isCustomersTransactionsLoading,
|
||||
CustomersTransactionsRefetch,
|
||||
filter,
|
||||
query
|
||||
};
|
||||
|
||||
return (
|
||||
<FinancialReportPage name={'customer-transactions'}>
|
||||
<CustomersTranscationsContext.Provider value={provider} {...props} />
|
||||
</FinancialReportPage>
|
||||
);
|
||||
}
|
||||
const useCustomersTranscationsContext = () =>
|
||||
useContext(CustomersTranscationsContext);
|
||||
|
||||
export { CustomersTranscationsProvider, useCustomersTranscationsContext };
|
||||
@@ -15,14 +15,14 @@ import Icon from 'components/Icon';
|
||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
||||
import NumberFormatDropdown from 'components/NumberFormatDropdown';
|
||||
|
||||
import { useVendorsTranscationsContext } from './VendorsTransactionsProvider';
|
||||
import { useVendorsTransactionsContext } from './VendorsTransactionsProvider';
|
||||
import withVendorsTransaction from './withVendorsTransaction';
|
||||
import withVendorsTransactionsActions from './withVendorsTransactionsActions';
|
||||
|
||||
import { compose, saveInvoke } from 'utils';
|
||||
|
||||
/**
|
||||
* vendors transcations actions bar.
|
||||
* vendors transactions actions bar.
|
||||
*/
|
||||
function VendorsTransactionsActionsBar({
|
||||
// #ownProps
|
||||
@@ -38,7 +38,7 @@ function VendorsTransactionsActionsBar({
|
||||
const {
|
||||
isVendorsTransactionsLoading,
|
||||
refetch,
|
||||
} = useVendorsTranscationsContext();
|
||||
} = useVendorsTransactionsContext();
|
||||
|
||||
// Handle filter toggle click.
|
||||
const handleFilterToggleClick = () => {
|
||||
@@ -70,9 +70,9 @@ function VendorsTransactionsActionsBar({
|
||||
icon={<Icon icon="cog-16" iconSize={16} />}
|
||||
text={
|
||||
isFilterDrawerOpen ? (
|
||||
<T id={'customize_report'} />
|
||||
) : (
|
||||
<T id={'hide_customizer'} />
|
||||
) : (
|
||||
<T id={'customize_report'} />
|
||||
)
|
||||
}
|
||||
onClick={handleFilterToggleClick}
|
||||
|
||||
Reference in New Issue
Block a user