diff --git a/public/pages/CreateMonitor/containers/DataSource/DataSource.js b/public/pages/CreateMonitor/containers/DataSource/DataSource.js index c7daff3e8..2324cc5e9 100644 --- a/public/pages/CreateMonitor/containers/DataSource/DataSource.js +++ b/public/pages/CreateMonitor/containers/DataSource/DataSource.js @@ -59,7 +59,7 @@ class DataSource extends Component { ); if (isMinimal) { - return { monitorIndexDisplay }; + return monitorIndexDisplay; } return ( { - constructor(props: DataSourceProps) { +class DataSourceFlyout extends Component { + constructor(props: any) { super(props); this.state = { - performanceResponse: null, - response: null, - formikSnapshot: this.props.values, accordionOpen: false, }; } render() { - const { canCallGetRemoteIndexes, remoteMonitoringEnabled } = this.props; - // @ts-ignore - const { monitor_type, searchType } = this.props.values; - const displayTimeField = - searchType === SEARCH_TYPE.GRAPH && - monitor_type !== MONITOR_TYPE.DOC_LEVEL && - monitor_type !== MONITOR_TYPE.CLUSTER_METRICS; - const monitorIndexDisplay = ( - <> - - - {displayTimeField && ( - <> - - - - )} - - ); - return ( <> { isOpen: this.state.accordionOpen, onToggle: () => {this.setState({accordionOpen: !this.state.accordionOpen})}, title: 'Data Source', - subTitle: `Index: [${this.state.formikSnapshot.index.map((index: {label: string} )=> index.label).join(",")}], timeField: ${this.state.formikSnapshot.timeField}` + subTitle: `Index: [${this.props.formik.values.index.map((index: {label: string} )=> index.label).join(",")}], timeField: ${this.props.formik.values.timeField}` , }} > - {monitorIndexDisplay} + ); } } -DataSourceFlyout.propTypes = propTypes; -DataSourceFlyout.defaultProps = defaultProps; - -export default DataSourceFlyout; +export default connect(DataSourceFlyout);