mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
fix: tables with custom views.
This commit is contained in:
@@ -42,6 +42,7 @@ function EstimateActionsBar({
|
||||
history.push('/estimates/new');
|
||||
};
|
||||
|
||||
// Handle tab change.
|
||||
const handleTabChange = (customView) => {
|
||||
setEstimatesTableState({
|
||||
customViewId: customView.id || null,
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import React, { useCallback } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
|
||||
import { CLASSES } from 'common/classes';
|
||||
import { compose } from 'utils';
|
||||
|
||||
import { DataTable } from 'components';
|
||||
|
||||
@@ -23,21 +23,21 @@ function EstimateViewTabs({
|
||||
// Estimates list context.
|
||||
const { estimatesViews } = useEstimatesListContext();
|
||||
|
||||
// Estimates views.
|
||||
const tabs = estimatesViews.map((view) => ({
|
||||
...pick(view, ['name', 'id']),
|
||||
}));
|
||||
|
||||
const handleTabsChange = (viewId) => {
|
||||
setEstimatesTableState({
|
||||
customViewId: viewId || null,
|
||||
});
|
||||
// Handle tab change.
|
||||
const handleTabsChange = (customViewId) => {
|
||||
setEstimatesTableState({ customViewId: customViewId || null });
|
||||
};
|
||||
|
||||
return (
|
||||
<Navbar className={'navbar--dashboard-views'}>
|
||||
<NavbarGroup align={Alignment.LEFT}>
|
||||
<DashboardViewsTabs
|
||||
customViewId={estimatesTableState.customViewId}
|
||||
currentViewId={estimatesTableState.customViewId}
|
||||
resourceName={'estimates'}
|
||||
tabs={tabs}
|
||||
onChange={handleTabsChange}
|
||||
|
||||
Reference in New Issue
Block a user