diff --git a/ui/package.json b/ui/package.json index cd03224cfb..168191e038 100644 --- a/ui/package.json +++ b/ui/package.json @@ -153,7 +153,7 @@ "papaparse": "^4.6.3", "prop-types": "^15.6.1", "qs": "^6.5.2", - "react": "^16.8.2", + "react": "^16.11.0", "react-codemirror2": "^4.2.1", "react-copy-to-clipboard": "^5.0.1", "react-datepicker": "^2.1.0", diff --git a/ui/src/dataLoaders/components/verifyStep/ConnectionInformation.tsx b/ui/src/dataLoaders/components/verifyStep/ConnectionInformation.tsx index 91a2ccc472..9af50c287c 100644 --- a/ui/src/dataLoaders/components/verifyStep/ConnectionInformation.tsx +++ b/ui/src/dataLoaders/components/verifyStep/ConnectionInformation.tsx @@ -20,15 +20,15 @@ export interface Props { } @ErrorHandling -class ListeningResults extends PureComponent { +class ConnectionInformation extends PureComponent { public render() { return ( - <> +

{this.header}

{this.additionalText}

- +
) } @@ -70,4 +70,4 @@ class ListeningResults extends PureComponent { } } -export default ListeningResults +export default ConnectionInformation diff --git a/ui/src/shared/components/GetResources.tsx b/ui/src/shared/components/GetResources.tsx index 4d83bcc7e6..3abea5218e 100644 --- a/ui/src/shared/components/GetResources.tsx +++ b/ui/src/shared/components/GetResources.tsx @@ -182,7 +182,7 @@ class GetResources extends PureComponent { loading={remoteDataState} spinnerComponent={} > - <>{children} + {children} ) } diff --git a/ui/src/shared/components/KeyboardShortcuts.test.tsx b/ui/src/shared/components/KeyboardShortcuts.test.tsx deleted file mode 100644 index 48812dd942..0000000000 --- a/ui/src/shared/components/KeyboardShortcuts.test.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import React from 'react' -import {shallow} from 'enzyme' -import KeyboardShortcuts from 'src/shared/components/KeyboardShortcuts' - -const map = { - keydown: null, -} - -const setup = (override?) => { - const props = { - onControlEnter: () => {}, - children:
, - ...override, - } - - // eslint-disable-next-line - document.addEventListener = jest.fn((event, cb) => { - map[event] = cb - }) - - const wrapper = shallow() - - return { - wrapper, - } -} - -describe('Shared.Comonents.KeyboardShortcuts', () => { - describe('rendering', () => { - it('renders without errors', () => { - const {wrapper} = setup() - expect(wrapper.exists()).toBe(true) - }) - }) - - describe('user interraction', () => { - describe('control + shift', () => { - const onControlEnter = jest.fn() - setup({onControlEnter}) - - const event = {ctrlKey: true, key: 'Enter', preventDefault: () => {}} - map.keydown(event) - - expect(onControlEnter).toHaveBeenCalledTimes(1) - }) - }) -}) diff --git a/ui/src/shared/components/KeyboardShortcuts.tsx b/ui/src/shared/components/KeyboardShortcuts.tsx deleted file mode 100644 index 2a56b9c2f9..0000000000 --- a/ui/src/shared/components/KeyboardShortcuts.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import {PureComponent, ReactNode} from 'react' - -interface Props { - children: ReactNode - onControlEnter: () => void -} - -class KeyboardShortcuts extends PureComponent { - public componentWillMount() { - document.addEventListener('keydown', this.handleKeyboardShortcuts) - } - - public componentWillUnmount() { - document.removeEventListener('keydown', this.handleKeyboardShortcuts) - } - - public render() { - return this.props.children - } - - private handleKeyboardShortcuts = (e: KeyboardEvent) => { - if (e.ctrlKey && e.key === 'Enter') { - this.props.onControlEnter() - e.preventDefault() - } - } -} - -export default KeyboardShortcuts diff --git a/ui/src/shared/components/search_widget/SearchWidget.tsx b/ui/src/shared/components/search_widget/SearchWidget.tsx index 1c622986cf..3e7e12d303 100644 --- a/ui/src/shared/components/search_widget/SearchWidget.tsx +++ b/ui/src/shared/components/search_widget/SearchWidget.tsx @@ -45,7 +45,7 @@ class SearchWidget extends Component { } } - public componentWillMount() { + public UNSAFE_componentWillMount() { this.handleSearch = _.debounce(this.handleSearch, 50) } diff --git a/ui/yarn.lock b/ui/yarn.lock index 8f6a047be9..5744bca83b 100644 --- a/ui/yarn.lock +++ b/ui/yarn.lock @@ -9633,15 +9633,14 @@ react-virtualized@^9.18.5: prop-types "^15.6.0" react-lifecycles-compat "^3.0.4" -react@^16.8.2: - version "16.8.2" - resolved "https://registry.yarnpkg.com/react/-/react-16.8.2.tgz#83064596feaa98d9c2857c4deae1848b542c9c0c" - integrity sha512-aB2ctx9uQ9vo09HVknqv3DGRpI7OIGJhCx3Bt0QqoRluEjHSaObJl+nG12GDdYH6sTgE7YiPJ6ZUyMx9kICdXw== +react@^16.11.0: + version "16.11.0" + resolved "https://registry.yarnpkg.com/react/-/react-16.11.0.tgz#d294545fe62299ccee83363599bf904e4a07fdbb" + integrity sha512-M5Y8yITaLmU0ynd0r1Yvfq98Rmll6q8AxaEe88c8e7LxO8fZ2cNgmFt0aGAS9wzf1Ao32NKXtCl+/tVVtkxq6g== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" prop-types "^15.6.2" - scheduler "^0.13.2" read-pkg-up@^4.0.0: version "4.0.0"