diff --git a/frontend/lib/js/AppRoot.js b/frontend/lib/js/AppRoot.js index c35ccabbf4..502d9b77a1 100644 --- a/frontend/lib/js/AppRoot.js +++ b/frontend/lib/js/AppRoot.js @@ -1,20 +1,20 @@ // @flow + import React from 'react'; -import PropTypes from 'prop-types'; import { Provider } from 'react-redux'; import { hot } from 'react-hot-loader' import AppRouter from './app/AppRouter'; -const AppRoot = ({store, browserHistory}) => ( +type PropsType = { + store: Object, + browserHistory: Object +}; + +const AppRoot = ({ store, browserHistory }: PropsType) => ( ); -AppRoot.propTypes = { - store: PropTypes.object.isRequired, - browserHistory: PropTypes.object.isRequired, -}; - export default hot(module)(AppRoot); diff --git a/frontend/lib/js/form-components/EditableTags.js b/frontend/lib/js/form-components/EditableTags.js index 79a1f00c00..dae26f8eed 100644 --- a/frontend/lib/js/form-components/EditableTags.js +++ b/frontend/lib/js/form-components/EditableTags.js @@ -1,11 +1,23 @@ -import React from 'react'; -import PropTypes from 'prop-types'; +// @flow + +import * as React from 'react'; import classnames from 'classnames'; import { Tags } from '../tags'; import EditableTagsForm from './EditableTagsForm'; -const EditableTags = (props) => { +type PropsType = { + className: string, + tags?: string[], + editing: boolean, + loading: boolean, + tagComponent?: React.Node, + onSubmit: () => void, + onToggleEdit: () => void, + availableTags: string[] +}; + +const EditableTags = (props: PropsType) => { return props.editing ? { ; }; -EditableTags.propTypes = { - className: PropTypes.string, - tags: PropTypes.arrayOf(PropTypes.string), - editing: PropTypes.bool.isRequired, - loading: PropTypes.bool.isRequired, - tagComponent: PropTypes.element, - onSubmit: PropTypes.func.isRequired, - onToggleEdit: PropTypes.func.isRequired, - availableTags: PropTypes.arrayOf(PropTypes.string), -} - export default EditableTags; diff --git a/frontend/lib/js/form-components/EditableTagsForm.js b/frontend/lib/js/form-components/EditableTagsForm.js index 3d8c2b5f52..2a644f09f9 100644 --- a/frontend/lib/js/form-components/EditableTagsForm.js +++ b/frontend/lib/js/form-components/EditableTagsForm.js @@ -1,5 +1,6 @@ +// @flow + import React from 'react'; -import PropTypes from 'prop-types'; import T from 'i18n-react'; import classnames from 'classnames'; import clickOutside from 'react-onclickoutside'; @@ -7,8 +8,17 @@ import clickOutside from 'react-onclickoutside'; // A multi-select where new items can be created import { Creatable as Select} from 'react-select'; -class EditableTagsForm extends React.Component { - constructor(props) { +type PropsType = { + className?: string, + tags?: string[], + loading: boolean, + onSubmit: () => void, + onCancel: () => void, + availableTags?: string[], +}; + +class EditableTagsForm extends React.Component { + constructor(props: PropsType) { super(props); this.state = { values: (props.tags && props.tags.map(t => ({ label: t, value: t}))) || [] @@ -61,13 +71,4 @@ class EditableTagsForm extends React.Component { } }; -EditableTagsForm.propTypes = { - className: PropTypes.string, - tags: PropTypes.arrayOf(PropTypes.string), - loading: PropTypes.bool.isRequired, - onSubmit: PropTypes.func.isRequired, - onCancel: PropTypes.func.isRequired, - availableTags: PropTypes.arrayOf(PropTypes.string), -}; - export default clickOutside(EditableTagsForm); diff --git a/frontend/lib/js/form-components/EditableText.js b/frontend/lib/js/form-components/EditableText.js index 740f89f36b..ea0c2b9593 100644 --- a/frontend/lib/js/form-components/EditableText.js +++ b/frontend/lib/js/form-components/EditableText.js @@ -1,10 +1,21 @@ +// @flow + import React from 'react'; -import PropTypes from 'prop-types'; import { SelectableLabel } from '../selectable-label'; import EditableTextForm from './EditableTextForm'; -class EditableText extends React.Component { +type PropsType = { + className?: string, + loading: boolean, + editing: boolean, + text: string, + selectTextOnMount: boolean, + onSubmit: () => void, + onToggleEdit: () => void, +}; + +class EditableText extends React.Component { render() { return this.props.editing ? { +type PropsType = { + search: string[], + onSearch: string => void, + onChange: () => void, + onClearQuery: () => void, + options: string[], + isMulti: boolean, + searchResult: Object, + datasetId: string, + searchConfig: Object +}; + +const SearchBox = (props: PropsType) => { const { searchResult, searchConfig } = props; return props.isMulti @@ -82,16 +95,4 @@ const SearchBox = (props) => { }; -SearchBox.propTypes = { - search: PropTypes.arrayOf(PropTypes.string), - onSearch: PropTypes.func.isRequired, - onChange: PropTypes.func, - onClearQuery: PropTypes.func, - options: PropTypes.arrayOf(PropTypes.string), - isMulti: PropTypes.bool, - searchResult: PropTypes.object, - datasetId: PropTypes.string, - searchConfig: PropTypes.object -}; - export default SearchBox; diff --git a/frontend/lib/js/form-components/VerticalToggleButton.js b/frontend/lib/js/form-components/VerticalToggleButton.js index ef6a2a13df..60f031d437 100644 --- a/frontend/lib/js/form-components/VerticalToggleButton.js +++ b/frontend/lib/js/form-components/VerticalToggleButton.js @@ -1,8 +1,18 @@ +// @flow + import React from 'react'; -import PropTypes from 'prop-types'; import classnames from 'classnames'; -const VerticalToggleButton = (props) => { +type PropsType = { + onToggle: string => void, + activeValue: string, + options: { + label: string, + value: string, + }[] +}; + +const VerticalToggleButton = (props: PropsType) => { return (

{ @@ -28,13 +38,4 @@ const VerticalToggleButton = (props) => { ); }; -VerticalToggleButton.propTypes = { - onToggle: PropTypes.func.isRequired, - activeValue: PropTypes.string.isRequired, - options: PropTypes.arrayOf(PropTypes.shape({ - label: PropTypes.string, - value: PropTypes.string, - })).isRequired, -}; - export default VerticalToggleButton; diff --git a/frontend/lib/js/header/Header.js b/frontend/lib/js/header/Header.js index 4a8654f099..c09184527d 100644 --- a/frontend/lib/js/header/Header.js +++ b/frontend/lib/js/header/Header.js @@ -1,9 +1,15 @@ +// @flow + import React from 'react'; -import PropTypes from 'prop-types'; import T from 'i18n-react'; import { connect } from 'react-redux'; -class Header extends React.Component { +type PropsType = { + version: string, + isDevelopment: boolean, +}; + +class Header extends React.Component { render() { return (

@@ -24,11 +30,6 @@ class Header extends React.Component { } } -Header.propTypes = { - version: PropTypes.string, - isDevelopment: PropTypes.bool -}; - const mapStateToProps = (state, ownProps) => { return { version: state.startup.config.version || '', diff --git a/frontend/lib/js/previous-queries/delete-modal/DeletePreviousQueryModal.js b/frontend/lib/js/previous-queries/delete-modal/DeletePreviousQueryModal.js index 5b6a854ba3..6448701c74 100644 --- a/frontend/lib/js/previous-queries/delete-modal/DeletePreviousQueryModal.js +++ b/frontend/lib/js/previous-queries/delete-modal/DeletePreviousQueryModal.js @@ -1,5 +1,6 @@ +// @flow + import React from 'react'; -import PropTypes from 'prop-types'; import T from 'i18n-react'; import { connect } from 'react-redux'; @@ -11,8 +12,13 @@ import { deletePreviousQueryModalClose, } from './actions'; +type PropsType = { + queryId: string | number, + onCloseModal: () => void, + onDeletePreviousQuery: () => void, +}; -const DeletePreviousQueryModal = (props) => { +const DeletePreviousQueryModal = (props: PropsType) => { return !!props.queryId && (
@@ -36,12 +42,6 @@ const DeletePreviousQueryModal = (props) => { ); }; -DeletePreviousQueryModal.propTypes = { - queryId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), - onCloseModal: PropTypes.func.isRequired, - onDeletePreviousQuery: PropTypes.func.isRequired, -}; - const mapStateToProps = (state) => ({ queryId: state.deletePreviousQueryModal.queryId, }); diff --git a/frontend/lib/js/previous-queries/list/PreviousQueries.js b/frontend/lib/js/previous-queries/list/PreviousQueries.js index febc0b33f1..4965fd5e26 100644 --- a/frontend/lib/js/previous-queries/list/PreviousQueries.js +++ b/frontend/lib/js/previous-queries/list/PreviousQueries.js @@ -1,21 +1,21 @@ +// @flow + import React, { Component } from 'react'; -import PropTypes from 'prop-types' import T from 'i18n-react'; import ReactList from 'react-list'; import { ErrorMessage } from '../../error-message'; import PreviousQuery from './PreviousQuery'; +type PropsType = { + datasetId: string, + queries: [], + loading: boolean, + error: string, + loadQueries: () => void, +}; -class PreviousQueries extends Component { - static propTypes = { - datasetId: PropTypes.string, - queries: PropTypes.array.isRequired, - loading: PropTypes.bool, - error: PropTypes.string, - loadQueries: PropTypes.func.isRequired, - } - +class PreviousQueries extends Component { componentDidMount() { this.props.loadQueries(); } diff --git a/frontend/lib/js/previous-queries/list/PreviousQueriesContainer.js b/frontend/lib/js/previous-queries/list/PreviousQueriesContainer.js index f5c7f0fc80..75996314f1 100644 --- a/frontend/lib/js/previous-queries/list/PreviousQueriesContainer.js +++ b/frontend/lib/js/previous-queries/list/PreviousQueriesContainer.js @@ -1,12 +1,21 @@ +// @flow + import React from 'react'; -import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { loadPreviousQueries } from './actions'; import { selectPreviousQueries } from './selector'; import PreviousQueries from './PreviousQueries'; -const PreviousQueriesContainer = (props) => { +type PropsType = { + datasetId: string, + queries: [], + loading: boolean, + error: string, + loadQueries: () => void, +} + +const PreviousQueriesContainer = (props: PropsType) => { return ( { ); }; -PreviousQueriesContainer.propTypes = { - datasetId: PropTypes.string.isRequired, - queries: PropTypes.array.isRequired, - loading: PropTypes.bool, - error: PropTypes.string, - loadQueries: PropTypes.func.isRequired, -}; - const mapStateToProps = (state) => ({ queries: selectPreviousQueries( state.previousQueries.queries, diff --git a/frontend/lib/js/previous-queries/list/PreviousQuery.js b/frontend/lib/js/previous-queries/list/PreviousQuery.js index 5196f80fa8..d6f4e7c696 100644 --- a/frontend/lib/js/previous-queries/list/PreviousQuery.js +++ b/frontend/lib/js/previous-queries/list/PreviousQuery.js @@ -1,12 +1,12 @@ +// @flow + import React from 'react'; -import PropTypes from 'prop-types'; import T from 'i18n-react'; import { DragSource } from 'react-dnd'; import { connect } from 'react-redux'; import moment from 'moment'; import classnames from 'classnames'; - import { ErrorMessage } from '../../error-message'; import { dndTypes } from '../../common/constants'; import { SelectableLabel } from '../../selectable-label'; @@ -58,7 +58,28 @@ function collect(connect, monitor) { }; } -const PreviousQuery = (props) => { +type PropsType = { + query: { + id: number | string, + label: string, + loading: boolean, + numberOfResults: number, + createdAt: string, + tags: string[], + own: boolean, + shared: boolean, + }, + onRenamePreviousQuery: () => void, + onToggleEditPreviousQueryLabel: () => void, + onToggleEditPreviousQueryTags: () => void, + onToggleSharePreviousQuery: () => void, + onRetagPreviousQuery: () => void, + onDeletePreviousQuery: () => void, + connectDragSource: () => void, + availableTags: string[], +}; + +const PreviousQuery = (props: PropsType) => { const { query, onRenamePreviousQuery, @@ -178,27 +199,6 @@ const PreviousQuery = (props) => { return isNotEditing ? props.connectDragSource(content) : content; }; -PreviousQuery.propTypes = { - query: PropTypes.shape({ - id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired, - label: PropTypes.string, - loading: PropTypes.bool, - numberOfResults: PropTypes.number.isRequired, - createdAt: PropTypes.string.isRequired, - tags: PropTypes.arrayOf(PropTypes.string), - own: PropTypes.bool, - shared: PropTypes.bool, - }).isRequired, - onRenamePreviousQuery: PropTypes.func.isRequired, - onToggleEditPreviousQueryLabel: PropTypes.func.isRequired, - onToggleEditPreviousQueryTags: PropTypes.func.isRequired, - onToggleSharePreviousQuery: PropTypes.func.isRequired, - onRetagPreviousQuery: PropTypes.func.isRequired, - onDeletePreviousQuery: PropTypes.func.isRequired, - connectDragSource: PropTypes.func.isRequired, - availableTags: PropTypes.arrayOf(PropTypes.string), -}; - const mapStateToProps = (state) => ({ availableTags: state.previousQueries.tags, }); diff --git a/frontend/lib/js/previous-queries/list/PreviousQueryError.js b/frontend/lib/js/previous-queries/list/PreviousQueryError.js index 59bd119324..4adb2bdee5 100644 --- a/frontend/lib/js/previous-queries/list/PreviousQueryError.js +++ b/frontend/lib/js/previous-queries/list/PreviousQueryError.js @@ -1,7 +1,14 @@ +// @flow + import React from 'react'; -import PropTypes from 'prop-types'; -const PreviousQueryError = (props) => { +type PropsType = { + query: { + error: string, + } +}; + +const PreviousQueryError = (props: PropsType) => { return !!props.query.error && (
{props.query.error} @@ -9,10 +16,4 @@ const PreviousQueryError = (props) => { ); }; -PreviousQueryError.propTypes = { - query: PropTypes.shape({ - error: PropTypes.string, - }).isRequired -}; - export default PreviousQueryError; diff --git a/frontend/lib/js/query-group-modal/QueryGroupModal.js b/frontend/lib/js/query-group-modal/QueryGroupModal.js index db64729804..059fdd6c6a 100644 --- a/frontend/lib/js/query-group-modal/QueryGroupModal.js +++ b/frontend/lib/js/query-group-modal/QueryGroupModal.js @@ -1,7 +1,6 @@ // @flow import React from 'react'; -import PropTypes from 'prop-types'; import classnames from 'classnames'; import T from 'i18n-react'; import { connect } from 'react-redux'; @@ -44,7 +43,17 @@ const getGroupDate = (dateRange, minOrMax) => const getTouched = (touched, minOrMax) => touched && touched[minOrMax] ? touched[minOrMax] : false -const QueryGroupModal = (props) => { +type PropsType = { + group: Object, + andIdx: number, + onCloseModal: () => void, + onSetMinDate: () => void, + onSetMaxDate: () => void, + onResetAllDates: () => void, + onSetTouched: () => void, +}; + +const QueryGroupModal = (props: PropsType) => { if (!props.group) return null; const min = 'min'; @@ -191,16 +200,6 @@ const QueryGroupModal = (props) => { ); }; -QueryGroupModal.propTypes = { - group: PropTypes.object, - andIdx: PropTypes.number, - onCloseModal: PropTypes.func.isRequired, - onSetMinDate: PropTypes.func.isRequired, - onSetMaxDate: PropTypes.func.isRequired, - onResetAllDates: PropTypes.func.isRequired, - onSetTouched: PropTypes.func, -}; - function findGroup(query, andIdx) { if (!query[andIdx]) return null; diff --git a/frontend/lib/js/selectable-label/SelectableLabel.js b/frontend/lib/js/selectable-label/SelectableLabel.js index dcef6f9209..3d5dff1f29 100644 --- a/frontend/lib/js/selectable-label/SelectableLabel.js +++ b/frontend/lib/js/selectable-label/SelectableLabel.js @@ -1,9 +1,16 @@ +// @flow + import React from 'react'; -import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import classnames from 'classnames'; -const SelectableLabel = (props) => { +type PropsType = { + className: string, + label: string, + isSelected: boolean, +}; + +const SelectableLabel = (props: PropsType) => { return ( { ); }; -SelectableLabel.propTypes = { - className: PropTypes.string, - label: PropTypes.string.isRequired, - isSelected: PropTypes.bool.isRequired, -}; - const labelContainsAnySearch = (label, searches) => { return searches.some(search => label.toLowerCase().indexOf(search.toLowerCase()) !== -1); } diff --git a/frontend/lib/js/standard-query-editor/QueryClearButton.js b/frontend/lib/js/standard-query-editor/QueryClearButton.js index 1400d6f521..ed63f9fa6a 100644 --- a/frontend/lib/js/standard-query-editor/QueryClearButton.js +++ b/frontend/lib/js/standard-query-editor/QueryClearButton.js @@ -1,5 +1,6 @@ +// @flow + import React from 'react'; -import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import T from 'i18n-react'; @@ -7,7 +8,12 @@ import { IconButton } from '../button'; import { clearQuery } from './actions'; -const QueryClearButton = (props) => { +type PropsType = { + clearQuery: () => void, + isVisible: boolean +}; + +const QueryClearButton = (props: PropsType) => { return props.isVisible && (
{ ); }; -QueryClearButton.propTypes = { - clearQuery: PropTypes.func.isRequired, - isVisible: PropTypes.bool.isRequired -}; - const mapStateToProps = (state) => ({ isVisible: state.panes.right.tabs.queryEditor.query.length !== 0, }); diff --git a/frontend/lib/js/standard-query-editor/QueryGroupActions.js b/frontend/lib/js/standard-query-editor/QueryGroupActions.js index 00dec59e40..e23ef2be20 100644 --- a/frontend/lib/js/standard-query-editor/QueryGroupActions.js +++ b/frontend/lib/js/standard-query-editor/QueryGroupActions.js @@ -1,9 +1,18 @@ +// @flow + import React from 'react'; -import PropTypes from 'prop-types'; import T from 'i18n-react'; import { CloseIconButton } from '../button'; -const QueryGroupActions = (props) => { +type PropsType = { + excludeActiveClass: string, + dateActiveClass: string, + onExcludeClick: () => void, + onDeleteGroup: () => void, + onDateClick: () => void, +}; + +const QueryGroupActions = (props: PropsType) => { return (
@@ -38,12 +47,4 @@ const QueryGroupActions = (props) => { ); }; -QueryGroupActions.propTypes = { - excludeActiveClass: PropTypes.string, - dateActiveClass: PropTypes.string, - onExcludeClick: PropTypes.func.isRequired, - onDeleteGroup: PropTypes.func.isRequired, - onDateClick: PropTypes.func.isRequired, -}; - export default QueryGroupActions; diff --git a/frontend/lib/js/tags/Tag.js b/frontend/lib/js/tags/Tag.js index d21946182d..6bbc812af1 100644 --- a/frontend/lib/js/tags/Tag.js +++ b/frontend/lib/js/tags/Tag.js @@ -1,9 +1,15 @@ +// @flow + import React from 'react'; -import PropTypes from 'prop-types'; import classnames from 'classnames'; +type PropsType = { + label: string, + isSelected: boolean, + onClick: () => void +}; -const Tag = (props) => { +const Tag = (props: PropsType) => { return (

{ ); } -Tag.propTypes = { - label: PropTypes.string.isRequired, - isSelected: PropTypes.bool.isRequired, - onClick: PropTypes.func, -}; - export default Tag; diff --git a/frontend/lib/js/tags/Tags.js b/frontend/lib/js/tags/Tags.js index 59d0eab9e4..8a5bd651a7 100644 --- a/frontend/lib/js/tags/Tags.js +++ b/frontend/lib/js/tags/Tags.js @@ -1,8 +1,18 @@ +// @flow + import React from 'react'; -import PropTypes from 'prop-types'; import Tag from './Tag'; -export const Tags = (props) => { +type PropsType = { + className: string, + tags: { + label: string, + isSelected: boolean, + }[], + onClickTag: (string) => void, +}; + +export const Tags = (props: PropsType) => { return !!props.tags && props.tags.length > 0 && (

{ @@ -19,13 +29,5 @@ export const Tags = (props) => { ); }; -Tags.propTypes = { - className: PropTypes.string, - tags: PropTypes.arrayOf(PropTypes.shape({ - label: PropTypes.string.isRequired, - isSelected: PropTypes.bool, - })), - onClickTag: PropTypes.func.isRequired, -}; export default Tags; diff --git a/frontend/lib/js/timebased-query-editor/TimebasedQueryClearButton.js b/frontend/lib/js/timebased-query-editor/TimebasedQueryClearButton.js index f20cb0acac..2c5342c96d 100644 --- a/frontend/lib/js/timebased-query-editor/TimebasedQueryClearButton.js +++ b/frontend/lib/js/timebased-query-editor/TimebasedQueryClearButton.js @@ -1,12 +1,18 @@ +// @flow + import React from 'react'; -import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import T from 'i18n-react'; import { IconButton } from '../button'; import { clearTimebasedQuery } from './actions'; import { anyConditionFilled } from './helpers'; -const TimebasedQueryClearButton = (props) => { +type PropsType = { + clearQuery: () => void, + isEnabled: boolean, +}; + +const TimebasedQueryClearButton = (props: PropsType) => { return (
{ ); }; -TimebasedQueryClearButton.propTypes = { - clearQuery: PropTypes.func.isRequired, - isEnabled: PropTypes.bool.isRequired, -}; - const mapStateToProps = (state) => ({ isEnabled: state.panes.right.tabs.timebasedQueryEditor.timebasedQuery.conditions.length > 1 || anyConditionFilled(state.panes.right.tabs.timebasedQueryEditor.timebasedQuery), diff --git a/frontend/lib/js/timebased-query-editor/TimebasedQueryEditor.js b/frontend/lib/js/timebased-query-editor/TimebasedQueryEditor.js index 8a72f1b2d2..911ce29499 100644 --- a/frontend/lib/js/timebased-query-editor/TimebasedQueryEditor.js +++ b/frontend/lib/js/timebased-query-editor/TimebasedQueryEditor.js @@ -1,5 +1,6 @@ +// @flow + import React from 'react'; -import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import T from 'i18n-react'; @@ -19,7 +20,22 @@ import { import TimebasedCondition from './TimebasedCondition'; -const TimebasedQueryEditor = (props) => { +type PropsType = { + query: Object, + onDropTimebasedNode: () => void, + onRemoveTimebasedNode: () => void, + onAddTimebasedCondition: () => void, + onRemoveTimebasedCondition: () => void, + onSetTimebasedConditionOperator: () => void, + onSetTimebasedNodeTimestamp: () => void, + onSetTimebasedIndexResult: () => void, + onSetTimebasedConditionMinDays: () => void, + onSetTimebasedConditionMaxDays: () => void, + onSetTimebasedConditionMinDaysOrNoEvent: () => void, + onSetTimebasedConditionMaxDaysOrNoEvent: () => void, +}; + +const TimebasedQueryEditor = (props: PropsType) => { return (
{ @@ -68,21 +84,6 @@ const TimebasedQueryEditor = (props) => { ); }; -TimebasedQueryEditor.propTypes = { - query: PropTypes.object.isRequired, - onDropTimebasedNode: PropTypes.func.isRequired, - onRemoveTimebasedNode: PropTypes.func.isRequired, - onAddTimebasedCondition: PropTypes.func.isRequired, - onRemoveTimebasedCondition: PropTypes.func.isRequired, - onSetTimebasedConditionOperator: PropTypes.func.isRequired, - onSetTimebasedNodeTimestamp: PropTypes.func.isRequired, - onSetTimebasedIndexResult: PropTypes.func.isRequired, - onSetTimebasedConditionMinDays: PropTypes.func.isRequired, - onSetTimebasedConditionMaxDays: PropTypes.func.isRequired, - onSetTimebasedConditionMinDaysOrNoEvent: PropTypes.func.isRequired, - onSetTimebasedConditionMaxDaysOrNoEvent: PropTypes.func.isRequired, -}; - const mapStateToProps = (state) => ({ query: state.panes.right.tabs.timebasedQueryEditor.timebasedQuery diff --git a/frontend/lib/js/timebased-query-editor/TimebasedQueryEditorDropzone.js b/frontend/lib/js/timebased-query-editor/TimebasedQueryEditorDropzone.js index a05307eef2..5d4171e4eb 100644 --- a/frontend/lib/js/timebased-query-editor/TimebasedQueryEditorDropzone.js +++ b/frontend/lib/js/timebased-query-editor/TimebasedQueryEditorDropzone.js @@ -1,5 +1,6 @@ +// @flow + import React from 'react'; -import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import classnames from 'classnames'; import T from 'i18n-react'; @@ -39,7 +40,14 @@ function collect(connect, monitor) { }; } -const TimebasedQueryEditorDropzone = (props) => { +type PropsType = { + isOver: boolean, + onDropNode: () => void, + connectDropTarget: () => void, + onRemoveTimebasedNode: () => void, +}; + +const TimebasedQueryEditorDropzone = (props: PropsType) => { return props.connectDropTarget(
{ }; TimebasedQueryEditorDropzone.propTypes = { - connectDropTarget: PropTypes.func.isRequired, - isOver: PropTypes.bool.isRequired, - onDropNode: PropTypes.func.isRequired, - onRemoveTimebasedNode: PropTypes.func.isRequired, }; const mapDispatchToProps = (dispatch) => ({ diff --git a/frontend/lib/js/tooltip/ActivateTooltip.js b/frontend/lib/js/tooltip/ActivateTooltip.js index 91a26a13b4..c90b5675e0 100644 --- a/frontend/lib/js/tooltip/ActivateTooltip.js +++ b/frontend/lib/js/tooltip/ActivateTooltip.js @@ -1,11 +1,16 @@ +// @flow + import React from 'react'; -import PropTypes from 'prop-types'; import T from 'i18n-react'; import { connect } from 'react-redux'; import { IconButton } from '../button'; import { toggleDisplayTooltip } from './actions'; -const ActivateTooltip = (props) => { +type PropsType = { + toggleDisplayTooltip: () => void, +}; + +const ActivateTooltip = (props: PropsType) => { return (
{ ); }; -ActivateTooltip.propTypes = { - toggleDisplayTooltip: PropTypes.func.isRequired, -}; - const mapDispatchToProps = (dispatch) => ({ toggleDisplayTooltip: () => dispatch(toggleDisplayTooltip()), }); diff --git a/frontend/package.json b/frontend/package.json index 1604e50644..20d51de384 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -36,15 +36,14 @@ "moment": "^2.17.0", "moment-duration-format": "^2.2.2", "mustache": "^2.3.0", - "prop-types": "^15.6.0", "query-string": "^5.1.0", - "react": "^16.2.0", + "react": "^16.8.1", "react-addons-test-utils": "^15.3.1", "react-animated-dots": "^1.0.0", "react-datepicker": "1.6.0", "react-dnd": "^2.5.4", "react-dnd-html5-backend": "^2.5.4", - "react-dom": "^16.2.0", + "react-dom": "^16.8.1", "react-dropzone": "^4.2.8", "react-hot-loader": "^4.6.5", "react-list": "^0.8.0", diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 91f863a227..6f6b0b078e 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -8474,14 +8474,14 @@ react-dom@15.6.1: object-assign "^4.1.0" prop-types "^15.5.10" -react-dom@^16.2.0: - version "16.2.0" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.2.0.tgz#69003178601c0ca19b709b33a83369fe6124c044" +react-dom@^16.8.1: + version "16.8.1" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.8.1.tgz#ec860f98853d09d39bafd3a6f1e12389d283dbb4" dependencies: - fbjs "^0.8.16" loose-envify "^1.1.0" object-assign "^4.1.1" - prop-types "^15.6.0" + prop-types "^15.6.2" + scheduler "^0.13.1" react-dropzone@^4.2.8: version "4.2.9" @@ -8637,14 +8637,14 @@ react@15.6.1: object-assign "^4.1.0" prop-types "^15.5.10" -react@^16.2.0: - version "16.2.0" - resolved "https://registry.yarnpkg.com/react/-/react-16.2.0.tgz#a31bd2dab89bff65d42134fa187f24d054c273ba" +react@^16.8.1: + version "16.8.1" + resolved "https://registry.yarnpkg.com/react/-/react-16.8.1.tgz#ae11831f6cb2a05d58603a976afc8a558e852c4a" dependencies: - fbjs "^0.8.16" loose-envify "^1.1.0" object-assign "^4.1.1" - prop-types "^15.6.0" + prop-types "^15.6.2" + scheduler "^0.13.1" read-pkg-up@^1.0.1: version "1.0.1" @@ -9338,6 +9338,13 @@ sax@^1.2.4, sax@~1.2.1, sax@~1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" +scheduler@^0.13.1: + version "0.13.1" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.1.tgz#1a217df1bfaabaf4f1b92a9127d5d732d85a9591" + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + schema-utils@^0.4.5: version "0.4.7" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-0.4.7.tgz#ba74f597d2be2ea880131746ee17d0a093c68187"