Skip to content
This repository was archived by the owner on Apr 1, 2020. It is now read-only.

Commit 70f4af5

Browse files
committed
Update dependencies
1 parent 5c9a9cd commit 70f4af5

33 files changed

+4193
-2668
lines changed

browser/src/Services/DragAndDrop.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const DropCollect = (connect: DND.DropTargetConnector, monitor: DND.DropTargetMo
4545
/**
4646
* A component which can have items of a specific matching type dropped onto it
4747
*/
48-
@DND.DropTarget<IDroppeable>(({ accepts }) => accepts, DropTarget, DropCollect)
48+
@DND.DropTarget<IDroppeable & any>(({ accepts }) => accepts, DropTarget, DropCollect)
4949
export class Droppeable<P extends IDroppeable> extends React.Component<P> {
5050
public render() {
5151
const { isOver, connectDropTarget, canDrop, didDrop } = this.props
@@ -84,7 +84,7 @@ const DragCollect = (connect: DND.DragSourceConnector, monitor: DND.DragSourceMo
8484
* @param {React.Component} A component which is dragged onto another
8585
* @returns {React.Component<P>} A react class component
8686
*/
87-
@DND.DragSource<IDraggeable>(props => props.target, DragSource, DragCollect)
87+
@DND.DragSource<IDraggeable & any>(props => props.target, DragSource, DragCollect)
8888
export class Draggeable<P extends IDraggeable> extends React.Component<P> {
8989
public render() {
9090
const { isDragging, connectDragSource } = this.props
@@ -109,8 +109,8 @@ interface IDragDrop {
109109
/**
110110
* A render prop which takes a given component and makes it a drop target as well as draggeable
111111
*/
112-
@DND.DropTarget<IDragDrop>(props => props.accepts, DropTarget, DropCollect)
113-
@DND.DragSource<IDragDrop>(props => props.dragTarget, DragSource, DragCollect)
112+
@DND.DropTarget<IDragDrop & any>(props => props.accepts, DropTarget, DropCollect)
113+
@DND.DragSource<IDragDrop & any>(props => props.dragTarget, DragSource, DragCollect)
114114
export class DragAndDrop<P extends IDragDrop> extends React.Component<P> {
115115
public render() {
116116
const { connectDragSource, connectDropTarget } = this.props

browser/src/Services/Menu/MenuComponent.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export class MenuView extends React.PureComponent<IMenuProps, {}> {
129129
*/
130130
private handleHide = (event: any) => {
131131
const node = ReactDOM.findDOMNode(this._popupBody)
132-
if (!node.contains(event.target as Node)) {
132+
if (typeof node !== "string" && !node.contains(event.target as Node)) {
133133
this.props.onHide()
134134
}
135135
}
@@ -173,7 +173,10 @@ const mapDispatchToProps = {
173173
onHide: ActionCreators.hidePopupMenu,
174174
}
175175

176-
export const ConnectedMenu: any = connect(mapStateToProps, mapDispatchToProps)(MenuView)
176+
export const ConnectedMenu: any = connect(
177+
mapStateToProps,
178+
mapDispatchToProps,
179+
)(MenuView)
177180

178181
export const MenuContainer = () => {
179182
return (

browser/src/UI/components/CommandLine.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export interface ICommandLineRendererProps {
5858
prompt: string
5959
}
6060

61-
interface State {
61+
export interface ICommandLineRendererState {
6262
focused: boolean
6363
}
6464

@@ -74,7 +74,10 @@ export const CommandLineIcon = (props: { iconName: string; arrow?: boolean }) =>
7474
</span>
7575
)
7676

77-
export class CommandLine extends React.PureComponent<ICommandLineRendererProps, State> {
77+
export class CommandLine extends React.PureComponent<
78+
ICommandLineRendererProps,
79+
ICommandLineRendererState
80+
> {
7881
public state = {
7982
focused: false,
8083
}

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -878,8 +878,8 @@
878878
"oni-ripgrep": "0.0.4",
879879
"oni-types": "^0.0.8",
880880
"react": "^16.3.2",
881-
"react-dnd": "^2.5.4",
882-
"react-dnd-html5-backend": "^2.5.4",
881+
"react-dnd": "^5.0.0",
882+
"react-dnd-html5-backend": "^5.0.1",
883883
"react-dom": "^16.3.2",
884884
"redux-batched-subscribe": "^0.1.6",
885885
"shell-env": "^0.3.0",
@@ -916,8 +916,7 @@
916916
"@types/msgpack-lite": "0.1.4",
917917
"@types/node": "8.0.53",
918918
"@types/react": "^16.3.16",
919-
"@types/react-dnd": "^2.0.34",
920-
"@types/react-dnd-html5-backend": "^2.1.8",
919+
"@types/react-dnd-html5-backend": "^3.0.2",
921920
"@types/react-dom": "^16.0.5",
922921
"@types/react-motion": "0.0.23",
923922
"@types/react-redux": "5.0.12",

ui-tests/BrowserView.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
import { Configuration } from "../browser/src/Services/Configuration"
1313

1414
const mockEvent = new Event<void>()
15-
const dispatch = () => mockEvent.dispatch()
1615

1716
const MockWebviewElement = (spy: (args?: any) => void) =>
1817
({

ui-tests/CommandLine.test.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
import { mount, shallow } from "enzyme"
1+
import { CommonWrapper, mount, shallow } from "enzyme"
22
import { shallowToJson } from "enzyme-to-json"
33
import * as React from "react"
44
import { Provider } from "react-redux"
55
import configureStore, { MockStore, MockStoreCreator } from "redux-mock-store"
6-
import ConnectCommand, { CommandLine } from "../browser/src/UI/components/CommandLine"
6+
import ConnectCommand, {
7+
CommandLine,
8+
ICommandLineRendererProps,
9+
ICommandLineRendererState,
10+
} from "../browser/src/UI/components/CommandLine"
711

812
const mockStore: MockStoreCreator<IState> = configureStore()
913

@@ -65,7 +69,10 @@ describe("<Commandline />", () => {
6569
})
6670

6771
it("should initially not have a focused state when rendered", () => {
68-
const wrapper = shallow(CommandLineComponent)
72+
const wrapper: CommonWrapper<
73+
ICommandLineRendererProps,
74+
ICommandLineRendererState
75+
> = shallow(CommandLineComponent)
6976
expect(wrapper.state().focused).toBe(false)
7077
})
7178

ui-tests/ContextMenuComponent.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { mount, ReactWrapper } from "enzyme"
2-
import toJson from "enzyme-to-json"
32
import * as React from "react"
43

54
import {

ui-tests/ErrorInfo.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from "react"
22
import { shallow } from "enzyme"
33
import { Diagnostic } from "vscode-languageserver-types"
44

5-
import { ErrorInfo, DiagnosticMessage } from "../browser/src/UI/components/ErrorInfo"
5+
import { ErrorInfo } from "../browser/src/UI/components/ErrorInfo"
66

77
describe("<ErrorInfo />", () => {
88
const errors: Diagnostic[] = [

ui-tests/ExplorerSplit.test.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ jest.mock("../browser/src/Services/WindowManager/WindowManager")
33
jest.mock("../browser/src/Services/Explorer/ExplorerView")
44
jest.mock("../browser/src/Services/Explorer/ExplorerStore")
55

6-
import * as React from "react"
7-
import { shallow } from "enzyme"
6+
import "react"
7+
import { Store } from "redux"
88

99
import MockOni from "./mocks/Oni"
1010

@@ -47,7 +47,7 @@ describe("ExplorerSplit", () => {
4747
})
4848

4949
it("dispatches SELECT_FILE_SUCCESS if fileToSelect matches selected item", () => {
50-
store.getState.mockReturnValue({ fileToSelect: "/path/to/file.cpp" })
50+
;(store.getState as any).mockReturnValue({ fileToSelect: "/path/to/file.cpp" })
5151
_getSelectedItem.mockReturnValue({
5252
type: "file",
5353
filePath: "/path/to/file.cpp",
@@ -59,7 +59,7 @@ describe("ExplorerSplit", () => {
5959
})
6060

6161
it("does not dispatch SELECT_FILE_SUCCESS if fileToSelect isn't selected", () => {
62-
store.getState.mockReturnValue({ fileToSelect: "/path/to/file.cpp" })
62+
;(store.getState as any).mockReturnValue({ fileToSelect: "/path/to/file.cpp" })
6363
_getSelectedItem.mockReturnValue({
6464
type: "file",
6565
filePath: "/something/else.cpp",
@@ -71,7 +71,7 @@ describe("ExplorerSplit", () => {
7171
})
7272

7373
it("does not dispatch SELECT_FILE_SUCCESS if there is no fileToSelect", () => {
74-
store.getState.mockReturnValue({ fileToSelect: null })
74+
;(store.getState as any).mockReturnValue({ fileToSelect: null })
7575

7676
explorerSplit["_onSelectionChanged"]("a")
7777

ui-tests/ExternalMenus.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { mount, shallow } from "enzyme"
1+
import { shallow } from "enzyme"
22
import { shallowToJson } from "enzyme-to-json"
33
import * as React from "react"
44

0 commit comments

Comments
 (0)