fix: tables with custom views.

This commit is contained in:
a.bouhuolia
2021-02-21 14:21:07 +02:00
parent df2d215071
commit 4fe00d59d8
20 changed files with 44 additions and 58 deletions

View File

@@ -42,6 +42,7 @@ function EstimateActionsBar({
history.push('/estimates/new');
};
// Handle tab change.
const handleTabChange = (customView) => {
setEstimatesTableState({
customViewId: customView.id || null,

View File

@@ -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';

View File

@@ -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}