Skip to content
This repository was archived by the owner on Jul 9, 2022. It is now read-only.

Commit 868e063

Browse files
authored
feat: add ErrorBoundary to chart controls (apache#13584)
1 parent 714d262 commit 868e063

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

superset-frontend/src/explore/components/Control.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import React, { ReactNode } from 'react';
2020
import { ControlType } from '@superset-ui/chart-controls';
2121
import { JsonValue, QueryFormData } from '@superset-ui/core';
22+
import ErrorBoundary from 'src/components/ErrorBoundary';
2223
import { ExploreActions } from 'src/explore/actions/exploreActions';
2324
import controlMap from './controls';
2425

@@ -78,11 +79,13 @@ export default class Control extends React.PureComponent<
7879
onMouseEnter={this.onMouseEnter}
7980
onMouseLeave={this.onMouseLeave}
8081
>
81-
<ControlComponent
82-
onChange={this.onChange}
83-
hovered={this.state.hovered}
84-
{...this.props}
85-
/>
82+
<ErrorBoundary>
83+
<ControlComponent
84+
onChange={this.onChange}
85+
hovered={this.state.hovered}
86+
{...this.props}
87+
/>
88+
</ErrorBoundary>
8689
</div>
8790
);
8891
}

superset-frontend/src/explore/components/controls/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19+
import { sharedControlComponents } from '@superset-ui/chart-controls';
1920
import AnnotationLayerControl from './AnnotationLayerControl';
2021
import BoundsControl from './BoundsControl';
2122
import CheckboxControl from './CheckboxControl';
@@ -73,5 +74,6 @@ const controlMap = {
7374
MetricsControl,
7475
AdhocFilterControl,
7576
FilterBoxItemControl,
77+
...sharedControlComponents,
7678
};
7779
export default controlMap;

0 commit comments

Comments
 (0)