From 10b276c28a6c16fc0c19b2cf3fa4cc8155013a08 Mon Sep 17 00:00:00 2001 From: Filip Barl Date: Fri, 5 May 2017 18:23:43 +0200 Subject: [PATCH] Use prop-types library to silence PropTypes deprecation warning (#2498) * Use prop-types library to fix the deprecation warning. * Updated weaveworks-ui-components version. --- client/app/scripts/components/cloud-feature.js | 11 ++++++----- client/app/scripts/components/sparkline.js | 5 +++-- client/package.json | 5 +++-- client/yarn.lock | 7 ++++--- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/client/app/scripts/components/cloud-feature.js b/client/app/scripts/components/cloud-feature.js index 013414421..b9c8f3524 100644 --- a/client/app/scripts/components/cloud-feature.js +++ b/client/app/scripts/components/cloud-feature.js @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types'; import { connect } from 'react-redux'; class CloudFeature extends React.Component { @@ -21,14 +22,14 @@ class CloudFeature extends React.Component { } CloudFeature.contextTypes = { - store: React.PropTypes.object.isRequired, - router: React.PropTypes.object, - serviceStore: React.PropTypes.object + store: PropTypes.object.isRequired, + router: PropTypes.object, + serviceStore: PropTypes.object }; CloudFeature.childContextTypes = { - store: React.PropTypes.object, - router: React.PropTypes.object + store: PropTypes.object, + router: PropTypes.object }; export default connect()(CloudFeature); diff --git a/client/app/scripts/components/sparkline.js b/client/app/scripts/components/sparkline.js index 1fea8323f..f802d329c 100644 --- a/client/app/scripts/components/sparkline.js +++ b/client/app/scripts/components/sparkline.js @@ -1,5 +1,6 @@ // Forked from: https://github.com/KyleAMathews/react-sparkline at commit a9d7c5203d8f240938b9f2288287aaf0478df013 import React from 'react'; +import PropTypes from 'prop-types'; import { min as d3Min, max as d3Max, mean as d3Mean } from 'd3-array'; import { isoParse as parseDate } from 'd3-time-format'; import { line, curveLinear } from 'd3-shape'; @@ -9,9 +10,9 @@ import { formatMetricSvg } from '../utils/string-utils'; export default class Sparkline extends React.Component { - constructor(props, context) { super(props, context); + this.x = scaleLinear(); this.y = scaleLinear(); this.line = line() @@ -96,7 +97,7 @@ export default class Sparkline extends React.Component { } Sparkline.propTypes = { - data: React.PropTypes.arrayOf(React.PropTypes.object) + data: PropTypes.arrayOf(PropTypes.object) }; Sparkline.defaultProps = { diff --git a/client/package.json b/client/package.json index 7ff3ed47d..f52b6c3b7 100644 --- a/client/package.json +++ b/client/package.json @@ -28,6 +28,7 @@ "materialize-css": "0.98.1", "moment": "2.18.1", "page": "1.7.1", + "prop-types": "^15.5.8", "react": "15.5.4", "react-addons-perf": "15.4.2", "react-dom": "15.5.4", @@ -41,9 +42,9 @@ "reqwest": "2.0.5", "reselect": "3.0.0", "reselect-map": "1.0.1", + "weaveworks-ui-components": "git+https://github.com/weaveworks/ui-components.git#v0.1.20", "whatwg-fetch": "2.0.3", - "xterm": "2.5.0", - "weaveworks-ui-components": "git+https://github.com/weaveworks/ui-components.git#v0.1.19" + "xterm": "2.5.0" }, "devDependencies": { "autoprefixer": "6.7.7", diff --git a/client/yarn.lock b/client/yarn.lock index 1a8b078ec..77b762a0c 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -6088,9 +6088,9 @@ wd@^0.4.0: underscore.string "~3.0.3" vargs "~0.1.0" -"weaveworks-ui-components@git+https://github.com/weaveworks/ui-components.git#v0.1.19": - version "0.1.19" - resolved "git+https://github.com/weaveworks/ui-components.git#653b64bba230219756ff3b9b675d46e8a55e3e8f" +"weaveworks-ui-components@git+https://github.com/weaveworks/ui-components.git#v0.1.20": + version "0.1.20" + resolved "git+https://github.com/weaveworks/ui-components.git#46e6165f39defe8a720b59a9db69c93514960e00" dependencies: babel-cli "^6.18.0" babel-plugin-transform-export-extensions "6.8.0" @@ -6098,6 +6098,7 @@ wd@^0.4.0: babel-preset-react "6.16.0" classnames "^2.2.5" node-sass "3.13.0" + prop-types "^15.5.8" webidl-conversions@^3.0.0: version "3.0.1"