diff --git a/public/components/FormControls/FormikInputWrapper/FormikInputWrapper.js b/public/components/FormControls/FormikInputWrapper/FormikInputWrapper.js index 1ee3f3cc..33c3a10d 100644 --- a/public/components/FormControls/FormikInputWrapper/FormikInputWrapper.js +++ b/public/components/FormControls/FormikInputWrapper/FormikInputWrapper.js @@ -18,7 +18,9 @@ import PropTypes from 'prop-types'; import { Field } from 'formik'; const FormikInputWrapper = ({ name, fieldProps, render }) => ( - render({ field, form })} /> + + {({ field, form }) => render({ field, form })} + ); FormikInputWrapper.propTypes = { diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/MonitorExpressions.test.js b/public/pages/CreateMonitor/components/MonitorExpressions/MonitorExpressions.test.js index 79264bdb..ddda5275 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/MonitorExpressions.test.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/MonitorExpressions.test.js @@ -23,10 +23,9 @@ import MonitorExpressions from './MonitorExpressions'; describe('MonitorExpressions', () => { test('renders', () => { const component = ( - {}} dataTypes={[]} ofEnabled={false} />} - /> + + {() => {}} dataTypes={[]} ofEnabled={false} />} + ); expect(render(component)).toMatchSnapshot(); diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/ForExpression.test.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/ForExpression.test.js index 0ba8bbe3..c67f5df8 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/ForExpression.test.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/ForExpression.test.js @@ -24,9 +24,8 @@ import { DEFAULT_CLOSED_STATES } from '../MonitorExpressions'; describe('ForExpression', () => { test('renders', () => { const component = ( - ( + + {(props) => ( { closeExpression={() => {}} /> )} - /> + ); expect(render(component)).toMatchSnapshot(); diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/OfExpression.test.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/OfExpression.test.js index 146b6866..2acb29ba 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/OfExpression.test.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/OfExpression.test.js @@ -24,9 +24,8 @@ import { DEFAULT_CLOSED_STATES } from '../MonitorExpressions'; describe('OfExpression', () => { test('renders', () => { const component = ( - ( + + {(props) => ( { dataTypes={[]} /> )} - /> + ); expect(render(component)).toMatchSnapshot(); diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/OverExpression.test.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/OverExpression.test.js index 18fda09d..920376d3 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/OverExpression.test.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/OverExpression.test.js @@ -24,9 +24,8 @@ import { DEFAULT_CLOSED_STATES } from '../MonitorExpressions'; describe('OverExpression', () => { test('renders', () => { const component = ( - ( + + {(props) => ( { closeExpression={() => {}} /> )} - /> + ); expect(render(component)).toMatchSnapshot(); diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhenExpression.test.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhenExpression.test.js index a62f07cf..8d192d9e 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhenExpression.test.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhenExpression.test.js @@ -24,9 +24,8 @@ import { DEFAULT_CLOSED_STATES } from '../MonitorExpressions'; describe('WhenExpression', () => { test('renders', () => { const component = ( - ( + + {(props) => ( { closeExpression={() => {}} /> )} - /> + ); expect(render(component)).toMatchSnapshot(); diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhereExpression.test.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhereExpression.test.js index 2adca2d3..e3d00eec 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhereExpression.test.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhereExpression.test.js @@ -31,9 +31,8 @@ const dataTypes = { const openExpression = jest.fn(); const closeExpression = jest.fn(); const getMountWrapper = (state = false) => ( - ( + + {(props) => ( ( onMadeChanges={jest.fn()} /> )} - /> + ); describe('WhereExpression', () => { diff --git a/public/pages/CreateMonitor/components/Schedule/Frequencies/Daily.js b/public/pages/CreateMonitor/components/Schedule/Frequencies/Daily.js index 514ba6df..9034e2fd 100644 --- a/public/pages/CreateMonitor/components/Schedule/Frequencies/Daily.js +++ b/public/pages/CreateMonitor/components/Schedule/Frequencies/Daily.js @@ -22,9 +22,8 @@ import TimezoneComboBox from './TimezoneComboBox'; const Daily = () => ( - + {({ field: { value, onChange, onBlur, ...rest }, form: { touched, errors, setFieldValue }, }) => ( @@ -32,10 +31,8 @@ const Daily = () => ( { + selected={moment().hours(value).minutes(0)} + onChange={(date) => { setFieldValue('daily', date.hours()); }} dateFormat="hh:mm A" @@ -44,7 +41,7 @@ const Daily = () => ( /> )} - /> + diff --git a/public/pages/CreateMonitor/components/Schedule/Frequencies/Weekly.js b/public/pages/CreateMonitor/components/Schedule/Frequencies/Weekly.js index f195e968..bb2c3469 100644 --- a/public/pages/CreateMonitor/components/Schedule/Frequencies/Weekly.js +++ b/public/pages/CreateMonitor/components/Schedule/Frequencies/Weekly.js @@ -28,7 +28,7 @@ const checkboxFlexItem = (day, checked, setFieldValue, setFieldTouched) => ( id={day} label={_.startCase(day)} checked={checked} - onChange={e => { + onChange={(e) => { setFieldValue(`weekly.${day}`, e.target.checked); }} onBlur={() => setFieldTouched('weekly')} @@ -37,17 +37,15 @@ const checkboxFlexItem = (day, checked, setFieldValue, setFieldTouched) => ( ); -const validate = value => { +const validate = (value) => { const booleans = Object.values(value); - if (!booleans.some(bool => bool)) return 'Must select at least one weekday'; + if (!booleans.some((bool) => bool)) return 'Must select at least one weekday'; }; const Weekly = () => ( - ( + + {({ field: { value }, form: { touched, errors, setFieldValue, setFieldTouched } }) => ( ( style={{ paddingLeft: '10px', marginTop: '5px' }} > - {days.map(day => checkboxFlexItem(day, value[day], setFieldValue, setFieldTouched))} + {days.map((day) => checkboxFlexItem(day, value[day], setFieldValue, setFieldTouched))} )} - /> + ); diff --git a/public/pages/CreateMonitor/containers/AnomalyDetectors/__tests__/AnomalyDetector.test.js b/public/pages/CreateMonitor/containers/AnomalyDetectors/__tests__/AnomalyDetector.test.js index a03cc304..5bd11a26 100644 --- a/public/pages/CreateMonitor/containers/AnomalyDetectors/__tests__/AnomalyDetector.test.js +++ b/public/pages/CreateMonitor/containers/AnomalyDetectors/__tests__/AnomalyDetector.test.js @@ -29,12 +29,11 @@ const renderEmptyMessage = jest.fn(); function getMountWrapper() { return mount( - ( + + {({ values }) => ( )} - /> + ); } diff --git a/public/pages/CreateMonitor/containers/AnomalyDetectors/__tests__/__snapshots__/AnomalyDetector.test.js.snap b/public/pages/CreateMonitor/containers/AnomalyDetectors/__tests__/__snapshots__/AnomalyDetector.test.js.snap index 9ad6afe6..a89b7263 100644 --- a/public/pages/CreateMonitor/containers/AnomalyDetectors/__tests__/__snapshots__/AnomalyDetector.test.js.snap +++ b/public/pages/CreateMonitor/containers/AnomalyDetectors/__tests__/__snapshots__/AnomalyDetector.test.js.snap @@ -53,7 +53,6 @@ exports[`AnomalyDetectors renders 1`] = ` }, } } - render={[Function]} > - ( + + {({ values, errors, handleSubmit, isSubmitting, isValid }) => (

{edit ? 'Edit' : 'Create'} monitor

@@ -182,7 +179,7 @@ export default class CreateMonitor extends Component { />
)} - /> +
); } diff --git a/public/pages/CreateMonitor/containers/CreateMonitor/__snapshots__/CreateMonitor.test.js.snap b/public/pages/CreateMonitor/containers/CreateMonitor/__snapshots__/CreateMonitor.test.js.snap index af59115e..59ec5a38 100644 --- a/public/pages/CreateMonitor/containers/CreateMonitor/__snapshots__/CreateMonitor.test.js.snap +++ b/public/pages/CreateMonitor/containers/CreateMonitor/__snapshots__/CreateMonitor.test.js.snap @@ -61,8 +61,9 @@ exports[`CreateMonitor renders 1`] = ` } } onSubmit={[Function]} - render={[Function]} validateOnChange={false} - /> + > + +
`; diff --git a/public/pages/CreateMonitor/containers/MonitorIndex/MonitorIndex.test.js b/public/pages/CreateMonitor/containers/MonitorIndex/MonitorIndex.test.js index 78d02f6d..746ba719 100644 --- a/public/pages/CreateMonitor/containers/MonitorIndex/MonitorIndex.test.js +++ b/public/pages/CreateMonitor/containers/MonitorIndex/MonitorIndex.test.js @@ -31,10 +31,9 @@ const runAllPromises = () => new Promise(setImmediate); function getMountWrapper(customProps = {}) { return mount( - } - /> + + {() => } + ); } diff --git a/public/pages/CreateMonitor/containers/MonitorIndex/__snapshots__/MonitorIndex.test.js.snap b/public/pages/CreateMonitor/containers/MonitorIndex/__snapshots__/MonitorIndex.test.js.snap index e5c9a89c..f7ce8dce 100644 --- a/public/pages/CreateMonitor/containers/MonitorIndex/__snapshots__/MonitorIndex.test.js.snap +++ b/public/pages/CreateMonitor/containers/MonitorIndex/__snapshots__/MonitorIndex.test.js.snap @@ -53,7 +53,6 @@ exports[`MonitorIndex renders 1`] = ` }, } } - render={[Function]} > () => 'test function getRenderWrapper(customProps = {}) { return render( - ( + + {() => ( )} - /> + ); } diff --git a/public/pages/CreateTrigger/components/TriggerExpressions/TriggerExpressions.js b/public/pages/CreateTrigger/components/TriggerExpressions/TriggerExpressions.js index 2c69c8c6..1fbf4c83 100644 --- a/public/pages/CreateTrigger/components/TriggerExpressions/TriggerExpressions.js +++ b/public/pages/CreateTrigger/components/TriggerExpressions/TriggerExpressions.js @@ -67,9 +67,8 @@ class TriggerExpressions extends Component { }} > - ( + + {({ field: { onBlur, ...rest }, form: { touched, errors } }) => ( )} - /> + - ( + + {({ field, form: { touched, errors } }) => ( )} - /> +
diff --git a/public/pages/CreateTrigger/components/TriggerExpressions/TriggerExpressions.test.js b/public/pages/CreateTrigger/components/TriggerExpressions/TriggerExpressions.test.js index 903051e1..b4ab3d5b 100644 --- a/public/pages/CreateTrigger/components/TriggerExpressions/TriggerExpressions.test.js +++ b/public/pages/CreateTrigger/components/TriggerExpressions/TriggerExpressions.test.js @@ -32,7 +32,7 @@ describe('TriggerExpressions', () => { }); test('calls openExpression when clicking expression', () => { - const wrapper = mount( } />); + const wrapper = mount( } />); const openExpression = jest.spyOn( wrapper.find(TriggerExpressions).instance(), 'openExpression' @@ -48,7 +48,7 @@ describe('TriggerExpressions', () => { }); test('calls closeExpression when closing popover', async () => { - const wrapper = mount( } />); + const wrapper = mount( } />); const openExpression = jest.spyOn( wrapper.find(TriggerExpressions).instance(), 'openExpression' diff --git a/public/pages/CreateTrigger/components/TriggerExpressions/__snapshots__/TriggerExpressions.test.js.snap b/public/pages/CreateTrigger/components/TriggerExpressions/__snapshots__/TriggerExpressions.test.js.snap index 16c0a825..35abc84b 100644 --- a/public/pages/CreateTrigger/components/TriggerExpressions/__snapshots__/TriggerExpressions.test.js.snap +++ b/public/pages/CreateTrigger/components/TriggerExpressions/__snapshots__/TriggerExpressions.test.js.snap @@ -59,9 +59,9 @@ exports[`TriggerExpressions renders 1`] = ` } } > - + + + - + + + diff --git a/public/pages/CreateTrigger/components/TriggerQuery/TriggerQuery.js b/public/pages/CreateTrigger/components/TriggerQuery/TriggerQuery.js index 8fadfd97..f7399ab0 100644 --- a/public/pages/CreateTrigger/components/TriggerQuery/TriggerQuery.js +++ b/public/pages/CreateTrigger/components/TriggerQuery/TriggerQuery.js @@ -31,7 +31,7 @@ import 'brace/snippets/javascript'; import 'brace/ext/language_tools'; import { formikToTrigger } from '../../containers/CreateTrigger/utils/formikToTrigger'; -export const getExecuteMessage = response => { +export const getExecuteMessage = (response) => { if (!response) return 'No response'; const triggerResults = _.get(response, 'trigger_results'); if (!triggerResults) return 'No trigger results'; @@ -70,12 +70,8 @@ const TriggerQuery = ({ - ( + + {({ field: { value }, form: { errors, touched, setFieldValue, setFieldTouched } }) => ( @@ -101,7 +97,7 @@ const TriggerQuery = ({ theme={isDarkMode ? 'sense-dark' : 'github'} height="200px" width="100%" - onChange={source => { + onChange={(source) => { setFieldValue('script.source', source); }} onBlur={() => setFieldTouched('script.source', true)} @@ -109,7 +105,7 @@ const TriggerQuery = ({ /> )} - /> + diff --git a/public/pages/CreateTrigger/components/TriggerQuery/__snapshots__/TriggerQuery.test.js.snap b/public/pages/CreateTrigger/components/TriggerQuery/__snapshots__/TriggerQuery.test.js.snap index 2b174ed9..c8bc024b 100644 --- a/public/pages/CreateTrigger/components/TriggerQuery/__snapshots__/TriggerQuery.test.js.snap +++ b/public/pages/CreateTrigger/components/TriggerQuery/__snapshots__/TriggerQuery.test.js.snap @@ -35,8 +35,9 @@ exports[`TriggerQuery renders 1`] = ` + > + + {this.renderSuccessCallOut()} - ( + + {({ values, handleSubmit, isSubmitting, errors, isValid }) => (

{edit ? 'Edit' : 'Create'} trigger

@@ -217,10 +214,8 @@ export default class CreateTrigger extends Component { isDarkMode={this.props.isDarkMode} /> - ( + + {(arrayHelpers) => ( )} - /> + @@ -255,7 +250,7 @@ export default class CreateTrigger extends Component { />
)} - /> +
); } diff --git a/public/pages/Destinations/components/createDestinations/CustomWebhook/HeaderParamsEditor.js b/public/pages/Destinations/components/createDestinations/CustomWebhook/HeaderParamsEditor.js index 6b384d02..acdf7c97 100644 --- a/public/pages/Destinations/components/createDestinations/CustomWebhook/HeaderParamsEditor.js +++ b/public/pages/Destinations/components/createDestinations/CustomWebhook/HeaderParamsEditor.js @@ -63,13 +63,11 @@ const propTypes = { const HeaderParamsEditor = ({ type, headerParams }) => ( Header information} description={''} /> - ( + + {(arrayHelpers) => ( arrayHelpers.push({ key: '', value: '' })} - onRemove={index => index !== 0 && arrayHelpers.remove(index)} + onRemove={(index) => index !== 0 && arrayHelpers.remove(index)} items={headerParams} name={`${type}.headerParams`} addButtonText="Add header" @@ -78,7 +76,7 @@ const HeaderParamsEditor = ({ type, headerParams }) => ( onRenderValueField={handleRenderValueField} /> )} - /> + ); diff --git a/public/pages/Destinations/components/createDestinations/CustomWebhook/QueryParamsEditor.js b/public/pages/Destinations/components/createDestinations/CustomWebhook/QueryParamsEditor.js index e84fdd6d..46b133ed 100644 --- a/public/pages/Destinations/components/createDestinations/CustomWebhook/QueryParamsEditor.js +++ b/public/pages/Destinations/components/createDestinations/CustomWebhook/QueryParamsEditor.js @@ -61,14 +61,12 @@ const propTypes = { }; const QueryParamsEditor = ({ type, queryParams, isEnabled = true }) => ( - ( + + {(arrayHelpers) => ( arrayHelpers.push({ key: '', value: '' })} - onRemove={index => arrayHelpers.remove(index)} + onRemove={(index) => arrayHelpers.remove(index)} items={queryParams} name={`${type}.queryParams`} addButtonText="Add parameter" @@ -78,7 +76,7 @@ const QueryParamsEditor = ({ type, queryParams, isEnabled = true }) => ( isEnabled={isEnabled} /> )} - /> + ); QueryParamsEditor.propTypes = propTypes; diff --git a/public/pages/Destinations/containers/CreateDestination/CreateDestination.js b/public/pages/Destinations/containers/CreateDestination/CreateDestination.js index 9d0a3928..008a9538 100644 --- a/public/pages/Destinations/containers/CreateDestination/CreateDestination.js +++ b/public/pages/Destinations/containers/CreateDestination/CreateDestination.js @@ -180,7 +180,8 @@ class CreateDestination extends React.Component { enableReinitialize={true} validateOnChange={false} onSubmit={this.handleSubmit} - render={({ values, handleSubmit, isSubmitting, errors, isValid }) => ( + > + {({ values, handleSubmit, isSubmitting, errors, isValid }) => (

{edit ? 'Edit' : 'Add'} destination

@@ -269,7 +270,7 @@ class CreateDestination extends React.Component { />
)} - /> +
); } diff --git a/public/pages/Destinations/containers/CreateDestination/ManageEmailGroups/ManageEmailGroups.js b/public/pages/Destinations/containers/CreateDestination/ManageEmailGroups/ManageEmailGroups.js index 1314ca44..b4e7e702 100644 --- a/public/pages/Destinations/containers/CreateDestination/ManageEmailGroups/ManageEmailGroups.js +++ b/public/pages/Destinations/containers/CreateDestination/ManageEmailGroups/ManageEmailGroups.js @@ -267,7 +267,8 @@ export default class ManageEmailGroups extends React.Component { this.processEmailGroups(values).then(() => onClickSave()); }} validateOnChange={false} - render={({ values, handleSubmit, isSubmitting }) => ( + > + {({ values, handleSubmit, isSubmitting }) => ( - + + {(arrayHelpers) => !isEmailAllowed || loadingEmailGroups ? (
{isEmailAllowed ? 'Loading Email Groups...' : 'Email is disallowed'} @@ -293,7 +292,7 @@ export default class ManageEmailGroups extends React.Component { this.renderEmailGroups({ values, arrayHelpers }) ) } - /> + {this.hasEmailGroupsToProcess(values) ? ( @@ -316,7 +315,7 @@ export default class ManageEmailGroups extends React.Component { )} - /> + ) : null; } } diff --git a/public/pages/Destinations/containers/CreateDestination/ManageEmailGroups/__snapshots__/ManageEmailGroups.test.js.snap b/public/pages/Destinations/containers/CreateDestination/ManageEmailGroups/__snapshots__/ManageEmailGroups.test.js.snap index ccd3af84..3cbc5841 100644 --- a/public/pages/Destinations/containers/CreateDestination/ManageEmailGroups/__snapshots__/ManageEmailGroups.test.js.snap +++ b/public/pages/Destinations/containers/CreateDestination/ManageEmailGroups/__snapshots__/ManageEmailGroups.test.js.snap @@ -21,7 +21,6 @@ exports[`ManageEmailGroups renders when email is disallowed 1`] = ` @@ -556,7 +555,6 @@ exports[`ManageEmailGroups renders when email is disallowed 1`] = ` >
@@ -1245,7 +1241,6 @@ exports[`ManageEmailGroups renders when visible 1`] = ` >
onClickSave()); }} validateOnChange={false} - render={({ values, handleSubmit, isSubmitting }) => ( + > + {({ values, handleSubmit, isSubmitting }) => ( - + + {(arrayHelpers) => !isEmailAllowed || loadingSenders ? (
{isEmailAllowed ? 'Loading Senders...' : 'Email is disallowed'} @@ -281,7 +280,7 @@ export default class ManageSenders extends React.Component { this.renderSenders({ values, arrayHelpers }) ) } - /> + {this.hasSendersToProcess(values) ? ( @@ -304,7 +303,7 @@ export default class ManageSenders extends React.Component { )} - /> + ) : null; } } diff --git a/public/pages/Destinations/containers/CreateDestination/ManageSenders/__snapshots__/ManageSenders.test.js.snap b/public/pages/Destinations/containers/CreateDestination/ManageSenders/__snapshots__/ManageSenders.test.js.snap index 2ee04789..a5ceaa4c 100644 --- a/public/pages/Destinations/containers/CreateDestination/ManageSenders/__snapshots__/ManageSenders.test.js.snap +++ b/public/pages/Destinations/containers/CreateDestination/ManageSenders/__snapshots__/ManageSenders.test.js.snap @@ -21,7 +21,6 @@ exports[`ManageSenders renders when email is disallowed 1`] = ` @@ -556,7 +555,6 @@ exports[`ManageSenders renders when email is disallowed 1`] = ` >
@@ -1245,7 +1241,6 @@ exports[`ManageSenders renders when visible 1`] = ` >