Skip to content

Commit

Permalink
Revert "fix(chart): scrollbar keep flusing on and off (apache#23778)"
Browse files Browse the repository at this point in the history
This reverts commit 839bc08.
  • Loading branch information
sadpandajoe committed May 17, 2023
1 parent 25a4e75 commit c822971
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
t,
useTheme,
} from '@superset-ui/core';
import { useResizeDetector } from 'react-resize-detector';
import { chartPropShape } from 'src/dashboard/util/propShapes';
import ChartContainer from 'src/components/Chart/ChartContainer';
import { isFeatureEnabled } from 'src/featureFlags';
Expand All @@ -41,12 +42,11 @@ import {
import Alert from 'src/components/Alert';
import { SaveDatasetModal } from 'src/SqlLab/components/SaveDatasetModal';
import { getDatasourceAsSaveableDataset } from 'src/utils/datasourceUtils';
import { buildV1ChartDataPayload } from 'src/explore/exploreUtils';
import { getChartRequiredFieldsMissingMessage } from 'src/utils/getChartRequiredFieldsMissingMessage';
import { DataTablesPane } from '../DataTablesPane';
import { ChartPills } from '../ChartPills';
import { ExploreAlert } from '../ExploreAlert';
import useResizeDetectorByObserver from './useResizeDetectorByObserver';
import { DataTablesPane } from './DataTablesPane';
import { buildV1ChartDataPayload } from '../exploreUtils';
import { ChartPills } from './ChartPills';
import { ExploreAlert } from './ExploreAlert';
import { getChartRequiredFieldsMissingMessage } from '../../utils/getChartRequiredFieldsMissingMessage';

const propTypes = {
actions: PropTypes.object.isRequired,
Expand Down Expand Up @@ -142,11 +142,13 @@ const ExploreChartPanel = ({
const gutterMargin = theme.gridUnit * GUTTER_SIZE_FACTOR;
const gutterHeight = theme.gridUnit * GUTTER_SIZE_FACTOR;
const {
ref: chartPanelRef,
observerRef: resizeObserverRef,
width: chartPanelWidth,
height: chartPanelHeight,
} = useResizeDetectorByObserver();
ref: chartPanelRef,
} = useResizeDetector({
refreshMode: 'debounce',
refreshRate: 300,
});
const [splitSizes, setSplitSizes] = useState(
isFeatureEnabled(FeatureFlag.DATAPANEL_CLOSED_BY_DEFAULT)
? INITIAL_SIZES
Expand Down Expand Up @@ -307,7 +309,6 @@ const ExploreChartPanel = ({
display: flex;
flex-direction: column;
`}
ref={resizeObserverRef}
>
{vizTypeNeedsDataset && (
<Alert
Expand Down Expand Up @@ -374,7 +375,6 @@ const ExploreChartPanel = ({
</div>
),
[
resizeObserverRef,
showAlertBanner,
errorMessage,
onQuery,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,10 @@ const reduxState = {
const KEY = 'aWrs7w29sd';
const SEARCH = `?form_data_key=${KEY}&dataset_id=1`;

jest.mock(
'src/explore/components/ExploreChartPanel/useResizeDetectorByObserver',
() => ({
__esModule: true,
default: () => ({ height: 100, width: 100 }),
}),
);
jest.mock('react-resize-detector', () => ({
__esModule: true,
useResizeDetector: () => ({ height: 100, width: 100 }),
}));

jest.mock('lodash/debounce', () => ({
__esModule: true,
Expand Down

0 comments on commit c822971

Please sign in to comment.