From 868e063b03208f78d4b2cc86e49ad86ca1849652 Mon Sep 17 00:00:00 2001 From: Jesse Yang Date: Mon, 15 Mar 2021 14:44:18 -0700 Subject: [PATCH] feat: add ErrorBoundary to chart controls (#13584) --- .../src/explore/components/Control.tsx | 13 ++++++++----- .../src/explore/components/controls/index.js | 2 ++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/superset-frontend/src/explore/components/Control.tsx b/superset-frontend/src/explore/components/Control.tsx index d3ae6bb1c1..6e9a736396 100644 --- a/superset-frontend/src/explore/components/Control.tsx +++ b/superset-frontend/src/explore/components/Control.tsx @@ -19,6 +19,7 @@ import React, { ReactNode } from 'react'; import { ControlType } from '@superset-ui/chart-controls'; import { JsonValue, QueryFormData } from '@superset-ui/core'; +import ErrorBoundary from 'src/components/ErrorBoundary'; import { ExploreActions } from 'src/explore/actions/exploreActions'; import controlMap from './controls'; @@ -78,11 +79,13 @@ export default class Control extends React.PureComponent< onMouseEnter={this.onMouseEnter} onMouseLeave={this.onMouseLeave} > - + + + ); } diff --git a/superset-frontend/src/explore/components/controls/index.js b/superset-frontend/src/explore/components/controls/index.js index dc27b1a9b4..e3ae9fa266 100644 --- a/superset-frontend/src/explore/components/controls/index.js +++ b/superset-frontend/src/explore/components/controls/index.js @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +import { sharedControlComponents } from '@superset-ui/chart-controls'; import AnnotationLayerControl from './AnnotationLayerControl'; import BoundsControl from './BoundsControl'; import CheckboxControl from './CheckboxControl'; @@ -73,5 +74,6 @@ const controlMap = { MetricsControl, AdhocFilterControl, FilterBoxItemControl, + ...sharedControlComponents, }; export default controlMap;