Merge pull request #1007 from embark-framework/fix/make-linter-happy

Make linter happy 2019
This commit is contained in:
Iuri Matias 2018-10-30 20:45:44 +01:00 committed by GitHub
commit 54dc34ef15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 105 additions and 15 deletions

View File

@ -52,6 +52,12 @@ const LayoutContract = ({contract, children, cardTitle}) => (
</Card> </Card>
); );
LayoutContract.propTypes = {
contract: PropTypes.object,
children: PropTypes.array,
cardTitle: PropTypes.string
};
const DeploymentResult = ({deployment}) => { const DeploymentResult = ({deployment}) => {
if (deployment.running) { if (deployment.running) {
return <p>Deployment is in progress <FontAwesomeIcon className="ml-1" name="spinner" spin/></p>; return <p>Deployment is in progress <FontAwesomeIcon className="ml-1" name="spinner" spin/></p>;
@ -73,6 +79,10 @@ const DeploymentResult = ({deployment}) => {
); );
}; };
DeploymentResult.propTypes = {
deployment: PropTypes.object
}
const GasEstimateResult = ({gasEstimate}) => { const GasEstimateResult = ({gasEstimate}) => {
if (gasEstimate.running) { if (gasEstimate.running) {
return <p>Gas Estimation is in progresss <FontAwesomeIcon className="ml-1" name="spinner" spin/></p>; return <p>Gas Estimation is in progresss <FontAwesomeIcon className="ml-1" name="spinner" spin/></p>;
@ -85,6 +95,10 @@ const GasEstimateResult = ({gasEstimate}) => {
return <p className="text-success">Gas Estimation succeed: {gasEstimate.gas}</p>; return <p className="text-success">Gas Estimation succeed: {gasEstimate.gas}</p>;
}; };
GasEstimateResult.propTypes = {
gasEstimate: PropTypes.object
};
class Web3Contract extends React.Component { class Web3Contract extends React.Component {
constructor(props) { constructor(props) {
super(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}) => ( const EmbarkContract = ({contract, toggleContractOverview}) => (
<LayoutContract contract={contract} cardTitle={ <LayoutContract contract={contract} cardTitle={
<React.Fragment> <React.Fragment>
<a href='#toggleContract' onClick={() => toggleContractOverview(contract)}>{contract.className}</a>&nbsp; <a href='#toggleContract' onClick={() => toggleContractOverview(contract)}>{contract.className}</a>&nbsp;
<span>{contract.address && `deployed at ${contract.address}` || "not deployed"}</span> <span>{(contract.address && `deployed at ${contract.address}`) || 'not deployed'}</span>
</React.Fragment> </React.Fragment>
}> }>
{contract.address && <p><strong>Arguments:</strong> {JSON.stringify(contract.args)}</p>} {contract.address && <p><strong>Arguments:</strong> {JSON.stringify(contract.args)}</p>}
@ -179,6 +202,11 @@ const EmbarkContract = ({contract, toggleContractOverview}) => (
</LayoutContract> </LayoutContract>
); );
EmbarkContract.propTypes = {
contract: PropTypes.object,
toggleContractOverview: PropTypes.func
};
const ContractsHeader = ({deploymentPipeline, updateDeploymentPipeline}) => ( const ContractsHeader = ({deploymentPipeline, updateDeploymentPipeline}) => (
<Row> <Row>
<div className="ml-auto mr-5"> <div className="ml-auto mr-5">
@ -215,6 +243,11 @@ const ContractsHeader = ({deploymentPipeline, updateDeploymentPipeline}) => (
</Row> </Row>
); );
ContractsHeader.propTypes = {
deploymentPipeline: PropTypes.object,
updateDeploymentPipeline: PropTypes.func
};
const Contract = ({web3, contract, deploymentPipeline, web3Deploy, web3EstimateGas, web3Deployments, web3GasEstimates, toggleContractOverview}) => { const Contract = ({web3, contract, deploymentPipeline, web3Deploy, web3EstimateGas, web3Deployments, web3GasEstimates, toggleContractOverview}) => {
const deployment = web3Deployments[contract.className]; const deployment = web3Deployments[contract.className];
const gasEstimate = web3GasEstimates[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 { class ContractsDeployment extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);

View File

@ -1,3 +1,4 @@
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
const Description = ({label, value}) => ( const Description = ({label, value}) => (
@ -7,4 +8,9 @@ const Description = ({label, value}) => (
</React.Fragment> </React.Fragment>
); );
Description.propTypes = {
label: PropTypes.string,
value: PropTypes.string
};
export default Description export default Description

View File

@ -1,3 +1,4 @@
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import { import {
Card, Card,
@ -13,7 +14,6 @@ import {
} from 'reactstrap'; } from 'reactstrap';
class SignAndVerify extends React.Component { class SignAndVerify extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { 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; export default SignAndVerify;

View File

@ -1,3 +1,4 @@
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import {withRouter} from 'react-router-dom'; import {withRouter} from 'react-router-dom';
import { 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); export default withRouter(TransactionDecoder);

View File

@ -12,7 +12,7 @@ const propTypes = {
variant: PropTypes.string, variant: PropTypes.string,
children: PropTypes.node, children: PropTypes.node,
className: PropTypes.string, className: PropTypes.string,
cssModule: PropTypes.object, cssModule: PropTypes.object
}; };
const defaultProps = { const defaultProps = {
@ -21,12 +21,11 @@ const defaultProps = {
icon: 'fa fa-cogs', icon: 'fa fa-cogs',
color: 'primary', color: 'primary',
variant: '0', variant: '0',
link: '#',
}; };
class Widget02 extends Component { class Widget02 extends Component {
render() { 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 // demo purposes only
const padding = (variant === '0' ? { card: 'p-3', icon: 'p-3', lead: 'mt-2' } : (variant === '1' ? { const padding = (variant === '0' ? { card: 'p-3', icon: 'p-3', lead: 'mt-2' } : (variant === '1' ? {

View File

@ -137,6 +137,7 @@ AppContainer.propTypes = {
theme: PropTypes.string, theme: PropTypes.string,
changeTheme: PropTypes.func, changeTheme: PropTypes.func,
fetchTheme: PropTypes.func, fetchTheme: PropTypes.func,
history: PropTypes.instanceOf(History)
}; };
function mapStateToProps(state) { function mapStateToProps(state) {

View File

@ -45,13 +45,15 @@ function mapStateToProps(state) {
} }
DeploymentContainer.propTypes = { DeploymentContainer.propTypes = {
web3: PropTypes.object,
web3Deployments: PropTypes.object,
web3GasEstimates: PropTypes.object,
contracts: PropTypes.array, contracts: PropTypes.array,
deploymentPipeline: PropTypes.object,
fetchContracts: PropTypes.func, fetchContracts: PropTypes.func,
updateDeploymentPipeline: PropTypes.func,
web3: PropTypes.object,
web3Deploy: PropTypes.func, web3Deploy: PropTypes.func,
web3Deployments: PropTypes.object,
web3EstimateGas: PropTypes.func, web3EstimateGas: PropTypes.func,
web3GasEstimates: PropTypes.object,
}; };
export default connect( export default connect(

View File

@ -1,3 +1,4 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react'; import React, { Component } from 'react';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import SignAndVerify from '../components/SignAndVerify'; import SignAndVerify from '../components/SignAndVerify';
@ -40,6 +41,19 @@ class SignAndVerifyContainer extends Component {
} }
} }
SignAndVerifyContainer.propTypes = {
accounts: PropTypes.array,
fetchAccounts: PropTypes.func,
signMessage: PropTypes.func,
signatureError: PropTypes.string,
signaturePending: PropTypes.boolean,
signedMessage: PropTypes.string,
verificationError: PropTypes.string,
verificationPending: PropTypes.boolean,
verifiedAddress: PropTypes.string,
verifyMessage: PropTypes.func
};
function mapStateToProps(state) { function mapStateToProps(state) {
return { return {
accounts: getAccounts(state), accounts: getAccounts(state),

View File

@ -1,3 +1,4 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react'; import React, { Component } from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import qs from 'qs'; import qs from 'qs';
@ -14,7 +15,6 @@ const getQueryParams = (props) => {
}; };
class TransactionDecoderContainer extends Component { class TransactionDecoderContainer extends Component {
componentDidMount() { componentDidMount() {
const { hash } = getQueryParams(this.props); const { hash } = getQueryParams(this.props);
if (hash) { if (hash) {
@ -43,6 +43,11 @@ class TransactionDecoderContainer extends Component {
} }
} }
TransactionDecoderContainer.propTypes = {
fetchTransaction: PropTypes.func,
transaction: PropTypes.object
};
function mapStateToProps(state, props) { function mapStateToProps(state, props) {
return { return {
transaction: getTransaction(state, getQueryParams(props).hash), transaction: getTransaction(state, getQueryParams(props).hash),