mirror of
https://github.com/apache/superset.git
synced 2024-09-06 13:57:40 -04:00
feat: add ErrorBoundary to chart controls (#13584)
This commit is contained in:
parent
714d262336
commit
868e063b03
@ -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}
|
||||
>
|
||||
<ControlComponent
|
||||
onChange={this.onChange}
|
||||
hovered={this.state.hovered}
|
||||
{...this.props}
|
||||
/>
|
||||
<ErrorBoundary>
|
||||
<ControlComponent
|
||||
onChange={this.onChange}
|
||||
hovered={this.state.hovered}
|
||||
{...this.props}
|
||||
/>
|
||||
</ErrorBoundary>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user