diff --git a/embark-ui/src/components/ContractsDeployment.js b/embark-ui/src/components/ContractsDeployment.js index 0fa193406..9458dd70a 100644 --- a/embark-ui/src/components/ContractsDeployment.js +++ b/embark-ui/src/components/ContractsDeployment.js @@ -52,6 +52,12 @@ const LayoutContract = ({contract, children, cardTitle}) => ( ); +LayoutContract.propTypes = { + contract: PropTypes.object, + children: PropTypes.array, + cardTitle: PropTypes.string +}; + const DeploymentResult = ({deployment}) => { if (deployment.running) { return

Deployment is in progress

; @@ -73,6 +79,10 @@ const DeploymentResult = ({deployment}) => { ); }; +DeploymentResult.propTypes = { + deployment: PropTypes.object +} + const GasEstimateResult = ({gasEstimate}) => { if (gasEstimate.running) { return

Gas Estimation is in progresss

; @@ -85,6 +95,10 @@ const GasEstimateResult = ({gasEstimate}) => { return

Gas Estimation succeed: {gasEstimate.gas}

; }; +GasEstimateResult.propTypes = { + gasEstimate: PropTypes.object +}; + class Web3Contract extends React.Component { constructor(props) { super(props); @@ -158,11 +172,20 @@ class Web3Contract extends React.Component { } } +Web3Contract.propTypes = { + contract: PropTypes.object, + web3: PropTypes.object, + web3EstimateGas: PropTypes.func, + web3Deploy: PropTypes.func, + gasEstimate: PropTypes.object, + deployment: PropTypes.object +}; + const EmbarkContract = ({contract, toggleContractOverview}) => ( toggleContractOverview(contract)}>{contract.className}  - {contract.address && `deployed at ${contract.address}` || "not deployed"} + {(contract.address && `deployed at ${contract.address}`) || 'not deployed'} }> {contract.address &&

Arguments: {JSON.stringify(contract.args)}

} @@ -179,6 +202,11 @@ const EmbarkContract = ({contract, toggleContractOverview}) => (
); +EmbarkContract.propTypes = { + contract: PropTypes.object, + toggleContractOverview: PropTypes.func +}; + const ContractsHeader = ({deploymentPipeline, updateDeploymentPipeline}) => (
@@ -215,6 +243,11 @@ const ContractsHeader = ({deploymentPipeline, updateDeploymentPipeline}) => ( ); +ContractsHeader.propTypes = { + deploymentPipeline: PropTypes.object, + updateDeploymentPipeline: PropTypes.func +}; + const Contract = ({web3, contract, deploymentPipeline, web3Deploy, web3EstimateGas, web3Deployments, web3GasEstimates, toggleContractOverview}) => { const deployment = web3Deployments[contract.className]; const gasEstimate = web3GasEstimates[contract.className]; @@ -233,6 +266,17 @@ const Contract = ({web3, contract, deploymentPipeline, web3Deploy, web3EstimateG } }; +Contract.propTypes = { + contract: PropTypes.object, + deploymentPipeline: PropTypes.object, + toggleContractOverview: PropTypes.func, + web3: PropTypes.object, + web3Deploy: PropTypes.func, + web3Deployments: PropTypes.object, + web3EstimateGas: PropTypes.func, + web3GasEstimates: PropTypes.object +}; + class ContractsDeployment extends React.Component { constructor(props) { super(props); diff --git a/embark-ui/src/components/Description.js b/embark-ui/src/components/Description.js index 36953f2dc..2e23a6bb7 100644 --- a/embark-ui/src/components/Description.js +++ b/embark-ui/src/components/Description.js @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; const Description = ({label, value}) => ( @@ -7,4 +8,9 @@ const Description = ({label, value}) => ( ); -export default Description \ No newline at end of file +Description.propTypes = { + label: PropTypes.string, + value: PropTypes.string +}; + +export default Description diff --git a/embark-ui/src/components/SignAndVerify.js b/embark-ui/src/components/SignAndVerify.js index 613db348f..674f2691f 100644 --- a/embark-ui/src/components/SignAndVerify.js +++ b/embark-ui/src/components/SignAndVerify.js @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; import { Card, @@ -13,7 +14,6 @@ import { } from 'reactstrap'; class SignAndVerify extends React.Component { - constructor(props) { super(props); this.state = { @@ -97,4 +97,16 @@ class SignAndVerify extends React.Component { } } +SignAndVerify.propTypes = { + accounts: PropTypes.array, + signMessage: PropTypes.function, + signatureError: PropTypes.string, + signaturePending: PropTypes.function, + signedMessage: PropTypes.string, + verificationError: PropTypes.string, + verificationPending: PropTypes.boolean, + verifiedAddress: PropTypes.string, + verifyMessage: PropTypes.function +}; + export default SignAndVerify; diff --git a/embark-ui/src/components/TransactionDecoder.js b/embark-ui/src/components/TransactionDecoder.js index 61e112ea4..d2e0edc1f 100644 --- a/embark-ui/src/components/TransactionDecoder.js +++ b/embark-ui/src/components/TransactionDecoder.js @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; import {withRouter} from 'react-router-dom'; import { @@ -65,4 +66,10 @@ class TransactionDecoder extends React.Component { } } +TransactionDecoder.propTypes = { + history: PropTypes.array, + transaction: PropTypes.object, + transactionHash: PropTypes.string +}; + export default withRouter(TransactionDecoder); diff --git a/embark-ui/src/components/Widget02.js b/embark-ui/src/components/Widget02.js index 6caf5ae82..b6685cc81 100644 --- a/embark-ui/src/components/Widget02.js +++ b/embark-ui/src/components/Widget02.js @@ -12,7 +12,7 @@ const propTypes = { variant: PropTypes.string, children: PropTypes.node, className: PropTypes.string, - cssModule: PropTypes.object, + cssModule: PropTypes.object }; const defaultProps = { @@ -21,12 +21,11 @@ const defaultProps = { icon: 'fa fa-cogs', color: 'primary', variant: '0', - link: '#', }; class Widget02 extends Component { render() { - const { className, cssModule, header, mainText, icon, color, footer, link, children, variant, ...attributes } = this.props; + const { className, cssModule, header, mainText, icon, color, children, variant, ...attributes } = this.props; // demo purposes only const padding = (variant === '0' ? { card: 'p-3', icon: 'p-3', lead: 'mt-2' } : (variant === '1' ? { diff --git a/embark-ui/src/containers/AppContainer.js b/embark-ui/src/containers/AppContainer.js index 563235171..b1083bc19 100644 --- a/embark-ui/src/containers/AppContainer.js +++ b/embark-ui/src/containers/AppContainer.js @@ -137,6 +137,7 @@ AppContainer.propTypes = { theme: PropTypes.string, changeTheme: PropTypes.func, fetchTheme: PropTypes.func, + history: PropTypes.instanceOf(History) }; function mapStateToProps(state) { diff --git a/embark-ui/src/containers/DeploymentContainer.js b/embark-ui/src/containers/DeploymentContainer.js index 5b38b217a..ce7c18eea 100644 --- a/embark-ui/src/containers/DeploymentContainer.js +++ b/embark-ui/src/containers/DeploymentContainer.js @@ -2,8 +2,8 @@ import React, {Component} from 'react'; import {connect} from 'react-redux'; import PropTypes from 'prop-types'; import { - contracts as contractsAction, - web3Deploy as web3DeployAction, + contracts as contractsAction, + web3Deploy as web3DeployAction, web3EstimateGas as web3EstimateGasAction, updateDeploymentPipeline} from "../actions"; @@ -19,8 +19,8 @@ class DeploymentContainer extends Component { render() { return ( 0} {...this.props} render={() => ( - { }; class TransactionDecoderContainer extends Component { - componentDidMount() { const { hash } = getQueryParams(this.props); if (hash) { @@ -43,6 +43,11 @@ class TransactionDecoderContainer extends Component { } } +TransactionDecoderContainer.propTypes = { + fetchTransaction: PropTypes.func, + transaction: PropTypes.object +}; + function mapStateToProps(state, props) { return { transaction: getTransaction(state, getQueryParams(props).hash),