mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
fix(*): hide/customizer report.
This commit is contained in:
@@ -69,9 +69,9 @@ function CustomersBalanceSummaryActionsBar({
|
|||||||
icon={<Icon icon="cog-16" iconSize={16} />}
|
icon={<Icon icon="cog-16" iconSize={16} />}
|
||||||
text={
|
text={
|
||||||
isFilterDrawerOpen ? (
|
isFilterDrawerOpen ? (
|
||||||
<T id={'customize_report'} />
|
|
||||||
) : (
|
|
||||||
<T id={'hide_customizer'} />
|
<T id={'hide_customizer'} />
|
||||||
|
) : (
|
||||||
|
<T id={'customize_report'} />
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
onClick={handleFilterToggleClick}
|
onClick={handleFilterToggleClick}
|
||||||
|
|||||||
@@ -15,16 +15,16 @@ import Icon from 'components/Icon';
|
|||||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
||||||
import NumberFormatDropdown from 'components/NumberFormatDropdown';
|
import NumberFormatDropdown from 'components/NumberFormatDropdown';
|
||||||
|
|
||||||
import { useCustomersTranscationsContext } from './CustomersTranscationsProvider';
|
import { useCustomersTransactionsContext } from './CustomersTransactionsProvider';
|
||||||
import withCustomersTransactions from './withCustomersTransactions';
|
import withCustomersTransactions from './withCustomersTransactions';
|
||||||
import withCustomersTransactionsActions from './withCustomersTransactionsActions';
|
import withCustomersTransactionsActions from './withCustomersTransactionsActions';
|
||||||
|
|
||||||
import { compose, saveInvoke } from 'utils';
|
import { compose, saveInvoke } from 'utils';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Customers transcations actions bar.
|
* Customers transactions actions bar.
|
||||||
*/
|
*/
|
||||||
function CustomersTranscationsActionsBar({
|
function CustomersTransactionsActionsBar({
|
||||||
// #ownProps
|
// #ownProps
|
||||||
numberFormat,
|
numberFormat,
|
||||||
onNumberFormatSubmit,
|
onNumberFormatSubmit,
|
||||||
@@ -38,7 +38,7 @@ function CustomersTranscationsActionsBar({
|
|||||||
const {
|
const {
|
||||||
isCustomersTransactionsLoading,
|
isCustomersTransactionsLoading,
|
||||||
CustomersTransactionsRefetch,
|
CustomersTransactionsRefetch,
|
||||||
} = useCustomersTranscationsContext();
|
} = useCustomersTransactionsContext();
|
||||||
|
|
||||||
// Handle filter toggle click.
|
// Handle filter toggle click.
|
||||||
const handleFilterToggleClick = () => {
|
const handleFilterToggleClick = () => {
|
||||||
@@ -70,9 +70,9 @@ function CustomersTranscationsActionsBar({
|
|||||||
icon={<Icon icon="cog-16" iconSize={16} />}
|
icon={<Icon icon="cog-16" iconSize={16} />}
|
||||||
text={
|
text={
|
||||||
isFilterDrawerOpen ? (
|
isFilterDrawerOpen ? (
|
||||||
<T id={'customize_report'} />
|
|
||||||
) : (
|
|
||||||
<T id={'hide_customizer'} />
|
<T id={'hide_customizer'} />
|
||||||
|
) : (
|
||||||
|
<T id={'customize_report'} />
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
onClick={handleFilterToggleClick}
|
onClick={handleFilterToggleClick}
|
||||||
@@ -132,4 +132,4 @@ export default compose(
|
|||||||
isFilterDrawerOpen: customersTransactionsDrawerFilter,
|
isFilterDrawerOpen: customersTransactionsDrawerFilter,
|
||||||
})),
|
})),
|
||||||
withCustomersTransactionsActions,
|
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 DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
||||||
import NumberFormatDropdown from 'components/NumberFormatDropdown';
|
import NumberFormatDropdown from 'components/NumberFormatDropdown';
|
||||||
|
|
||||||
import { useVendorsTranscationsContext } from './VendorsTransactionsProvider';
|
import { useVendorsTransactionsContext } from './VendorsTransactionsProvider';
|
||||||
import withVendorsTransaction from './withVendorsTransaction';
|
import withVendorsTransaction from './withVendorsTransaction';
|
||||||
import withVendorsTransactionsActions from './withVendorsTransactionsActions';
|
import withVendorsTransactionsActions from './withVendorsTransactionsActions';
|
||||||
|
|
||||||
import { compose, saveInvoke } from 'utils';
|
import { compose, saveInvoke } from 'utils';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* vendors transcations actions bar.
|
* vendors transactions actions bar.
|
||||||
*/
|
*/
|
||||||
function VendorsTransactionsActionsBar({
|
function VendorsTransactionsActionsBar({
|
||||||
// #ownProps
|
// #ownProps
|
||||||
@@ -38,7 +38,7 @@ function VendorsTransactionsActionsBar({
|
|||||||
const {
|
const {
|
||||||
isVendorsTransactionsLoading,
|
isVendorsTransactionsLoading,
|
||||||
refetch,
|
refetch,
|
||||||
} = useVendorsTranscationsContext();
|
} = useVendorsTransactionsContext();
|
||||||
|
|
||||||
// Handle filter toggle click.
|
// Handle filter toggle click.
|
||||||
const handleFilterToggleClick = () => {
|
const handleFilterToggleClick = () => {
|
||||||
@@ -70,9 +70,9 @@ function VendorsTransactionsActionsBar({
|
|||||||
icon={<Icon icon="cog-16" iconSize={16} />}
|
icon={<Icon icon="cog-16" iconSize={16} />}
|
||||||
text={
|
text={
|
||||||
isFilterDrawerOpen ? (
|
isFilterDrawerOpen ? (
|
||||||
<T id={'customize_report'} />
|
|
||||||
) : (
|
|
||||||
<T id={'hide_customizer'} />
|
<T id={'hide_customizer'} />
|
||||||
|
) : (
|
||||||
|
<T id={'customize_report'} />
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
onClick={handleFilterToggleClick}
|
onClick={handleFilterToggleClick}
|
||||||
|
|||||||
Reference in New Issue
Block a user