From 79cb60f164b0b5563d27f173e0ba4589e4650380 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Thu, 25 Oct 2018 14:16:45 -0400 Subject: [PATCH 1/3] style improvments to functions, explorer and icon --- embark-ui/src/components/ContractOverview.js | 4 ++-- embark-ui/src/components/Explorer.css | 10 +++++----- embark-ui/src/components/Layout.js | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/embark-ui/src/components/ContractOverview.js b/embark-ui/src/components/ContractOverview.js index cffb2071..adbe8bb1 100644 --- a/embark-ui/src/components/ContractOverview.js +++ b/embark-ui/src/components/ContractOverview.js @@ -95,8 +95,8 @@ class ContractFunction extends Component { render() { return ( - - this.toggleFunction()}> + this.toggleFunction()}> + {ContractFunction.isPureCall(this.props.method) && } diff --git a/embark-ui/src/components/Explorer.css b/embark-ui/src/components/Explorer.css index 69bd17a3..289a298b 100644 --- a/embark-ui/src/components/Explorer.css +++ b/embark-ui/src/components/Explorer.css @@ -1,23 +1,23 @@ -.explorer-row { +#root .explorer-row { border-top-width: 0 !important; /*Bootstrap uses important, so we need to override it*/ } -.explorer-overview .card-body { +#root .explorer-overview .card-body { overflow: hidden; } -.explorer-row + .explorer-row { +#root .explorer-row + .explorer-row { margin-top: 5px; padding-top: 20px; border-top-width: 1px !important; } -.explorer-row .text-truncate { +#root .explorer-row .text-truncate { width: 90%; display: inline-block; } -.explorer-row .text-truncate { +#root .explorer-row .text-truncate { width: 90%; display: inline-block; } diff --git a/embark-ui/src/components/Layout.js b/embark-ui/src/components/Layout.js index 38534335..bd53a10e 100644 --- a/embark-ui/src/components/Layout.js +++ b/embark-ui/src/components/Layout.js @@ -40,7 +40,7 @@ const SIDEBAR_NAV_ITEMS = { {url: "/embark/explorer/accounts", icon: "fa fa-users", name: "Accounts"}, {url: "/embark/explorer/blocks", icon: "fa fa-stop", name: "Blocks"}, {url: "/embark/explorer/contracts", icon: "fa fa-file-code-o", name: "Contracts"}, - {url: "/embark/explorer/transactions", icon: "fa fa-tree", name: "Transactions"} + {url: "/embark/explorer/transactions", icon: "fa fa-exchange", name: "Transactions"} ]}, "/embark/utilities/": {items: [ {url: "/embark/utilities/converter", icon: "fa fa-plug", name: "Converter"}, From b85f8aff8c5464543d36e3331b940af125e75274 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Thu, 25 Oct 2018 14:34:54 -0400 Subject: [PATCH 2/3] fix margins by using a padding on the container instead --- embark-ui/src/components/CardTitleIdenticon.js | 3 ++- embark-ui/src/components/Communication.js | 2 +- embark-ui/src/components/ContractsDeployment.js | 2 +- embark-ui/src/components/Converter.js | 2 +- embark-ui/src/components/ExplorerDashboardLayout.js | 2 +- embark-ui/src/components/Layout.js | 2 +- embark-ui/src/components/Processes.js | 2 +- embark-ui/src/components/SignAndVerify.js | 4 ++-- embark-ui/src/containers/EditorContainer.css | 1 + embark-ui/src/containers/EnsContainer.js | 2 +- embark-ui/src/containers/HomeContainer.js | 12 +++++++++--- .../src/containers/TransactionDecoderContainer.js | 4 ++-- embark-ui/src/reducers/selectors.js | 2 +- 13 files changed, 24 insertions(+), 16 deletions(-) diff --git a/embark-ui/src/components/CardTitleIdenticon.js b/embark-ui/src/components/CardTitleIdenticon.js index f0576ff3..b9a8e9f7 100644 --- a/embark-ui/src/components/CardTitleIdenticon.js +++ b/embark-ui/src/components/CardTitleIdenticon.js @@ -13,7 +13,8 @@ CardTitleIdenticon.propTypes = { id: PropTypes.string, children: PropTypes.oneOfType([ PropTypes.object, - PropTypes.array + PropTypes.array, + PropTypes.string ]) }; diff --git a/embark-ui/src/components/Communication.js b/embark-ui/src/components/Communication.js index ca93bd43..eaa9603d 100644 --- a/embark-ui/src/components/Communication.js +++ b/embark-ui/src/components/Communication.js @@ -44,7 +44,7 @@ class Communication extends Component { render() { return ( - + diff --git a/embark-ui/src/components/ContractsDeployment.js b/embark-ui/src/components/ContractsDeployment.js index dcdca38c..866fe385 100644 --- a/embark-ui/src/components/ContractsDeployment.js +++ b/embark-ui/src/components/ContractsDeployment.js @@ -180,7 +180,7 @@ const EmbarkContract = ({contract, toggleContractOverview}) => ( ); const ContractsHeader = ({deploymentPipeline, updateDeploymentPipeline}) => ( - +
Deploy using diff --git a/embark-ui/src/components/Converter.js b/embark-ui/src/components/Converter.js index c21365a4..765026f0 100644 --- a/embark-ui/src/components/Converter.js +++ b/embark-ui/src/components/Converter.js @@ -35,7 +35,7 @@ class Converter extends React.Component { render() { return( - + diff --git a/embark-ui/src/components/ExplorerDashboardLayout.js b/embark-ui/src/components/ExplorerDashboardLayout.js index ee49bd10..4af97834 100644 --- a/embark-ui/src/components/ExplorerDashboardLayout.js +++ b/embark-ui/src/components/ExplorerDashboardLayout.js @@ -12,7 +12,7 @@ import './Explorer.css'; const ExplorerDashboardLayout = () => (
- + diff --git a/embark-ui/src/components/Layout.js b/embark-ui/src/components/Layout.js index bd53a10e..5c71b5c9 100644 --- a/embark-ui/src/components/Layout.js +++ b/embark-ui/src/components/Layout.js @@ -225,7 +225,7 @@ class Layout extends React.Component { {searchResult.error} - + {children} diff --git a/embark-ui/src/components/Processes.js b/embark-ui/src/components/Processes.js index 5bcf2fdc..9379cf01 100644 --- a/embark-ui/src/components/Processes.js +++ b/embark-ui/src/components/Processes.js @@ -29,7 +29,7 @@ Process.propTypes = { }; const Processes = ({processes}) => ( - + {processes.map((process) => )} ); diff --git a/embark-ui/src/components/SignAndVerify.js b/embark-ui/src/components/SignAndVerify.js index 99039ba7..613db348 100644 --- a/embark-ui/src/components/SignAndVerify.js +++ b/embark-ui/src/components/SignAndVerify.js @@ -19,7 +19,7 @@ class SignAndVerify extends React.Component { this.state = { selectedAccount: this.props.accounts[0].address, messageToSign: '', - messageToVerify: '', + messageToVerify: '' }; } @@ -40,7 +40,7 @@ class SignAndVerify extends React.Component { render() { return ( - + diff --git a/embark-ui/src/containers/EditorContainer.css b/embark-ui/src/containers/EditorContainer.css index 56a9a97f..47965252 100644 --- a/embark-ui/src/containers/EditorContainer.css +++ b/embark-ui/src/containers/EditorContainer.css @@ -1,4 +1,5 @@ .editor--grid { margin-left: -30px !important; margin-right: -30px !important; + margin-top: -1.5rem !important; } diff --git a/embark-ui/src/containers/EnsContainer.js b/embark-ui/src/containers/EnsContainer.js index 68a7e0d6..a394c3f7 100644 --- a/embark-ui/src/containers/EnsContainer.js +++ b/embark-ui/src/containers/EnsContainer.js @@ -12,7 +12,7 @@ class EnsContainer extends Component { showEns() { return ( - + diff --git a/embark-ui/src/containers/HomeContainer.js b/embark-ui/src/containers/HomeContainer.js index 29f50151..632f5ec0 100644 --- a/embark-ui/src/containers/HomeContainer.js +++ b/embark-ui/src/containers/HomeContainer.js @@ -35,11 +35,11 @@ class HomeContainer extends Component { } isEmbark() { - return this.state.activeProcess === EMBARK_PROCESS_NAME + return this.state.activeProcess === EMBARK_PROCESS_NAME; } updateTab(processName = EMBARK_PROCESS_NAME) { - this.props.stopProcessLogs(this.state.activeProcess) + this.props.stopProcessLogs(this.state.activeProcess); this.props.fetchProcessLogs(processName, LOG_LIMIT); this.props.listenToProcessLogs(processName); @@ -93,7 +93,13 @@ HomeContainer.propTypes = { postCommand: PropTypes.func, postCommandSuggestions: PropTypes.func, error: PropTypes.string, - loading: PropTypes.bool + loading: PropTypes.bool, + stopProcessLogs: PropTypes.func, + fetchProcessLogs: PropTypes.func, + listenToProcessLogs: PropTypes.func, + fetchContracts: PropTypes.func, + services: PropTypes.array, + contracts: PropTypes.array }; function mapStateToProps(state) { diff --git a/embark-ui/src/containers/TransactionDecoderContainer.js b/embark-ui/src/containers/TransactionDecoderContainer.js index d4e083ba..0747213c 100644 --- a/embark-ui/src/containers/TransactionDecoderContainer.js +++ b/embark-ui/src/containers/TransactionDecoderContainer.js @@ -11,7 +11,7 @@ const getQueryParams = (props) => { return qs.parse(props.location.search, { ignoreQueryPrefix: true }); -} +}; class TransactionDecoderContainer extends Component { @@ -33,7 +33,7 @@ class TransactionDecoderContainer extends Component { render() { return ( - + diff --git a/embark-ui/src/reducers/selectors.js b/embark-ui/src/reducers/selectors.js index 555fd3ce..b3034851 100644 --- a/embark-ui/src/reducers/selectors.js +++ b/embark-ui/src/reducers/selectors.js @@ -33,7 +33,7 @@ export function getTransactionsByAccount(state, address) { } export function getTransactionsByBlock(state, blockNumber) { - return state.entities.transactions.filter((transaction) => transaction.blockNumber.toString() === blockNumber); + return state.entities.transactions.filter((transaction) => transaction.hasOwnProperty('blockNumber') && transaction.blockNumber.toString() === blockNumber); } export function getBlocks(state) { From ef2b4ea5706877cc83ea61f2ca9d2ee823b394c1 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Thu, 25 Oct 2018 15:20:29 -0400 Subject: [PATCH 3/3] fix error message that print undefined --- lib/core/logger.js | 7 +++---- lib/modules/blockchain_connector/index.js | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/core/logger.js b/lib/core/logger.js index 50030ff5..b02781f3 100644 --- a/lib/core/logger.js +++ b/lib/core/logger.js @@ -1,7 +1,6 @@ require('colors'); let fs = require('./fs.js'); const date = require('date-and-time'); -const constants = require('../constants'); const DATE_FORMAT = 'YYYY-MM-DD HH:mm:ss:SSS'; const LOG_REGEX = new RegExp(/\[(\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d:\d\d\d)\] (?:\[(\w*)\]:?)?\s?\s?(.*)/gmi); @@ -91,7 +90,7 @@ Logger.prototype.error = function () { return; } this.events.emit("log", "error", ...arguments); - this.logFunction(...Array.from(arguments).map(t => {return t ? t.red : t;})); + this.logFunction(...Array.from(arguments).map(t => { return t ? t.red : t; })); this.writeToFile("[error]: ", ...arguments); }; @@ -100,7 +99,7 @@ Logger.prototype.warn = function () { return; } this.events.emit("log", "warn", ...arguments); - this.logFunction(...Array.from(arguments).map(t => {return t ? t.yellow : t;})); + this.logFunction(...Array.from(arguments).map(t => { return t ? t.yellow : t; })); this.writeToFile("[warning]: ", ...arguments); }; @@ -109,7 +108,7 @@ Logger.prototype.info = function () { return; } this.events.emit("log", "info", ...arguments); - this.logFunction(...Array.from(arguments).map(t => {return t ? t.green : t;})); + this.logFunction(...Array.from(arguments).map(t => { return t ? t.green : t; })); this.writeToFile("[info]: ", ...arguments); }; diff --git a/lib/modules/blockchain_connector/index.js b/lib/modules/blockchain_connector/index.js index 5f83b45a..a12da9c5 100644 --- a/lib/modules/blockchain_connector/index.js +++ b/lib/modules/blockchain_connector/index.js @@ -538,8 +538,8 @@ class BlockchainConnector { function(next) { async.times(limit, function(n, eachCb) { self.web3.eth.getBlock(from - n, returnTransactionObjects, function(err, block) { - if (err) { - self.logger.error(err); + if (err && err.message) { + // FIXME Returns an error because we are too low return eachCb(); } blocks.push(block);