From 6c44fed1e2289dee9cff5e1ff6fc215f9b11e07d Mon Sep 17 00:00:00 2001 From: Walter Rafelsberger Date: Tue, 11 Dec 2018 11:38:17 +0100 Subject: [PATCH] [ML] Adds isRequired where applicable to timeseries_chart props. (#26880) Adds isRequired to timeseries_chart props to match the minimum required props necessary to render the component without errors reflected in the Minimal initialization test. --- .../public/timeseriesexplorer/timeseries_chart.js | 14 +++++++------- .../timeseriesexplorer/timeseries_chart.test.js | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/x-pack/plugins/ml/public/timeseriesexplorer/timeseries_chart.js b/x-pack/plugins/ml/public/timeseriesexplorer/timeseries_chart.js index 0c54cf9a91ae..f9d9db59eea4 100644 --- a/x-pack/plugins/ml/public/timeseriesexplorer/timeseries_chart.js +++ b/x-pack/plugins/ml/public/timeseriesexplorer/timeseries_chart.js @@ -79,19 +79,19 @@ export class TimeseriesChart extends React.Component { contextAggregationInterval: PropTypes.object, contextChartData: PropTypes.array, contextForecastData: PropTypes.array, - contextChartSelected: PropTypes.func, + contextChartSelected: PropTypes.func.isRequired, detectorIndex: PropTypes.string, focusAggregationInterval: PropTypes.object, focusChartData: PropTypes.array, focusForecastData: PropTypes.array, - modelPlotEnabled: PropTypes.bool, - renderFocusChartOnly: PropTypes.bool, + modelPlotEnabled: PropTypes.bool.isRequired, + renderFocusChartOnly: PropTypes.bool.isRequired, selectedJob: PropTypes.object, - showForecast: PropTypes.bool, - showModelBounds: PropTypes.bool, - svgWidth: PropTypes.number, + showForecast: PropTypes.bool.isRequired, + showModelBounds: PropTypes.bool.isRequired, + svgWidth: PropTypes.number.isRequired, swimlaneData: PropTypes.array, - timefilter: PropTypes.object, + timefilter: PropTypes.object.isRequired, zoomFrom: PropTypes.object, zoomTo: PropTypes.object } diff --git a/x-pack/plugins/ml/public/timeseriesexplorer/timeseries_chart.test.js b/x-pack/plugins/ml/public/timeseriesexplorer/timeseries_chart.test.js index 5f306eb06ee8..ea0c648fa565 100644 --- a/x-pack/plugins/ml/public/timeseriesexplorer/timeseries_chart.test.js +++ b/x-pack/plugins/ml/public/timeseriesexplorer/timeseries_chart.test.js @@ -37,6 +37,7 @@ function getTimeseriesChartPropsMock() { return { contextChartSelected: jest.fn(), modelPlotEnabled: false, + renderFocusChartOnly: false, showForecast: true, showModelBounds: true, svgWidth: 1600,