move to react prop-types package and fix jsdom usage
This commit is contained in:
parent
b7abfec8c0
commit
7bdf04ab9e
38 changed files with 79 additions and 41 deletions
|
@ -1,4 +1,5 @@
|
||||||
import React, { Component, PropTypes } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
import onClickOutsideAddon from 'react-onclickoutside'
|
import onClickOutsideAddon from 'react-onclickoutside'
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { Component, PropTypes } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
import onClickOutsideAddon from 'react-onclickoutside'
|
import onClickOutsideAddon from 'react-onclickoutside'
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { Component, PropTypes } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
import { Link } from 'react-router'
|
import { Link } from 'react-router'
|
||||||
|
|
||||||
import Sprite from '../common/Sprite'
|
import Sprite from '../common/Sprite'
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { PropTypes, Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
class NotificationIcon extends Component {
|
class NotificationIcon extends Component {
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { Component, PropTypes } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
class Toast extends Component {
|
class Toast extends Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { Component, PropTypes } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
import { Link } from 'react-router'
|
import { Link } from 'react-router'
|
||||||
|
|
||||||
class UpperLeftUI extends Component {
|
class UpperLeftUI extends Component {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { Component, PropTypes } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
import AccountMenu from './AccountMenu'
|
import AccountMenu from './AccountMenu'
|
||||||
import LoginForm from './LoginForm'
|
import LoginForm from './LoginForm'
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { Component, PropTypes } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
import MobileHeader from './MobileHeader'
|
import MobileHeader from './MobileHeader'
|
||||||
import UpperLeftUI from './UpperLeftUI'
|
import UpperLeftUI from './UpperLeftUI'
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { PropTypes, Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
import Dropzone from 'react-dropzone'
|
import Dropzone from 'react-dropzone'
|
||||||
|
|
||||||
class ImportDialogBox extends Component {
|
class ImportDialogBox extends Component {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { Component, PropTypes } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
class Instructions extends Component {
|
class Instructions extends Component {
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { PropTypes, Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
import { Emoji, Picker } from 'emoji-mart'
|
import { Emoji, Picker } from 'emoji-mart'
|
||||||
|
|
||||||
class NewMessage extends Component {
|
class NewMessage extends Component {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { PropTypes, Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
class Participant extends Component {
|
class Participant extends Component {
|
||||||
render() {
|
render() {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { PropTypes, Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
import Unread from './Unread'
|
import Unread from './Unread'
|
||||||
import Participant from './Participant'
|
import Participant from './Participant'
|
||||||
import Message from './Message'
|
import Message from './Message'
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { Component, PropTypes } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
class MapInfoBox extends Component {
|
class MapInfoBox extends Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { Component, PropTypes } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
import DataVis from '../common/DataVis'
|
import DataVis from '../common/DataVis'
|
||||||
import UpperOptions from '../common/UpperOptions'
|
import UpperOptions from '../common/UpperOptions'
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { Component, PropTypes } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
import { Link } from 'react-router'
|
import { Link } from 'react-router'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { Component, PropTypes } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
import { Link } from 'react-router'
|
import { Link } from 'react-router'
|
||||||
import { find, values } from 'lodash'
|
import { find, values } from 'lodash'
|
||||||
import Util from '../../Metamaps/Util'
|
import Util from '../../Metamaps/Util'
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { Component, PropTypes } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
class MapperCard extends Component {
|
class MapperCard extends Component {
|
||||||
render = () => {
|
render = () => {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { Component, PropTypes } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
import { throttle } from 'lodash'
|
import { throttle } from 'lodash'
|
||||||
import Header from './Header'
|
import Header from './Header'
|
||||||
import MapperCard from './MapperCard'
|
import MapperCard from './MapperCard'
|
||||||
|
|
|
@ -8,7 +8,8 @@
|
||||||
* passes that metacode's id to the callback.
|
* passes that metacode's id to the callback.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { PropTypes, Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
class MetacodeSelect extends Component {
|
class MetacodeSelect extends Component {
|
||||||
render = () => {
|
render = () => {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { PropTypes, Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
import EmbedlyLink from './EmbedlyLink'
|
import EmbedlyLink from './EmbedlyLink'
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { PropTypes, Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
import { RIETextArea } from 'riek'
|
import { RIETextArea } from 'riek'
|
||||||
import Util from '../../Metamaps/Util'
|
import Util from '../../Metamaps/Util'
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* global $, embedly */
|
/* global $, embedly */
|
||||||
import React, { PropTypes, Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
class EmbedlyCard extends Component {
|
class EmbedlyCard extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* global embedly */
|
/* global embedly */
|
||||||
import React, { PropTypes, Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
import Card from './Card'
|
import Card from './Card'
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { PropTypes, Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
class Follow extends Component {
|
class Follow extends Component {
|
||||||
render = () => {
|
render = () => {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/* global $ */
|
/* global $ */
|
||||||
|
|
||||||
import React, { PropTypes, Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
import { Link } from 'react-router'
|
import { Link } from 'react-router'
|
||||||
|
|
||||||
import MetacodeSelect from '../MetacodeSelect'
|
import MetacodeSelect from '../MetacodeSelect'
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { PropTypes, Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
import onClickOutsideAddon from 'react-onclickoutside'
|
import onClickOutsideAddon from 'react-onclickoutside'
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { Component, PropTypes } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
import { RIETextArea } from 'riek'
|
import { RIETextArea } from 'riek'
|
||||||
|
|
||||||
const maxTitleLength = 140
|
const maxTitleLength = 140
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { PropTypes, Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
import Draggable from 'react-draggable'
|
import Draggable from 'react-draggable'
|
||||||
|
|
||||||
import Title from './Title'
|
import Title from './Title'
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { Component, PropTypes } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
import DataVis from '../common/DataVis'
|
import DataVis from '../common/DataVis'
|
||||||
import UpperOptions from '../common/UpperOptions'
|
import UpperOptions from '../common/UpperOptions'
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { Component, PropTypes } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
class DataVis extends Component {
|
class DataVis extends Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { Component, PropTypes } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
import onClickOutsideAddon from 'react-onclickoutside'
|
import onClickOutsideAddon from 'react-onclickoutside'
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { Component, PropTypes } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
import MapInfoBox from '../MapView/MapInfoBox'
|
import MapInfoBox from '../MapView/MapInfoBox'
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { Component, PropTypes } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
export default class Sprite extends Component {
|
export default class Sprite extends Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { Component, PropTypes } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
import FilterBox from '../common/FilterBox'
|
import FilterBox from '../common/FilterBox'
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { Component, PropTypes } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
export default class VisualizationControls extends Component {
|
export default class VisualizationControls extends Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
const jsdom = require('jsdom')
|
const jsdom = require('jsdom')
|
||||||
const doc = jsdom.jsdom('<!doctype html><html><body></body></html>')
|
|
||||||
const win = doc.defaultView
|
|
||||||
|
|
||||||
global.document = doc
|
const { JSDOM } = jsdom
|
||||||
global.window = win
|
const dom = new JSDOM('<!doctype html><html><body></body></html>')
|
||||||
|
|
||||||
|
global.document = dom.window.document
|
||||||
|
global.window = dom.window
|
||||||
|
|
||||||
// take all properties of the window object and also attach it to the
|
// take all properties of the window object and also attach it to the
|
||||||
// mocha global object
|
// mocha global object
|
||||||
propagateToGlobal(win)
|
propagateToGlobal(dom.window)
|
||||||
|
|
||||||
// from mocha-jsdom https://github.com/rstacruz/mocha-jsdom/blob/master/index.js#L80
|
// from mocha-jsdom https://github.com/rstacruz/mocha-jsdom/blob/master/index.js#L80
|
||||||
function propagateToGlobal(window) {
|
function propagateToGlobal(window) {
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
"lodash": "4.17.4",
|
"lodash": "4.17.4",
|
||||||
"node-uuid": "1.4.8",
|
"node-uuid": "1.4.8",
|
||||||
"outdent": "0.3.0",
|
"outdent": "0.3.0",
|
||||||
|
"prop-types": "15.5.10",
|
||||||
"react": "15.6.1",
|
"react": "15.6.1",
|
||||||
"react-dom": "15.6.1",
|
"react-dom": "15.6.1",
|
||||||
"react-draggable": "3.0.3",
|
"react-draggable": "3.0.3",
|
||||||
|
|
Loading…
Add table
Reference in a new issue