From 89225b7ea5c9d799bc1f8b10eb46e548ee04be00 Mon Sep 17 00:00:00 2001 From: Miika Turunen Date: Fri, 4 Aug 2017 22:48:28 +0300 Subject: [PATCH 01/83] Refactor wallestnav to use connect & mapstatetoprops --- .../dashboard/main/dashboard.render.js | 2 +- .../dashboard/walletsNav/walletsNav.js | 39 ++++++++++++------- .../dashboard/walletsNav/walletsNav.render.js | 18 ++++----- 3 files changed, 34 insertions(+), 25 deletions(-) diff --git a/react/src/components/dashboard/main/dashboard.render.js b/react/src/components/dashboard/main/dashboard.render.js index 580f60e..2ac1da2 100644 --- a/react/src/components/dashboard/main/dashboard.render.js +++ b/react/src/components/dashboard/main/dashboard.render.js @@ -27,7 +27,7 @@ const DashboardRender = function() {
- + { !this.isNativeMode() && } { !this.isNativeMode() && } diff --git a/react/src/components/dashboard/walletsNav/walletsNav.js b/react/src/components/dashboard/walletsNav/walletsNav.js index 0835bfd..ac7976b 100644 --- a/react/src/components/dashboard/walletsNav/walletsNav.js +++ b/react/src/components/dashboard/walletsNav/walletsNav.js @@ -13,18 +13,17 @@ import { WalletsNavNoWalletRender, WalletsNavWithWalletRender } from './walletsNav.render'; +import { connect } from 'react-redux'; class WalletsNav extends React.Component { - constructor(props) { - super(props); - this.state = { - nativeOnly: Config.iguanaLessMode, - }; + constructor() { + super(); this.toggleSendReceiveCoinForms = this.toggleSendReceiveCoinForms.bind(this); + } componentWillMount() { - Store.dispatch(iguanaEdexBalance(this.props.ActiveCoin.coin)); + Store.dispatch(iguanaEdexBalance(this.props.activeCoin.coin)); } copyMyAddress(address) { @@ -32,10 +31,10 @@ class WalletsNav extends React.Component { } toggleSendReceiveCoinForms() { - if (this.props.ActiveCoin.mode === 'native') { + if (this.props.activeCoin.mode === 'native') { Store.dispatch( toggleDashboardActiveSection( - this.props.ActiveCoin.nativeActiveSection === 'settings' ? 'default' : 'settings' + this.props.activeCoin.nativeActiveSection === 'settings' ? 'default' : 'settings' ) ); } else { @@ -44,10 +43,10 @@ class WalletsNav extends React.Component { } toggleSendCoinForm(display) { - if (this.props.ActiveCoin.mode === 'native') { + if (this.props.activeCoin.mode === 'native') { Store.dispatch( toggleDashboardActiveSection( - this.props.ActiveCoin.nativeActiveSection === 'send' ? 'default' : 'send' + this.props.activeCoin.nativeActiveSection === 'send' ? 'default' : 'send' ) ); } else { @@ -56,10 +55,10 @@ class WalletsNav extends React.Component { } toggleReceiveCoinForm(display) { - if (this.props.ActiveCoin.mode === 'native') { + if (this.props.activeCoin.mode === 'native') { Store.dispatch( toggleDashboardActiveSection( - this.props.ActiveCoin.nativeActiveSection === 'receive' ? 'default' : 'receive' + this.props.activeCoin.nativeActiveSection === 'receive' ? 'default' : 'receive' ) ); } else { @@ -69,8 +68,8 @@ class WalletsNav extends React.Component { render() { if (this.props && - this.props.ActiveCoin && - !this.props.ActiveCoin.coin) { + this.props.activeCoin && + !this.props.activeCoin.coin) { return WalletsNavNoWalletRender.call(this); } @@ -78,4 +77,14 @@ class WalletsNav extends React.Component { } } -export default WalletsNav; +const mapStateToProps = (state) => { + return { + activeCoin: state.ActiveCoin, + activeHandle: state.Dashboard.activeHandle, + activeSection: state.Dashboard.activeSection, + appSettings: state.Settings.appSettings + }; +}; + +export default connect(mapStateToProps)(WalletsNav); + diff --git a/react/src/components/dashboard/walletsNav/walletsNav.render.js b/react/src/components/dashboard/walletsNav/walletsNav.render.js index d740cea..9cc80a1 100644 --- a/react/src/components/dashboard/walletsNav/walletsNav.render.js +++ b/react/src/components/dashboard/walletsNav/walletsNav.render.js @@ -24,15 +24,15 @@ export const WalletsNavWithWalletRender = function() { return (
-
    - { translate('INDEX.MY') } { this.props && this.props.ActiveCoin ? this.props.ActiveCoin.coin : '-' } { translate('INDEX.ADDRESS') }: - { this.props && this.props.Dashboard && this.props.Dashboard.activeHandle ? this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin] : '-' } + style={{ marginBottom: this.props.activeCoin.mode === 'basilisk' ? '30px' : '0' }}> +
      + { translate('INDEX.MY') } { this.props.activeCoin ? this.props.activeCoin.coin : '-' } { translate('INDEX.ADDRESS') }: + { this.props.activeHandle ? this.props.activeHandle[this.props.activeCoin.coin] : '-' }
    @@ -42,18 +42,18 @@ export const WalletsNavWithWalletRender = function() { type="button" className="btn btn-dark waves-effect waves-light" onClick={ this.toggleSendReceiveCoinForms }> - { this.props.ActiveCoin.mode !== 'native' ? translate('INDEX.DASHBOARD') : translate('INDEX.WALLET_INFO') } + { this.props.activeCoin.mode !== 'native' ? translate('INDEX.DASHBOARD') : translate('INDEX.WALLET_INFO') }
From edd82826b27efd4b4cbe178b45f8907f7703f9ba Mon Sep 17 00:00:00 2001 From: Miika Turunen Date: Wed, 9 Aug 2017 18:47:59 +0300 Subject: [PATCH 02/83] Walletnav prop refactor --- .../dashboard/walletsNav/walletsNav.js | 25 ++++++++++++++----- .../dashboard/walletsNav/walletsNav.render.js | 8 +++--- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/react/src/components/dashboard/walletsNav/walletsNav.js b/react/src/components/dashboard/walletsNav/walletsNav.js index 4b17767..0c6ed43 100644 --- a/react/src/components/dashboard/walletsNav/walletsNav.js +++ b/react/src/components/dashboard/walletsNav/walletsNav.js @@ -1,4 +1,5 @@ import React from 'react'; +import { connect } from 'react-redux'; import { copyCoinAddress, iguanaEdexBalance, @@ -15,11 +16,8 @@ import { } from './walletsNav.render'; class WalletsNav extends React.Component { - constructor(props) { - super(props); - this.state = { - nativeOnly: Config.iguanaLessMode, - }; + constructor() { + super(); this.toggleSendReceiveCoinForms = this.toggleSendReceiveCoinForms.bind(this); this.toggleNativeWalletInfo = this.toggleNativeWalletInfo.bind(this); this.toggleNativeWalletTransactions = this.toggleNativeWalletTransactions.bind(this); @@ -124,4 +122,19 @@ class WalletsNav extends React.Component { } } -export default WalletsNav; +const mapStateToProps = (state) => { + return { + ActiveCoin: { + coin: state.ActiveCoin.coin, + mode: state.ActiveCoin.mode, + send: state.ActiveCoin.send, + receive: state.ActiveCoin.receive, + balance: state.ActiveCoin.balance, + }, + ActiveHandle: state.Dashboard.activeHandle, + nativeOnly: Config.iguanaLessMode, + }; + +}; + +export default connect(mapStateToProps)(WalletsNav); diff --git a/react/src/components/dashboard/walletsNav/walletsNav.render.js b/react/src/components/dashboard/walletsNav/walletsNav.render.js index 67d43a7..9b21f8b 100644 --- a/react/src/components/dashboard/walletsNav/walletsNav.render.js +++ b/react/src/components/dashboard/walletsNav/walletsNav.render.js @@ -24,15 +24,15 @@ export const WalletsNavWithWalletRender = function() { return (
-
    +
      { translate('INDEX.MY') } { this.props && this.props.ActiveCoin ? this.props.ActiveCoin.coin : '-' } { translate('INDEX.ADDRESS') }: - { this.props && this.props.Dashboard && this.props.Dashboard.activeHandle ? this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin] : '-' } + { this.props.activeHandle ? this.props.activeHandle[this.props.ActiveCoin.coin] : '-' }
    From 526699b4a505204e2f9dd5cd352d64a062b1ecf6 Mon Sep 17 00:00:00 2001 From: Miika Turunen Date: Wed, 9 Aug 2017 18:48:27 +0300 Subject: [PATCH 03/83] SyncOnly component prop refactor --- .../components/dashboard/syncOnly/syncOnly.js | 23 ++++++++++++++++--- react/src/components/main/walletMain.js | 2 +- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/react/src/components/dashboard/syncOnly/syncOnly.js b/react/src/components/dashboard/syncOnly/syncOnly.js index c79f267..01e06ab 100644 --- a/react/src/components/dashboard/syncOnly/syncOnly.js +++ b/react/src/components/dashboard/syncOnly/syncOnly.js @@ -1,4 +1,5 @@ import React from 'react'; +import { connect } from 'react-redux'; import { getCoinTitle } from '../../../util/coinHelper'; import { translate } from '../../../translate/translate'; import { @@ -17,8 +18,8 @@ import { } from './syncOnly.render'; class SyncOnly extends React.Component { - constructor(props) { - super(props); + constructor() { + super(); this.state = { autoRestartedForks: {}, }; @@ -157,4 +158,20 @@ class SyncOnly extends React.Component { } } -export default SyncOnly; \ No newline at end of file +const mapStateToProps = (state) => { + return { + SyncOnly: { + display: state.SyncOnly.display, + forks: state.SyncOnly.forks, + send: state.ActiveCoin.send, + receive: state.ActiveCoin.receive, + balance: state.ActiveCoin.balance, + }, + Interval: { + interval: state.Interval.interval, + } + }; + +}; + +export default connect(mapStateToProps)(SyncOnly); \ No newline at end of file diff --git a/react/src/components/main/walletMain.js b/react/src/components/main/walletMain.js index 65e0e5c..27961f9 100644 --- a/react/src/components/main/walletMain.js +++ b/react/src/components/main/walletMain.js @@ -11,7 +11,7 @@ class WalletMain extends React.Component { return (
    - + From 219bd18a3a25f65d32b65f3ae27868a322f8d015 Mon Sep 17 00:00:00 2001 From: Miika Turunen Date: Sat, 12 Aug 2017 08:59:19 +0300 Subject: [PATCH 04/83] Navbar & CoinDownModal prop refactor --- .../coindDownModal/coindDownModal.js | 32 +++++++++---------- .../coindDownModal/coindDownModal.render.js | 3 +- .../dashboard/main/dashboard.render.js | 4 +-- .../src/components/dashboard/navbar/navbar.js | 20 ++++++++++-- 4 files changed, 37 insertions(+), 22 deletions(-) diff --git a/react/src/components/dashboard/coindDownModal/coindDownModal.js b/react/src/components/dashboard/coindDownModal/coindDownModal.js index 7d082a2..518f326 100644 --- a/react/src/components/dashboard/coindDownModal/coindDownModal.js +++ b/react/src/components/dashboard/coindDownModal/coindDownModal.js @@ -1,12 +1,13 @@ import React from 'react'; +import { connect } from 'react-redux'; import { toggleCoindDownModal } from '../../../actions/actionCreators'; import Store from '../../../store'; import CoindDownModalRender from './coindDownModal.render'; class CoindDownModal extends React.Component { - constructor(props) { - super(props); + constructor() { + super(); this.state = { display: false, debugLogCrash: null, @@ -18,20 +19,12 @@ class CoindDownModal extends React.Component { Store.dispatch(toggleCoindDownModal(false)); } - componentWillReceiveProps(props) { - const coindDownModalProps = props ? props.Dashboard : null; - - if (coindDownModalProps && - coindDownModalProps.displayCoindDownModal !== this.state.display) { + componentWillReceiveProps(nextProps) { + console.log(nextProps.displayCoindDownModal); + if (this.props.displayCoindDownModal !== nextProps.displayCoindDownModal) { this.setState(Object.assign({}, this.state, { - display: coindDownModalProps.displayCoindDownModal, + display: nextProps.displayCoindDownModal, })); - - setTimeout(() => { - this.setState(Object.assign({}, this.state, { - display: coindDownModalProps.displayCoindDownModal, - })); - }, 100); } } @@ -43,5 +36,12 @@ class CoindDownModal extends React.Component { return null; } } - -export default CoindDownModal; +const mapStateToProps = (state) => { + return { + displayCoindDownModal: state.Dashboard.displayCoindDownModal, + debugLog: state.Settings.debugLog + }; + +}; + +export default connect(mapStateToProps)(CoindDownModal); diff --git a/react/src/components/dashboard/coindDownModal/coindDownModal.render.js b/react/src/components/dashboard/coindDownModal/coindDownModal.render.js index 548e661..d00a81e 100644 --- a/react/src/components/dashboard/coindDownModal/coindDownModal.render.js +++ b/react/src/components/dashboard/coindDownModal/coindDownModal.render.js @@ -24,8 +24,9 @@ const CoindDownModalRender = function () { Debug.log (last 50 lines)
    + value={ this.props.debugLog || '' }>
- +
- - - - - + + + + +
diff --git a/react/src/components/dashboard/walletsNativeInfo/walletsNativeInfo.js b/react/src/components/dashboard/walletsNativeInfo/walletsNativeInfo.js index 4630f4e..92e88fe 100644 --- a/react/src/components/dashboard/walletsNativeInfo/walletsNativeInfo.js +++ b/react/src/components/dashboard/walletsNativeInfo/walletsNativeInfo.js @@ -1,11 +1,12 @@ import React from 'react'; +import { connect } from 'react-redux'; import { toggleClaimInterestModal } from '../../../actions/actionCreators'; import Store from '../../../store'; import WalletsNativeInfoRender from './walletsNativeInfo.render'; class WalletsNativeInfo extends React.Component { - constructor(props) { - super(props); + constructor() { + super(); this.openClaimInterestModal = this.openClaimInterestModal.bind(this); } @@ -25,4 +26,17 @@ class WalletsNativeInfo extends React.Component { } } -export default WalletsNativeInfo; +const mapStateToProps = (state) => { + return { + ActiveCoin: { + coin: state.ActiveCoin.coin, + nativeActiveSection: state.ActiveCoin.nativeActiveSection, + }, + Dashboard: { + progress: state.Dashboard.progress + } + }; + +}; + +export default connect(mapStateToProps)(WalletsNativeInfo); diff --git a/react/src/components/dashboard/walletsNativeInfo/walletsNativeInfo.render.js b/react/src/components/dashboard/walletsNativeInfo/walletsNativeInfo.render.js index 19acf59..6cbd781 100644 --- a/react/src/components/dashboard/walletsNativeInfo/walletsNativeInfo.render.js +++ b/react/src/components/dashboard/walletsNativeInfo/walletsNativeInfo.render.js @@ -47,7 +47,7 @@ const WalletsNativeInfoRender = function() { type="button" className="btn btn-success waves-effect waves-light margin-top-20 btn-next" onClick={ () => this.openClaimInterestModal() }>Claim interest - +
}
diff --git a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js index 3444ff8..ee7958c 100644 --- a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js +++ b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js @@ -1,4 +1,5 @@ import React from 'react'; +import { connect } from 'react-redux'; import Config from '../../../config'; import { translate } from '../../../translate/translate'; import { secondsToString } from '../../../util/time'; @@ -18,8 +19,8 @@ import { } from './walletsNativeSend.render'; class WalletsNativeSend extends React.Component { - constructor(props) { - super(props); + constructor() { + super(); this.state = { addressType: null, sendFrom: null, @@ -359,4 +360,18 @@ class WalletsNativeSend extends React.Component { } } -export default WalletsNativeSend; +const mapStateToProps = (state) => { + return { + ActiveCoin: { + addresses: state.ActiveCoin.addresses, + coin: state.ActiveCoin.coin, + mode: state.ActiveCoin.mode, + opids: state.ActiveCoin.opids, + nativeActiveSection: state.ActiveCoin.nativeActiveSection, + }, + renderFormOnly: state.renderFormOnly + }; + +}; + +export default connect(mapStateToProps)(WalletsNativeSend); diff --git a/react/src/components/dashboard/walletsTxInfo/walletsTxInfo.js b/react/src/components/dashboard/walletsTxInfo/walletsTxInfo.js index 245f98e..5afc090 100644 --- a/react/src/components/dashboard/walletsTxInfo/walletsTxInfo.js +++ b/react/src/components/dashboard/walletsTxInfo/walletsTxInfo.js @@ -1,4 +1,5 @@ import React from 'react'; +import { connect } from 'react-redux'; import { sortByDate } from '../../../util/sort'; import { toggleDashboardTxInfoModal } from '../../../actions/actionCreators'; import Store from '../../../store'; @@ -60,6 +61,7 @@ const mapStateToProps = (state) => { showTransactionInfo: state.ActiveCoin.showTransactionInfo, nativeActiveSection: state.ActiveCoin.nativeActiveSection, activeAddress: state.ActiveCoin.activeAddress, + showTransactionInfoTxIndex: state.ActiveCoin.showTransactionInfoTxIndex, } }; From 8f234fd5c7101877cd4b4a1bbc4cff44461e748b Mon Sep 17 00:00:00 2001 From: Miika Turunen Date: Wed, 16 Aug 2017 23:20:49 +0300 Subject: [PATCH 15/83] ActiveSection fixes --- .../components/addcoin/addcoinOptionsCrypto.js | 14 +++++++++++--- react/src/components/dashboard/atomic/atomic.js | 15 ++++++++++++--- .../claimInterestModal/claimInterestModal.js | 2 +- .../components/dashboard/main/dashboard.render.js | 2 +- .../dashboard/receiveCoin/receiveCoin.js | 2 +- .../src/components/dashboard/sendCoin/sendCoin.js | 1 - .../dashboard/walletsBalance/walletsBalance.js | 2 +- .../dashboard/walletsData/walletsData.js | 2 +- .../dashboard/walletsInfo/walletsInfo.js | 4 ++-- .../walletsNativeSend/walletsNativeSend.js | 2 +- .../components/dashboard/walletsNav/walletsNav.js | 2 +- .../dashboard/walletsTxInfo/walletsTxInfo.js | 2 +- 12 files changed, 33 insertions(+), 17 deletions(-) diff --git a/react/src/components/addcoin/addcoinOptionsCrypto.js b/react/src/components/addcoin/addcoinOptionsCrypto.js index fec1d56..c192407 100644 --- a/react/src/components/addcoin/addcoinOptionsCrypto.js +++ b/react/src/components/addcoin/addcoinOptionsCrypto.js @@ -1,10 +1,11 @@ import React from 'react'; +import { connect } from 'react-redux'; import { translate } from '../../translate/translate'; import Config from '../../config'; class AddCoinOptionsCrypto extends React.Component { - constructor(props) { - super(props); + constructor() { + super(); this.state = { nativeOnly: Config.iguanaLessMode, } @@ -60,4 +61,11 @@ class AddCoinOptionsCrypto extends React.Component { } } -export default AddCoinOptionsCrypto; +const mapStateToProps = (state) => { + return { + appSettings: state.appSettings, + }; + +}; + +export default connect(mapStateToProps)(AddCoinOptionsCrypto); diff --git a/react/src/components/dashboard/atomic/atomic.js b/react/src/components/dashboard/atomic/atomic.js index 031b473..98ac693 100755 --- a/react/src/components/dashboard/atomic/atomic.js +++ b/react/src/components/dashboard/atomic/atomic.js @@ -1,4 +1,5 @@ import React from 'react'; +import { connect } from 'react-redux'; import { atomic } from '../../../actions/actionCreators'; import Store from '../../../store'; @@ -10,8 +11,8 @@ import AtomicRender from './atomic.render'; 2) validation */ class Atomic extends React.Component { - constructor(props) { - super(props); + constructor() { + super(); this.state = { output: null, api: null, @@ -496,5 +497,13 @@ class Atomic extends React.Component { return AtomicRender.call(this); } } +const mapStateToProps = (state) => { + return { + Atomic: { + response: state.Atomic.response, + } + }; + +}; -export default Atomic; +export default connect(mapStateToProps)(Atomic); diff --git a/react/src/components/dashboard/claimInterestModal/claimInterestModal.js b/react/src/components/dashboard/claimInterestModal/claimInterestModal.js index d9a82dd..c6972ea 100755 --- a/react/src/components/dashboard/claimInterestModal/claimInterestModal.js +++ b/react/src/components/dashboard/claimInterestModal/claimInterestModal.js @@ -138,7 +138,7 @@ const mapStateToProps = (state) => { ActiveCoin: { coin: state.ActiveCoin.coin, balance: state.ActiveCoin.balance, - nativeActiveSection: state.ActiveCoin.nativeActiveSection, + activeSection: state.ActiveCoin.activeSection, }, Dashboard: { displayClaimInterestModal: state.Dashboard.displayClaimInterestModal diff --git a/react/src/components/dashboard/main/dashboard.render.js b/react/src/components/dashboard/main/dashboard.render.js index d71ebf7..c6b2026 100644 --- a/react/src/components/dashboard/main/dashboard.render.js +++ b/react/src/components/dashboard/main/dashboard.render.js @@ -37,7 +37,7 @@ const DashboardRender = function() { { this.isSectionActive('edex') && - + } { this.isSectionActive('atomic') && diff --git a/react/src/components/dashboard/receiveCoin/receiveCoin.js b/react/src/components/dashboard/receiveCoin/receiveCoin.js index b76e84b..c9f0097 100644 --- a/react/src/components/dashboard/receiveCoin/receiveCoin.js +++ b/react/src/components/dashboard/receiveCoin/receiveCoin.js @@ -224,7 +224,7 @@ const mapStateToProps = (state) => { receive: state.ActiveCoin.receive, balance: state.ActiveCoin.balance, cache: state.ActiveCoin.cache, - nativeActiveSection: state.ActiveCoin.nativeActiveSection, + activeSection: state.ActiveCoin.activeSection, activeAddress: state.ActiveCoin.activeAddress, addresses: state.ActiveCoin.addresses }; diff --git a/react/src/components/dashboard/sendCoin/sendCoin.js b/react/src/components/dashboard/sendCoin/sendCoin.js index 602f611..c984fab 100644 --- a/react/src/components/dashboard/sendCoin/sendCoin.js +++ b/react/src/components/dashboard/sendCoin/sendCoin.js @@ -778,7 +778,6 @@ const mapStateToProps = (state) => { receive: state.ActiveCoin.receive, balance: state.ActiveCoin.balance, cache: state.ActiveCoin.cache, - nativeActiveSection: state.ActiveCoin.nativeActiveSection, activeAddress: state.ActiveCoin.activeAddress, lastSendToResponse: state.ActiveCoin.lastSendToResponse, addresses: state.ActiveCoin.addresses, diff --git a/react/src/components/dashboard/walletsBalance/walletsBalance.js b/react/src/components/dashboard/walletsBalance/walletsBalance.js index 9a3ae70..aef0381 100755 --- a/react/src/components/dashboard/walletsBalance/walletsBalance.js +++ b/react/src/components/dashboard/walletsBalance/walletsBalance.js @@ -197,7 +197,7 @@ const mapStateToProps = (state) => { receive: state.ActiveCoin.receive, balance: state.ActiveCoin.balance, cache: state.ActiveCoin.cache, - nativeActiveSection: state.ActiveCoin.nativeActiveSection, + activeSection: state.ActiveCoin.activeSection, activeAddress: state.ActiveCoin.activeAddress }, Dashboard: { diff --git a/react/src/components/dashboard/walletsData/walletsData.js b/react/src/components/dashboard/walletsData/walletsData.js index a919ef3..af48e0e 100644 --- a/react/src/components/dashboard/walletsData/walletsData.js +++ b/react/src/components/dashboard/walletsData/walletsData.js @@ -657,7 +657,7 @@ const mapStateToProps = (state) => { receive: state.ActiveCoin.receive, balance: state.ActiveCoin.balance, cache: state.ActiveCoin.cache, - nativeActiveSection: state.ActiveCoin.nativeActiveSection, + activeSection: state.ActiveCoin.activeSection, activeAddress: state.ActiveCoin.activeAddress, lastSendToResponse: state.ActiveCoin.lastSendToResponse, addresses: state.ActiveCoin.addresses, diff --git a/react/src/components/dashboard/walletsInfo/walletsInfo.js b/react/src/components/dashboard/walletsInfo/walletsInfo.js index 4a6df93..66a6a61 100644 --- a/react/src/components/dashboard/walletsInfo/walletsInfo.js +++ b/react/src/components/dashboard/walletsInfo/walletsInfo.js @@ -4,7 +4,7 @@ import WalletsNativeInfoRender from './walletsInfo.render'; import { toggleClaimInterestModal } from '../../../actions/actionCreators'; import Store from '../../../store'; -class WalletsNativeInfo extends React.Component { +class WalletsInfo extends React.Component { constructor() { super(); this.openClaimInterestModal = this.openClaimInterestModal.bind(this); @@ -39,4 +39,4 @@ const mapStateToProps = (state) => { }; -export default connect(mapStateToProps)(WalletsNativeInfo); +export default connect(mapStateToProps)(WalletsInfo); diff --git a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js index c46e233..6af8ce0 100644 --- a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js +++ b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js @@ -367,7 +367,7 @@ const mapStateToProps = (state) => { coin: state.ActiveCoin.coin, mode: state.ActiveCoin.mode, opids: state.ActiveCoin.opids, - nativeActiveSection: state.ActiveCoin.nativeActiveSection, + activeSection: state.ActiveCoin.activeSection, }, renderFormOnly: state.renderFormOnly }; diff --git a/react/src/components/dashboard/walletsNav/walletsNav.js b/react/src/components/dashboard/walletsNav/walletsNav.js index ae7c408..ce92355 100644 --- a/react/src/components/dashboard/walletsNav/walletsNav.js +++ b/react/src/components/dashboard/walletsNav/walletsNav.js @@ -131,7 +131,7 @@ const mapStateToProps = (state) => { receive: state.ActiveCoin.receive, balance: state.ActiveCoin.balance, cache: state.ActiveCoin.cache, - nativeActiveSection: state.ActiveCoin.nativeActiveSection, + ativeSection: state.ActiveCoin.activeSection, activeAddress: state.ActiveCoin.activeAddress }, ActiveHandle: state.Dashboard.activeHandle, diff --git a/react/src/components/dashboard/walletsTxInfo/walletsTxInfo.js b/react/src/components/dashboard/walletsTxInfo/walletsTxInfo.js index 42141a0..8a8d0e3 100644 --- a/react/src/components/dashboard/walletsTxInfo/walletsTxInfo.js +++ b/react/src/components/dashboard/walletsTxInfo/walletsTxInfo.js @@ -59,7 +59,7 @@ const mapStateToProps = (state) => { mode: state.ActiveCoin.mode, txhistory: state.ActiveCoin.txhistory, showTransactionInfo: state.ActiveCoin.showTransactionInfo, - nativeActiveSection: state.ActiveCoin.nativeActiveSection, + activeSection: state.ActiveCoin.activeSection, activeAddress: state.ActiveCoin.activeAddress, showTransactionInfoTxIndex: state.ActiveCoin.showTransactionInfoTxIndex, } From 8923219384478d178ce37315cdc577a8644055e7 Mon Sep 17 00:00:00 2001 From: Miika Turunen Date: Thu, 17 Aug 2017 00:16:34 +0300 Subject: [PATCH 16/83] Jumblr prop refactor --- react/src/components/dashboard/jumblr/jumblr.js | 16 +++++++++++++--- .../components/dashboard/jumblr/jumblr.render.js | 2 -- .../dashboard/main/dashboard.render.js | 4 ++-- react/src/components/dashboard/navbar/navbar.js | 4 ++++ .../walletsNativeSend/walletsNativeSend.js | 7 +++---- 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/react/src/components/dashboard/jumblr/jumblr.js b/react/src/components/dashboard/jumblr/jumblr.js index a69dbd1..d5d1582 100755 --- a/react/src/components/dashboard/jumblr/jumblr.js +++ b/react/src/components/dashboard/jumblr/jumblr.js @@ -1,4 +1,5 @@ import React from 'react'; +import { connect } from 'react-redux'; import { translate } from '../../../translate/translate'; import { dashboardChangeActiveCoin, @@ -39,8 +40,8 @@ if (!window.jumblrPasshrase) { // gen jumblr passphrase } class Jumblr extends React.Component { - constructor(props) { - super(props); + constructor() { + super(); this.state = { activeTab: 0, randomSeed: window.jumblrPasshrase, @@ -418,4 +419,13 @@ class Jumblr extends React.Component { } } -export default Jumblr; +const mapStateToProps = (state) => { + return { + ActiveCoin: { + coin: state.ActiveCoin.coin, + } + }; + +}; + +export default connect(mapStateToProps)(Jumblr); diff --git a/react/src/components/dashboard/jumblr/jumblr.render.js b/react/src/components/dashboard/jumblr/jumblr.render.js index fe060f7..cd8718b 100644 --- a/react/src/components/dashboard/jumblr/jumblr.render.js +++ b/react/src/components/dashboard/jumblr/jumblr.render.js @@ -369,7 +369,6 @@ export const JumblrRender = function() {

Use the form below to send funds to your jumblr deposit address.

You can also send funds to deposit address from an external service or another wallet.

@@ -475,7 +474,6 @@ export const JumblrRender = function() {
diff --git a/react/src/components/dashboard/main/dashboard.render.js b/react/src/components/dashboard/main/dashboard.render.js index c6b2026..66f3891 100644 --- a/react/src/components/dashboard/main/dashboard.render.js +++ b/react/src/components/dashboard/main/dashboard.render.js @@ -40,10 +40,10 @@ const DashboardRender = function() { } { this.isSectionActive('atomic') && - + } { this.isSectionActive('jumblr') && - + } { this.isSectionActive('settings') && diff --git a/react/src/components/dashboard/navbar/navbar.js b/react/src/components/dashboard/navbar/navbar.js index 63de947..c4adac0 100755 --- a/react/src/components/dashboard/navbar/navbar.js +++ b/react/src/components/dashboard/navbar/navbar.js @@ -117,6 +117,10 @@ class Navbar extends React.Component { } const mapStateToProps = (state) => { return { + ActiveCoin: { + mode: state.ActiveCoin.mode, + coin: state.ActiveCoin.coin, + }, Dashboard: { activeSection: state.Dashboard.activeSection, }, diff --git a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js index 6af8ce0..96178fc 100644 --- a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js +++ b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js @@ -19,8 +19,8 @@ import { } from './walletsNativeSend.render'; class WalletsNativeSend extends React.Component { - constructor() { - super(); + constructor(props) { + super(props); this.state = { addressType: null, sendFrom: null, @@ -368,8 +368,7 @@ const mapStateToProps = (state) => { mode: state.ActiveCoin.mode, opids: state.ActiveCoin.opids, activeSection: state.ActiveCoin.activeSection, - }, - renderFormOnly: state.renderFormOnly + } }; }; From 036196990daf98356e374ecb2c31a290b0ccab45 Mon Sep 17 00:00:00 2001 From: Miika Turunen Date: Sun, 20 Aug 2017 10:42:25 +0300 Subject: [PATCH 17/83] Use props instead of state --- .../components/dashboard/walletsNav/walletsNav.render.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/react/src/components/dashboard/walletsNav/walletsNav.render.js b/react/src/components/dashboard/walletsNav/walletsNav.render.js index 58e7cf1..85892f6 100644 --- a/react/src/components/dashboard/walletsNav/walletsNav.render.js +++ b/react/src/components/dashboard/walletsNav/walletsNav.render.js @@ -24,10 +24,10 @@ export const WalletsNavWithWalletRender = function() { return (
-
    + style={{ marginBottom: this.props.ActiveCoin.mode === 'basilisk' ? '30px' : (this.props.nativeOnly ? '30px' : '0') }}> +
      { translate('INDEX.MY') } { this.props && this.props.ActiveCoin ? this.props.ActiveCoin.coin : '-' } { translate('INDEX.ADDRESS') }: { this.props && this.props.Dashboard && this.props.Dashboard.activeHandle ? this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin] : '-' } - +
}
From 299c7a3907c81509bb54d337a44f9e62fa682d01 Mon Sep 17 00:00:00 2001 From: Miika Turunen Date: Wed, 23 Aug 2017 22:57:14 +0300 Subject: [PATCH 20/83] Fixed typo --- react/src/components/dashboard/walletsNav/walletsNav.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react/src/components/dashboard/walletsNav/walletsNav.js b/react/src/components/dashboard/walletsNav/walletsNav.js index ce92355..96b3732 100644 --- a/react/src/components/dashboard/walletsNav/walletsNav.js +++ b/react/src/components/dashboard/walletsNav/walletsNav.js @@ -131,7 +131,7 @@ const mapStateToProps = (state) => { receive: state.ActiveCoin.receive, balance: state.ActiveCoin.balance, cache: state.ActiveCoin.cache, - ativeSection: state.ActiveCoin.activeSection, + activeSection: state.ActiveCoin.activeSection, activeAddress: state.ActiveCoin.activeAddress }, ActiveHandle: state.Dashboard.activeHandle, From 07c8f3efd3c245ba546759c1ae767ccd54caa990 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Sun, 27 Aug 2017 15:04:23 +0300 Subject: [PATCH 21/83] disable jumblr for ac --- react/change.log | 3 ++- react/src/actions/actions/nativeSend.js | 4 ++-- react/src/components/dashboard/navbar/navbar.render.js | 2 +- .../dashboard/walletsNativeSend/walletsNativeSend.js | 5 +++-- react/src/translate/en.js | 4 ++-- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/react/change.log b/react/change.log index d856f0b..ff11909 100644 --- a/react/change.log +++ b/react/change.log @@ -8,7 +8,7 @@ UI: - minor placeholders fixes - hide address dropdown if wallet has only one address - komodod crash report modal -- values rounding (up to 6 decimals) +- values clipping - add coin multi ui reflow fix - reset app setting to default - manual balance / transactions list refresh @@ -26,6 +26,7 @@ UI: - coin daemon port check on addcoin - updated application settings - komodo datadir +- windows bins path fix v0.2.0.21a-beta -------------- diff --git a/react/src/actions/actions/nativeSend.js b/react/src/actions/actions/nativeSend.js index 17032ed..9cb421f 100644 --- a/react/src/actions/actions/nativeSend.js +++ b/react/src/actions/actions/nativeSend.js @@ -251,7 +251,7 @@ export function getKMDOPID(opid, coin) { payload = { mode: null, chain: coin, - cmd: 'z_getoperationstatus' + cmd: 'z_getoperationstatus', }; _fetchConfig = { @@ -342,6 +342,6 @@ export function sendToAddressPromise(coin, address, amount) { .then(response => response.json()) .then(json => { resolve(json); - }) + }); }); } \ No newline at end of file diff --git a/react/src/components/dashboard/navbar/navbar.render.js b/react/src/components/dashboard/navbar/navbar.render.js index 4449f5f..d0e2d1f 100644 --- a/react/src/components/dashboard/navbar/navbar.render.js +++ b/react/src/components/dashboard/navbar/navbar.render.js @@ -57,7 +57,7 @@ const NavbarRender = function() { BarterDEX - { this.props.ActiveCoin && this.props.ActiveCoin.mode === 'native' && (this._checkAC() || this.props.ActiveCoin.coin === 'KMD') && + { this.props.ActiveCoin && this.props.ActiveCoin.mode === 'native' && (/*this._checkAC() || */this.props.ActiveCoin.coin === 'KMD') &&
  • this.dashboardChangeSection('jumblr') }> Jumblr diff --git a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js index 0d9771c..e5daafb 100644 --- a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js +++ b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js @@ -17,7 +17,7 @@ import { WalletsNativeSendFormRender, _WalletsNativeSendFormRender } from './walletsNativeSend.render'; -import { isPositiveNumber } from "../../../util/number"; +import { isPositiveNumber } from '../../../util/number'; class WalletsNativeSend extends React.Component { constructor(props) { @@ -376,6 +376,7 @@ class WalletsNativeSend extends React.Component { validateSendFormData() { let valid = true; + if (!this.state.sendTo || this.state.sendTo.length < 34) { Store.dispatch( @@ -455,7 +456,7 @@ const mapStateToProps = (state) => { activeSection: state.ActiveCoin.activeSection, } }; - + }; export default connect(mapStateToProps)(WalletsNativeSend); diff --git a/react/src/translate/en.js b/react/src/translate/en.js index 4e7f46c..270081a 100644 --- a/react/src/translate/en.js +++ b/react/src/translate/en.js @@ -2,10 +2,10 @@ export const _lang = { 'EN': { 'CLAIM_INTEREST': { 'REQ_P1': 'Requirements to accrue interest', - 'REQ_P2': 'locktime field is set and amount is greater than', + 'REQ_P2': 'spend transaction was made at least 1 hour ago, locktime field is set and amount is greater than', 'CLAIM_INTEREST': 'Claim interest', 'LOADING': 'Loading interest data', - 'NO_DATA': 'No data' + 'NO_DATA': 'No data', }, 'ABOUT': { 'ABOUT_AGAMA': 'About Agama', From 34b3b70b16e128e8d5732a1261bbb56c93a089a8 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Mon, 28 Aug 2017 21:07:17 +0300 Subject: [PATCH 22/83] disable full mode by default --- assets/mainWindow/css/loading.css | 274 +++++++++++++++++- assets/mainWindow/img/fa-close.png | Bin 0 -> 2522 bytes assets/mainWindow/img/fa-cogs.png | Bin 0 -> 4844 bytes assets/mainWindow/img/fa-cube.png | Bin 0 -> 3474 bytes assets/mainWindow/img/fa-cubes.png | Bin 0 -> 3731 bytes assets/mainWindow/img/fa-question.png | Bin 0 -> 2595 bytes assets/mainWindow/js/loading.js | 244 +++++++++++++--- .../addcoin/addcoinOptionsACFiat.js | 75 +++-- .../addcoin/addcoinOptionsCrypto.js | 44 +-- .../addcoin/coin-selectors.render.js | 9 +- .../components/dashboard/settings/settings.js | 3 +- .../walletsNativeSend/walletsNativeSend.js | 6 +- 12 files changed, 560 insertions(+), 95 deletions(-) create mode 100644 assets/mainWindow/img/fa-close.png create mode 100644 assets/mainWindow/img/fa-cogs.png create mode 100644 assets/mainWindow/img/fa-cube.png create mode 100644 assets/mainWindow/img/fa-cubes.png create mode 100644 assets/mainWindow/img/fa-question.png diff --git a/assets/mainWindow/css/loading.css b/assets/mainWindow/css/loading.css index 8782de6..47ad63a 100644 --- a/assets/mainWindow/css/loading.css +++ b/assets/mainWindow/css/loading.css @@ -2,6 +2,8 @@ body { overflow: hidden !important; border: solid 1px #ccc; height: 300px; + user-select: none; + cursor: default; } .text-center { @@ -31,6 +33,15 @@ body.agamaMode { background-color: rgba(33, 33, 33, 0.85); padding-top: 40px; color: #fff; + height: 335px; +} + +body.agama-default-window-height { + height: 300px !important; +} + +body.agama-app-settings-window { + height: 770px; } .agama-logo { @@ -38,11 +49,21 @@ body.agamaMode { } #agamaModeStatus { - padding-bottom: 25px; + padding-bottom: 35px; font-weight: bold; font-size: 16px; } +.btn-info { + color: #fff; + background-color: #25b4c5 !important; + border-color: #25b4c5 !important; +} +.btn-info:hover { + background-color: #6cd2de !important; + border-color: #6cd2de !important; +} + .btn-primary.focus, .btn-primary:focus, .btn-primary:hover, @@ -67,8 +88,8 @@ body.agamaMode { font-size: 14px; line-height: 1.57142857; border-radius: 3px; - -webkit-box-shadow: 0 1px 4px 0 rgba(0,0,0,.1); - box-shadow: 0 1px 4px 0 rgba(0,0,0,.1); + -webkit-box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.1); + box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.1); -webkit-transition: border .2s linear,color .2s linear,width .2s linear,background-color .2s linear; -o-transition: border .2s linear,color .2s linear,width .2s linear,background-color .2s linear; transition: border .2s linear,color .2s linear,width .2s linear,background-color .2s linear; @@ -114,4 +135,251 @@ body.agamaMode { .app-closing { position: relative; top: 50px; +} + +.height--auto { + height: auto; +} + +.settings-title { + font-weight: bold; + margin-bottom: 30px; +} + +.margin-right-5 { + margin-right: 5px; +} +.margin-right-10 { + margin-right: 10px; +} +.margin-right-20 { + margin-right: 20px; +} +.margin-top-15 { + margin-top: 15px; +} +.margin-top-20 { + margin-top: 20px; +} + +.btn-close { + border-bottom-left-radius: 50%; + background: #fff; + color: rgba(33, 33, 33, 0.85); + padding: 8px 10px; + font-weight: bold; + font-size: 20px; + position: absolute; + top: 0; + right: 0; + cursor: pointer; +} + +.btn-close img { + height: 12px; + position: relative; + top: -1px; + right: -1px; +} + +.btn-mode img { + height: 20px; + position: relative; + top: -1px; + left: -4px; + padding-right: 5px; +} + +/* settings */ +.settings-help { + position: relative; + top: -2px; + left: 10px; + color: #fff; + border-radius: 50%; + background: #5683ad; + display: inline-block; + padding: 4px 4px; + line-height: 30px; + cursor: default; +} + +.settings-help img { + height: 13px; +} + +.settings-buttons-block { + margin-top: 50px; +} + +.settings-table { + margin: 0 auto; + width: 650px; + text-align: left; +} + +.settings-table input[type="number"] { + width: 100px; + padding: 0 4px; +} + +.settings-table input[type="text"] { + width: 100%; + padding: 0 4px; +} + +.settings-table td { + padding-bottom: 35px; +} + +.settings-table tr:last-child td { + padding: 0; +} + +.settings-table .left { + width: 50%; +} + +.settings-table .right { + width: 50%; + text-align: left; +} + +.agama-app-settings-window #agamaModeStatus { + padding-bottom: 50px; +} + +/* toggle */ +.slider { + border-radius: 20px; + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: #fff; + transition: .4s; +} +.switch input { + display: none; +} +input[type=checkbox], +input[type=radio] { + margin: 4px 0 0; + margin-top: 1px\9; + line-height: normal; +} +input[type=checkbox], +input[type=radio] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + padding: 0; +} +.switch { + position: relative; + display: inline-block; + width: 40px; + height: 24px; +} +label { + font-weight: 300; +} +label { + display: inline-block; + max-width: 100%; + margin-bottom: 5px; + font-weight: 700; +} +input:checked + .slider { + background: #36ab7a; +} +input:checked + .slider:before { + background: #fff; +} +input:checked + .slider:before { + -ms-transform: translateX(16px); + transform: translateX(16px); +} +.slider:before { + content: ''; + display: inline-block; + border-radius: 50%; + position: absolute; + height: 20px; + width: 20px; + left: 2px; + bottom: 2px; + background-color: #ccc; + transition: .4s; +} +input[type="text"], +input[type="number"] { + color: rgb(33, 33, 33); +} + +/* toastr */ +#toast-container { + position: fixed; + z-index: 999999; +} +.toast-bottom-right { + right: 12px; + bottom: 12px; +} +#toast-container > .toast-success { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==) !important; +} +#toast-container > .toast-error { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=) !important; +} +#toast-container > div { + margin: 0 0 6px; + padding: 15px 15px 15px 50px; + width: 300px; + -moz-border-radius: 3px 3px 3px 3px; + -webkit-border-radius: 3px 3px 3px 3px; + border-radius: 3px 3px 3px 3px; + background-position: 15px center; + background-repeat: no-repeat; + color: #fff; +} +.toast-success { + background-color: #51a351; +} +.toast-error { + background-color: #bd362f; +} +.toast-title { + font-weight: bold; + text-align: left; + margin-left: 10px; +} +button.toast-close-button { + padding: 0; + cursor: pointer; + background: transparent; + border: 0; + -webkit-appearance: none; +} +.toast-close-button { + position: relative; + right: -0.3em; + top: -0.3em; + float: right; + font-size: 20px; + font-weight: bold; + color: #fff; + -webkit-text-shadow: 0 1px 0 #fff; + text-shadow: 0 1px 0 #fff; + opacity: .8; + -ms-filter: alpha(opacity=80); + filter: alpha(opacity=80); +} +.toast-message { + text-align: left; + margin-left: 10px; + -ms-word-wrap: break-word; + word-wrap: break-word; } \ No newline at end of file diff --git a/assets/mainWindow/img/fa-close.png b/assets/mainWindow/img/fa-close.png new file mode 100644 index 0000000000000000000000000000000000000000..541cde8464c56273dd25345e8807e97e4acec000 GIT binary patch literal 2522 zcmeHJ=~q+t7ELbwiQX$FJP26PM|?PdF@_dfv8~NTP-+#K2L)c@1Xe9*0YRxrh&V%& zWko@dT$uvOB%{0qB%(M15djet5)lK)EWu3o!pooWKD@KmS!eIBd+&4Bx#Y9k(*j-w zlSm|s9lv<^kw|0{B$F1Jna0uLkN^|O_SqG%%|uuJzy4PhxFsA2H92%C)^E2zi42*2 z1s0euTm&PFEtXI$t*mLbOTV^TzQUfq@?Q?C*Q{N~U~XVJf9tZ*m5sW&Z}Z&otCzQr zUqDcBNNCu;{SlEzkNqBf{6tJ_T>Pm-9$#?r(v_6IuBN5m%*JwZ^9u^^+$}4wsH&~| zPkp2O!Nca~Ep3X9uHJY3s)0fE@W|-+6EYDD+z3 z(#O*-i=XD?q!-lO%vTF*CJ$YwMeW&BQ@E!nt!Ufz{c52*q^SMNOPHRaU9b2<@=y*WIVY^J5CI!$GVm&WsPnT z0}sF1o3O^a^uqgS;(nL-R>R&8oBLCrMEO^`O#dYJo@*}% z&V7-^{~_AvZcIhQ*yLPwSJ&g3^3>%8uZRBZ>y#bIYwbJflDb@aa>(`tbT_)X;VmXq zR-xx4QZ!9jj^;~p(Q0L}-~zirAW{|zZm_Eb5@nu1$}SO-aZ*j?_!0}dnWzqeXJnC15UW$AuB-8%n1}cVfhK3DH};Q zI2b8Y7Eb<|ok-r!ABD1bYN&WF2qX~2Af0GMjvK#5%8i*cm9~;bonkTR?<3dI2iEph z9v*bIJVIW{ZZ8E6(f_z@L!IdubeM4vnV@*as&6FQu1LA26S~UFsf=ORTPE3vXRUtE z+%vKoV$#Q@M_pXZ7gY)FONKLwGWMQzMjUk`n$9*W4>8z?dxW<&>=c7oysEkGN^%JL z%zM&x({2H%!ZrD$tC|>?TB`gwPow&x3h&x?M}!P)SbCz{^Dx**#CFG7hL8i<#K^l< zLF91utv{kd;>5gC2mQ#FI_W-NP(@TdtQ$}ENBg`R+PcS)T+=ibJL!s&k@=~!lr2lHo-(0FavYC*4c6m`(!S(OWT^a+jQ^fd z{y}(%Y&HLKKz4RLLf0`7u5KL0bS3byPctWqtN=f6vSCy$&{-VRq}m9*W<`R{PQM1 zduUv3WDqKs1d=WJ+d(qkV@;ij^g~}twvm1L3qUe41s)M9V2!^70k|Ao!^=S@jsa^z z3<3xNxJDcYodnmUj1Sm_qaX!$1}!)pEGDR67eN9kgc`IEj{ylU0CfC3K=BB`#oM+V zdmkO!r1ScDK1^Q{)@mo;Hq8?E^7KzDH6M{s3H_F}HDiX&-?7!bg*~68+%vY@&_h zo5?`zu*@^5iAV#NwZYaQ3+8IT^>Z>WQzW)zL2Kq5W)Vkl41X<~ecLbcledX{xz)Fo zchDygUtzIR=9^SmttWb;Yk0Yky+UDM`NfX*=DSUeJ^j)C+}MeouII`4_aH)c{tzQs znI}J})l7+&^8SXRy<5NB)-mCfT_qDq)1lTOqwj`Xd1s--EIaaNZ<=da;;r1$1s{W1 z$J^o#=&O;ic*X<#Ian4&yUD4QpXoLm3T95-xcfo>9TIjj%34ttqVgYV1e#G=LUUcP zC2<6N|AUsA$0?GtI~1VI-4F*am;CdzWk;DGmuT5-)=}o8y3lj$493$#W-&k7x)HBH zKi|3IEot_J&3%nB)LrB)G^|G6jqP!+wCZ97b7Na`GWrU6MNqEUd}dGTryEY?k66Bf zXDnarl0-(zl*mwjc074IJ3h&V*AEq&nn`4tqMHSJb$YnmsE4a&V@#(ghE_N=V@;i& zu`blaSW`d8SWit!ZK*R-+o{h|8>&WXGo_KzsIw*&q$+PG`k1#9RV8B4Cqyjjpood7 zL`>?ih=C1=Op7IQ!Ujc7)b|t?rlzo{A1O?1n8KuvP#D-J3WGXMal*zZPGXgog-vK# z;z2EwtI{&X!&(M+K+6!1X`Q%(S|_=xYy($awn08nwvIbowoX16AC;IHub{Yg_!|pm zyP`_>W%hJ_%5DDJm^Hik)pLH`g%gLGGYag2yEBZp-kzu(>09zTA+jbs)Zp;N&q6*K zHgr3moinsR7oYue!{LGF{Yw_kX-0TQ+t*4a_!Vvu($OM<6W-wR&FS$L^B;{|O=aY` n>K@{7-~*qtdAe6EwpGji%;%|P-I96J3qabjZMR41R<7{B1guSg literal 0 HcmV?d00001 diff --git a/assets/mainWindow/img/fa-cogs.png b/assets/mainWindow/img/fa-cogs.png new file mode 100644 index 0000000000000000000000000000000000000000..3faf85401717d60f56f95ea32daccffefae3509a GIT binary patch literal 4844 zcmeI0*IN@zx5Yz;AP^uFsiB8xq)1mv5+EVc0-=Kx6$nLow@^awN)SXk0fI=AB1NS) zDUqU54KJvGH07m;g@fOD&OdOjzqy&;+IueM+0R_8HOc0tXbzwd5C8yh7-94+006o( zqyw-roNeBf&cFW_Qwi2&)(4MU<*@A03AI8BNHY^Z(xWv!d^2rF*P&CS>Ua#ZEWov9G$K^ySm-D>F(i4@b>Zb^A89L4haj7h`Mv{ zespYHd_q!kYFb8S_JbVKqrArjg+(Q0<>bohny1g|8=9J1+S)t1UUm2M4GayBj!jIy zot}L^H@~<{`)BR*`o`Do-EaE`M?Zf4ehN>6003N1jPwzB!SmZaiTCkVz09`LhCH_<&jVxdNx%ynRw%f(-tnI zk^AQ-Q4`u>gCk=KlX2WqhG~LIZv9EzQcWgvF@C-pz@m94q9fm;VbdH7ON`osg8i)2 zS}w`1-4{&qA2pZXzwSm(5Y}m^pO71(t0;A$EC+065Y-;DMJwU`G%WgO^1O!{F;{uQ zCSsV|?_Z_swLJ6+%81iW{y@EP1KIZcL}@a&Y`YfsT%EtJfvG))_S!HTH8AY8I{#B8xYGC&*A#a0A;pv0!QUb>(gz8B{Q(H9ZLbfoF040hvW*UY~~b9Ehe5F|ATAMyVSmbgVOC=(*j|- z2-}YFR#V0I^#ptA0l}6O(YiVO0t?!Mk^rtQf6Ub8Q=?6XKER`ZT?Q@47q=`oc%In3 z#3O-sOk0G`BtZ%Ms)EOYCOCUN&Owbdh;o%BWzjF;e}Zq%;em+KSS;22L-@T(eazg9 zzhEHmVe3x4fn))e9~_I1o&QI0SCf|55A}M%aXyM=cOjZl&8p1&8;%VYG4!LmML8+G zoKw6Xd+A%uc9Mss3_V`~)*SkJ1YPzVqViB{P|wqvn7P%am}4SS%~;LoF&VF^|Bxvr zeg?-y_tl#-pnnjgMxr+tM9FA8eiJ?}A?;n3abL;~cVYF(ch@WvG7vgr$!5BItL%!I z#0cHyF^^GYVm>VsAoiT{FEd!Dl1JoXS@#`jukws(jEk>pQ))zbf8~@b)UlFhE!Wbs zI9=lvG=z9J$uhi1avO2=rX`#e{Rtm81H?89tSWg=?LZIokJN0#eY|uB>Js*%O`WiU~rH#vD_f0qvI8)R%pe0I0?_ z7MoZ>|3t5kJw3blPL9T-jV;^iSMlx>I_mA28T0%8&Mq6Ou<^K=`_;j|1OU=cx%|@c zH$6n(5c=naw3-;t<@M^*bu)vja#_?k?t)xIbB4;kDI3$7j(vG8Yxw{V`VB^E% z^Vh{_*x)#VEbj!S$g!OU4D4VjXUisOZ+t4r&}I%GeR6KrVRkqTqdZ-LVJ!#98L+WLRG zI@^IQ@f$O#Y3alHv+$0`cU#DwXmRbNmD@+@EDpa$wp6Y7Y}pMGh}5IB>0gYCC%M>d zx);1JkYw>v7!FI!t)yx42d0 zHQI7sCq6>l%Ro1%dz&6ZItc21MW3f}jbx;#ln;AUTHcy|(^+05Ej8<^u9z%+2;PqU zaxsp4PODZu@^)@7E@X1t&VK|}{p06g`CYu0Z%zkL|o3wpFV392b-JEZw`G|_!lvvl6|D_E`-y(N)e)Ma{fa!2vYZk2=0 zVOO*Y+rf0Va(H7b^PvMKRaPj8k!AqFGMwt!FP6lZ?73g&cw%5r)tBj_l*I^6#WHKr ztOPh9a8DP$E_)OMhFz#S-ez(NaMt;?2h%$%bcE3@J5@xTL7V9E_Wy$5GMxOkqRz2A zUh)@g7{egSiNZBkYQk{1VEZ`cg97#`q|UKe!&eOq$ZJU|M=g47;)M z_v~zUr%*>?b4k=RZRy;9AeFYn^B-7PSu*_(2+)=c{sNtD7m)h*Rz)#3yq*98g5fD` zR!B(Co~p;vwOK(|VUWfQTQT7?fxsu;cFTrOV;I!4_)kk>Fo5ffk}6bUa|7pew?%m4 z6XxC@n1?5`x=R(;?&{?2FOj1}XEAcl8#!Em77Xte_c%&9ZRj-pnXUT%&7;B4k*ga>_Um?v)(BFji@T_mEMrOe z%4R!AgcMR-A4mC$r^F>k);u9*jJiKi|GrYP&N)*4N%1)mraj|O_$qZt+p^jfY-yvY7&+5*!M4$2A0MXh@eYT`KG&sV?0ox3aJgulXq{$pZ11Bi(? zZdL_6a>t>}M1xH>$q5wy?~w`*iD)S!_`{{&kC<#~O*fBO?Q6}dSA|4onl099#M!<_ zL8q>>+gvB-ezvG46;|fXWi23+8InAHBa-3%eVgQ>109Wh--=4WT8I2|k$_g*XU@g& zjE<9BMu>pzJG7I7#1T7rQ?dUdRy2XVRBSWVr-u09!yv1ZXY>pbdqCW?#pPM-mriOK zglSo8ucEKs->%{8n0~~S4;(G*mUY?Sr1?_HtAa?uZflWQmXKtIyK zu;@zBv93CheyAnQpN=O@(Ro&%jk^R(St(0W}e2|)iz9jox<5M!OKzdCab9VF41mJ!KWSIvcl z?E*!Y3Qz8^kBbz5v`jr7`WN3v2$OV(Godi2$GeI8>sq3}aI7Uef=fSl*cP7`nO3@W z!)rtnpDdZSIAo2yHl@h2GmJj&4PO1;OMg`nZcND+bg_h6)3d0~04P+|lmoNA8;5Dd z6pFXid1g|xr5nFk1LYkfI?XtY=?h@E>f>rg4&FoOMQ5(|xEU9e*VJ@EQreOE`+)nY;ClEl1%|ushde*w0idUmt=)6~dQ`BlGPzRm>|5&-vmz zlkjhJs9HMP+*>iFbe8cRsnuXtE}Z<3WxeWNB)E(p>{G?lCp`jYE_$p%=# zXbAtUe+QgJI}I8&LH7EM1w*gwRh}s)&2(Jz;AUU8>-nA_`0$yYvN!ufgHwC{<}Cis z^;&NErhNLLlx&&;9BiA~%oaj5vH{8Sq~IX$@M#jGVV2T7dMC#^x2wj|751~0zsiTY z-wPS0uZ^vGNv`-#*Su z$d!`&@LOfZTSA}yyAAV z^NXLNk(the9CZGgy>?)93$&Nf3`O%Z1{L{9s1rjkPjrG#(gH#mv#-=l22s^8B5Nhn zq+$4e#}BF!JI^a?o#3y2!H4ZLvE0asU_^nCjOdU1I+SWEt;A literal 0 HcmV?d00001 diff --git a/assets/mainWindow/img/fa-cube.png b/assets/mainWindow/img/fa-cube.png new file mode 100644 index 0000000000000000000000000000000000000000..6d89cfa132de05fe1215f4d8d2292568a46fb813 GIT binary patch literal 3474 zcmeH}={ppB7sr2NjC~nfZu`g@vM<>q`@V(japPuWH@28ztl5pVR3e4Qnx(R3N|ulz zN*H7*+emhqr~6-cuIqXCoHyTdzSsA>`CRA4Nw=~vWTfM!0{}1@8|m2q0Qu8G01fny zAnP3M0HDycGPBeFGm`&b|0nQY5%3R{wf=KJ-QhMCwg5r_rG!yY)6mk8=3!^_7nfDpVWBrGB-CVojmQc7AzR!&|)QAt_limIBrhNhPGRUO@Hdin;2 z#wMm_<`$M#);4z6?HwF%IJ>yIx!?5k`rF6%A3tQkt)SqLu<(e;sOZ?+@n}pUHaR6N zJtH$aCojLCu(;&zz55T!D=Mp=RM$SMZ)j|8ebL_e@^yD_U;o>I_d_G2V;>1q)1SY5 zohL4RTV4OYv9+_iw|{ti`nyYG;2QvR2F7|ic2Qrp?jK)cH@q<5ZaK!#A19V1LX+r& zy<=^sVV`~nqA_0QkZEE?@lHw9p1KOGM>ASA|lm#f!xiY|*pl#3t64v2G5L z5f1y4hif&p(GN=xx3+&cTnEp;|DJjpLo4XDbt=gwxLwc{mixN$z!JL49=B90EwAJI zL~@s|=+bTc>m*-aE$?4L&{i$~VB7)#$5;dz3O+)@2 zB+f>j*lb5HpLNNspLDn{H}eUjElQ8jpHkkDGlndzzx2Jm@%(cFdJ+A-d(XqG$RIM| zZTtF5dV#WU221E)3f@Zs(i2;X-u*%*>PHg8i}(dilS6YE2mDe0>K4}vv6{amyyFB` zBJ28Z8?G$ltcTl%WOvCrr8QXf=3T5*ML1{WS+mHlAG(Z`=h-q{j6V4My|FD#O|xNS z_ahhM3g0`d8Wrm5t#M}il(L>lys~o`om98^p=Juo$9cajxxkWZwZ-Dlx4g?ZgZF*_ zAxw0Ik}#efuu+L7U0%6$GSyjoUx86*R15(g2R^=Swc+F)`GNYk3!zZ8phwSxcBS&f z%2pZoELV-J79lOM%0^aP@fa}q>q3n1)ZzHKxT?>)NAX(iO1lyBR}^i#{WsmR%!Vh; zE&s~#m|`+PXUd+&QCyE)KjA-Dqb|ca9rNHAF8@~XZXYn^Z6KMr5X_Hll|(keZyaNu z4h2!18Wn5d z^PH-(0+i_U3ZwatA=e#G&DzQJHn8l1F0c2$n2$zXLbC?jH200qy2_-qSd}^7zMn5TjSQBr0-*3+dXF?$lKmpYE5r6?kIvFg3^TqsXf+xNVC5<;@ZWy5zV;y^b?cK* zS?1QK9D&j#?9+lK^I0Z;9puSgx>#{T{d70iAp?UIP^x=i?;;7ces@kKp5eDEt#sW)Q{>@=|n~Xhu^ScmaF7{6^4$0D>tMHX9E_t8Bi3#@0hBec^f)~mO>Fp3@S~n z&>wSLZc|EEAeftjQgLt3?ukXGg2twQ?U!Wj;$>d&YIwDV(=Vszsyc12fqJ>yW6eGs zAC*T2-*`hA!RXo=1fGEu|9P(8Y2RXsdo2mpw-DZ%D^BKfQ+K2x2t|7FKifR@_TkJx zu020H{u<-5Qs{Gv-dV`L(}$90!gExZ8|J26_F;{3sG?40L<%2et@yP6MHLGo1rU5} zy4O%^R_W55yr72V1WrDMWWFso6H#T$MVj6yb)#9cPW!O(zR5r*7YHKg(;;>7d=*m5 zCk84q{|7XGz)@lIO0wlhP=22vFqu2e^k-Ab0a0yPC>~82(Ae5gdjzDm>m;vWn1*8| zGZ={9i1#5*2=NFd70H5aS+y8* z29Tqopnl5~0GWeT1t}RKfA4qsHkjybXh(a}acRbFXtk%is|dshuwp0?|8pV2fL4}u zI~^CJwgQqJ4U1L^xdalj;YBoPrlJNmS*^2mz#;>93bG zt$N9@^2v)?XM--4f%&tPFj<~xEy8-O<15sv8wdPq2z6lQx`lQ{`=vt|G&hb`70522ZmBk^2?A=h8Y*WS zRoCdIfk~bZpWkEcgBRcU+d*i9;Hf5Wb2wJ6;h`xQ6wB>$dry&}dzy&_6blHxlbnm{ z{Bj>1xKqKA7COE4{4?r9lQ91>O>YI{@&5Eor-SxMAWjL>6De5VqXUao>cm1pv`XH6 zK8A$fclYq#pk~JJRaj}S-q4UWCxo&`9~J%-UNYDtw8RP)p2)eV# zrU3_+Rs76Bq|ycp6qK&zWyPCQPghN5&M+XtX+D2LL4pN;#rm;>eaXLrn0F=_V67 zoSR0ZDrRPsgdU?_Omc3;*o-N{ZD{M;lC&MGFx9%2-+v$jaLju4eYcRiJB*3zcXxBO z&TMOlkW0hjGBhgMAm@F1@>1fsD;2*@@WVk8^#$xelH=e>_I?m4;V>zF*z|z1_uiYX zHSJQ02ZcZVMoe;eqKSUT$~>P=!s8eoIFQuiHry#g9<>tgF7~+WV56+h@ps17w*ej} zn&rL&pXW%7vi00AogSlct@qYSvxMa<5Uy=gk+qM$6~?#37rkHr4~ DnLBQt literal 0 HcmV?d00001 diff --git a/assets/mainWindow/img/fa-cubes.png b/assets/mainWindow/img/fa-cubes.png new file mode 100644 index 0000000000000000000000000000000000000000..df37e21f93c6e53b32968071a95440eda1873acc GIT binary patch literal 3731 zcmeHKSv(Yc7yi#!$5O*&iL8;NtYtSQS&JcAQYtMBT)`R>2x<~iqg&Uw!Ho!_}RNj7LRejYI%006&*xv?z(kOLC} zxY-Wqc7>B208lL(OFNSTcmMzR{|5fY4fr-vf)7roDbyBy1wf!|>>Qk2+%O(qKK?_8 z;R1q)BSOL=qDRG!Nk~db%g7#=lRu$wQt_11=`+eIs%q*QXU}PBY3u0f=^G#oQRj^= z7@L@ySzNqiX@$17xom4^@8Ia<>~ih8tDDEoTVCEizPJ4Y0)y^`goZ^#M%|B&#bDzf zJbaXxl=2rY^;ud*X7=;kJbVG+@1mC_Wv|QMR8`m1erWjE)ZEhA-q}t1+}A%aG%`9q zIYpkGUtC&V`LVjb@oRI7zRTEKO62_w0I#)$@p-$*sdfDB1tEL!Zf|OvEF*5dyW_TW^`j4zVh^gq>a8fT(^c8y$`ARpm$GPDc-^?lhFx#f4*UVv*PRVICL3*q#^yo_uNnf1pjn(jJyxc zVD!GZJ7E!rbR;khWVGu$M4hfUri(xso%z18tf1?G zD+0L{%Ij4xZ%B@fq3d7iiDHsEA4;Sq-d6C=dx+4~=5|l@r3T_<>*RSA$l)}8(h_BV zKwjO|&I(Vx`|hclR|zlUyDN5rG{oFmf6+Uh>sF% zgYNZdY}@+JTs4}a4>x{4Ge0IS^W%v_!KGi=Jl6-N5h6YQYRoZ-zA8fREZabT_V(=7 zx@eurIFWlUR^yg6wNVHd-MpW?PKu#J6Mv*~{0^BL1@M2oFPH~Y8;_y-VEmo7A#+>c zhOVQc8l4EFmlHl#SCHwP*yo7tEK*NQ6-dCw-BK7@dKnIbU_ENMn^n2Gs^`JY3owG zKuwL%W3&9vuyNbb1#!L6i~JT*P=$(8fDIaW4U)`EB7IMcY134#y5a6(Rjye zTMN5UDmcBRhK>7@gAI@2C4A#>8hB+0G0rQ%)~%X>3maZ7(_6=}CvwAu00#GF`flm-4|D__q4 zNj9>kAdjM!_c;}$G~2bO2|!f*-XInQ}rx|SC*{FDpnR|PAp z-lV--kiGY(NI49kLc#PnUY4kG^Fm-6Un?6?=lb<=a6jUuVZoWp+g6|lvG zD?*A~S^2`-O6tl^nfA}`IdHbFdo^+G#;=_9_p5n09VbdzKPDg;>%u`1UrTu!NFt`| z!nZU94t40n#Y7|}k>{Ru57NGFkkIv-LzuGt&#XT(eq#gr3*wiawrB1l-%7n=2*jD< z6u3|g(`NpkV;&$}n=Q5XCm-)SUD!*pC`YZ&@ilxhNNrs3eOxhJX1xgM$L0l{Y-at*JAnGpPl+KiSJIQ_`)lh$or`UosqUT*ESvmA4?2rdw0i)no=ot zhlSG;9zM0C11~B~MTB4){z^+I3EUl>GEqFE`eJ8yB_GhbX_Jq5A5Px0KVw~6S1;4Ayan`&nY1}ID%md=? zwp8wuO@5=WeQk}lfZFwRFP%B}qL#+XWT0~R_%JNtu=G=G4`AiT!?`@dQ#8*L-Dby0af^v7oCudno9h3yrIzLKWZ0(M|a-9)~{EsDi5b%FB!XLJI)2&aW7|R>9_47z5z0<`k5pQ zUCo-9XT!E^rnQSRp4pto!+l@qzcr0fjOai3iNr_ZX?)QIu7I;J}u@Yn;Gk#uWI0w zyeYsT9oA|XoFpGgJBL8U_}Gk6*bv|g_R;P0#|4(82j*Ev;pkj-b)LV=ft z?i$CS?^R(-WsovysR>P#tU1Yh0)eGiBBueoS&Raa?pt~f18=#k1VP(rhdh9~r&0`7 zTrL$1$w&eJP-`ewgK!S=4uaA`2=KdyIzlQ2Y)*mXt>haJcSn_pLs&n2fjO{S^^k)S za%W`)!Dv|=lmJcw9_+u;72q1mjcSQp!yX5}F(@41Zt~2xDhks9g!!ivk{&@jVT$QV zoHcB9Y;XzW5tKWd7t*5K;kE|&wa^aOXFJfPlf|CXJcM~wBQ)Ty&~lc!R_yD&&L*u8 zt&VNcea|s`-AIbW4jv9)+!Q!LtvZJpmVb?|n}iZ^QF>Ea>4^NNo8xj0NS1pX$cb`0?^J86;hW0{@CC^@ z=_Pg$qvP>*x#fxlufO4wix3nartCToAZFD#gnhUx)|)|GguvUSqK^|Y-Qb5%Zl+gD zVnwy^3F2`O)X-(rPLfcwNCI>)JFRVh$X}CRAzlu24$?TJ&3Q0A0b{fV0ZXV&^k1^f zdaqhu2tnn#xfx8N3(HCJriTIRYKH@)M(~21YL41(4RhG~s^Qw_K}K)P0l49ZT+e z>+>kEDynV?-RST{|OA;1hPb+XCuW>xl@1>OrmmK|OiWNxQ6 zYw7y6M>GWYwl*B86<=taC3n-b1rd8KM5R%N`I!6f?Z;B%O-g(VA4n6yPsHL9X*uv3 z($rlXPh8nSbL;oxqjz&$tm6d|`3iYj?@sCkdTrpQq+hQHFX$@xmsV_X7_|qe6Lc(!tG%JA#Nu+R`#6ov1?V}9SLE&Jo9Y5RJ zK~@-KTC6gkY2$zQ6tli9B~|{Bdn3L7eZ>Ce4;Q^f+D2hz?`VFOB#-V$ko1wkjDN++ aKT^{UGpFXl)er|S0`_%y*U;3`*{^#*@1Q=?z|hFp#PpEaVT&VHN00r1vbM3cvqw8( zu*aQnF0O8W5{RCsyhz@@e*OW0A*auf&r!l7s8Q!HT)afTa+Pr{{(52(GcEl_ChMjke;ze7wmcI)Z|{83)zjB68X6gWHU9d|)Vuc|CA0Gj zOJBdQto_*762E#*0RUt*aTo{U9@Pcm2Aw#f3YuE`yJ1jwN9NANK`kyRACZY;*DEQd zc_szPP>dkX+Qw?>_T?n~pl5!MWs>jq?$C2Y-|cx4eD&G1^WGHQO?>`qt6%ySCJ{*XXf(8dew|>D9-yp7pGDQsztiTsqOU}B8%=Kb zYFLk0bU7ndlfU4{I$xX_pUQcNJWe?Tu1=0W+eV(4W}iE_r`a659^%F3-lQ^BZhayl zH9;j$_{dXzT!aC2!P*e{2+kepc9}?lKtQCJRDxNJ;j+*UO+3D7uyqLTbU-&sq%woV zM2XgxJI|;Q%KHZnD&sJQHrS`H-L+iOQOmt6N+NKlX&u@> z=dhUk8*lDyslEPmPjKrqG?OK6>9mZs@Rz4tQONn zQOk&+m~9DL^5(WFw&hM-YH=>NO~sB*k#@tEv{*oN$#GNbQl^&utLe+$M7*2m0RdQ<>55@(EFwJUv)6p_>v zXgzfnZ&UR9y*RP^OpF?ypUiB>^V{T^0jbKaQFOeaH=|M%Vnq@s(;8??&>N0lpOB&d^=zMKCJ9Y}%kQ&9Qhf#^-{9 zfsHx(gr$9cTk!bFG>06)IhL3KqP8xo8;3DXYI0NSXZI0tpR)`7QF+cG@wvQR@9_Jt znEyG?LT6>I&Dv{lNQ`WgWyjPYI@^8Nfytks%_tGaydUgUoWX0wu&QYG31__w_ z&`E0D^zm`0ZwmuKb{Y*nim+1y>^Pu>oSvlZiaAY^5B-q?q&a_>efAPjzs^~mWb6yG z7;Mabi)LRNzkEmmyIWLSz1xv%H(2Itmue#1??aR%Sel9oqUQ4ZRO(M z6MS#h*Y=X#>57pxmGZA zN|VY4j5j;5vj!G*u%JADp3dp*IJdV4G*0NSM|JH9byAgH&_BH$P` + + ${appConfSchema[key].displayName}`; + + if (appConfSchema[key].info) { + _htmlOut = ` + ${_htmlOut} +
    + +
    `; + } - window.forseCloseApp(); + if (appConfSchema[key].type === 'number') { + _htmlOut = ` + ${_htmlOut} + + + + + `; + } else if (appConfSchema[key].type === 'string' || appConfSchema[key].type === 'folder') { + _htmlOut = ` + ${_htmlOut} + + + + + `; + } else if (appConfSchema[key].type === 'boolean') { + _htmlOut = `${_htmlOut} + + + + + `; + } + } } - function normalStart() { + _htmlOut = ` + ${_htmlOut} + `; + + $('#agamaConfigBlock').html(_htmlOut); +} + +function hideToastImmediate() { + $('#toast-container').addClass('hide'); +} + +function hideToast() { + setTimeout(function() { + $('#toast-container').addClass('hide'); + }, 5000); +} + +function showToast(type, message) { + $('#toast-container .toast').removeClass('toast-success').removeClass('toast-error'); + $('#toast-container .toast').addClass(`toast-${type}`); + $('#toast-container .toast-message').html(message); + $('#toast-container').removeClass('hide'); + hideToast(); +} + +function setDefaultAppSettings() { + const remote = require('electron').remote; + + remote.getCurrentWindow().setDefaultAppSettings(); + remote.getCurrentWindow().appConfig = remote.getCurrentWindow().defaultAppSettings; + initSettingsForm(); + showToast('success', 'App settings are reset to default'); +} + +function handleSaveSettings() { + if (_configCopy.dataDir && + _configCopy.dataDir.length) { const remote = require('electron').remote; - let appConf = remote.getCurrentWindow().appConfig; - appConf.iguanaLessMode = false; - - // run iguana-less mode with no daemons startup - if (appConf && appConf.iguanaLessMode) { - // do something - } else { // run normal mode with 2 iguana instances started prior loading GUI - if (appConf && !appConf.manualIguanaStart) { - StartIguana(); + + remote.getCurrentWindow().testLocation(_configCopy.dataDir) + .then(function(res) { + $('#debugOut').html(res + ' | ' + _configCopy.dataDir); + if (res === -1) { + showToast('error', 'Komodo datadir path is invalid'); + } else if (res === false) { + showToast('error', 'Komodo datadir path is not a directory'); + } else { + // save settings + remote.getCurrentWindow().updateAppSettings(_configCopy); + remote.getCurrentWindow().appConfig = _configCopy; + showToast('success', 'Settings saved'); } + }); + } else { + // save settings + const remote = require('electron').remote; - var portcheck; + remote.getCurrentWindow().updateAppSettings(_configCopy); + remote.getCurrentWindow().appConfig = _configCopy; + showToast('success', 'Settings saved'); + } +} - function startcheck() { - portcheck = setInterval(function() { - Iguana_activehandle(appConf).then(function(result){ - console.log(result); +function handleInput(key) { + const _value = $(`#${key}`).val(); + _configCopy[key] = _value; +} - if (result !== 'error') { - stopcheck(); +function settingsToggle(key) { + const _value = $(`#${key} .cb`).prop('checked'); + _configCopy[key] = _value; +} - if (appConf && appConf.useBasiliskInstance) { - StartIguana_Cache(); - } +function closeSettingsWindow() { + const remote = require('electron').remote; + const window = remote.getCurrentWindow(); - $('#loading_status_text').text('Connecting to Basilisk Network...'); - EDEX_DEXgetinfoAll(appConf.skipBasiliskNetworkCheck, appConf.minNotaries, appConf); + window.destroyAppSettingsWindow(); +} + +function reloadSettingsWindow() { + const remote = require('electron').remote; + const window = remote.getCurrentWindow(); + + window.reloadSettingsWindow(); +} + +function openSettingsWindow() { + const remote = require('electron').remote; + const window = remote.getCurrentWindow(); + + window.createAppSettingsWindow(); +} + +function closeMainWindow() { + const remote = require('electron').remote; + const window = remote.getCurrentWindow(); + + window.createWindow('open'); + window.hide(); +} + +function quitApp() { + const remote = require('electron').remote; + const window = remote.getCurrentWindow(); + + window.forseCloseApp(); +} + +function normalStart() { + const remote = require('electron').remote; + let appConf = remote.getCurrentWindow().appConfig; + appConf.iguanaLessMode = false; + + // run iguana-less mode with no daemons startup + if (appConf && + appConf.iguanaLessMode) { + // do something + } else { // run normal mode with 2 iguana instances started prior loading GUI + if (appConf && + !appConf.manualIguanaStart) { + StartIguana(); + } + + var portcheck; + + function startcheck() { + portcheck = setInterval(function() { + Iguana_activehandle(appConf).then(function(result){ + console.log(result); + + if (result !== 'error') { + stopcheck(); + + if (appConf && appConf.useBasiliskInstance) { + StartIguana_Cache(); } - }) - }, 2000); - } - function stopcheck() { - clearInterval(portcheck); - } + $('#loading_status_text').text('Connecting to Basilisk Network...'); + EDEX_DEXgetinfoAll(appConf.skipBasiliskNetworkCheck, appConf.minNotaries, appConf); + } + }) + }, 2000); + } - startcheck(); + function stopcheck() { + clearInterval(portcheck); } + + startcheck(); } +} function IguanaAJAX(url, ajax_data, timeout) { return $.ajax({ diff --git a/react/src/components/addcoin/addcoinOptionsACFiat.js b/react/src/components/addcoin/addcoinOptionsACFiat.js index c5b8ace..6268c70 100644 --- a/react/src/components/addcoin/addcoinOptionsACFiat.js +++ b/react/src/components/addcoin/addcoinOptionsACFiat.js @@ -2,41 +2,52 @@ import React from 'react'; import { translate } from '../../translate/translate'; class AddCoinOptionsACFiat extends React.Component { + const _fiat = [ + 'aud', + 'brl', + 'gbp', + 'bgn', + 'cad', + 'hrk', + 'czk', + 'cny', + 'dkk', + 'eur', + 'hkd', + 'huf', + 'inr', + 'idr', + 'ils', + 'jpy', + 'krw', + 'myr', + 'mxn', + 'nzd', + 'nok', + 'php', + 'pln', + 'ron', + 'rub', + 'sgd', + 'zar', + 'sek', + 'chf', + 'thb', + 'try', + 'usd' + ]; + let _items = []; + + for (let i = 0; i < _fiat.length; i++) { + _items.push( + + ); + } + render() { return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + { _items } ); } diff --git a/react/src/components/addcoin/addcoinOptionsCrypto.js b/react/src/components/addcoin/addcoinOptionsCrypto.js index c192407..c72aa68 100644 --- a/react/src/components/addcoin/addcoinOptionsCrypto.js +++ b/react/src/components/addcoin/addcoinOptionsCrypto.js @@ -12,50 +12,61 @@ class AddCoinOptionsCrypto extends React.Component { } render() { - const isWindows = this.props.appSettings && this.props.appSettings.appInfo && this.props.appSettings.appInfo.sysInfo && this.props.appSettings.appInfo.sysInfo.platform === 'win32'; + // const isWindows = this.props.appSettings && this.props.appSettings.appInfo && this.props.appSettings.appInfo.sysInfo && this.props.appSettings.appInfo.sysInfo.platform === 'win32'; + let appConfig; + + try { + appConfig = window.require('electron').remote.getCurrentWindow().appConfig; + } catch (e) {} - // - // - // return ( + + className={ this.state.nativeOnly || !appConfig.experimentalFeatures ? 'hide' : '' }>BitcoinDark (BTCD) + className={ this.state.nativeOnly || !appConfig.experimentalFeatures ? 'hide' : '' }>Bitcoin (BTC) + className={ this.state.nativeOnly || !appConfig.experimentalFeatures ? 'hide' : '' }>Bitmark (BTM) + className={ this.state.nativeOnly || !appConfig.experimentalFeatures ? 'hide' : '' }>Carboncoin (CARB) + className={ this.state.nativeOnly || !appConfig.experimentalFeatures ? 'hide' : '' }>Digibyte (DGB) + className={ this.state.nativeOnly || !appConfig.experimentalFeatures ? 'hide' : '' }>Dogecoin (DOGE) + className={ this.state.nativeOnly || !appConfig.experimentalFeatures ? 'hide' : '' }>Franko (FRK) + className={ this.state.nativeOnly || !appConfig.experimentalFeatures ? 'hide' : '' }>Gamecredits (GAME) + + className={ this.state.nativeOnly || !appConfig.experimentalFeatures ? 'hide' : '' }>Litecoin (LTC) + + className={ this.state.nativeOnly || !appConfig.experimentalFeatures ? 'hide' : '' }>Unobtanium (UNO) + className={ this.state.nativeOnly || !appConfig.experimentalFeatures ? 'hide' : '' }>Zcash (ZEC) + className={ this.state.nativeOnly || !appConfig.experimentalFeatures ? 'hide' : '' }>Zetacoin (ZET) ); } @@ -65,7 +76,6 @@ const mapStateToProps = (state) => { return { appSettings: state.appSettings, }; - }; export default connect(mapStateToProps)(AddCoinOptionsCrypto); diff --git a/react/src/components/addcoin/coin-selectors.render.js b/react/src/components/addcoin/coin-selectors.render.js index 7f164f8..60bc6f9 100644 --- a/react/src/components/addcoin/coin-selectors.render.js +++ b/react/src/components/addcoin/coin-selectors.render.js @@ -6,6 +6,13 @@ import AddCoinOptionsACFiat from '../addcoin/addcoinOptionsACFiat'; const CoinSelectorsRender = function(item, coin, i) { const isWindows = this.props.Settings && this.props.Settings.appInfo && this.props.Settings.appInfo.sysInfo && this.props.Settings.appInfo.sysInfo.platform === 'win32'; + let appConfig; + + try { + appConfig = window.require('electron').remote.getCurrentWindow().appConfig; + } catch (e) {} + + const hideFullModeBtn = item && item.selectedCoin && item.selectedCoin.indexOf('|full') === -1 || !appConfig.experimentalFeatures ? true : false; return (
    -
    +
    this.updateInputSettings(event, key, _key) } /> @@ -856,7 +855,7 @@ const mapStateToProps = (state) => { ActiveCoin: { coin: state.ActiveCoin.coin, }, - Settings: state.Settings, + Settings: state.Settings, }; }; diff --git a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js index e5daafb..9a9225f 100644 --- a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js +++ b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js @@ -47,6 +47,9 @@ class WalletsNativeSend extends React.Component { this.toggleSubstractFee = this.toggleSubstractFee.bind(this); } + // TODO: 1) t -> z amount validation + // 2) z -> z amount validation + WalletsNativeSendFormRender() { return _WalletsNativeSendFormRender.call(this); } @@ -366,8 +369,9 @@ class WalletsNativeSend extends React.Component { checkTotalBalance() { let _balance = 0; + if (this.props.ActiveCoin.balance && - this.props.ActiveCoin.balance.total) { + this.props.ActiveCoin.balance.total) { _balance = this.props.ActiveCoin.balance.total; } From 0166259c3c8540f5f0530d0d6f5340505b4c5775 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Mon, 28 Aug 2017 21:59:05 +0300 Subject: [PATCH 23/83] refactor addcoin ac render --- .../components/addcoin/addcoinOptionsAC.js | 43 ++++++---- .../addcoin/addcoinOptionsACFiat.js | 82 +++++++++---------- react/src/translate/en.js | 19 +++++ 3 files changed, 86 insertions(+), 58 deletions(-) diff --git a/react/src/components/addcoin/addcoinOptionsAC.js b/react/src/components/addcoin/addcoinOptionsAC.js index 811f186..f97f796 100644 --- a/react/src/components/addcoin/addcoinOptionsAC.js +++ b/react/src/components/addcoin/addcoinOptionsAC.js @@ -3,25 +3,34 @@ import { translate } from '../../translate/translate'; class AddCoinOptionsAC extends React.Component { render() { + const _assetChains = [ + 'bet', + 'bots', + 'ceal', + 'coqui', + 'crypto', + 'hodl', + 'dex', + 'jumblr', + 'kv', + 'mgw', + //'mvp', + 'pangea', + 'revs', + 'shark', + 'supernet', + ]; + let _items = []; + + for (let i = 0; i < _assetChains.length; i++) { + _items.push( + + ); + } + return ( - - - - - - - - - - - - - - - - - + { _items } ); } diff --git a/react/src/components/addcoin/addcoinOptionsACFiat.js b/react/src/components/addcoin/addcoinOptionsACFiat.js index 6268c70..ac50be9 100644 --- a/react/src/components/addcoin/addcoinOptionsACFiat.js +++ b/react/src/components/addcoin/addcoinOptionsACFiat.js @@ -2,49 +2,49 @@ import React from 'react'; import { translate } from '../../translate/translate'; class AddCoinOptionsACFiat extends React.Component { - const _fiat = [ - 'aud', - 'brl', - 'gbp', - 'bgn', - 'cad', - 'hrk', - 'czk', - 'cny', - 'dkk', - 'eur', - 'hkd', - 'huf', - 'inr', - 'idr', - 'ils', - 'jpy', - 'krw', - 'myr', - 'mxn', - 'nzd', - 'nok', - 'php', - 'pln', - 'ron', - 'rub', - 'sgd', - 'zar', - 'sek', - 'chf', - 'thb', - 'try', - 'usd' - ]; - let _items = []; + render() { + const _fiat = [ + 'aud', + 'brl', + 'gbp', + 'bgn', + 'cad', + 'hrk', + 'czk', + 'cny', + 'dkk', + 'eur', + 'hkd', + 'huf', + 'inr', + 'idr', + 'ils', + 'jpy', + 'krw', + 'myr', + 'mxn', + 'nzd', + 'nok', + 'php', + 'pln', + 'ron', + 'rub', + 'sgd', + 'zar', + 'sek', + 'chf', + 'thb', + 'try', + 'usd' + ]; + let _items = []; - for (let i = 0; i < _fiat.length; i++) { - _items.push( - - ); - } + for (let i = 0; i < _fiat.length; i++) { + _items.push( + + ); + } - render() { return ( { _items } diff --git a/react/src/translate/en.js b/react/src/translate/en.js index 270081a..08534eb 100644 --- a/react/src/translate/en.js +++ b/react/src/translate/en.js @@ -681,5 +681,24 @@ export const _lang = { 'TRY': 'Turkish Lira (TRY)', 'USD': 'US Dollar (USD)', }, + 'ASSETCHAINS': { + 'BET': 'BET (BET)', + 'BOTS': 'BOTS (BOTS)', + 'CEAL': 'CEAL NET (CEAL)', + 'COQUI': 'COQUI (COQUI)', + 'CRYPTO': 'CRYPTO (CRYPTO)', + 'HODL': 'HODL (HODL)', + 'DEX': 'InstantDEX (DEX)', + 'JUMBLR': 'JUMBLR (JUMBLR)', + 'KV': 'KV (KV)', + 'MGW': 'MultiGateway (MGW)', + 'MVP': 'MVP Lineup (MVP)', + 'PANGEA': 'PANGEA (PANGEA)', + 'REVS': 'REVS (REVS)', + 'SHARK': 'SHARK (SHARK)', + 'MESH': 'SpaceMesh (MESH)', + 'SUPERNET': 'SUPERNET (SUPERNET)', + 'WLC': 'WIRELESS (WIRELESS)', + }, }, }; \ No newline at end of file From 9a5f3027d61e53655099ed9de5b0017efc1a351f Mon Sep 17 00:00:00 2001 From: pbca26 Date: Thu, 31 Aug 2017 21:37:55 +0300 Subject: [PATCH 24/83] toaster message multi-line render --- react/src/components/overrides.scss | 21 ++++++++++------ react/src/components/toaster/toaster-item.js | 26 +++++++++++++++++++- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/react/src/components/overrides.scss b/react/src/components/overrides.scss index 1422ea2..653bb27 100644 --- a/react/src/components/overrides.scss +++ b/react/src/components/overrides.scss @@ -753,6 +753,8 @@ select{ #toast-container { > div { + padding: 15px 15px 15px 60px; + width: 310px; opacity: 1; } } @@ -980,9 +982,10 @@ select{ color: #757575; background-color: #efefef; border: 1px solid #e0e0e0; - } - .-btn:hover { - color: #fff; + + &:hover { + color: #fff; + } } .-btn[disabled]:hover { color: #757575; @@ -1073,11 +1076,13 @@ select{ table { width: 100%; - td:first-child { - width: 40%; - } - td:last-child { - width: 60%; + td { + &:first-child { + width: 40%; + } + &:last-child { + width: 60%; + } } } } \ No newline at end of file diff --git a/react/src/components/toaster/toaster-item.js b/react/src/components/toaster/toaster-item.js index 77797e5..36864d0 100644 --- a/react/src/components/toaster/toaster-item.js +++ b/react/src/components/toaster/toaster-item.js @@ -22,6 +22,7 @@ class ToasterItem extends React.Component { }; this.dismissToast = this.dismissToast.bind(this); + this.renderLB = this.renderLB.bind(this); this.timeoutHandler = null; } @@ -50,6 +51,29 @@ class ToasterItem extends React.Component { Store.dispatch(dismissToasterMessage(toastId)); } + renderLB() { + if (typeof this.state.message === 'object') { + let _items = []; + const _msg = this.state.message; + + for (let i = 0; i < _msg.length; i++) { + if (_msg[i] === '') { + _items.push( +
    + ); + } else { + _items.push( +
    { _msg[i] }
    + ); + } + } + + return _items; + } else { + return this.state.message; + } + } + renderToast() { // ensure that setTimeout is called only once for each toast message if (this.state.autoClose && @@ -66,7 +90,7 @@ class ToasterItem extends React.Component { onClick={ () => this.dismissToast(this.state.toastId) }>×
    { this.state.title }
    -
    { this.state.message }
    +
    { this.renderLB() }
    ); } From d9a392ddd4106909781ac6d9d33a4b84ce562cf2 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Thu, 31 Aug 2017 21:44:25 +0300 Subject: [PATCH 25/83] zcashparams missing extended message --- .../components/addcoin/addcoinOptionsAC.js | 4 +++- .../addcoin/addcoinOptionsACFiat.js | 4 +++- react/src/components/main/main.js | 22 +++++++++++++++++-- react/src/components/toaster/toaster-item.js | 2 +- react/src/translate/en.js | 7 +++++- 5 files changed, 33 insertions(+), 6 deletions(-) diff --git a/react/src/components/addcoin/addcoinOptionsAC.js b/react/src/components/addcoin/addcoinOptionsAC.js index f97f796..e5bd59a 100644 --- a/react/src/components/addcoin/addcoinOptionsAC.js +++ b/react/src/components/addcoin/addcoinOptionsAC.js @@ -24,7 +24,9 @@ class AddCoinOptionsAC extends React.Component { for (let i = 0; i < _assetChains.length; i++) { _items.push( - + ); } diff --git a/react/src/components/addcoin/addcoinOptionsACFiat.js b/react/src/components/addcoin/addcoinOptionsACFiat.js index ac50be9..3506c43 100644 --- a/react/src/components/addcoin/addcoinOptionsACFiat.js +++ b/react/src/components/addcoin/addcoinOptionsACFiat.js @@ -41,7 +41,9 @@ class AddCoinOptionsACFiat extends React.Component { for (let i = 0; i < _fiat.length; i++) { _items.push( - + ); } diff --git a/react/src/components/main/main.js b/react/src/components/main/main.js index 103bfcd..d2fd8bd 100644 --- a/react/src/components/main/main.js +++ b/react/src/components/main/main.js @@ -40,10 +40,28 @@ class Main extends React.Component { document.title = `${appVersion.name} (v${appVersion.version.replace('version=', '')}-beta)${_appMode}`; } - if (!zcashParamsExist) { + if (zcashParamsExist.errors) { + let _errors = [translate('KMD_NATIVE.ZCASH_PARAMS_MISSING'), '']; + + if (!zcashParamsExist.rootDir) { + _errors.push(translate('KMD_NATIVE.ZCASH_PARAMS_MISSING_ROOT_DIR')); + } + if (!zcashParamsExist.provingKey) { + _errors.push(translate('KMD_NATIVE.ZCASH_PARAMS_MISSING_PROVING_KEY')); + } + if (!zcashParamsExist.provingKey) { + _errors.push(translate('KMD_NATIVE.ZCASH_PARAMS_MISSING_VERIFYING_KEY')); + } + if (!zcashParamsExist.provingKeySize) { + _errors.push(translate('KMD_NATIVE.ZCASH_PARAMS_MISSING_PROVING_KEY_SIZE')); + } + if (!zcashParamsExist.verifyingKeySize) { + _errors.push(translate('KMD_NATIVE.ZCASH_PARAMS_MISSING_VERIFYING_KEY_SIZE')); + } + Store.dispatch( triggerToaster( - translate('KMD_NATIVE.ZCASH_PARAMS_MISSING'), + _errors, 'Komodo', 'error', false diff --git a/react/src/components/toaster/toaster-item.js b/react/src/components/toaster/toaster-item.js index 36864d0..1cbf3bb 100644 --- a/react/src/components/toaster/toaster-item.js +++ b/react/src/components/toaster/toaster-item.js @@ -28,7 +28,7 @@ class ToasterItem extends React.Component { componentWillReceiveProps(props) { if (props && - props.message) { + props.message) { this.setState({ message: props.message, type: props._type, diff --git a/react/src/translate/en.js b/react/src/translate/en.js index 08534eb..345a4dd 100644 --- a/react/src/translate/en.js +++ b/react/src/translate/en.js @@ -550,7 +550,12 @@ export const _lang = { 'EXECUTION_SECONDS': 'Execution Seconds', 'WAIT_UNTIL_SYNCED': 'Transaction history is unavailable during synchronization progresss', 'TXID': 'Transaction ID', - 'ZCASH_PARAMS_MISSING': 'Zcash params are missing', + 'ZCASH_PARAMS_MISSING': 'Zcash params are missing or incomplete:', + 'ZCASH_PARAMS_MISSING_ROOT_DIR': '- missing root folder', + 'ZCASH_PARAMS_MISSING_PROVING_KEY': '- missing proving key', + 'ZCASH_PARAMS_MISSING_VERIFYING_KEY': '- missing verifying key', + 'ZCASH_PARAMS_MISSING_PROVING_KEY_SIZE': '- proving key size is incorrect', + 'ZCASH_PARAMS_MISSING_VERIFYING_KEY_SIZE': '- verifying key size is incorrect', }, 'LOGIN': { 'QUICK_ACCESS': 'Quick access', From 3ca487dee8a503c770820d831c0c47d10f3591db Mon Sep 17 00:00:00 2001 From: Miika Turunen Date: Thu, 31 Aug 2017 22:12:48 +0300 Subject: [PATCH 26/83] Added check if state exist --- react/src/components/dashboard/settings/settings.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/react/src/components/dashboard/settings/settings.js b/react/src/components/dashboard/settings/settings.js index 101565e..8db8120 100644 --- a/react/src/components/dashboard/settings/settings.js +++ b/react/src/components/dashboard/settings/settings.js @@ -102,7 +102,7 @@ class Settings extends React.Component { try { const _appConfigSchema = window.require('electron').remote.getCurrentWindow().appConfigSchema; const _appSettings = this.props.Settings.appSettings ? this.props.Settings.appSettings : Object.assign({}, window.require('electron').remote.getCurrentWindow().appConfig); - + console.warn(_appConfigSchema); this.setState(Object.assign({}, this.state, { appConfigSchema: _appConfigSchema, appSettings: _appSettings, @@ -503,7 +503,7 @@ class Settings extends React.Component { for (let key in _appConfig) { if (typeof _appConfig[key] === 'object') { - if (this.state.appConfigSchema[key].display) { + if (this.state.appConfigSchema[key] && this.state.appConfigSchema[key].display) { items.push( @@ -567,7 +567,7 @@ class Settings extends React.Component { } } } else { - if (this.state.appConfigSchema[key].display) { + if (this.state.appConfigSchema[key] && this.state.appConfigSchema[key].display) { items.push( From 55c9e762bfe0895e3b9b9b841c12cd06250f31d6 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Thu, 31 Aug 2017 22:56:41 +0300 Subject: [PATCH 27/83] partial overrides.scss split --- react/src/components/addcoin/addcoin.scss | 59 ++ .../claimInterestModal.scss | 48 ++ .../coindDownModal/coindDownModal.scss | 24 + .../components/dashboard/jumblr/jumblr.scss | 89 +++ .../components/dashboard/qrModal/qrModal.scss | 5 + .../dashboard/settings/settings.scss | 115 ++++ .../dashboard/syncOnly/syncOnly.scss | 37 ++ .../dashboard/walletsData/pagination.js | 2 +- .../dashboard/walletsData/walletsData.scss | 89 +++ .../dashboard/walletsNative/walletsNative.js | 26 +- react/src/components/login/login.scss | 8 +- react/src/components/overrides.scss | 530 +----------------- react/src/components/toaster/toaster.scss | 7 + react/src/styles/index.scss | 8 + 14 files changed, 515 insertions(+), 532 deletions(-) create mode 100644 react/src/components/dashboard/claimInterestModal/claimInterestModal.scss create mode 100644 react/src/components/dashboard/coindDownModal/coindDownModal.scss create mode 100644 react/src/components/dashboard/jumblr/jumblr.scss create mode 100644 react/src/components/dashboard/qrModal/qrModal.scss create mode 100644 react/src/components/dashboard/settings/settings.scss create mode 100644 react/src/components/dashboard/syncOnly/syncOnly.scss create mode 100644 react/src/components/dashboard/walletsData/walletsData.scss create mode 100644 react/src/components/toaster/toaster.scss diff --git a/react/src/components/addcoin/addcoin.scss b/react/src/components/addcoin/addcoin.scss index ca0772b..284e025 100644 --- a/react/src/components/addcoin/addcoin.scss +++ b/react/src/components/addcoin/addcoin.scss @@ -1,5 +1,43 @@ .add-coin-modal { color: #757575; + + .modal-body { + max-height: 590px; + overflow-y: auto; + } + + .multi { + .col-sm-8 { + width: 30%; + } + .col-sm-12 { + &.text-center { + width: 60%; + padding: 0; + + .col-lg-4 { + width: 25%; + margin-right: 8%; + padding: 0; + + .input{ + &.to-labelauty+label { + max-width: 136px; + } + } + } + .col-lg-4 { + &:last-child { + margin-right: 0; + } + } + .col-sm-1 { + width: 44px; + padding: 0; + } + } + } + } } .vertical-margin-20 { @@ -24,4 +62,25 @@ margin: 0; } } +} + +.btn-add-coin-item, +.btn-add-coin-item-options, +.btn-save-coin-selection, +.btn-load-coin-selection { + position: absolute; + right: 32px; + z-index: 50; +} +.btn-add-coin-item { + right: 60px; +} +.btn-add-coin-item-options { + padding: 6px; +} +.btn-save-coin-selection { + top: 60px; +} +.btn-load-coin-selection { + top: 95px; } \ No newline at end of file diff --git a/react/src/components/dashboard/claimInterestModal/claimInterestModal.scss b/react/src/components/dashboard/claimInterestModal/claimInterestModal.scss new file mode 100644 index 0000000..d278ffa --- /dev/null +++ b/react/src/components/dashboard/claimInterestModal/claimInterestModal.scss @@ -0,0 +1,48 @@ +.modal-claim-interest { + .modal-dialog { + width: 70%; + + .table > tbody > tr > td, + .table > tbody > tr > th, + .table > tfoot > tr > td, + .table > tfoot > tr > th, + .table > thead > tr > td, + .table > thead > tr > th { + padding: 8px 30px 8px 0; + } + + .claim-btn { + position: absolute; + right: 29px; + top: 66px; + } + .table-scroll { + height: 366px; + overflow-y: auto; + overflow-x: hidden; + width: 100%; + } + .bold { + font-weight: bold; + } + .green { + color: #66bb6a; + } + .red { + color: #f96868; + } + .locktime { + i { + font-size: 20px; + line-height: 1.1; + } + } + + .refresh-icon { + position: absolute; + right: 20px; + font-size: 20px; + z-index: 100; + } + } +} \ No newline at end of file diff --git a/react/src/components/dashboard/coindDownModal/coindDownModal.scss b/react/src/components/dashboard/coindDownModal/coindDownModal.scss new file mode 100644 index 0000000..179ecd4 --- /dev/null +++ b/react/src/components/dashboard/coindDownModal/coindDownModal.scss @@ -0,0 +1,24 @@ +.coind-down-modal { + .modal-body { + height: 60vh; + + > div { + height: 100%; + } + .form-group { + &.form-material { + &.floating { + height: 80%; + } + } + } + .page-content { + width: 90%; + height: 100%; + + textarea { + height: 100%; + } + } + } +} \ No newline at end of file diff --git a/react/src/components/dashboard/jumblr/jumblr.scss b/react/src/components/dashboard/jumblr/jumblr.scss new file mode 100644 index 0000000..38953a2 --- /dev/null +++ b/react/src/components/dashboard/jumblr/jumblr.scss @@ -0,0 +1,89 @@ +.jumblr { + p { + width: calc(100% - 100px); + } + .breadcrumb { + padding: 8px 30px; + position: relative; + top: 0; + } + .img-responsive { + position: absolute; + top: -28px; + right: 18px; + + .coin { + font-size: 30px; + position: relative; + left: -18px; + top: 4px; + } + .image { + width: 60px; + } + } + .header-easydex-section { + img { + max-width: inherit; + } + } + .copy-string-btn { + position: absolute; + right: 36px; + margin-top: -68px; + } + .btn-next { + position: absolute; + top: 60px; + right: 32px; + } + input.labelauty+label, + input.labelauty+label { + background: #d6d5d5; + color: #504e4e; + } + input.labelauty:checked+label { + color: #fff; + background-color: #3949ab; + } + input.labelauty + label:hover .labelauty-unchecked, + input.labelauty + label .labelauty-unchecked { + color: #504e4e; + } + .nofloat { + float: none; + display: inline-block; + padding-left: 0; + } +} + +.jumblr-mode-selector { + .nav-tabs { + li { + cursor: pointer; + + &.active { + > a { + cursor: pointer; + color: #fff; + background-color: #62a8ea; + border-color: transparent; + border-bottom-color: #62a8ea; + } + } + } + } + + .panel-heading { + background: #f3f3f3; + cursor: pointer; + } + .panel-title { + color: #676767; + } + .jumblr-addresses-list { + .col-xs-3 { + padding: 0; + } + } +} \ No newline at end of file diff --git a/react/src/components/dashboard/qrModal/qrModal.scss b/react/src/components/dashboard/qrModal/qrModal.scss new file mode 100644 index 0000000..c0b3cd0 --- /dev/null +++ b/react/src/components/dashboard/qrModal/qrModal.scss @@ -0,0 +1,5 @@ +.qr-modal-send-block { + position: absolute; + top: 15px; + right: 30px; +} \ No newline at end of file diff --git a/react/src/components/dashboard/settings/settings.scss b/react/src/components/dashboard/settings/settings.scss new file mode 100644 index 0000000..f6297d8 --- /dev/null +++ b/react/src/components/dashboard/settings/settings.scss @@ -0,0 +1,115 @@ +.support-box { + padding: 15px 20px; + width: 220px; + display: inline-block; + cursor: pointer; + + &-title { + font-weight: bold; + padding-top: 12px; + padding-bottom: 3px; + } + img { + height: 50px; + } +} + +.support-box-wrapper { + display: inline-block; + margin-right: 50px; + + &:last-child, { + margin-right: 0; + } +} + +.support-box:hover { + .support-box-link { + color: #5683ad; + font-weight: 500; + } +} + +.login-settings-modal { + #AppUpdate { + .col-sm-4 { + width: 100%; + } + } + .modal-dialog { + width: 80%; + } + .modal-body { + background: #f3f4f5; + border-radius: 4px; + } + .modal-footer { + margin-top: 15px; + } + .page-content { + padding-top: 0; + } + .support-box-wrapper { + .support-box { + margin: 0; + margin-bottom: 20px; + } + } +} + +.settings-help { + font-size: 20px; + position: relative; + top: 2px; + left: 10px; + color: #5683ad; +} + +#SettingsAccordion { + .toggle { + position: relative; + top: 4px; + } + table { + width: 100%; + + td { + &:first-child { + width: 40%; + } + &:last-child { + width: 60%; + } + } + } +} + +#SettingsAccordion { + .panel { + .panel-collapse { + transition: all .3s; + + &.collapse { + height: 0; + } + } + } +} + +#section-iguana-wallet-settings { + background: #f3f4f5; + + .panel-title { + cursor: pointer; + cursor: hand; + + &:before { + content: '\F273'; + } + &.collapsed { + &:before { + content: '\F278'; + } + } + } +} \ No newline at end of file diff --git a/react/src/components/dashboard/syncOnly/syncOnly.scss b/react/src/components/dashboard/syncOnly/syncOnly.scss new file mode 100644 index 0000000..3fa0ae6 --- /dev/null +++ b/react/src/components/dashboard/syncOnly/syncOnly.scss @@ -0,0 +1,37 @@ +.sync-only-forks { + color: #757575; + + .modal-body { + overflow-y: auto; + } + .badge{ + &.up { + position: absolute; + top: 40px; + left: 65px; + margin: 0 5px; + } + } + .avatar { + width: 20%; + display: inline-block; + text-align: center; + vertical-align: top; + + img { + width: 55px; + display: inherit; + } + } + .progress-bars { + padding-left: 40px; + display: inline-block; + width: 80%; + margin: 0 auto; + } + .padding-bottom-60 { + &:last-child { + padding-bottom: 0 !important; + } + } +} \ No newline at end of file diff --git a/react/src/components/dashboard/walletsData/pagination.js b/react/src/components/dashboard/walletsData/pagination.js index dba569d..e92d445 100644 --- a/react/src/components/dashboard/walletsData/pagination.js +++ b/react/src/components/dashboard/walletsData/pagination.js @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import PaginationRender from './pagination.render'; export default class TablePaginationRenderer extends Component { - constructor (props) { + constructor(props) { super(); this.state = { page: props.page diff --git a/react/src/components/dashboard/walletsData/walletsData.scss b/react/src/components/dashboard/walletsData/walletsData.scss new file mode 100644 index 0000000..ab72b82 --- /dev/null +++ b/react/src/components/dashboard/walletsData/walletsData.scss @@ -0,0 +1,89 @@ +.search-box { + float: right; + padding-right: 0; +} +.basilisk-progress-bar { + position: absolute; + width: 100%; +} +.breadcrumb--basilisk, +.breadcrumb--native { + top: 0; +} +.dropdown-menu { + .no--hover { + pointer-events: none; + } +} +.ReactTable { + border: none; + + .pagination-bottom { + margin-top: 35px; + } + .rt-td { + text-align: center; + } + .rt-table { + border: 1px solid rgba(0, 0, 0, 0.1); + } + .rt-thead .rt-th, + .rt-thead .rt-td { + padding: 10px 5px; + } + .rt-tr.-odd div, + .rt-tr.-even div { + padding-top: 10px; + padding-bottom: 10px; + } + .-pagination, + .rt-thead, + .rt-tfoot { + border: none; + } + .rt-tfoot { + border-top: 1px solid rgba(0, 0, 0, 0.1); + } + .rt-thead { + border-bottom: 1px solid rgba(0, 0, 0, 0.1); + } + .colum--direction { + width: 40px !important; + flex: 40 0 auto !important; + padding-right: 10px; + } + .colum--txinfo { + width: 40px !important; + flex: 40 0 auto !important; + } + .colum--type { + width: 40px !important; + flex: 40 0 auto !important; + } + .-pagination { + .-pageJump { + margin-right: 5px; + margin-left: 5px; + } + .-btn { + color: #757575; + background-color: #efefef; + border: 1px solid #e0e0e0; + + &:hover { + color: #fff; + } + } + .-btn[disabled]:hover { + color: #757575; + } + } + .rt-noData { + top: 46px; + width: 100%; + text-align: center; + height: 98px; + padding: 38px; + background: rgba(255, 255, 255, 0.85); + } +} \ No newline at end of file diff --git a/react/src/components/dashboard/walletsNative/walletsNative.js b/react/src/components/dashboard/walletsNative/walletsNative.js index e220d6a..05531f3 100644 --- a/react/src/components/dashboard/walletsNative/walletsNative.js +++ b/react/src/components/dashboard/walletsNative/walletsNative.js @@ -26,18 +26,18 @@ class WalletsNative extends React.Component { if (data && data.komodod && data.komodod.error) { - switch (data.komodod.error) { - case 'run -reindex': - Store.dispatch( - triggerToaster( - translate('TOASTR.RESTART_AGAMA_WITH_REINDEX_PARAM'), - translate('TOASTR.WALLET_NOTIFICATION'), - 'info', - false - ) - ); - break; - } + switch (data.komodod.error) { + case 'run -reindex': + Store.dispatch( + triggerToaster( + translate('TOASTR.RESTART_AGAMA_WITH_REINDEX_PARAM'), + translate('TOASTR.WALLET_NOTIFICATION'), + 'info', + false + ) + ); + break; + } } } @@ -81,7 +81,7 @@ const mapStateToProps = (state) => { mode: state.ActiveCoin.mode, } }; - + }; export default connect(mapStateToProps)(WalletsNative); diff --git a/react/src/components/login/login.scss b/react/src/components/login/login.scss index 4b07173..beceabf 100644 --- a/react/src/components/login/login.scss +++ b/react/src/components/login/login.scss @@ -103,7 +103,7 @@ input[type="password"] { z-index: 1; top: -5px; left: 105%; - + &::after { content: ''; position: absolute; @@ -152,4 +152,10 @@ input[type="password"] { a { color: #fb8c00; } +} + +.login-form, +.register-form { + width: 540px; + margin: 30px 0; } \ No newline at end of file diff --git a/react/src/components/overrides.scss b/react/src/components/overrides.scss index 653bb27..d09dffc 100644 --- a/react/src/components/overrides.scss +++ b/react/src/components/overrides.scss @@ -1,6 +1,8 @@ /* TODO: nesting, separate */ #app { + height: 100%; + > div { height: 100%; } @@ -28,30 +30,6 @@ body { padding-top: 44px; } -.login-form, -.register-form { - width: 540px; - margin: 30px 0; -} - -#section-iguana-wallet-settings { - background: #f3f4f5; - - .panel-title { - cursor: pointer; - cursor: hand; - - &:before { - content: '\F273'; - } - &.collapsed { - &:before { - content: '\F278'; - } - } - } -} - #section-dashboard { height: 100%; } @@ -147,131 +125,12 @@ body { } } -.display-sync-only-coins-toggle { - cursor: pointer; - - &:hover { - color: #ffa726; - } -} - -.btn-add-coin-item, -.btn-add-coin-item-options, -.btn-save-coin-selection, -.btn-load-coin-selection { - position: absolute; - right: 32px; - z-index: 50; -} -.btn-add-coin-item { - right: 60px; -} -.btn-add-coin-item-options { - padding: 6px; -} -.btn-save-coin-selection { - top: 60px; -} -.btn-load-coin-selection { - top: 95px; -} - .btn-outline-primary { color: #FF6600; background-color: #fff; border-color: #FF6600; } -.add-coin-modal { - .modal-body { - max-height: 590px; - overflow-y: auto; - } - - .multi { - .col-sm-8 { - width: 30%; - } - .col-sm-12 { - &.text-center { - width: 60%; - padding: 0; - - .col-lg-4 { - width: 25%; - margin-right: 8%; - padding: 0; - - .input{ - &.to-labelauty+label { - max-width: 136px; - } - } - } - .col-lg-4 { - &:last-child { - margin-right: 0; - } - } - .col-sm-1 { - width: 44px; - padding: 0; - } - } - } - } -} - -.sync-only-forks { - color: #757575; - - .modal-body { - overflow-y: auto; - } - .badge{ - &.up { - position: absolute; - top: 40px; - left: 65px; - margin: 0 5px; - } - } - .avatar { - width: 20%; - display: inline-block; - text-align: center; - vertical-align: top; - - img { - width: 55px; - display: inherit; - } - } - .progress-bars { - padding-left: 40px; - display: inline-block; - width: 80%; - margin: 0 auto; - } - .padding-bottom-60 { - &:last-child { - padding-bottom: 0 !important; - } - } -} - -#SettingsAccordion { - .panel { - .panel-collapse { - transition: all .3s; - - &.collapse { - height: 0; - } - } - } -} - .center { text-align: center; } @@ -314,6 +173,13 @@ body { -webkit-transition: .4s; transition: .4s; + &.round { + border-radius: 34px; + + &:before { + border-radius: 50%; + } + } &:before { border-radius: 50%; position: absolute; @@ -356,15 +222,6 @@ input:checked + .slider:before { } } -.slider { - &.round { - border-radius: 34px; - &:before { - border-radius: 50%; - } - } -} - .pointer { cursor: pointer; } @@ -373,8 +230,10 @@ input:checked + .slider:before { text-align: center; } -.coin-logo.breadcrumb { - z-index: 100; +.coin-logo { + &.breadcrumb { + z-index: 100; + } } .breadcrumb > li + li:before { display: none; @@ -521,10 +380,6 @@ input:checked + .slider:before { width: 200px; } -#app { - height: 100%; -} - .spinner { width: 50px; height: 40px; @@ -625,31 +480,6 @@ select{ margin-left: 10px; } -.coind-down-modal { - .modal-body { - height: 60vh; - - > div { - height: 100%; - } - .form-group { - &.form-material { - &.floating { - height: 80%; - } - } - } - .page-content { - width: 90%; - height: 100%; - - textarea { - height: 100%; - } - } - } -} - .backround-gray { background: #f3f4f5; } @@ -669,12 +499,6 @@ select{ } } -.qr-modal-send-block { - position: absolute; - top: 15px; - right: 30px; -} - @media only screen and (min-width : 1201px) { .wallet-widgets { .flex { @@ -751,338 +575,10 @@ select{ height: 75px; } -#toast-container { - > div { - padding: 15px 15px 15px 60px; - width: 310px; - opacity: 1; - } -} - .toggle-filters:hover { background-color: #f3f1f1; } -/* jumblr */ -.jumblr { - p { - width: calc(100% - 100px); - } - .breadcrumb { - padding: 8px 30px; - position: relative; - top: 0; - } - .img-responsive { - position: absolute; - top: -28px; - right: 18px; - - .coin { - font-size: 30px; - position: relative; - left: -18px; - top: 4px; - } - .image { - width: 60px; - } - } - .header-easydex-section { - img { - max-width: inherit; - } - } - .copy-string-btn { - position: absolute; - right: 36px; - margin-top: -68px; - } - .btn-next { - position: absolute; - top: 60px; - right: 32px; - } - input.labelauty+label, - input.labelauty+label { - background: #d6d5d5; - color: #504e4e; - } - input.labelauty:checked+label { - color: #fff; - background-color: #3949ab; - } - input.labelauty + label:hover .labelauty-unchecked, - input.labelauty + label .labelauty-unchecked { - color: #504e4e; - } - .nofloat { - float: none; - display: inline-block; - padding-left: 0; - } -} - -.jumblr-mode-selector { - .nav-tabs { - li { - cursor: pointer; - - &.active { - > a { - cursor: pointer; - color: #fff; - background-color: #62a8ea; - border-color: transparent; - border-bottom-color: #62a8ea; - } - } - } - } - - .panel-heading { - background: #f3f3f3; - cursor: pointer; - } - .panel-title { - color: #676767; - } - .jumblr-addresses-list { - .col-xs-3 { - padding: 0; - } - } -} - -.modal-claim-interest { - .modal-dialog { - width: 70%; - - .table > tbody > tr > td, - .table > tbody > tr > th, - .table > tfoot > tr > td, - .table > tfoot > tr > th, - .table > thead > tr > td, - .table > thead > tr > th { - padding: 8px 30px 8px 0; - } - - .claim-btn { - position: absolute; - right: 29px; - top: 66px; - } - .table-scroll { - height: 366px; - overflow-y: auto; - overflow-x: hidden; - width: 100%; - } - .bold { - font-weight: bold; - } - .green { - color: #66bb6a; - } - .red { - color: #f96868; - } - .locktime { - i { - font-size: 20px; - line-height: 1.1; - } - } - - .refresh-icon { - position: absolute; - right: 20px; - font-size: 20px; - z-index: 100; - } - } -} - -.search-box { - float: right; - padding-right: 0; -} - .no-padding-left { padding-left: 0; -} - -.basilisk-progress-bar { - position: absolute; - width: 100%; -} - -.breadcrumb--basilisk, -.breadcrumb--native { - top: 0; -} - -.dropdown-menu { - .no--hover { - pointer-events: none; - } -} - -.ReactTable { - border: none; - - .pagination-bottom { - margin-top: 35px; - } - .rt-td { - text-align: center; - } - .rt-table { - border: 1px solid rgba(0, 0, 0, 0.1); - } - .rt-thead .rt-th, - .rt-thead .rt-td { - padding: 10px 5px; - } - .rt-tr.-odd div, - .rt-tr.-even div { - padding-top: 10px; - padding-bottom: 10px; - } - .-pagination, - .rt-thead, - .rt-tfoot { - border: none; - } - .rt-tfoot { - border-top: 1px solid rgba(0, 0, 0, 0.1); - } - .rt-thead { - border-bottom: 1px solid rgba(0, 0, 0, 0.1); - } - .colum--direction { - width: 40px !important; - flex: 40 0 auto !important; - padding-right: 10px; - } - .colum--txinfo { - width: 40px !important; - flex: 40 0 auto !important; - } - .colum--type { - width: 40px !important; - flex: 40 0 auto !important; - } - .-pagination { - .-pageJump { - margin-right: 5px; - margin-left: 5px; - } - .-btn { - color: #757575; - background-color: #efefef; - border: 1px solid #e0e0e0; - - &:hover { - color: #fff; - } - } - .-btn[disabled]:hover { - color: #757575; - } - } - .rt-noData { - top: 46px; - width: 100%; - text-align: center; - height: 98px; - padding: 38px; - background: rgba(255, 255, 255, 0.85); - } -} - -.support-box { - padding: 15px 20px; - width: 220px; - display: inline-block; - cursor: pointer; - - &-title { - font-weight: bold; - padding-top: 12px; - padding-bottom: 3px; - } - img { - height: 50px; - } -} - -.support-box-wrapper { - display: inline-block; - margin-right: 50px; - - &:last-child, { - margin-right: 0; - } -} - -.support-box:hover { - .support-box-link { - color: #5683ad; - font-weight: 500; - } -} - -.login-settings-modal { - #AppUpdate { - .col-sm-4 { - width: 100%; - } - } - .modal-dialog { - width: 80%; - } - .modal-body { - background: #f3f4f5; - border-radius: 4px; - } - .modal-footer { - margin-top: 15px; - } - .page-content { - padding-top: 0; - } - .support-box-wrapper { - .support-box { - margin: 0; - margin-bottom: 20px; - } - } -} - -.settings-help { - font-size: 20px; - position: relative; - top: 2px; - left: 10px; - color: #5683ad; -} - -#SettingsAccordion { - .toggle { - position: relative; - top: 4px; - } - table { - width: 100%; - - td { - &:first-child { - width: 40%; - } - &:last-child { - width: 60%; - } - } - } } \ No newline at end of file diff --git a/react/src/components/toaster/toaster.scss b/react/src/components/toaster/toaster.scss new file mode 100644 index 0000000..d42bc45 --- /dev/null +++ b/react/src/components/toaster/toaster.scss @@ -0,0 +1,7 @@ +#toast-container { + > div { + padding: 15px 15px 15px 60px; + width: 310px; + opacity: 1; + } +} \ No newline at end of file diff --git a/react/src/styles/index.scss b/react/src/styles/index.scss index b8589ce..a276e12 100644 --- a/react/src/styles/index.scss +++ b/react/src/styles/index.scss @@ -34,4 +34,12 @@ @import '../components/dashboard/main/dashboard.scss'; @import '../components/login/login.scss'; @import '../components/overrides.scss'; +@import '../components/dashboard/settings/settings.scss'; +@import '../components/dashboard/walletsData/walletsData.scss'; +@import '../components/dashboard/claimInterestModal/claimInterestModal.scss'; +@import '../components/dashboard/jumblr/jumblr.scss'; +@import '../components/dashboard/qrModal/qrModal.scss'; +@import '../components/dashboard/coindDownModal/coindDownModal.scss'; +@import '../components/dashboard/syncOnly/syncOnly.scss'; +@import '../components/toaster/toaster.scss'; @import '~react-table/react-table.css'; From 66b547a4ccc1ea7a29a832c4572a4147f51acfe2 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Fri, 1 Sep 2017 19:02:42 +0300 Subject: [PATCH 28/83] remove gui http state logger --- assets/mainWindow/css/loading.css | 15 +- assets/mainWindow/js/loading.js | 8 + react/src/actions/actionCreators.js | 5 - react/src/actions/actions/addCoin.js | 30 ---- react/src/actions/actions/addressBalance.js | 113 ------------ react/src/actions/actions/atomic.js | 30 ---- react/src/actions/actions/basiliskCache.js | 4 - .../actions/actions/basiliskProcessAddress.js | 56 ------ .../src/actions/actions/basiliskTxHistory.js | 4 - react/src/actions/actions/cli.js | 4 - react/src/actions/actions/coinList.js | 4 - react/src/actions/actions/createWallet.js | 30 ---- react/src/actions/actions/dexCoins.js | 30 ---- react/src/actions/actions/edexBalance.js | 49 ----- react/src/actions/actions/edexGetTx.js | 30 ---- react/src/actions/actions/fullTxHistory.js | 30 ---- react/src/actions/actions/getAddrByAccount.js | 30 ---- react/src/actions/actions/iguanaHelpers.js | 30 ---- react/src/actions/actions/iguanaInstance.js | 4 - react/src/actions/actions/interest.js | 4 - react/src/actions/actions/jumblr.js | 4 - react/src/actions/actions/log.js | 61 ------- react/src/actions/actions/logout.js | 30 ---- react/src/actions/actions/nativeBalance.js | 30 ---- react/src/actions/actions/nativeNewAddress.js | 30 ---- react/src/actions/actions/nativeSend.js | 57 ------ react/src/actions/actions/nativeSyncInfo.js | 55 ------ react/src/actions/actions/nativeTxHistory.js | 30 ---- react/src/actions/actions/notary.js | 55 ------ react/src/actions/actions/openAlias.js | 4 - react/src/actions/actions/sendFullBasilisk.js | 110 +----------- react/src/actions/actions/settings.js | 82 --------- react/src/actions/actions/syncInfo.js | 30 ---- react/src/actions/actions/syncOnly.js | 4 - react/src/actions/actions/sysInfo.js | 4 - react/src/actions/actions/update.js | 4 - react/src/actions/actions/walletAuth.js | 108 ----------- react/src/actions/storeType.js | 1 - .../dashboard/notifications/notifications.js | 122 ------------- .../notifications/notifications.render.js | 116 ------------ react/src/components/main/walletMain.js | 2 - react/src/components/overrides.scss | 169 ++---------------- react/src/reducers/dashboard.js | 31 ---- react/src/reducers/errors.js | 26 --- react/src/reducers/index.js | 2 - 45 files changed, 40 insertions(+), 1637 deletions(-) delete mode 100644 react/src/actions/actions/log.js delete mode 100755 react/src/components/dashboard/notifications/notifications.js delete mode 100644 react/src/components/dashboard/notifications/notifications.render.js delete mode 100644 react/src/reducers/errors.js diff --git a/assets/mainWindow/css/loading.css b/assets/mainWindow/css/loading.css index 47ad63a..dde1669 100644 --- a/assets/mainWindow/css/loading.css +++ b/assets/mainWindow/css/loading.css @@ -41,7 +41,7 @@ body.agama-default-window-height { } body.agama-app-settings-window { - height: 770px; + height: 820px; } .agama-logo { @@ -162,6 +162,11 @@ body.agama-app-settings-window { margin-top: 20px; } +.pull-left { + float: left; + margin-left: 50px; +} + .btn-close { border-bottom-left-radius: 50%; background: #fff; @@ -210,6 +215,8 @@ body.agama-app-settings-window { .settings-buttons-block { margin-top: 50px; + margin-right: 50px; + text-align: right; } .settings-table { @@ -382,4 +389,10 @@ button.toast-close-button { margin-left: 10px; -ms-word-wrap: break-word; word-wrap: break-word; +} + +.test-bins { + text-align: left; + margin-top: 10px; + margin-left: 30px; } \ No newline at end of file diff --git a/assets/mainWindow/js/loading.js b/assets/mainWindow/js/loading.js index 82ff800..4de0cca 100644 --- a/assets/mainWindow/js/loading.js +++ b/assets/mainWindow/js/loading.js @@ -102,6 +102,14 @@ function setDefaultAppSettings() { showToast('success', 'App settings are reset to default'); } +function testBins(binName) { + const remote = require('electron').remote; + remote.getCurrentWindow().testBins(binName). + then(function(res) { + $('#debugOut').html(JSON.stringify(res, null, '\t')); + }); +} + function handleSaveSettings() { if (_configCopy.dataDir && _configCopy.dataDir.length) { diff --git a/react/src/actions/actionCreators.js b/react/src/actions/actionCreators.js index fd910e4..04c457d 100644 --- a/react/src/actions/actionCreators.js +++ b/react/src/actions/actionCreators.js @@ -31,11 +31,6 @@ import { START_INTERVAL, STOP_INTERVAL } from './storeType'; -import { - logGuiHttp, - getAgamaLog, - guiLogState -} from './actions/log'; export * from './actions/nativeSyncInfo'; export * from './actions/basiliskCache'; diff --git a/react/src/actions/actions/addCoin.js b/react/src/actions/actions/addCoin.js index 0ebe38d..54b5ea3 100644 --- a/react/src/actions/actions/addCoin.js +++ b/react/src/actions/actions/addCoin.js @@ -7,10 +7,6 @@ import { startIguanaInstance, iguanaWalletPassphraseState, } from '../actionCreators'; -import { - logGuiHttp, - guiLogState -} from './log'; import { startCurrencyAssetChain, startAssetChain, @@ -96,31 +92,12 @@ export function addCoin(coin, mode, syncOnly, port, startupParams) { export function iguanaAddCoin(coin, mode, acData, port) { function _iguanaAddCoin(dispatch) { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'iguanaAddCoin', - type: 'post', - url: `http://127.0.0.1:${(port ? port : Config.iguanaCorePort)}`, - payload: acData, - status: 'pending', - })); - } - return fetch(`http://127.0.0.1:${(port ? port : Config.iguanaCorePort)}`, { method: 'POST', body: JSON.stringify(acData), }) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( translate('TOASTR.FAILED_TO_ADDCOIN'), @@ -131,13 +108,6 @@ export function iguanaAddCoin(coin, mode, acData, port) { }) .then(response => response.json()) .then(json => { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } dispatch( addCoinResult( coin, diff --git a/react/src/actions/actions/addressBalance.js b/react/src/actions/actions/addressBalance.js index 1072b21..c286ca5 100644 --- a/react/src/actions/actions/addressBalance.js +++ b/react/src/actions/actions/addressBalance.js @@ -5,10 +5,6 @@ import { getPassthruAgent, iguanaHashHex } from '../actionCreators'; -import { - logGuiHttp, - guiLogState -} from './log'; import Config from '../../config'; function getKMDAddressesNativeState(json) { @@ -105,18 +101,6 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { }; } - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'getKMDAddressesNative', - type: 'post', - url: Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } - let _fetchConfig = { method: 'POST', body: JSON.stringify(payload), @@ -139,13 +123,6 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { ) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'getKMDAddressesNative', @@ -156,13 +133,6 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { }) .then(response => response.json()) .then(json => { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } resolve(Config.cli.default && mode === 'native' ? json.result : json); }) } @@ -307,16 +277,6 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { hex: hashHexJson, }; } - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'getKMDAddressesNative+ZBalance', - type: 'post', - url: Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } let _fetchConfig = { method: 'POST', @@ -349,13 +309,6 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { ) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'getKMDAddressesNative+ZBalance', @@ -369,13 +322,6 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { if (json && json.error) { resolve(0); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: json, - })); - } dispatch( triggerToaster( 'getKMDAddressesNative+ZBalance', @@ -394,13 +340,6 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { amount: json, type: 'private', }; - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } } }); }); @@ -448,31 +387,12 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { if (json[coin][currentAddress].refresh) { calcBalance(result, json[coin][currentAddress].refresh.data, dispatch, mode); } else { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'getKMDAddressesNative+Balance', - type: 'post', - url: `http://127.0.0.1:${(Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort)}`, - payload: payload, - status: 'pending', - })); - } - fetch(`http://127.0.0.1:${(Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort)}`, { method: 'POST', body: JSON.stringify(payload), }) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'getKMDAddressesNative+Balance', @@ -483,13 +403,6 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { }) .then(response => response.json()) .then(function(json) { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } updatedCache.basilisk[coin][currentAddress].refresh = { data: json, status: 'done', @@ -506,18 +419,6 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { } }) } else { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'getKMDAddressesNative+Balance', - type: 'post', - url: `http://127.0.0.1:${(Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort)}`, - payload: payload, - status: 'pending', - })); - } - let _fetchConfig = { method: 'POST', body: JSON.stringify(payload), @@ -547,13 +448,6 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { ) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'getKMDAddressesNative+Balance', @@ -568,13 +462,6 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { mode === 'native') { json = json.result; } - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } calcBalance( result, json, diff --git a/react/src/actions/actions/atomic.js b/react/src/actions/actions/atomic.js index 378942b..d28e724 100644 --- a/react/src/actions/actions/atomic.js +++ b/react/src/actions/actions/atomic.js @@ -1,38 +1,15 @@ import { ATOMIC } from '../storeType'; import { triggerToaster } from '../actionCreators'; -import { - logGuiHttp, - guiLogState -} from './log'; import Config from '../../config'; export function atomic(payload) { return dispatch => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'atomic', - type: 'post', - url: `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } - return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', body: JSON.stringify(payload), }) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( payload.method, @@ -43,13 +20,6 @@ export function atomic(payload) { }) .then(response => response.json()) .then(json => { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } dispatch(atomicState(json)); }); } diff --git a/react/src/actions/actions/basiliskCache.js b/react/src/actions/actions/basiliskCache.js index f3c743c..8b9506d 100644 --- a/react/src/actions/actions/basiliskCache.js +++ b/react/src/actions/actions/basiliskCache.js @@ -1,9 +1,5 @@ import { DASHBOARD_ACTIVE_COIN_GET_CACHE } from '../storeType'; import { triggerToaster } from '../actionCreators'; -import { - logGuiHttp, - guiLogState -} from './log'; import Config from '../../config'; // TODO: rewrite cache API to use POST diff --git a/react/src/actions/actions/basiliskProcessAddress.js b/react/src/actions/actions/basiliskProcessAddress.js index fd91018..83e63e1 100644 --- a/react/src/actions/actions/basiliskProcessAddress.js +++ b/react/src/actions/actions/basiliskProcessAddress.js @@ -1,9 +1,5 @@ import { translate } from '../../translate/translate'; import { triggerToaster } from '../actionCreators'; -import { - logGuiHttp, - guiLogState -} from './log'; import Config from '../../config'; export function checkAddressBasilisk(coin, address) { @@ -16,31 +12,12 @@ export function checkAddressBasilisk(coin, address) { }; return dispatch => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'checkAddressBasilisk', - type: 'post', - url: `http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } - return fetch(`http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, { method: 'POST', body: JSON.stringify(payload), }) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'checkAddressBasilisk', @@ -51,13 +28,6 @@ export function checkAddressBasilisk(coin, address) { }) .then(response => response.json()) .then(json => { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } dispatch(checkAddressBasiliskHandle(json)); }) } @@ -102,31 +72,12 @@ export function validateAddressBasilisk(coin, address) { }; return dispatch => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'validateAddressBasilisk', - type: 'post', - url: `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } - return fetch(`http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, { method: 'POST', body: JSON.stringify(payload), }) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'validateAddressBasilisk', @@ -137,13 +88,6 @@ export function validateAddressBasilisk(coin, address) { }) .then(response => response.json()) .then(json => { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } dispatch(validateAddressBasiliskHandle(json)); }) } diff --git a/react/src/actions/actions/basiliskTxHistory.js b/react/src/actions/actions/basiliskTxHistory.js index 06485a3..259a607 100644 --- a/react/src/actions/actions/basiliskTxHistory.js +++ b/react/src/actions/actions/basiliskTxHistory.js @@ -2,10 +2,6 @@ import { triggerToaster, getNativeTxHistoryState } from '../actionCreators'; -import { - logGuiHttp, - guiLogState -} from './log'; import Config from '../../config'; export function getBasiliskTransactionsList(coin, address) { diff --git a/react/src/actions/actions/cli.js b/react/src/actions/actions/cli.js index 11e223f..ca98443 100644 --- a/react/src/actions/actions/cli.js +++ b/react/src/actions/actions/cli.js @@ -1,9 +1,5 @@ import { triggerToaster } from '../actionCreators'; import { CLI } from '../storeType'; -import { - logGuiHttp, - guiLogState -} from './log'; import Config from '../../config'; export function shepherdCliPromise(mode, chain, cmd) { diff --git a/react/src/actions/actions/coinList.js b/react/src/actions/actions/coinList.js index f83ab43..3fa06dc 100644 --- a/react/src/actions/actions/coinList.js +++ b/react/src/actions/actions/coinList.js @@ -1,8 +1,4 @@ import { triggerToaster } from '../actionCreators'; -import { - logGuiHttp, - guiLogState -} from './log'; import Config from '../../config'; export function shepherdGetCoinList() { diff --git a/react/src/actions/actions/createWallet.js b/react/src/actions/actions/createWallet.js index 671c807..cc94cba 100644 --- a/react/src/actions/actions/createWallet.js +++ b/react/src/actions/actions/createWallet.js @@ -1,9 +1,5 @@ import { translate } from '../../translate/translate'; import { triggerToaster } from '../actionCreators'; -import { - logGuiHttp, - guiLogState -} from './log'; import Config from '../../config'; function createNewWalletState(json) { @@ -41,31 +37,12 @@ export function createNewWallet(_passphrase) { }; return dispatch => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'createNewWallet', - type: 'post', - url: `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } - return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', body: JSON.stringify(payload), }) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'createNewWallet', @@ -76,13 +53,6 @@ export function createNewWallet(_passphrase) { }) .then(response => response.json()) .then(json => { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } dispatch(createNewWalletState(json)); }) } diff --git a/react/src/actions/actions/dexCoins.js b/react/src/actions/actions/dexCoins.js index 12697e5..a5bd20b 100644 --- a/react/src/actions/actions/dexCoins.js +++ b/react/src/actions/actions/dexCoins.js @@ -2,10 +2,6 @@ import { triggerToaster, dashboardCoinsState } from '../actionCreators'; -import { - logGuiHttp, - guiLogState -} from './log'; import Config from '../../config'; // TODO: find out why it errors on slow systems @@ -17,18 +13,6 @@ export function getDexCoins() { }; return dispatch => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'getDexCoins', - type: 'post', - url: Config.iguanaLessMode ? `http://127.0.0.1:${Config.agamaPort}/shepherd/InstantDEX/allcoins` : `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: _payload, - status: 'pending', - })); - } - let _fetchConfig = { method: 'POST', body: JSON.stringify(_payload), @@ -49,13 +33,6 @@ export function getDexCoins() { ) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'Error getDexCoins', @@ -66,13 +43,6 @@ export function getDexCoins() { }) .then(response => response.json()) .then(json => { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } dispatch(dashboardCoinsState(json)); }); } diff --git a/react/src/actions/actions/edexBalance.js b/react/src/actions/actions/edexBalance.js index 29a1b14..39be212 100644 --- a/react/src/actions/actions/edexBalance.js +++ b/react/src/actions/actions/edexBalance.js @@ -1,9 +1,5 @@ import { DASHBOARD_ACTIVE_COIN_BALANCE } from '../storeType'; import { triggerToaster } from '../actionCreators'; -import { - logGuiHttp, - guiLogState -} from './log'; import Config from '../../config'; export function iguanaEdexBalance(coin) { @@ -16,31 +12,12 @@ export function iguanaEdexBalance(coin) { return dispatch => { if (coin) { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'iguanaEdexBalance', - type: 'post', - url: `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: _payload, - status: 'pending', - })); - } - return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', body: JSON.stringify(_payload), }) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'Error iguanaEdexBalance', @@ -73,31 +50,12 @@ export function getDexBalance(coin, mode, addr) { }; return new Promise((resolve, reject) => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'getDexBalance', - type: 'post', - url: `http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } - fetch(`http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, { method: 'POST', body: JSON.stringify(payload), }) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'getDexBalance', @@ -109,13 +67,6 @@ export function getDexBalance(coin, mode, addr) { .then(response => response.json()) .then(json => { console.log(json); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } }) resolve(index); diff --git a/react/src/actions/actions/edexGetTx.js b/react/src/actions/actions/edexGetTx.js index 77b09d2..f95e64c 100644 --- a/react/src/actions/actions/edexGetTx.js +++ b/react/src/actions/actions/edexGetTx.js @@ -1,8 +1,4 @@ import { triggerToaster } from '../actionCreators'; -import { - logGuiHttp, - guiLogState -} from './log'; import Config from '../../config'; export function edexGetTransaction(data, dispatch) { @@ -16,31 +12,12 @@ export function edexGetTransaction(data, dispatch) { }; return new Promise((resolve, reject) => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'edexGetTransaction', - type: 'post', - url: `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } - fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', body: JSON.stringify(payload), }) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'edexGetTransaction', @@ -51,13 +28,6 @@ export function edexGetTransaction(data, dispatch) { }) .then(response => response.json()) .then(json => { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } resolve(json); }) }); diff --git a/react/src/actions/actions/fullTxHistory.js b/react/src/actions/actions/fullTxHistory.js index cbc92a8..c3ffe3a 100644 --- a/react/src/actions/actions/fullTxHistory.js +++ b/react/src/actions/actions/fullTxHistory.js @@ -2,10 +2,6 @@ import { triggerToaster, getNativeTxHistoryState } from '../actionCreators'; -import { - logGuiHttp, - guiLogState -} from './log'; import Config from '../../config'; export function getFullTransactionsList(coin) { @@ -21,31 +17,12 @@ export function getFullTransactionsList(coin) { }; return dispatch => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'getFullTransactionsList', - type: 'post', - url: `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } - return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', body: JSON.stringify(payload), }) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'getFullTransactionsList', @@ -56,13 +33,6 @@ export function getFullTransactionsList(coin) { }) .then(response => response.json()) .then(json => { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } dispatch(getNativeTxHistoryState(json)); }) } diff --git a/react/src/actions/actions/getAddrByAccount.js b/react/src/actions/actions/getAddrByAccount.js index 1797c4a..d77a46e 100644 --- a/react/src/actions/actions/getAddrByAccount.js +++ b/react/src/actions/actions/getAddrByAccount.js @@ -1,8 +1,4 @@ import { ACTIVE_COIN_GET_ADDRESSES } from '../storeType'; -import { - logGuiHttp, - guiLogState -} from './log'; import Config from '../../config'; export function getAddressesByAccountState(json, coin, mode) { @@ -36,31 +32,12 @@ export function getAddressesByAccount(coin, mode) { }; return dispatch => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'getAddressesByAccount', - type: 'post', - url: `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } - return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', body: JSON.stringify(payload), }) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch(updateErrosStack('activeHandle')); dispatch( triggerToaster( @@ -72,13 +49,6 @@ export function getAddressesByAccount(coin, mode) { }) .then(response => response.json()) .then(json => { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } dispatch( getAddressesByAccountState( json, diff --git a/react/src/actions/actions/iguanaHelpers.js b/react/src/actions/actions/iguanaHelpers.js index 76a0f88..2b2560c 100644 --- a/react/src/actions/actions/iguanaHelpers.js +++ b/react/src/actions/actions/iguanaHelpers.js @@ -1,7 +1,3 @@ -import { - logGuiHttp, - guiLogState -} from './log'; import Config from '../../config'; import { checkAC } from '../../components/addcoin/payload'; @@ -29,31 +25,12 @@ export function iguanaHashHex(data, dispatch) { if (Config.cli.default) { resolve(true); } else { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'iguanaHashHex', - type: 'post', - url: `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } - fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', body: JSON.stringify(payload), }) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'iguanaHashHex', @@ -64,13 +41,6 @@ export function iguanaHashHex(data, dispatch) { }) .then(response => response.json()) .then(json => { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } resolve(json.hex); }) } diff --git a/react/src/actions/actions/iguanaInstance.js b/react/src/actions/actions/iguanaInstance.js index 28b5870..ceba837 100644 --- a/react/src/actions/actions/iguanaInstance.js +++ b/react/src/actions/actions/iguanaInstance.js @@ -1,8 +1,4 @@ import { triggerToaster } from '../actionCreators'; -import { - logGuiHttp, - guiLogState -} from './log'; import Config from '../../config'; export function restartIguanaInstance(pmid) { diff --git a/react/src/actions/actions/interest.js b/react/src/actions/actions/interest.js index 1dd95c6..1db5941 100644 --- a/react/src/actions/actions/interest.js +++ b/react/src/actions/actions/interest.js @@ -1,10 +1,6 @@ import { triggerToaster } from '../actionCreators'; -import { - logGuiHttp, - guiLogState -} from './log'; import Config from '../../config'; export function getListUnspent(coin) { diff --git a/react/src/actions/actions/jumblr.js b/react/src/actions/actions/jumblr.js index 1b4a359..5e8373b 100644 --- a/react/src/actions/actions/jumblr.js +++ b/react/src/actions/actions/jumblr.js @@ -2,10 +2,6 @@ import { triggerToaster, getNewKMDAddresses } from '../actionCreators'; -import { - logGuiHttp, - guiLogState -} from './log'; import Config from '../../config'; function getNewAddress(coin) { // TODO: remove(?) diff --git a/react/src/actions/actions/log.js b/react/src/actions/actions/log.js deleted file mode 100644 index c53f402..0000000 --- a/react/src/actions/actions/log.js +++ /dev/null @@ -1,61 +0,0 @@ -import { LOG_GUI_HTTP } from '../storeType'; -import { triggerToaster } from '../actionCreators'; -import Config from '../../config'; - -export function logGuiHttp(payload) { - return dispatch => { - dispatch(guiLogState(payload)); - - // disabled for now - /*return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/guilog`, { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify(payload), - }) - .catch(function(error) { - console.log(error); - dispatch(triggerToaster('logGuiHttp', 'Error', 'error')); - }) - .then(response => response.json())*/ - } -} - -export function getAgamaLog(type) { - return dispatch => { - return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/getlog?type=${type}`, { - method: 'GET', - headers: { - 'Content-Type': 'application/json', - }, - }) - .catch(function(error) { - console.log(error); - dispatch( - triggerToaster( - 'getAgamaLog', - 'Error', - 'error' - ) - ); - }) - .then(response => response.json()) - } -} - -export function guiLogState(logData) { - return { - type: LOG_GUI_HTTP, - timestamp: logData.timestamp, - log: { - timestamp: logData.timestamp, - function: logData.function, - httpMethod: logData.type, - url: logData.url, - payload: logData.payload, - status: logData.status, - response: logData.response, - } - } -} \ No newline at end of file diff --git a/react/src/actions/actions/logout.js b/react/src/actions/actions/logout.js index f12fdef..3449245 100644 --- a/react/src/actions/actions/logout.js +++ b/react/src/actions/actions/logout.js @@ -4,10 +4,6 @@ import { } from '../storeType'; import { triggerToaster } from '../actionCreators'; import Config from '../../config'; -import { - logGuiHttp, - guiLogState -} from './log'; function logoutState(json) { sessionStorage.removeItem('IguanaActiveAccount'); @@ -38,31 +34,12 @@ function walletLock() { }; return dispatch => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'walletLock', - type: 'post', - url: `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } - return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', body: JSON.stringify(payload), }) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'walletLock', @@ -73,13 +50,6 @@ function walletLock() { }) .then(response => response.json()) .then(json => { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } dispatch(logoutState(json)); dispatch(logoutResetAppState()); }) diff --git a/react/src/actions/actions/nativeBalance.js b/react/src/actions/actions/nativeBalance.js index 93a9e14..1f545ec 100644 --- a/react/src/actions/actions/nativeBalance.js +++ b/react/src/actions/actions/nativeBalance.js @@ -4,10 +4,6 @@ import { getPassthruAgent } from '../actionCreators'; import Config from '../../config'; -import { - logGuiHttp, - guiLogState -} from './log'; export function getKMDBalanceTotal(coin) { let payload; @@ -41,18 +37,6 @@ export function getKMDBalanceTotal(coin) { } return dispatch => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'getKMDBalanceTotal', - type: 'post', - url: Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } - let _fetchConfig = { method: 'POST', body: JSON.stringify(payload), @@ -74,13 +58,6 @@ export function getKMDBalanceTotal(coin) { ) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'getKMDBalanceTotal', @@ -91,13 +68,6 @@ export function getKMDBalanceTotal(coin) { }) .then(response => response.json()) .then(function(json) { // TODO: figure out why komodod spits out "parse error" - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } if (json && !json.error) { dispatch(getNativeBalancesState(json)); diff --git a/react/src/actions/actions/nativeNewAddress.js b/react/src/actions/actions/nativeNewAddress.js index de3c376..96e163b 100644 --- a/react/src/actions/actions/nativeNewAddress.js +++ b/react/src/actions/actions/nativeNewAddress.js @@ -5,10 +5,6 @@ import { getKMDAddressesNative } from '../actionCreators'; import Config from '../../config'; -import { - logGuiHttp, - guiLogState -} from './log'; export function getNewKMDAddresses(coin, pubpriv, mode) { let payload; @@ -34,18 +30,6 @@ export function getNewKMDAddresses(coin, pubpriv, mode) { } return dispatch => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'getNewKMDAddresses', - type: 'post', - url: Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } - let _fetchConfig = { method: 'POST', body: JSON.stringify(payload), @@ -73,13 +57,6 @@ export function getNewKMDAddresses(coin, pubpriv, mode) { ) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'getNewKMDAddresses', @@ -93,13 +70,6 @@ export function getNewKMDAddresses(coin, pubpriv, mode) { if (Config.cli.default) { json = json.result; } - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } dispatch( triggerToaster( json.result ? json.result : json, diff --git a/react/src/actions/actions/nativeSend.js b/react/src/actions/actions/nativeSend.js index 9cb421f..ca28f88 100644 --- a/react/src/actions/actions/nativeSend.js +++ b/react/src/actions/actions/nativeSend.js @@ -5,10 +5,6 @@ import { getPassthruAgent, iguanaHashHex } from '../actionCreators'; -import { - logGuiHttp, - guiLogState -} from './log'; import Config from '../../config'; export function sendNativeTx(coin, _payload) { @@ -47,18 +43,6 @@ export function sendNativeTx(coin, _payload) { }; } - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'sendNativeTx', - type: 'post', - url: Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } - let _fetchConfig = { method: 'POST', body: JSON.stringify(payload), @@ -110,13 +94,6 @@ export function sendNativeTx(coin, _payload) { ) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'sendNativeTx', @@ -130,14 +107,6 @@ export function sendNativeTx(coin, _payload) { return _response; }) .then(function(json) { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } - if (json.indexOf('"code":') > -1) { const _message = json.substring( `${json.indexOf('"message":"')}11`, @@ -230,18 +199,6 @@ export function getKMDOPID(opid, coin) { }; } - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'getKMDOPID', - type: 'post', - url: Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } - let _fetchConfig = { method: 'POST', body: JSON.stringify(payload), @@ -269,13 +226,6 @@ export function getKMDOPID(opid, coin) { ) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'getKMDOPID', @@ -289,13 +239,6 @@ export function getKMDOPID(opid, coin) { if (Config.cli.default) { json = json.result; } - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } dispatch(getKMDOPIDState(json)); }) }) diff --git a/react/src/actions/actions/nativeSyncInfo.js b/react/src/actions/actions/nativeSyncInfo.js index 60cabc4..26a1680 100644 --- a/react/src/actions/actions/nativeSyncInfo.js +++ b/react/src/actions/actions/nativeSyncInfo.js @@ -5,41 +5,18 @@ import { getDebugLog, toggleCoindDownModal } from '../actionCreators'; -import { - logGuiHttp, - guiLogState -} from './log'; import Config from '../../config'; export function getSyncInfoNativeKMD(skipDebug, json) { const coin = 'KMD'; // https://www.kmd.host/ return dispatch => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'getSyncInfoNativeKMD', - type: 'post', - url: Config.iguanaLessMode ? 'http://kmd.explorer.supernet.org/api/status?q=getInfo' : `http://127.0.0.1:${Config.iguanaCorePort}/api/dex/getinfo?userpass=tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}&symbol=${coin}`, - payload: '', - status: 'pending', - })); - } - return fetch( Config.iguanaLessMode ? 'http://kmd.explorer.supernet.org/api/status?q=getInfo' : `http://127.0.0.1:${Config.iguanaCorePort}/api/dex/getinfo?userpass=tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}&symbol=${coin}`, { method: 'GET', }) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } /*dispatch( triggerToaster( 'getSyncInfoNativeKMD', @@ -52,13 +29,6 @@ export function getSyncInfoNativeKMD(skipDebug, json) { }) .then(response => response.json()) .then(json => { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: Config.iguanaLessMode ? json.info : json, - })); - } dispatch(getSyncInfoNativeState({ remoteKMDNode: Config.iguanaLessMode ? json.info : json })); }) .then(function() { @@ -111,17 +81,6 @@ export function getSyncInfoNative(coin, skipDebug) { } return dispatch => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'getSyncInfo', - type: 'post', - url: Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } let _fetchConfig = { method: 'POST', body: JSON.stringify(payload), @@ -143,13 +102,6 @@ export function getSyncInfoNative(coin, skipDebug) { ) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'getSyncInfo', @@ -206,13 +158,6 @@ export function getSyncInfoNative(coin, skipDebug) { } } - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } dispatch( getSyncInfoNativeState( json, diff --git a/react/src/actions/actions/nativeTxHistory.js b/react/src/actions/actions/nativeTxHistory.js index 5cba39c..2a0c19f 100644 --- a/react/src/actions/actions/nativeTxHistory.js +++ b/react/src/actions/actions/nativeTxHistory.js @@ -4,10 +4,6 @@ import { getNativeTxHistoryState } from '../actionCreators'; import Config from '../../config'; -import { - logGuiHttp, - guiLogState -} from './log'; export function getNativeTxHistory(coin) { let payload; @@ -32,18 +28,6 @@ export function getNativeTxHistory(coin) { } return dispatch => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'getNativeTxHistory', - type: 'post', - url: Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } - let _fetchConfig = { method: 'POST', body: JSON.stringify(payload), @@ -71,13 +55,6 @@ export function getNativeTxHistory(coin) { ) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'getNativeTxHistory', @@ -88,13 +65,6 @@ export function getNativeTxHistory(coin) { }) .then(response => response.json()) .then(json => { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } dispatch(getNativeTxHistoryState(json)); }) } diff --git a/react/src/actions/actions/notary.js b/react/src/actions/actions/notary.js index 23c7479..9a81283 100644 --- a/react/src/actions/actions/notary.js +++ b/react/src/actions/actions/notary.js @@ -5,10 +5,6 @@ import { import { translate } from '../../translate/translate'; import { triggerToaster } from '../actionCreators'; import Config from '../../config'; -import { - logGuiHttp, - guiLogState -} from './log'; function initNotaryNodesConSequence(nodes) { return dispatch => { @@ -22,30 +18,11 @@ function initNotaryNodesConSequence(nodes) { }; return new Promise((resolve, reject) => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: `initNotaryNodesConSequence+${node}`, - type: 'post', - url: `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } - fetch(`http://127.0.0.1:${(Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort)}/api/dex/getinfo?userpass=${('tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'))}&symbol=${node}`, { method: 'GET', }) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( `getInfoDexNode+${node}`, @@ -56,13 +33,6 @@ function initNotaryNodesConSequence(nodes) { }) .then(response => response.json()) .then(json => { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } dispatch( updateNotaryNodeConState( json, @@ -176,30 +146,12 @@ export function getDexNotaries(coin) { }; return dispatch => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'getDexNotaries', - type: 'post', - url: `http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } return fetch(`http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, { method: 'POST', body: JSON.stringify(payload), }) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'getDexNotaries', @@ -210,13 +162,6 @@ export function getDexNotaries(coin) { }) .then(response => response.json()) .then(json => { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } dispatch(getDexNotariesState(json)); }) } diff --git a/react/src/actions/actions/openAlias.js b/react/src/actions/actions/openAlias.js index f7edec3..14b0801 100644 --- a/react/src/actions/actions/openAlias.js +++ b/react/src/actions/actions/openAlias.js @@ -1,8 +1,4 @@ import { triggerToaster } from '../actionCreators'; -import { - logGuiHttp, - guiLogState -} from './log'; export function resolveOpenAliasAddress(email) { const url = email.replace('@', '.'); diff --git a/react/src/actions/actions/sendFullBasilisk.js b/react/src/actions/actions/sendFullBasilisk.js index 9b78aa6..a3bdd51 100644 --- a/react/src/actions/actions/sendFullBasilisk.js +++ b/react/src/actions/actions/sendFullBasilisk.js @@ -5,10 +5,6 @@ import { getDispatch } from '../actionCreators'; import Config from '../../config'; -import { - logGuiHttp, - guiLogState -} from './log'; export function sendToAddress(coin, _payload) { const payload = { @@ -24,31 +20,12 @@ export function sendToAddress(coin, _payload) { }; return dispatch => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'sendToAddress', - type: 'post', - url: `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } - return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', body: JSON.stringify(payload), }) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'sendToAddress', @@ -59,13 +36,6 @@ export function sendToAddress(coin, _payload) { }) .then(response => response.json()) .then(json => { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } dispatch(sendToAddressState(json, dispatch)); }) } @@ -86,31 +56,12 @@ export function sendFromAddress(coin, _payload) { }; return dispatch => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'sendFromAddress', - type: 'post', - url: `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } - return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', body: JSON.stringify(payload), }) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'sendFromAddress', @@ -121,13 +72,6 @@ export function sendFromAddress(coin, _payload) { }) .then(response => response.json()) .then(json => { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } dispatch(sendToAddressState(json, dispatch)); }) } @@ -151,31 +95,12 @@ export function iguanaUTXORawTX(data, dispatch) { }; return new Promise((resolve, reject) => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'iguanaUTXORawTX', - type: 'post', - url: `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } - fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', body: JSON.stringify(payload), }) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch => dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'iguanaUTXORawTX', @@ -186,13 +111,6 @@ export function iguanaUTXORawTX(data, dispatch) { }) .then(response => response.json()) .then(json => { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } resolve(json); }) }); @@ -208,31 +126,12 @@ export function dexSendRawTX(data, dispatch) { }; return new Promise((resolve, reject) => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'dexSendRawTX', - type: 'post', - url: `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } - - fetch('http://127.0.0.1:' + Config.iguanaCorePort, { + fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', body: JSON.stringify(payload), }) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'dexSendRawTX', @@ -247,13 +146,6 @@ export function dexSendRawTX(data, dispatch) { return _response; }) .then(function(json) { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } resolve(json); }) }); diff --git a/react/src/actions/actions/settings.js b/react/src/actions/actions/settings.js index f4cdab3..587ecdf 100644 --- a/react/src/actions/actions/settings.js +++ b/react/src/actions/actions/settings.js @@ -8,10 +8,6 @@ import { import { translate } from '../../translate/translate'; import { triggerToaster } from '../actionCreators'; import Config from '../../config'; -import { - logGuiHttp, - guiLogState -} from './log'; function getAppInfoState(json) { return { @@ -100,31 +96,12 @@ export function importPrivKey(wifKey) { }; return dispatch => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'importPrivKey', - type: 'post', - url: `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } - return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', body: JSON.stringify(payload), }) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'importPrivKey', @@ -135,13 +112,6 @@ export function importPrivKey(wifKey) { }) .then(response => response.json()) .then(json => { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } dispatch( parseImportPrivKeyResponse( json, @@ -209,31 +179,12 @@ export function getPeersList(coin) { }; return dispatch => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'getPeersList', - type: 'post', - url: `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } - return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', body: JSON.stringify(payload), }) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'getPeersList', @@ -244,13 +195,6 @@ export function getPeersList(coin) { }) .then(response => response.json()) .then(json => { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } dispatch(getPeersListState(json, dispatch)); }) } @@ -331,31 +275,12 @@ export function addPeerNode(coin, ip) { }; return dispatch => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'addPeerNode', - type: 'post', - url: `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } - return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', body: JSON.stringify(payload), }) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'addPeerNode', @@ -366,13 +291,6 @@ export function addPeerNode(coin, ip) { }) .then(response => response.json()) .then(json => { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } dispatch(addPeerNodeState(json, dispatch)); }) } diff --git a/react/src/actions/actions/syncInfo.js b/react/src/actions/actions/syncInfo.js index 157911a..56ce526 100644 --- a/react/src/actions/actions/syncInfo.js +++ b/react/src/actions/actions/syncInfo.js @@ -1,10 +1,6 @@ import { SYNCING_FULL_MODE } from '../storeType'; import { triggerToaster } from '../actionCreators'; import Config from '../../config'; -import { - logGuiHttp, - guiLogState -} from './log'; // TODO: add custom json parser function getSyncInfoState(json) { @@ -30,31 +26,12 @@ export function getSyncInfo(coin) { }; return dispatch => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'getSyncInfo', - type: 'post', - url: `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } - return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', body: JSON.stringify(payload), }) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'getSyncInfo', @@ -69,13 +46,6 @@ export function getSyncInfo(coin) { return _response; }) .then(function(json) { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } if (json.indexOf('coin is busy processing') === -1) { dispatch(getSyncInfoState(json, dispatch)); } diff --git a/react/src/actions/actions/syncOnly.js b/react/src/actions/actions/syncOnly.js index d98aef4..44d32e3 100644 --- a/react/src/actions/actions/syncOnly.js +++ b/react/src/actions/actions/syncOnly.js @@ -5,10 +5,6 @@ import { import { translate } from '../../translate/translate'; import Config from '../../config'; import { triggerToaster } from '../actionCreators'; -import { - logGuiHttp, - guiLogState -} from './log'; export function toggleSyncOnlyModal(display) { return { diff --git a/react/src/actions/actions/sysInfo.js b/react/src/actions/actions/sysInfo.js index 597e53f..9a4b15b 100644 --- a/react/src/actions/actions/sysInfo.js +++ b/react/src/actions/actions/sysInfo.js @@ -1,9 +1,5 @@ import { triggerToaster } from '../actionCreators'; import Config from '../../config'; -import { - logGuiHttp, - guiLogState -} from './log'; export function shepherdGetSysInfo() { return dispatch => { diff --git a/react/src/actions/actions/update.js b/react/src/actions/actions/update.js index 7ddd761..4210fdc 100644 --- a/react/src/actions/actions/update.js +++ b/react/src/actions/actions/update.js @@ -1,9 +1,5 @@ import { triggerToaster } from '../actionCreators'; import Config from '../../config'; -import { - logGuiHttp, - guiLogState -} from './log'; export function checkForUpdateUIPromise() { return new Promise((resolve, reject) => { diff --git a/react/src/actions/actions/walletAuth.js b/react/src/actions/actions/walletAuth.js index c73d920..95ca1d8 100644 --- a/react/src/actions/actions/walletAuth.js +++ b/react/src/actions/actions/walletAuth.js @@ -9,10 +9,6 @@ import { getMainAddressState, updateErrosStack } from '../actionCreators'; -import { - logGuiHttp, - guiLogState -} from './log'; export function encryptWallet(_passphrase, cb, coin) { const payload = { @@ -23,31 +19,12 @@ export function encryptWallet(_passphrase, cb, coin) { }; return dispatch => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'encryptWallet', - type: 'post', - url: `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } - return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', body: JSON.stringify(payload), }) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'encryptWallet', @@ -59,13 +36,6 @@ export function encryptWallet(_passphrase, cb, coin) { .then(dispatch(walletPassphrase(_passphrase))) .then(response => response.json()) .then(json => { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } dispatch( cb.call( this, @@ -87,31 +57,12 @@ export function walletPassphrase(_passphrase) { }; return dispatch => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'walletpassphrase', - type: 'post', - url: `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: payload, - status: 'pending', - })); - } - return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', body: JSON.stringify(payload), }) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'walletPassphrase', @@ -121,13 +72,6 @@ export function walletPassphrase(_passphrase) { ); }) .then(json => { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } }) } } @@ -143,31 +87,12 @@ export function iguanaWalletPassphrase(_passphrase) { }; return dispatch => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'iguanaWalletPassphrase', - type: 'post', - url: `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: _payload, - status: 'pending', - })); - } - return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', body: JSON.stringify(_payload), }) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch( triggerToaster( 'Error iguanaWalletPassphrase', @@ -178,13 +103,6 @@ export function iguanaWalletPassphrase(_passphrase) { }) .then(response => response.json()) .then(json => { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } dispatch(iguanaWalletPassphraseState(json, dispatch)); }); } @@ -198,18 +116,6 @@ export function iguanaActiveHandle(getMainAddress) { }; return dispatch => { - const _timestamp = Date.now(); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - function: 'iguanaActiveHandle', - type: 'post', - url: Config.iguanaLessMode ? `http://127.0.0.1:${Config.agamaPort}/shepherd/SuperNET/activehandle` : `http://127.0.0.1:${Config.iguanaCorePort}`, - payload: _payload, - status: 'pending', - })); - } - let _fetchConfig = { method: 'POST', body: JSON.stringify(_payload), @@ -230,13 +136,6 @@ export function iguanaActiveHandle(getMainAddress) { ) .catch(function(error) { console.log(error); - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'error', - response: error, - })); - } dispatch(updateErrosStack('activeHandle')); dispatch( triggerToaster( @@ -248,13 +147,6 @@ export function iguanaActiveHandle(getMainAddress) { }) .then(response => response.json()) .then(json => { - if (Config.debug) { - dispatch(logGuiHttp({ - timestamp: _timestamp, - status: 'success', - response: json, - })); - } if (!Config.iguanaLessMode && sessionStorage.getItem('IguanaActiveAccount') && JSON.parse(sessionStorage.getItem('IguanaActiveAccount')).pubkey === json.pubkey && diff --git a/react/src/actions/storeType.js b/react/src/actions/storeType.js index 1e4c8af..55e2857 100644 --- a/react/src/actions/storeType.js +++ b/react/src/actions/storeType.js @@ -41,7 +41,6 @@ export const SAVE_APP_CONFIG = 'SAVE_APP_CONFIG'; export const SERVICE_ERROR = 'SERVICE_ERROR'; export const DASHBOARD_ACTIVE_ADDRESS = 'DASHBOARD_ACTIVE_ADDRESS'; export const LOAD_APP_INFO = 'LOAD_APP_INFO'; -export const LOG_GUI_HTTP = 'LOG_GUI_HTTP'; export const CLI = 'CLI'; export const LOGOUT = 'LOGOUT'; export const DISPLAY_COIND_DOWN_MODAL = 'DISPLAY_COIND_DOWN_MODAL'; diff --git a/react/src/components/dashboard/notifications/notifications.js b/react/src/components/dashboard/notifications/notifications.js deleted file mode 100755 index 1504121..0000000 --- a/react/src/components/dashboard/notifications/notifications.js +++ /dev/null @@ -1,122 +0,0 @@ -import React from 'react'; -import { connect } from 'react-redux'; -import { sortByDate } from '../../../util/sort'; -import Config from '../../../config'; -import { - NotificationsByTypeRender, - NotificationsModalRender, - NotificationsRender -} from './notifications.render'; - -class Notifications extends React.Component { - constructor() { - super(); - this.state = { - displayModal: false, - calls: { - total: 0, - error: 0, - success: 0, - pending: 0, - }, - activeTab: 2, - guiLog: null, - debug: Config.debug, - }; - this.toggleNotificationsModal = this.toggleNotificationsModal.bind(this); - } - - openTab(tab) { - this.setState(Object.assign({}, this.state, { - activeTab: tab, - })); - } - - componentWillReceiveProps(props) { - // get total number of calls per type - if (this.props.Dashboard && - this.props.Dashboard.guiLog) { - const _guiLog = this.props.Dashboard.guiLog; - let _callsLength = { - total: Object.keys(_guiLog).length, - error: 0, - success: 0, - pending: 0, - } - let guiLogToArray = []; - - for (let timestamp in _guiLog) { - guiLogToArray.push(_guiLog[timestamp]); - _callsLength[_guiLog[timestamp].status]++; - } - - this.setState(Object.assign({}, this.state, { - calls: { - total: _callsLength.total, - error: _callsLength.error, - success: _callsLength.success, - pending: _callsLength.pending, - }, - guiLog: guiLogToArray, - })); - } - } - - renderNotificationsByType(type) { - // get total number of calls per type - if (this.state.guiLog && - this.state.guiLog.length) { - let _guiLog = this.state.guiLog; - let items = []; - _guiLog = sortByDate(_guiLog); - - for (let i = 0; i < _guiLog.length; i++) { - if (_guiLog[i].status === type) { - const _logItem = _guiLog[i]; - - items.push( - NotificationsByTypeRender.call( - this, - _logItem, - type, - i - ) - ); - } - } - - return items; - } - } - - renderNotificationsModal() { - if (this.state.displayModal) { - return NotificationsModalRender.call(this); - } - - return null; - } - - toggleNotificationsModal() { - this.setState(Object.assign({}, this.state, { - displayModal: !this.state.displayModal, - })); - } - - render() { - return NotificationsRender.call(this); - } -} - -const mapStateToProps = (state) => { - return { - Dashboard: { - guiLog: state.Dashboard.guiLog, - activeHandle: state.Dashboard.activeHandle, - } - }; - -}; - -export default connect(mapStateToProps)(Notifications); - diff --git a/react/src/components/dashboard/notifications/notifications.render.js b/react/src/components/dashboard/notifications/notifications.render.js deleted file mode 100644 index 8a894c9..0000000 --- a/react/src/components/dashboard/notifications/notifications.render.js +++ /dev/null @@ -1,116 +0,0 @@ -import React from 'react'; -import { - secondsToString -} from '../../../util/time'; -import { translate } from '../../../translate/translate'; - -export const NotificationsByTypeRender = function(logItem, type, index) { - return ( -
    -
    { index + 1 }.
    -
    - Time: { secondsToString(logItem.timestamp, true, true) } -
    -
    - GUI Function: { logItem.function } -
    -
    - HTTP: { logItem.httpMethod.toUpperCase() } -
    -
    - URL: { logItem.url } -
    -
    - Payload: { JSON.stringify(logItem.payload, null, '\t') } -
    -
    - Response: { JSON.stringify(logItem.response, null, '\t') } -
    -
    -
    - ); -} - -export const NotificationsModalRender = function() { - return ( -
    - ); -}; - -export const NotificationsRender = function() { - return ( -
    -
    - - { this.state.calls.success } - - - { this.state.calls.error } - - - { this.state.calls.pending } - -
    -
    -
    -
    -
    -
    -
    -
    - { this.renderNotificationsModal() } -
    - ); -}; \ No newline at end of file diff --git a/react/src/components/main/walletMain.js b/react/src/components/main/walletMain.js index 2f7aca3..e688c7f 100644 --- a/react/src/components/main/walletMain.js +++ b/react/src/components/main/walletMain.js @@ -5,7 +5,6 @@ import AddCoin from '../addcoin/addcoin'; import Login from '../login/login'; import Dashboard from '../dashboard/main/dashboard'; import SyncOnly from '../dashboard/syncOnly/syncOnly'; -import Notifications from '../dashboard/notifications/notifications'; class WalletMain extends React.Component { render() { @@ -17,7 +16,6 @@ class WalletMain extends React.Component { -
    ); } diff --git a/react/src/components/overrides.scss b/react/src/components/overrides.scss index d09dffc..3559389 100644 --- a/react/src/components/overrides.scss +++ b/react/src/components/overrides.scss @@ -239,141 +239,6 @@ input:checked + .slider:before { display: none; } -.notifications-modal { - color: #757575; -} - -.notifications { - .notice { - position: relative; - margin: 1em; - background: #F9F9F9; - padding: 1em 1em 1em 2em; - border-left: 4px solid #DDD; - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.125); - - &:before { - position: absolute; - top: 50%; - margin-top: -17px; - left: -17px; - background-color: #DDD; - color: #FFF; - width: 30px; - height: 30px; - border-radius: 100%; - text-align: center; - line-height: 30px; - font-weight: bold; - font-family: Georgia; - text-shadow: 1px 1px rgba(0, 0, 0, 0.5); - } - } - - .info { - border-color: #0074D9; - - &:before { - content: 'i'; - background-color: #0074D9; - } - } - - .success { - border-color: #2ECC40; - - &:before { - content: '√'; - background-color: #2ECC40; - } - } - - .warning { - border-color: #FFDC00; - - &:before { - content: '!'; - background-color: #FFDC00; - } - } - - .error { - border-color: #FF4136; - - &:before { - content: 'X'; - background-color: #FF4136; - } - } -} - -.notifications-badge { - position: fixed; - bottom: 10px; - left: 5px; - cursor: pointer; - height: 20px; - z-index: 20; - - .badge { - margin-left: 2px; - font-weight: bold; - - &.success { - color: #3c763d; - background-color: #dff0d8; - border-color: #d6e9c6; - } - &.pending { - color: #8a6d3b; - background-color: #fcf8e3; - border-color: #faebcc; - } - &.error { - color: #a94442; - background-color: #f2dede; - border-color: #ebccd1; - } - } - - .spinner-hide { - >div { - display: none; - } - } - - .spinner { - position: absolute; - left: 60px; - bottom: -12px; - - >div { - background-color: #fff; - margin-right: 1px; - width: 3px; - } - } - - &.stick-to-top { - top: -3px; - left: 400px; - z-index: 1500; - - .spinner { - display: inline-block; - position: relative; - left: -4px; - bottom: -16px; - - >div { - background-color: #00bcd4; - margin-right: 1px; - width: 3px; - } - } - } -} - #js-copytextarea { opacity: 0; height: 10px; @@ -533,21 +398,6 @@ select{ } } -.coin-logo-wide { - padding: 8px 30px 0; - position: relative; - top: 0; - - .header-easydex-section { - img { - width: inherit; - max-width: inherit; - position: relative; - top: -5px; - } - } -} - .native-coin-logo { float: left; position: absolute; @@ -562,11 +412,26 @@ select{ } .coin-logo-wide { + padding: 8px 30px 0; + position: relative; + top: 0; + + .header-easydex-section { + img { + width: inherit; + max-width: inherit; + position: relative; + top: -5px; + } + } + &.native-coin-logo { top: -93px; - .header-easydex-section img { - width: inherit; + .header-easydex-section { + img { + width: inherit; + } } } } diff --git a/react/src/reducers/dashboard.js b/react/src/reducers/dashboard.js index 54e2e63..c9bf593 100644 --- a/react/src/reducers/dashboard.js +++ b/react/src/reducers/dashboard.js @@ -7,24 +7,11 @@ import { BASILISK_CONNECTION, DASHBOARD_CONNECT_NOTARIES, VIEW_CACHE_DATA, - LOG_GUI_HTTP, TOGGLE_NOTIFICATIONS_MODAL, DISPLAY_COIND_DOWN_MODAL, DISPLAY_CLAIM_INTEREST_MODAL } from '../actions/storeType'; -const HTTP_STACK_MAX_ENTRIES = 150; // limit stack mem length to N records per type - -const trimHTTPLogs = (logObject) => { - const logObjectArray = Object.keys(logObject); - - if (logObjectArray.length - HTTP_STACK_MAX_ENTRIES === 1) { - delete logObject[logObjectArray.shift()]; - } - - return logObject; -}; - export function Dashboard(state = { activeSection: 'wallets', activeHandle: null, @@ -83,24 +70,6 @@ export function Dashboard(state = { return Object.assign({}, state, { displayViewCacheModal: action.display, }); - case LOG_GUI_HTTP: - const logState = state.guiLog; - const actionTS = action.timestamp; - let newLogState = {}; - - if (logState[actionTS]) { - const logItem = { [actionTS]: logState[actionTS] }; - logItem[actionTS].status = action.log.status; - logItem[actionTS].response = action.log.response; - newLogState = trimHTTPLogs(Object.assign({}, logState, logItem)); - } else { - const logItem = { [actionTS]: action.log }; - newLogState = trimHTTPLogs(Object.assign({}, logState, logItem)); - } - - return Object.assign({}, state, { - guiLog: newLogState, - }); case DISPLAY_COIND_DOWN_MODAL: return Object.assign({}, state, { displayCoindDownModal: action.displayCoindDownModal, diff --git a/react/src/reducers/errors.js b/react/src/reducers/errors.js deleted file mode 100644 index bf77baf..0000000 --- a/react/src/reducers/errors.js +++ /dev/null @@ -1,26 +0,0 @@ -import { - SERVICE_ERROR -} from '../actions/storeType'; - -export function Errors(state = { - errors: {}, -}, action) { - switch (action.type) { - case SERVICE_ERROR: - let _errors = Object.assign({}, state); - - if (_errors[action.apiMethod]) { - _errors[action.apiMethod]++; - } else { - _errors[action.apiMethod] = 1; - } - - return Object.assign({}, state, { - errors: _errors, - }); - default: - return state; - } -} - -export default Errors; diff --git a/react/src/reducers/index.js b/react/src/reducers/index.js index 2f20cd1..b6c4c76 100644 --- a/react/src/reducers/index.js +++ b/react/src/reducers/index.js @@ -10,7 +10,6 @@ import { Atomic } from './atomic'; import { Settings } from './settings'; import { Interval } from './interval'; import { SyncOnly } from './syncOnly'; -import { Errors } from './errors'; const appReducer = combineReducers({ AddCoin, @@ -22,7 +21,6 @@ const appReducer = combineReducers({ Settings, Interval, SyncOnly, - Errors, routing: routerReducer, }); From 7b048eefe30a23d35372308d97b130717335b593 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Fri, 1 Sep 2017 19:54:27 +0300 Subject: [PATCH 29/83] remove outdated basilisk modals --- react/src/actions/actionCreators.js | 9 - react/src/actions/actions/iguanaInstance.js | 16 -- react/src/actions/actions/notary.js | 168 ------------------ react/src/actions/storeType.js | 3 - .../walletsBasiliskConnection.js | 46 ----- .../walletsBasiliskConnection.render.js | 83 --------- .../walletsBasiliskRefresh.js | 26 --- .../walletsBasiliskRefresh.render.js | 36 ---- .../dashboard/walletsData/walletsData.js | 36 ---- .../walletsData/walletsData.render.js | 21 --- .../walletsNotariesList.js | 73 -------- .../walletsNotariesList.render.js | 60 ------- react/src/reducers/activeCoin.js | 12 -- react/src/reducers/dashboard.js | 16 -- 14 files changed, 605 deletions(-) delete mode 100644 react/src/actions/actions/notary.js delete mode 100755 react/src/components/dashboard/walletsBasiliskConnection/walletsBasiliskConnection.js delete mode 100644 react/src/components/dashboard/walletsBasiliskConnection/walletsBasiliskConnection.render.js delete mode 100644 react/src/components/dashboard/walletsBasiliskRefresh/walletsBasiliskRefresh.js delete mode 100644 react/src/components/dashboard/walletsBasiliskRefresh/walletsBasiliskRefresh.render.js delete mode 100644 react/src/components/dashboard/walletsNotariesList/walletsNotariesList.js delete mode 100644 react/src/components/dashboard/walletsNotariesList/walletsNotariesList.render.js diff --git a/react/src/actions/actionCreators.js b/react/src/actions/actionCreators.js index 04c457d..731aee4 100644 --- a/react/src/actions/actionCreators.js +++ b/react/src/actions/actionCreators.js @@ -6,7 +6,6 @@ import { GET_ACTIVE_COINS, DASHBOARD_ACTIVE_ADDRESS, VIEW_CACHE_DATA, - DASHBOARD_DISPLAY_NOTARIES_MODAL, DASHBOARD_ACTIVE_COIN_MAIN_BASILISK_ADDR, DASHBOARD_ACTIVE_SECTION, DASHBOARD_ACTIVE_TXINFO_MODAL, @@ -47,7 +46,6 @@ export * from './actions/sendFullBasilisk'; export * from './actions/settings'; export * from './actions/syncOnly'; export * from './actions/iguanaInstance'; -export * from './actions/notary'; export * from './actions/edexBalance'; export * from './actions/addCoin'; export * from './actions/addressBalance'; @@ -87,13 +85,6 @@ export function toggleViewCacheModal(display) { } } -export function displayNotariesModal(display) { - return { - type: DASHBOARD_DISPLAY_NOTARIES_MODAL, - display, - } -} - export function changeMainBasiliskAddress(address) { return { type: DASHBOARD_ACTIVE_COIN_MAIN_BASILISK_ADDR, diff --git a/react/src/actions/actions/iguanaInstance.js b/react/src/actions/actions/iguanaInstance.js index ceba837..42856da 100644 --- a/react/src/actions/actions/iguanaInstance.js +++ b/react/src/actions/actions/iguanaInstance.js @@ -24,22 +24,6 @@ export function restartIguanaInstance(pmid) { }); } -export function restartBasiliskInstance() { - return dispatch => { - getIguanaInstancesList() - .then(function(json) { - for (let port in json.result) { - if (json.result[port].mode === 'basilisk') { - restartIguanaInstance(json.result[port].pmid) - .then(function(json) { - console.log('restartBasiliskInstance', json); - }); - } - } - }); - } -} - export function startIguanaInstance(mode, coin) { return new Promise((resolve, reject) => { fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/forks`, { diff --git a/react/src/actions/actions/notary.js b/react/src/actions/actions/notary.js deleted file mode 100644 index 9a81283..0000000 --- a/react/src/actions/actions/notary.js +++ /dev/null @@ -1,168 +0,0 @@ -import { - DASHBOARD_CONNECT_NOTARIES, - DASHBOARD_GET_NOTARIES_LIST -} from '../storeType'; -import { translate } from '../../translate/translate'; -import { triggerToaster } from '../actionCreators'; -import Config from '../../config'; - -function initNotaryNodesConSequence(nodes) { - return dispatch => { - Promise.all(nodes.map((node, index) => { - const payload = { - userpass: `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`, - agent: 'dex', - method: 'getinfo', - symbol: node, - timeout: 10000, - }; - - return new Promise((resolve, reject) => { - fetch(`http://127.0.0.1:${(Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort)}/api/dex/getinfo?userpass=${('tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'))}&symbol=${node}`, { - method: 'GET', - }) - .catch(function(error) { - console.log(error); - dispatch( - triggerToaster( - `getInfoDexNode+${node}`, - 'Error', - 'error' - ) - ); - }) - .then(response => response.json()) - .then(json => { - dispatch( - updateNotaryNodeConState( - json, - nodes.length, - index, - node - ) - ); - }) - }); - })); - } -} - -function updateNotaryNodeConState(json, totalNodes, currentNodeIndex, currentNodeName) { - if (currentNodeIndex === totalNodes - 1) { - return dispatch => { - dispatch(basiliskConnectionState(false)); - }; - } else { - if (json && - json.error === 'less than required responses') { - return { - type: DASHBOARD_CONNECT_NOTARIES, - total: totalNodes - 1, - current: currentNodeIndex, - name: currentNodeName, - failedNode: currentNodeName, - } - } else { - return { - type: DASHBOARD_CONNECT_NOTARIES, - total: totalNodes - 1, - current: currentNodeIndex, - name: currentNodeName, - } - } - } -} - -function connectAllNotaryNodes(json, dispatch) { - if (json && - json.length) { - dispatch(initNotaryNodesConSequence(json)); - - return { - type: DASHBOARD_CONNECT_NOTARIES, - total: json.length - 1, - current: 0, - name: json[0], - } - } -} - -export function connectNotaries() { - const payload = { - userpass: `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`, - agent: 'dpow', - method: 'notarychains', - }; - - return dispatch => { - return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { - method: 'POST', - body: JSON.stringify(payload), - }) - .catch(function(error) { - console.log(error); - dispatch( - triggerToaster( - 'connectNotaries', - 'Error', - 'error' - ) - ); - }) - .then(response => response.json()) - .then( - json => dispatch( - connectAllNotaryNodes(json, dispatch) - ) - ) - } -} - -function getDexNotariesState(json) { - if (json.error === 'less than required responses') { - return dispatch => { - dispatch( - triggerToaster( - translate('TOASTR.LESS_RESPONSES_REQ'), - translate('TOASTR.BASILISK_NOTIFICATION'), - 'error' - ) - ); - } - } else { - return { - type: DASHBOARD_GET_NOTARIES_LIST, - notaries: json, - } - } -} - -export function getDexNotaries(coin) { - const payload = { - userpass: `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`, - agent: 'dex', - method: 'getnotaries', - symbol: coin, - }; - - return dispatch => { - return fetch(`http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, { - method: 'POST', - body: JSON.stringify(payload), - }) - .catch(function(error) { - console.log(error); - dispatch( - triggerToaster( - 'getDexNotaries', - 'Error', - 'error' - ) - ); - }) - .then(response => response.json()) - .then(json => { - dispatch(getDexNotariesState(json)); - }) - } -} \ No newline at end of file diff --git a/react/src/actions/storeType.js b/react/src/actions/storeType.js index 55e2857..6438740 100644 --- a/react/src/actions/storeType.js +++ b/react/src/actions/storeType.js @@ -30,9 +30,6 @@ export const DASHBOARD_ACTIVE_COIN_NATIVE_OPIDS = 'DASHBOARD_ACTIVE_COIN_NATIVE_ export const DASHBOARD_ACTIVE_COIN_SENDTO = 'DASHBOARD_ACTIVE_COIN_SENDTO'; export const DASHBOARD_ACTIVE_COIN_GET_CACHE = 'DASHBOARD_ACTIVE_COIN_GET_CACHE'; export const DASHBOARD_ACTIVE_COIN_MAIN_BASILISK_ADDR = 'DASHBOARD_ACTIVE_COIN_MAIN_BASILISK_ADDR'; -export const DASHBOARD_GET_NOTARIES_LIST = 'DASHBOARD_GET_NOTARIES_LIST'; -export const DASHBOARD_DISPLAY_NOTARIES_MODAL = 'DASHBOARD_DISPLAY_NOTARIES_MODAL'; -export const DASHBOARD_CONNECT_NOTARIES = 'DASHBOARD_CONNECT_NOTARIES'; export const VIEW_CACHE_DATA = 'VIEW_CACHE_DATA'; export const SYNC_ONLY_MODAL_TOGGLE = 'SYNC_ONLY_MODAL_TOGGLE'; export const SYNC_ONLY_DATA = 'SYNC_ONLY_DATA'; diff --git a/react/src/components/dashboard/walletsBasiliskConnection/walletsBasiliskConnection.js b/react/src/components/dashboard/walletsBasiliskConnection/walletsBasiliskConnection.js deleted file mode 100755 index eba514b..0000000 --- a/react/src/components/dashboard/walletsBasiliskConnection/walletsBasiliskConnection.js +++ /dev/null @@ -1,46 +0,0 @@ -import React from 'react'; -import { connect } from 'react-redux'; -import { basiliskConnection } from '../../../actions/actionCreators'; -import Store from '../../../store'; -import WalletsBasiliskConnectionRender from './walletsBasiliskConnection.render'; - -class WalletsBasiliskConnection extends React.Component { - constructor() { - super(); - this.basiliskConnectionAction = this.basiliskConnectionAction.bind(this); - } - - basiliskConnectionAction() { - Store.dispatch(basiliskConnection(false)); - } - - handleKeydown(e) { - if (e.key === 'Escape') { - this.basiliskConnectionAction(); - } - } - - isBasiliskConnection() { - return this.props && - this.props.Dashboard.basiliskConnection; - } - - render() { - if (this.isBasiliskConnection()) { - return WalletsBasiliskConnectionRender.call(this); - } else { - return null; - } - } -} - -const mapStateToProps = (state) => { - return { - Dashboard: { - basiliskConnection: state.Dashboard.basiliskConnection, - connectedNotaries: state.Dashboard.connectedNotaries, - } - }; -}; - -export default connect(mapStateToProps)(WalletsBasiliskConnection); diff --git a/react/src/components/dashboard/walletsBasiliskConnection/walletsBasiliskConnection.render.js b/react/src/components/dashboard/walletsBasiliskConnection/walletsBasiliskConnection.render.js deleted file mode 100644 index a9a8afd..0000000 --- a/react/src/components/dashboard/walletsBasiliskConnection/walletsBasiliskConnection.render.js +++ /dev/null @@ -1,83 +0,0 @@ -import React from 'react'; -import { translate } from '../../../translate/translate'; - -const WalletsBasiliskConnectionRender = function() { - return ( -
    this.handleKeydown(event) }> -
    -
    -
    -
    -

    - { translate('INDEX.REFRESHING_BASILISK_NET') }... -

    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - { `${translate('IAPI.CON_STATUS')}... ${this.props.Dashboard.connectedNotaries.current} / ${this.props.Dashboard.connectedNotaries.total}:${this.props.Dashboard.connectedNotaries.currentNodeName}` } { Math.floor(this.props.Dashboard.connectedNotaries.current * 100 / this.props.Dashboard.connectedNotaries.total) }% -
    -
    -
    -
    -
    -                { this.props.Dashboard.connectedNotaries.failedToConnectNodes ? `Failed: ${this.props.Dashboard.connectedNotaries.failedToConnectNodes}` : null }
    -                
    -
    -
    -
    -
    -
    -
    - ); -}; - -export default WalletsBasiliskConnectionRender; \ No newline at end of file diff --git a/react/src/components/dashboard/walletsBasiliskRefresh/walletsBasiliskRefresh.js b/react/src/components/dashboard/walletsBasiliskRefresh/walletsBasiliskRefresh.js deleted file mode 100644 index aa60dd7..0000000 --- a/react/src/components/dashboard/walletsBasiliskRefresh/walletsBasiliskRefresh.js +++ /dev/null @@ -1,26 +0,0 @@ -import React from 'react'; -import { connect } from 'react-redux'; -import WalletsBasiliskRefreshRender from './walletsBasiliskRefresh.render'; - -class WalletsBasiliskRefresh extends React.Component { - isBasiliskRefresh() { - return this.props && - this.props.Dashboard.basiliskRefresh; - } - - render() { - if (this.isBasiliskRefresh()) { - return WalletsBasiliskRefreshRender.call(this); - } - - return null; - } -} -const mapStateToProps = (state) => { - return { - Dashboard: { - basiliskRefresh: state.Dashboard.basiliskRefresh, - } - }; -}; -export default connect(mapStateToProps)(WalletsBasiliskRefresh); diff --git a/react/src/components/dashboard/walletsBasiliskRefresh/walletsBasiliskRefresh.render.js b/react/src/components/dashboard/walletsBasiliskRefresh/walletsBasiliskRefresh.render.js deleted file mode 100644 index 2ca1658..0000000 --- a/react/src/components/dashboard/walletsBasiliskRefresh/walletsBasiliskRefresh.render.js +++ /dev/null @@ -1,36 +0,0 @@ -import React from 'react'; -import { translate } from '../../../translate/translate'; - -const WalletsBasiliskRefreshRender = function() { - return ( -
    -
    -
    -
    -
    -

    { translate('INDEX.FETCHING_BASILISK_DATA') }

    -
    - -
    -
    -
    - - - - - - - - - - -
    { translate('INDEX.ADDRESS') }{ translate('INDEX.LIST_UNSPENT') }{ translate('INDEX.LIST_TRANSACTIONS') }{ translate('INDEX.GET_BALANCE') }{ translate('INDEX.REFRESH') }
    -
    -
    -
    -
    -
    - ); -}; - -export default WalletsBasiliskRefreshRender; \ No newline at end of file diff --git a/react/src/components/dashboard/walletsData/walletsData.js b/react/src/components/dashboard/walletsData/walletsData.js index 684718c..e8367ac 100644 --- a/react/src/components/dashboard/walletsData/walletsData.js +++ b/react/src/components/dashboard/walletsData/walletsData.js @@ -10,12 +10,8 @@ import { toggleDashboardTxInfoModal, getBasiliskTransactionsList, changeMainBasiliskAddress, - displayNotariesModal, toggleViewCacheModal, changeActiveAddress, - restartBasiliskInstance, - connectNotaries, - getDexNotaries, deleteCacheFile, fetchNewCacheData, fetchUtxoCache, @@ -64,14 +60,10 @@ class WalletsData extends React.Component { this.toggleBasiliskActionsMenu = this.toggleBasiliskActionsMenu.bind(this); this.basiliskRefreshAction = this.basiliskRefreshAction.bind(this); - this.basiliskConnectionAction = this.basiliskConnectionAction.bind(this); - this.getDexNotariesAction = this.getDexNotariesAction.bind(this); this.openDropMenu = this.openDropMenu.bind(this); this.removeAndFetchNewCache = this.removeAndFetchNewCache.bind(this); this._toggleViewCacheModal = this._toggleViewCacheModal.bind(this); - this.toggleCacheApi = this.toggleCacheApi.bind(this); this._fetchUtxoCache = this._fetchUtxoCache.bind(this); - this.restartBasiliskInstance = this.restartBasiliskInstance.bind(this); this.basiliskRefreshActionOne = this.basiliskRefreshActionOne.bind(this); this.handleClickOutside = this.handleClickOutside.bind(this); this.refreshTxHistory = this.refreshTxHistory.bind(this); @@ -219,20 +211,6 @@ class WalletsData extends React.Component { } } - // deprecated - toggleCacheApi() { - const _useCache = !this.state.useCache; - - sessionStorage.setItem('useCache', _useCache); - this.setState(Object.assign({}, this.state, { - useCache: _useCache, - })); - } - - restartBasiliskInstance() { - Store.dispatch(restartBasiliskInstance()); - } - _toggleViewCacheModal() { Store.dispatch(toggleViewCacheModal(!this.props.Dashboard.displayViewCacheModal)); } @@ -340,18 +318,6 @@ class WalletsData extends React.Component { })); } - basiliskConnectionAction() { - if (this.props.Dashboard) { - Store.dispatch(basiliskConnection(!this.props.Dashboard.basiliskConnection)); - Store.dispatch(connectNotaries()); - } - } - - getDexNotariesAction() { - Store.dispatch(getDexNotaries(this.props.ActiveCoin.coin)); - Store.dispatch(displayNotariesModal(true)); - } - toggleTxInfoModal(display, txIndex) { Store.dispatch(toggleDashboardTxInfoModal(display, txIndex)); } @@ -697,9 +663,7 @@ const mapStateToProps = (state) => { Main: { coins: state.Main.coins, } - }; - }; export default connect(mapStateToProps)(WalletsData); \ No newline at end of file diff --git a/react/src/components/dashboard/walletsData/walletsData.render.js b/react/src/components/dashboard/walletsData/walletsData.render.js index f404a8f..3e50ece 100644 --- a/react/src/components/dashboard/walletsData/walletsData.render.js +++ b/react/src/components/dashboard/walletsData/walletsData.render.js @@ -1,8 +1,5 @@ import React from 'react'; import { translate } from '../../../translate/translate'; -import WalletsBasiliskRefresh from '../walletsBasiliskRefresh/walletsBasiliskRefresh'; -import WalletsBasiliskConnection from '../walletsBasiliskConnection/walletsBasiliskConnection'; -import WalletsNotariesList from '../walletsNotariesList/walletsNotariesList'; import WalletsCacheData from '../walletsCacheData/walletsCacheData'; import ReactTable from 'react-table'; import TablePaginationRenderer from './pagination'; @@ -192,9 +189,6 @@ export const WalletsDataRender = function() { return ( - - -
    @@ -225,16 +219,6 @@ export const WalletsDataRender = function() {
    -
    +
    ) }; + export default CoinSelectorsRender; \ No newline at end of file diff --git a/react/src/components/dashboard/navbar/navbar.js b/react/src/components/dashboard/navbar/navbar.js index 5e16c05..9d5babc 100755 --- a/react/src/components/dashboard/navbar/navbar.js +++ b/react/src/components/dashboard/navbar/navbar.js @@ -21,6 +21,7 @@ class Navbar extends React.Component { this.state = { openDropMenu: false, nativeOnly: Config.iguanaLessMode, + isExperimentalOn: false, }; this.openDropMenu = this.openDropMenu.bind(this); this.logout = this.logout.bind(this); @@ -34,6 +35,16 @@ class Navbar extends React.Component { this.handleClickOutside, false ); + + let appConfig; + + try { + appConfig = window.require('electron').remote.getCurrentWindow().appConfig; + } catch (e) {} + + this.setState({ + isExperimentalOn: appConfig.experimentalFeatures, + }); } componentWillUnmount() { diff --git a/react/src/components/dashboard/navbar/navbar.render.js b/react/src/components/dashboard/navbar/navbar.render.js index d0e2d1f..eed8d1b 100644 --- a/react/src/components/dashboard/navbar/navbar.render.js +++ b/react/src/components/dashboard/navbar/navbar.render.js @@ -99,7 +99,7 @@ const NavbarRender = function() { { translate('INDEX.SETTINGS') }
  • -
  • +
  • this.openSyncOnlyModal() }> { translate('ADD_COIN.SYNC_ONLY') } diff --git a/react/src/components/dashboard/sendCoin/sendCoin.js b/react/src/components/dashboard/sendCoin/sendCoin.js index e11b575..231ae13 100644 --- a/react/src/components/dashboard/sendCoin/sendCoin.js +++ b/react/src/components/dashboard/sendCoin/sendCoin.js @@ -789,7 +789,7 @@ class SendCoin extends React.Component { } } - return +_balance; + return _balance; } validateSendFormData() { diff --git a/react/src/components/login/login.js b/react/src/components/login/login.js index 75777e7..9739b74 100644 --- a/react/src/components/login/login.js +++ b/react/src/components/login/login.js @@ -45,6 +45,7 @@ class Login extends React.Component { trimPassphraseTimer: null, displayLoginSettingsDropdown: false, displayLoginSettingsDropdownSection: null, + isExperimentalOn: false, }; this.toggleActivateCoinForm = this.toggleActivateCoinForm.bind(this); this.updateRegisterConfirmPassPhraseInput = this.updateRegisterConfirmPassPhraseInput.bind(this); @@ -118,6 +119,15 @@ class Login extends React.Component { componentDidMount() { Store.dispatch(iguanaActiveHandle(true)); + let appConfig; + + try { + appConfig = window.require('electron').remote.getCurrentWindow().appConfig; + } catch (e) {} + + this.setState({ + isExperimentalOn: appConfig.experimentalFeatures, + }); } toggleSeedInputVisibility() { diff --git a/react/src/components/login/login.render.js b/react/src/components/login/login.render.js index 7dd58ce..44774db 100644 --- a/react/src/components/login/login.render.js +++ b/react/src/components/login/login.render.js @@ -5,8 +5,7 @@ import LoginSettingsModal from '../dashboard/loginSettingsModal/loginSettingsMod const LoginRender = function () { return (
    - + { this.renderSwallModal() }
    @@ -35,7 +34,7 @@ const LoginRender = function () { { translate('INDEX.SETTINGS') }
  • -
  • +
  • { translate('ADD_COIN.SYNC_ONLY') } From e136e4846196257b4a90cb4699beb976e79ef772 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Sat, 2 Sep 2017 12:43:10 +0300 Subject: [PATCH 34/83] send amount validation fix --- .../components/dashboard/sendCoin/sendCoin.js | 14 ++++----- .../walletsNativeSend/walletsNativeSend.js | 30 +++++++++++-------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/react/src/components/dashboard/sendCoin/sendCoin.js b/react/src/components/dashboard/sendCoin/sendCoin.js index 231ae13..ede761e 100644 --- a/react/src/components/dashboard/sendCoin/sendCoin.js +++ b/react/src/components/dashboard/sendCoin/sendCoin.js @@ -757,7 +757,7 @@ class SendCoin extends React.Component { } // TODO same as in walletsNav and receiveCoin, find a way to reuse it? - checkTotalBalance() { + checkBalance() { let _balance = '0'; const _mode = this.props.ActiveCoin.mode; @@ -777,21 +777,16 @@ class SendCoin extends React.Component { (_cache[_coin][_address].getbalance.data.balance || _cache[_coin][_address].getbalance.data.interest)) { const _regBalance = _cache[_coin][_address].getbalance.data.balance ? _cache[_coin][_address].getbalance.data.balance : 0; - const _regInterest = _cache[_coin][_address].getbalance.data.interest ? _cache[_coin][_address].getbalance.data.interest : 0; - _balance = _regBalance + _regInterest; + _balance = _regBalance; } } - } else if (_mode === 'native') { - if (this.props.ActiveCoin.balance && - this.props.ActiveCoin.balance.total) { - _balance = this.props.ActiveCoin.balance.total; - } } return _balance; } + // TODO: reduce to a single toast validateSendFormData() { let valid = true; if (!this.state.sendTo || this.state.sendTo.length < 34) { @@ -838,7 +833,8 @@ class SendCoin extends React.Component { valid = false; } - if (this.state.amount > this.checkTotalBalance()) { + if ((this.props.ActiveCoin.mode === 'basilisk' && Number(this.state.amount) > Number(this.state.sendFromAmount)) || + (this.props.ActiveCoin.mode === 'full' && Number(this.state.amount) > Number(this.checkBalance()))) { Store.dispatch( triggerToaster( translate('SEND.INSUFFICIENT_FUNDS'), diff --git a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js index a1ee7aa..5c30dad 100644 --- a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js +++ b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js @@ -367,17 +367,7 @@ class WalletsNativeSend extends React.Component { return null; } - checkTotalBalance() { - let _balance = 0; - - if (this.props.ActiveCoin.balance && - this.props.ActiveCoin.balance.total) { - _balance = this.props.ActiveCoin.balance.total; - } - - return _balance; - } - + // TODO: reduce to a single toast validateSendFormData() { let valid = true; @@ -404,7 +394,20 @@ class WalletsNativeSend extends React.Component { valid = false; } - if (this.state.amount > this.checkTotalBalance()) { + if (((!this.state.sendFrom || this.state.addressType === 'public') && + this.state.sendTo && + this.state.sendTo.length === 34 && + this.props.ActiveCoin.balance && + this.props.ActiveCoin.balance.transparent && + Number(this.state.amount) > Number(this.props.ActiveCoin.balance.transparent)) || + (this.state.addressType === 'public' && + this.state.sendTo && + this.state.sendTo.length > 34 && + Number(this.state.amount) > Number(this.state.sendFromAmount)) || + (this.state.addressType === 'private' && + this.state.sendTo && + this.state.sendTo.length >= 34 && + Number(this.state.amount) > Number(this.state.sendFromAmount))) { Store.dispatch( triggerToaster( translate('SEND.INSUFFICIENT_FUNDS'), @@ -427,6 +430,8 @@ class WalletsNativeSend extends React.Component { valid = false; } + valid = false; + return valid; } @@ -457,6 +462,7 @@ const mapStateToProps = (state) => { coin: state.ActiveCoin.coin, mode: state.ActiveCoin.mode, opids: state.ActiveCoin.opids, + balance: state.ActiveCoin.balance, activeSection: state.ActiveCoin.activeSection, }, }; From b17b4cf8d46f003c8ffa8fad8ce5fa5d0cb68d63 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Sat, 2 Sep 2017 13:17:31 +0300 Subject: [PATCH 35/83] hide qr code scan btn if device check failed --- .../components/dashboard/qrModal/qrModal.js | 2 + .../dashboard/qrModal/qrModal.render.js | 76 +++++++++---------- .../components/dashboard/qrModal/qrModal.scss | 6 ++ 3 files changed, 45 insertions(+), 39 deletions(-) diff --git a/react/src/components/dashboard/qrModal/qrModal.js b/react/src/components/dashboard/qrModal/qrModal.js index a77fe25..c1a5757 100755 --- a/react/src/components/dashboard/qrModal/qrModal.js +++ b/react/src/components/dashboard/qrModal/qrModal.js @@ -14,6 +14,7 @@ class QRModal extends React.Component { this.state = { modalIsOpen: false, error: null, + errorShown: false, }; this.openModal = this.openModal.bind(this); this.closeModal = this.closeModal.bind(this); @@ -65,6 +66,7 @@ class QRModal extends React.Component { closeModal() { this.setState({ modalIsOpen: false, + errorShown: this.state.error ? true : false, }); } diff --git a/react/src/components/dashboard/qrModal/qrModal.render.js b/react/src/components/dashboard/qrModal/qrModal.render.js index db7d0eb..b08bdbf 100644 --- a/react/src/components/dashboard/qrModal/qrModal.render.js +++ b/react/src/components/dashboard/qrModal/qrModal.render.js @@ -2,7 +2,7 @@ import React from 'react'; import { translate } from '../../../translate/translate'; import QRCode from 'qrcode.react'; -export const QRModalRender = function () { +export const QRModalRender = function() { return ( - -
    -
    -
    -
    - -

    { translate('INDEX.SCAN_QRCODE_WEBCAM') }

    -
    -
    -
    -
    -
    - { this.state.error } +export const QRModalReaderRender = function() { + if (!this.state.errorShown) { + return ( + + +
    +
    +
    +
    + +

    { translate('INDEX.SCAN_QRCODE_WEBCAM') }

    +
    +
    +
    +
    +
    + { this.state.error } +
    -
    -
    - - ); +
    + + ); + } else { + return null; + } }; \ No newline at end of file diff --git a/react/src/components/dashboard/qrModal/qrModal.scss b/react/src/components/dashboard/qrModal/qrModal.scss index c0b3cd0..7eef696 100644 --- a/react/src/components/dashboard/qrModal/qrModal.scss +++ b/react/src/components/dashboard/qrModal/qrModal.scss @@ -2,4 +2,10 @@ position: absolute; top: 15px; right: 30px; +} + +.webcam-frame { + width: 100%; + text-align: center; + font-size: 16px; } \ No newline at end of file From 65cf4fb781cb62ade1cb1a99c0fa4be62f1df226 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Sat, 2 Sep 2017 23:15:28 +0300 Subject: [PATCH 36/83] moved coin progress prop from dashboard to activeCoin reducer --- .../components/addcoin/addcoinOptionsAC.js | 1 + .../coindDownModal/coindDownModal.js | 4 + .../coindDownModal/coindDownModal.render.js | 2 +- .../dashboard/loginModal/loginModal.render.js | 2 +- .../dashboard/syncOnly/syncOnly.render.js | 4 +- .../walletsBalance/walletsBalance.js | 22 ++--- .../dashboard/walletsData/walletsData.js | 16 ++-- .../dashboard/walletsInfo/walletsInfo.js | 8 +- .../walletsInfo/walletsInfo.render.js | 38 ++++----- .../walletsProgress/walletsProgress.js | 81 ++++++++++--------- .../walletsProgress/walletsProgress.render.js | 26 +++--- .../components/login/swall-modal.render.js | 2 +- react/src/reducers/activeCoin.js | 24 ++++++ 13 files changed, 135 insertions(+), 95 deletions(-) diff --git a/react/src/components/addcoin/addcoinOptionsAC.js b/react/src/components/addcoin/addcoinOptionsAC.js index e5bd59a..81377db 100644 --- a/react/src/components/addcoin/addcoinOptionsAC.js +++ b/react/src/components/addcoin/addcoinOptionsAC.js @@ -19,6 +19,7 @@ class AddCoinOptionsAC extends React.Component { 'revs', 'shark', 'supernet', + 'wlc' ]; let _items = []; diff --git a/react/src/components/dashboard/coindDownModal/coindDownModal.js b/react/src/components/dashboard/coindDownModal/coindDownModal.js index a605a06..f468156 100644 --- a/react/src/components/dashboard/coindDownModal/coindDownModal.js +++ b/react/src/components/dashboard/coindDownModal/coindDownModal.js @@ -37,6 +37,10 @@ class CoindDownModal extends React.Component { } const mapStateToProps = (state) => { return { + ActiveCoin: { + mode: state.ActiveCoin.mode, + coin: state.ActiveCoin.coin, + }, displayCoindDownModal: state.Dashboard.displayCoindDownModal, debugLog: state.Settings.debugLog, }; diff --git a/react/src/components/dashboard/coindDownModal/coindDownModal.render.js b/react/src/components/dashboard/coindDownModal/coindDownModal.render.js index 7aad606..4b22596 100644 --- a/react/src/components/dashboard/coindDownModal/coindDownModal.render.js +++ b/react/src/components/dashboard/coindDownModal/coindDownModal.render.js @@ -1,7 +1,7 @@ import React from 'react'; import { translate } from '../../../translate/translate'; -const CoindDownModalRender = function () { +const CoindDownModalRender = function() { return (
    @@ -46,7 +46,7 @@ export const ProgressRender = function (fork) { ); }; -export const ForkItemRender = function (forkInfo, port) { +export const ForkItemRender = function(forkInfo, port) { return (
    { balance: state.ActiveCoin.balance, cache: state.ActiveCoin.cache, activeSection: state.ActiveCoin.activeSection, - activeAddress: state.ActiveCoin.activeAddress + activeAddress: state.ActiveCoin.activeAddress, + progress: state.ActiveCoin.progress, }, Dashboard: { - progress: state.Dashboard.progress, activeHandle: state.Dashboard.activeHandle, }, }; diff --git a/react/src/components/dashboard/walletsData/walletsData.js b/react/src/components/dashboard/walletsData/walletsData.js index 34c0b53..56463f3 100644 --- a/react/src/components/dashboard/walletsData/walletsData.js +++ b/react/src/components/dashboard/walletsData/walletsData.js @@ -365,11 +365,13 @@ class WalletsData extends React.Component { } isFullySynced() { - if (this.props.Dashboard.progress && - (Number(this.props.Dashboard.progress.balances) + - Number(this.props.Dashboard.progress.validated) + - Number(this.props.Dashboard.progress.bundles) + - Number(this.props.Dashboard.progress.utxo)) / 4 === 100) { + const _progress = this.props.ActiveCoin.progress; + + if (_progress && + (Number(_progress.balances) + + Number(_progress.validated) + + Number(_progress.bundles) + + Number(_progress.utxo)) / 4 === 100) { return true; } else { return false; @@ -644,15 +646,15 @@ const mapStateToProps = (state) => { addresses: state.ActiveCoin.addresses, txhistory: state.ActiveCoin.txhistory, showTransactionInfo: state.ActiveCoin.showTransactionInfo, + progress: state.ActiveCoin.progress, }, Dashboard: { activeHandle: state.Dashboard.activeHandle, displayViewCacheModal: state.Dashboard.displayViewCacheModal, - progress: state.Dashboard.progress, }, Main: { coins: state.Main.coins, - } + }, }; }; diff --git a/react/src/components/dashboard/walletsInfo/walletsInfo.js b/react/src/components/dashboard/walletsInfo/walletsInfo.js index 3f4444c..1b43678 100644 --- a/react/src/components/dashboard/walletsInfo/walletsInfo.js +++ b/react/src/components/dashboard/walletsInfo/walletsInfo.js @@ -16,8 +16,8 @@ class WalletsInfo extends React.Component { render() { if (this.props && - this.props.Dashboard && - this.props.Dashboard.progress && + this.props.ActiveCoin && + this.props.ActiveCoin.progress && this.props.ActiveCoin.activeSection === 'settings') { return WalletsNativeInfoRender.call(this); } @@ -31,9 +31,7 @@ const mapStateToProps = (state) => { ActiveCoin: { coin: state.ActiveCoin.coin, activeSection: state.ActiveCoin.activeSection, - }, - Dashboard: { - progress: state.Dashboard.progress, + progress: state.ActiveCoin.progress, }, }; }; diff --git a/react/src/components/dashboard/walletsInfo/walletsInfo.render.js b/react/src/components/dashboard/walletsInfo/walletsInfo.render.js index 972da9d..9ba0cb4 100644 --- a/react/src/components/dashboard/walletsInfo/walletsInfo.render.js +++ b/react/src/components/dashboard/walletsInfo/walletsInfo.render.js @@ -3,6 +3,8 @@ import { translate } from '../../../translate/translate'; import ClaimInterestModal from '../claimInterestModal/claimInterestModal'; const WalletsInfoRender = function() { + const _progress = this.props.ActiveCoin.progress; + return (
    @@ -16,13 +18,13 @@ const WalletsInfoRender = function() { { translate('INDEX.WALLET_VERSION') } - { this.props.Dashboard.progress.walletversion } + { _progress.walletversion } { translate('INDEX.BALANCE') } - { this.props.Dashboard.progress.balance } + { _progress.balance } @@ -65,19 +67,19 @@ const WalletsInfoRender = function() { { translate('INDEX.VERSION') } - { this.props.Dashboard.progress.KMDversion } + { _progress.KMDversion } { translate('INDEX.PROTOCOL_VERSION') } - { this.props.Dashboard.progress.protocolversion } + { _progress.protocolversion } { translate('INDEX.NOTARIZED') } - { this.props.Dashboard.progress.notarized } + { _progress.notarized } @@ -85,15 +87,15 @@ const WalletsInfoRender = function() { { translate('INDEX.NOTARIZED') } { translate('INDEX.HASH') } - { this.props.Dashboard.progress.notarizedhash ? - this.props.Dashboard.progress.notarizedhash.substring( + { _progress.notarizedhash ? + _progress.notarizedhash.substring( 0, - Math.floor(this.props.Dashboard.progress.notarizedhash.length / 2) + Math.floor(_progress.notarizedhash.length / 2) ) + '\t' + - this.props.Dashboard.progress.notarizedhash.substring( - Math.floor(this.props.Dashboard.progress.notarizedhash.length / 2), - this.props.Dashboard.progress.notarizedhash.length + _progress.notarizedhash.substring( + Math.floor(_progress.notarizedhash.length / 2), + _progress.notarizedhash.length ) : '' } @@ -108,43 +110,43 @@ const WalletsInfoRender = function() { { translate('INDEX.BLOCKS') } - { this.props.Dashboard.progress.blocks } + { _progress.blocks } { translate('INDEX.CONNECTIONS') } - { this.props.Dashboard.progress.connections } + { _progress.connections } { translate('INDEX.DIFFICULTY') } - { this.props.Dashboard.progress.difficulty } + { _progress.difficulty } Testnet - { this.props.Dashboard.progress.testnet } + { _progress.testnet } { translate('INDEX.PAY_TX_FEE') } - { this.props.Dashboard.progress.paytxfee } + { _progress.paytxfee } { translate('INDEX.RELAY_FEE') } - { this.props.Dashboard.progress.relayfee } + { _progress.relayfee } { translate('INDEX.ERRORS') } - { this.props.Dashboard.progress.errors } + { _progress.errors } diff --git a/react/src/components/dashboard/walletsProgress/walletsProgress.js b/react/src/components/dashboard/walletsProgress/walletsProgress.js index fbdbc60..b70c776 100644 --- a/react/src/components/dashboard/walletsProgress/walletsProgress.js +++ b/react/src/components/dashboard/walletsProgress/walletsProgress.js @@ -19,10 +19,12 @@ class WalletsProgress extends React.Component { } isFullySynced() { - if ((Number(this.props.Dashboard.progress.balances) + - Number(this.props.Dashboard.progress.validated) + - Number(this.props.Dashboard.progress.bundles) + - Number(this.props.Dashboard.progress.utxo)) / 4 === 100) { + const _progress = this.props.ActiveCoin.progress; + + if ((Number(_progress.balances) + + Number(_progress.validated) + + Number(_progress.bundles) + + Number(_progress.utxo)) / 4 === 100) { return true; } else { return false; @@ -38,9 +40,11 @@ class WalletsProgress extends React.Component { } renderChainActivationNotification() { - if (this.props.Dashboard.progress) { - if ((!this.props.Dashboard.progress.blocks && !this.props.Dashboard.progress.longestchain) || - (this.props.Dashboard.progress.blocks < this.props.Dashboard.progress.longestchain)) { + const _progress = this.props.ActiveCoin.progress; + + if (_progress) { + if ((!_progress.blocks && !_progress.longestchain) || + (_progress.blocks < _progress.longestchain)) { return ChainActivationNotificationRender.call(this); } } else { @@ -86,35 +90,37 @@ class WalletsProgress extends React.Component { } renderSyncPercentagePlaceholder() { + const _progress = this.props.ActiveCoin.progress; + // activating best chain - if (this.props.Dashboard.progress && - this.props.Dashboard.progress.code && - this.props.Dashboard.progress.code === -28 && + if (_progress && + _progress.code && + _progress.code === -28 && this.props.Settings.debugLog) { - const _progress = this.parseActivatingBestChainProgress(); + const _parseProgress = this.parseActivatingBestChainProgress(); - if (_progress && - _progress[1]) { - return SyncPercentageRender.call(this, _progress[1] === 1000 ? 100 : _progress[1].toFixed(2)); + if (_parseProgress && + _parseProgress[1]) { + return SyncPercentageRender.call(this, _parseProgress[1] === 1000 ? 100 : _parseProgress[1].toFixed(2)); } else { return LoadingBlocksRender.call(this); } } - if (this.props.Dashboard.progress && - this.props.Dashboard.progress.blocks > 0 && - this.props.Dashboard.progress.longestchain === 0) { + if (_progress && + _progress.blocks > 0 && + _progress.longestchain === 0) { return SyncErrorLongestChainRender.call(this); } - if (this.props.Dashboard.progress && - this.props.Dashboard.progress.blocks === 0) { + if (_progress && + _progress.blocks === 0) { return SyncErrorBlocksRender.call(this); } - if (this.props.Dashboard.progress && - this.props.Dashboard.progress.blocks) { - const syncPercentage = (parseFloat(parseInt(this.props.Dashboard.progress.blocks, 10) * 100 / parseInt(this.props.Dashboard.progress.longestchain, 10)).toFixed(2) + '%').replace('NaN', 0); + if (_progress && + _progress.blocks) { + const syncPercentage = (parseFloat(parseInt(_progress.blocks, 10) * 100 / parseInt(_progress.longestchain, 10)).toFixed(2) + '%').replace('NaN', 0); return SyncPercentageRender.call(this, syncPercentage === 1000 ? 100 : syncPercentage); } @@ -129,8 +135,8 @@ class WalletsProgress extends React.Component { if (this.props.Settings && this.props.Settings.debugLog) { if (this.props.Settings.debugLog.indexOf('UpdateTip') > -1 && - !this.props.Dashboard.progress && - !this.props.Dashboard.progress.blocks) { + !this.props.ActiveCoin.progress && + !this.props.ActiveCoin.progress.blocks) { const temp = this.props.Settings.debugLog.split(' '); let currentBestChain; let currentProgress; @@ -145,23 +151,23 @@ class WalletsProgress extends React.Component { } // fallback to local data if remote node is inaccessible - if (this.props.Dashboard.progress.remoteKMDNode && - !this.props.Dashboard.progress.remoteKMDNode.blocks) { + if (this.props.ActiveCoin.progress.remoteKMDNode && + !this.props.ActiveCoin.progress.remoteKMDNode.blocks) { return ( `: ${currentProgress}% (${ translate('INDEX.ACTIVATING_SM') })` ); } else { - if (this.props.Dashboard.progress.remoteKMDNode && - this.props.Dashboard.progress.remoteKMDNode.blocks) { + if (this.props.ActiveCoin.progress.remoteKMDNode && + this.props.ActiveCoin.progress.remoteKMDNode.blocks) { return( - `: ${Math.floor(currentBestChain * 100 / this.props.Dashboard.progress.remoteKMDNode.blocks)}% (${ translate('INDEX.BLOCKS_SM') } ${currentBestChain} / ${this.props.Dashboard.progress.remoteKMDNode.blocks})` + `: ${Math.floor(currentBestChain * 100 / this.props.ActiveCoin.progress.remoteKMDNode.blocks)}% (${ translate('INDEX.BLOCKS_SM') } ${currentBestChain} / ${this.props.ActiveCoin.progress.remoteKMDNode.blocks})` ); } } } else if ( this.props.Settings.debugLog.indexOf('Still rescanning') > -1 && - !this.props.Dashboard.progress || - !this.props.Dashboard.progress.blocks + !this.props.ActiveCoin.progress || + !this.props.ActiveCoin.progress.blocks ) { const temp = this.props.Settings.debugLog.split(' '); let currentProgress; @@ -173,9 +179,9 @@ class WalletsProgress extends React.Component { } // activating best chain - if (this.props.Dashboard.progress && - this.props.Dashboard.progress.code && - this.props.Dashboard.progress.code === -28 && + if (this.props.ActiveCoin.progress && + this.props.ActiveCoin.progress.code && + this.props.ActiveCoin.progress.code === -28 && this.props.Settings.debugLog) { const _blocks = this.parseActivatingBestChainProgress(); @@ -219,8 +225,8 @@ class WalletsProgress extends React.Component { if (this.props && this.props.ActiveCoin && (this.isFullMode() || this.isNativeMode())) { - if (this.props.Dashboard.progress && - this.props.Dashboard.progress.error) { + if (this.props.ActiveCoin.progress && + this.props.ActiveCoin.progress.error) { return CoinIsBusyRender.call(this); } @@ -238,7 +244,8 @@ const mapStateToProps = (state) => { }, ActiveCoin: { mode: state.ActiveCoin.mode, - coin: state.coin, + coin: state.ActiveCoin.coin, + progress: state.ActiveCoin.progress, }, }; }; diff --git a/react/src/components/dashboard/walletsProgress/walletsProgress.render.js b/react/src/components/dashboard/walletsProgress/walletsProgress.render.js index 0305aa1..d1b19cc 100644 --- a/react/src/components/dashboard/walletsProgress/walletsProgress.render.js +++ b/react/src/components/dashboard/walletsProgress/walletsProgress.render.js @@ -22,7 +22,7 @@ export const SyncPercentageRender = function(syncPercentage) {
    - { syncPercentage } | { this.props.Dashboard.progress.blocks } / { this.props.Dashboard.progress.longestchain } | { translate('INDEX.CONNECTIONS') }: { this.props.Dashboard.progress.connections } + { syncPercentage } | { this.props.ActiveCoin.progress.blocks } / { this.props.ActiveCoin.progress.longestchain } | { translate('INDEX.CONNECTIONS') }: { this.props.ActiveCoin.progress.connections }
    ); }; @@ -77,22 +77,22 @@ export const WalletsProgressRender = function() { id="edex-footer" className="margin-bottom-20"> { !this.isNativeMode() && - this.props.Dashboard.progress && + this.props.ActiveCoin.progress &&
    { translate('INDEX.BUNDLES') }  - ({ this.props.ActiveCoin.coin }) 100.00% - ( { this.props.Dashboard.progress.blocks } - / { this.props.Dashboard.progress.blocks } ) ==>> - RT{ this.props.Dashboard.progress.RTheight } + ({ this.props.ActiveCoin.coin }) 100.00% - ( { this.props.ActiveCoin.progress.blocks } + / { this.props.ActiveCoin.progress.blocks } ) ==>> + RT{ this.props.ActiveCoin.progress.RTheight }
    - { translate('INDEX.BUNDLES') } { this.props.Dashboard.progress.bundles }% + style={{ width: `${this.props.ActiveCoin.progress.bundles}%` }}> + { translate('INDEX.BUNDLES') } { this.props.ActiveCoin.progress.bundles }%
    @@ -100,22 +100,22 @@ export const WalletsProgressRender = function() {
    - utxo { this.props.Dashboard.progress.utxo }% + style={{ width: `${this.props.ActiveCoin.progress.utxo}%` }}> + utxo { this.props.ActiveCoin.progress.utxo }%
    - { translate('INDEX.BALANCES') } { this.props.Dashboard.progress.balances }% + style={{ width: `${this.props.ActiveCoin.progress.balances}%` }}> + { translate('INDEX.BALANCES') } { this.props.ActiveCoin.progress.balances }%
    - { translate('INDEX.VALIDATED') } { this.props.Dashboard.progress.validated }% + style={{ width: `${this.props.ActiveCoin.progress.validated}%` }}> + { translate('INDEX.VALIDATED') } { this.props.ActiveCoin.progress.validated }%
    diff --git a/react/src/components/login/swall-modal.render.js b/react/src/components/login/swall-modal.render.js index 9f5a7b1..27e47b8 100644 --- a/react/src/components/login/swall-modal.render.js +++ b/react/src/components/login/swall-modal.render.js @@ -1,7 +1,7 @@ import React from 'react'; import { translate } from '../../translate/translate'; -const SwallModalRender = function () { +const SwallModalRender = function() { return (
    diff --git a/react/src/reducers/activeCoin.js b/react/src/reducers/activeCoin.js index e4914d4..2ae0551 100644 --- a/react/src/reducers/activeCoin.js +++ b/react/src/reducers/activeCoin.js @@ -14,6 +14,9 @@ import { DASHBOARD_ACTIVE_COIN_GET_CACHE, DASHBOARD_ACTIVE_COIN_MAIN_BASILISK_ADDR, DASHBOARD_ACTIVE_ADDRESS, + SYNCING_FULL_MODE, + SYNCING_NATIVE_MODE, + DASHBOARD_UPDATE, } from '../actions/storeType'; // TODO: refactor @@ -34,6 +37,7 @@ export function ActiveCoin(state = { cache: null, mainBasiliskAddress: null, activeAddress: null, + progress: null, }, action) { switch (action.type) { case DASHBOARD_ACTIVE_COIN_CHANGE: @@ -54,6 +58,7 @@ export function ActiveCoin(state = { mainBasiliskAddress: state.mainBasiliskAddress, opids: state.opids, activeBasiliskAddress: state.activeBasiliskAddress, + progress: state.progress, }; let _coins = state.coins; _coins[state.coin] = _coinDataToStore; @@ -74,6 +79,7 @@ export function ActiveCoin(state = { mainBasiliskAddress: _coinData.mainBasiliskAddress, opids: _coinData.opids, activeBasiliskAddress: _coinData.activeBasiliskAddress, + progress: _coinData.progress, }); } else { if (state.coin) { @@ -92,6 +98,7 @@ export function ActiveCoin(state = { mainBasiliskAddress: state.mainBasiliskAddress, opids: state.opids, activeBasiliskAddress: state.activeBasiliskAddress, + progress: state.progress, }; let _coins = state.coins; _coins[state.coin] = _coinData; @@ -107,6 +114,7 @@ export function ActiveCoin(state = { showTransactionInfo: false, showTransactionInfoTxIndex: null, activeSection: 'default', + progress: null, }); } else { return Object.assign({}, state, { @@ -119,6 +127,7 @@ export function ActiveCoin(state = { showTransactionInfo: false, showTransactionInfoTxIndex: null, activeSection: 'default', + progress: null, }); } } @@ -182,6 +191,21 @@ export function ActiveCoin(state = { return Object.assign({}, state, { activeAddress: action.address, }); + case SYNCING_FULL_MODE: + return Object.assign({}, state, { + progress: action.progress, + }); + case SYNCING_NATIVE_MODE: + return Object.assign({}, state, { + progress: action.progress, + }); + case DASHBOARD_UPDATE: + return Object.assign({}, state, { + progress: action.progress, + opids: action.opids, + txhistory: action.txhistory, + balance: action.balance, + }); default: return state; } From cbddd34c86179a151d906e8f8798e722c41b07c7 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Sun, 3 Sep 2017 13:46:37 +0300 Subject: [PATCH 37/83] kmd explorer url fix --- react/src/actions/actions/nativeSyncInfo.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/react/src/actions/actions/nativeSyncInfo.js b/react/src/actions/actions/nativeSyncInfo.js index 26a1680..30d8540 100644 --- a/react/src/actions/actions/nativeSyncInfo.js +++ b/react/src/actions/actions/nativeSyncInfo.js @@ -7,12 +7,13 @@ import { } from '../actionCreators'; import Config from '../../config'; +// TODO: use debug.log instead export function getSyncInfoNativeKMD(skipDebug, json) { const coin = 'KMD'; // https://www.kmd.host/ return dispatch => { return fetch( - Config.iguanaLessMode ? 'http://kmd.explorer.supernet.org/api/status?q=getInfo' : `http://127.0.0.1:${Config.iguanaCorePort}/api/dex/getinfo?userpass=tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}&symbol=${coin}`, { + Config.iguanaLessMode ? 'https://kmd.explorer.supernet.org/api/status?q=getInfo' : `http://127.0.0.1:${Config.iguanaCorePort}/api/dex/getinfo?userpass=tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}&symbol=${coin}`, { method: 'GET', }) .catch(function(error) { From 5a9005904cc07d74b7dd4ba237a582e2cb299a8d Mon Sep 17 00:00:00 2001 From: pbca26 Date: Sun, 3 Sep 2017 15:22:25 +0300 Subject: [PATCH 38/83] refactored reducers --- react/src/reducers/addcoin.js | 5 +++-- react/src/reducers/atomic.js | 5 +++-- react/src/reducers/interval.js | 10 ++++++---- react/src/reducers/main.js | 20 ++++++++++++-------- react/src/reducers/settings.js | 30 ++++++++++++++++++------------ react/src/reducers/syncOnly.js | 10 ++++++---- 6 files changed, 48 insertions(+), 32 deletions(-) diff --git a/react/src/reducers/addcoin.js b/react/src/reducers/addcoin.js index 1f0a915..88e9024 100644 --- a/react/src/reducers/addcoin.js +++ b/react/src/reducers/addcoin.js @@ -8,10 +8,11 @@ export function AddCoin(state = { }, action) { switch (action.type) { case DISPLAY_ADDCOIN_MODAL: - return Object.assign({}, state, { + return { + ...state, display: action.display, isLogin: action.isLogin, - }); + }; default: return state; } diff --git a/react/src/reducers/atomic.js b/react/src/reducers/atomic.js index 073f7e6..a839bdb 100644 --- a/react/src/reducers/atomic.js +++ b/react/src/reducers/atomic.js @@ -7,9 +7,10 @@ export function Atomic(state = { }, action) { switch (action.type) { case ATOMIC: - return Object.assign({}, state, { + return { + ...state, response: action.response, - }); + }; default: return state; } diff --git a/react/src/reducers/interval.js b/react/src/reducers/interval.js index 10dca6f..af37259 100644 --- a/react/src/reducers/interval.js +++ b/react/src/reducers/interval.js @@ -12,15 +12,17 @@ export function Interval(state = { case START_INTERVAL: newIntervalState[action.name] = action.handle; - return Object.assign({}, state, { + return { + ...state, interval: newIntervalState, - }); + }; case STOP_INTERVAL: newIntervalState[action.name] = null; - return Object.assign({}, state, { + return { + ...state, interval: newIntervalState, - }); + }; default: return state; } diff --git a/react/src/reducers/main.js b/react/src/reducers/main.js index 0381ef1..bef5931 100644 --- a/react/src/reducers/main.js +++ b/react/src/reducers/main.js @@ -12,23 +12,27 @@ export function Main(state = { }, action) { switch (action.type) { case GET_ACTIVE_COINS: - return Object.assign({}, state, { + return { + ...state, activeCoins: action.activeCoins, coins: action.coins, - }); + }; case LOGIN: - return Object.assign({}, state, { + return { + ...state, isLoggedIn: action.isLoggedIn, - }); + }; case ACTIVE_HANDLE: - return Object.assign({}, state, { + return { + ...state, isLoggedIn: action.isLoggedIn, activeHandle: action.handle, - }); + }; case DISPLAY_LOGIN_SETTINGS_MODAL: - return Object.assign({}, state, { + return { + ...state, displayLoginSettingsModal: action.displayLoginSettingsModal, - }); + }; default: return state; } diff --git a/react/src/reducers/settings.js b/react/src/reducers/settings.js index 133cd96..e07f9dc 100644 --- a/react/src/reducers/settings.js +++ b/react/src/reducers/settings.js @@ -17,31 +17,37 @@ export function Settings(state = { }, action) { switch (action.type) { case GET_WIF_KEY: - return Object.assign({}, state, { + return { + ...state, wifkey: action.wifkey, address: action.address, - }); + }; case GET_PEERS_LIST: - return Object.assign({}, state, { + return { + ...state, supernetPeers: action.supernetPeers, rawPeers: action.rawPeers, - }); + }; case GET_DEBUG_LOG: - return Object.assign({}, state, { + return { + ...state, debugLog: action.data, - }); + }; case LOAD_APP_CONFIG: - return Object.assign({}, state, { + return { + ...state, appSettings: action.config, - }); + }; case LOAD_APP_INFO: - return Object.assign({}, state, { + return { + ...state, appInfo: action.info, - }); + }; case CLI: - return Object.assign({}, state, { + return { + ...state, cli: action.data, - }); + }; default: return state; } diff --git a/react/src/reducers/syncOnly.js b/react/src/reducers/syncOnly.js index c1fecfb..5896431 100644 --- a/react/src/reducers/syncOnly.js +++ b/react/src/reducers/syncOnly.js @@ -9,13 +9,15 @@ export function SyncOnly(state = { }, action) { switch (action.type) { case SYNC_ONLY_MODAL_TOGGLE: - return Object.assign({}, state, { + return { + ...state, display: action.display, - }); + }; case SYNC_ONLY_DATA: - return Object.assign({}, state, { + return { + ...state, forks: action.forks, - }); + }; default: return state; } From 374bc2ebb6332e68be4288b8ee9fc8a885d1528b Mon Sep 17 00:00:00 2001 From: pbca26 Date: Tue, 5 Sep 2017 00:08:54 +0300 Subject: [PATCH 39/83] combined native dashboard update --- assets/mainWindow/js/loading.js | 12 +- react/src/actions/actionCreators.js | 1 + .../actions/actions/nativeDashboardUpdate.js | 66 +++++++++++ react/src/actions/storeType.js | 1 + .../dashboard/coinTile/coinTileItem.js | 17 ++- .../dashboard/walletsData/walletsData.js | 6 +- .../dashboard/walletsData/walletsData.scss | 3 + .../walletsNative/walletsNative.render.js | 2 +- .../walletsNativeSend/walletsNativeSend.js | 2 - .../walletsProgress/walletsProgress.render.js | 8 +- react/src/components/overrides.scss | 68 ++---------- react/src/reducers/activeCoin.js | 103 +++++++++++------- react/src/reducers/dashboard.js | 51 +++------ 13 files changed, 184 insertions(+), 156 deletions(-) create mode 100644 react/src/actions/actions/nativeDashboardUpdate.js diff --git a/assets/mainWindow/js/loading.js b/assets/mainWindow/js/loading.js index 4de0cca..012d984 100644 --- a/assets/mainWindow/js/loading.js +++ b/assets/mainWindow/js/loading.js @@ -22,7 +22,7 @@ function initSettingsForm() {
    - +
    `; } @@ -174,6 +174,8 @@ function closeMainWindow() { const remote = require('electron').remote; const window = remote.getCurrentWindow(); + disableModeButtons(); + window.createWindow('open'); window.hide(); } @@ -185,11 +187,19 @@ function quitApp() { window.forseCloseApp(); } +function disableModeButtons() { + $('#nativeOnlyBtn').attr('disabled', true); + $('#normalStartBtn').attr('disabled', true); + $('#settingsBtn').attr('disabled', true); +} + function normalStart() { const remote = require('electron').remote; let appConf = remote.getCurrentWindow().appConfig; appConf.iguanaLessMode = false; + disableModeButtons(); + // run iguana-less mode with no daemons startup if (appConf && appConf.iguanaLessMode) { diff --git a/react/src/actions/actionCreators.js b/react/src/actions/actionCreators.js index 77454f1..b278b7d 100644 --- a/react/src/actions/actionCreators.js +++ b/react/src/actions/actionCreators.js @@ -64,6 +64,7 @@ export * from './actions/cli'; export * from './actions/update'; export * from './actions/jumblr'; export * from './actions/interest'; +export * from './actions/nativeDashboardUpdate'; export function changeActiveAddress(address) { return { diff --git a/react/src/actions/actions/nativeDashboardUpdate.js b/react/src/actions/actions/nativeDashboardUpdate.js new file mode 100644 index 0000000..6af0940 --- /dev/null +++ b/react/src/actions/actions/nativeDashboardUpdate.js @@ -0,0 +1,66 @@ +import { + triggerToaster, +} from '../actionCreators'; +import Config from '../../config'; +import { DASHBOARD_UPDATE } from '../storeType'; + +export function getDashboardUpdate(coin, activeCoinProps) { + return dispatch => { + const _fetchConfig = { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ coin: coin }), + }; + + return fetch( + `http://127.0.0.1:${Config.agamaPort}/shepherd/native/dashboard/update`, + _fetchConfig + ) + .catch(function(error) { + console.log(error); + dispatch( + triggerToaster( + 'getDashboardUpdate', + 'Error', + 'error' + ) + ); + }) + .then(response => response.json()) + .then(json => { + dispatch(getDashboardUpdateState(json)); + + // dirty hack to trigger dashboard render + if (!activeCoinProps.balance && + !activeCoinProps.addresses) { + setTimeout(() => { + dispatch(getDashboardUpdateState(json)); + }, 100); + } + }) + } +} + +export function getDashboardUpdateState(json) { + let _listtransactions = json.result['listtransactions']; + + if (_listtransactions && + _listtransactions.error) { + _listtransactions = null; + } else if (_listtransactions && _listtransactions.result && _listtransactions.result.length) { + _listtransactions = _listtransactions.result; + } else if (!_listtransactions || (!_listtransactions.result || !_listtransactions.result.length)) { + _listtransactions = 'no data'; + } + + return { + type: DASHBOARD_UPDATE, + progress: json.result['getinfo'].result, + opids: json.result['z_getoperationstatus'].result, + txhistory: _listtransactions, + balance: json.result['z_gettotalbalance'].result, + addresses: json.result['addresses'], + }; +} \ No newline at end of file diff --git a/react/src/actions/storeType.js b/react/src/actions/storeType.js index 6438740..adb9141 100644 --- a/react/src/actions/storeType.js +++ b/react/src/actions/storeType.js @@ -30,6 +30,7 @@ export const DASHBOARD_ACTIVE_COIN_NATIVE_OPIDS = 'DASHBOARD_ACTIVE_COIN_NATIVE_ export const DASHBOARD_ACTIVE_COIN_SENDTO = 'DASHBOARD_ACTIVE_COIN_SENDTO'; export const DASHBOARD_ACTIVE_COIN_GET_CACHE = 'DASHBOARD_ACTIVE_COIN_GET_CACHE'; export const DASHBOARD_ACTIVE_COIN_MAIN_BASILISK_ADDR = 'DASHBOARD_ACTIVE_COIN_MAIN_BASILISK_ADDR'; +export const DASHBOARD_UPDATE = 'DASHBOARD_UPDATE'; export const VIEW_CACHE_DATA = 'VIEW_CACHE_DATA'; export const SYNC_ONLY_MODAL_TOGGLE = 'SYNC_ONLY_MODAL_TOGGLE'; export const SYNC_ONLY_DATA = 'SYNC_ONLY_DATA'; diff --git a/react/src/components/dashboard/coinTile/coinTileItem.js b/react/src/components/dashboard/coinTile/coinTileItem.js index 08c0fab..83ea141 100644 --- a/react/src/components/dashboard/coinTile/coinTileItem.js +++ b/react/src/components/dashboard/coinTile/coinTileItem.js @@ -18,7 +18,8 @@ import { getNativeTxHistory, getKMDBalanceTotal, getSyncInfoNative, - getDebugLog + getDebugLog, + getDashboardUpdate } from '../../../actions/actionCreators'; import Store from '../../../store'; import Config from '../../../config'; @@ -42,8 +43,8 @@ class CoinTileItem extends React.Component { dispatchCoinActions(coin, mode) { if (mode === 'native') { Store.dispatch(iguanaActiveHandle(true)); - const _propsDashboard = this.props.Dashboard; - const syncPercentage = _propsDashboard && _propsDashboard.progress && (parseFloat(parseInt(_propsDashboard.progress.blocks, 10) * 100 / parseInt(this.props.Dashboard.progress.longestchain, 10)).toFixed(2)).replace('NaN', 0); + const _propsDashboard = this.props.ActiveCoin; + const syncPercentage = _propsDashboard && _propsDashboard.progress && (parseFloat(parseInt(_propsDashboard.progress.blocks, 10) * 100 / parseInt(_propsDashboard.progress.longestchain, 10)).toFixed(2)).replace('NaN', 0); if (syncPercentage < 100 && !this.props.Dashboard.displayCoindDownModal) { @@ -56,10 +57,7 @@ class CoinTileItem extends React.Component { syncPercentage && (Config.iguanaLessMode || syncPercentage >= NATIVE_MIN_SYNC_PERCENTAGE_THRESHOLD)) { Store.dispatch(getSyncInfoNative(coin, true)); - Store.dispatch(getKMDBalanceTotal(coin)); - Store.dispatch(getNativeTxHistory(coin)); - Store.dispatch(getKMDAddressesNative(coin, mode)); - Store.dispatch(getKMDOPID(null, coin)); + Store.dispatch(getDashboardUpdate(coin, _propsDashboard)); } else { Store.dispatch(getSyncInfoNative(coin)); } @@ -205,14 +203,15 @@ const mapStateToProps = (state) => { ActiveCoin: { coin: state.ActiveCoin.coin, addresses: state.ActiveCoin.addresses, - mainBasiliskAddress: state.ActiveCoin.mainBasiliskAddress + mainBasiliskAddress: state.ActiveCoin.mainBasiliskAddress, + progress: state.ActiveCoin.progress, }, Dashboard: state.Dashboard, Interval: { interval: state.Interval.interval } }; - + }; export default connect(mapStateToProps)(CoinTileItem); \ No newline at end of file diff --git a/react/src/components/dashboard/walletsData/walletsData.js b/react/src/components/dashboard/walletsData/walletsData.js index 56463f3..a317b2b 100644 --- a/react/src/components/dashboard/walletsData/walletsData.js +++ b/react/src/components/dashboard/walletsData/walletsData.js @@ -385,20 +385,20 @@ class WalletsData extends React.Component { if (this.isFullySynced()) { return ( - { translate('INDEX.LOADING_HISTORY') }... + { translate('INDEX.LOADING_HISTORY') }... ); } else { return ( - { translate('INDEX.SYNC_IN_PROGRESS') }... + { translate('INDEX.SYNC_IN_PROGRESS') }... ); } } else if (this.state.itemsList === 'no data') { return ( - { translate('INDEX.NO_DATA') } + { translate('INDEX.NO_DATA') } ); } else if (this.state.itemsList) { diff --git a/react/src/components/dashboard/walletsData/walletsData.scss b/react/src/components/dashboard/walletsData/walletsData.scss index ab72b82..a03e870 100644 --- a/react/src/components/dashboard/walletsData/walletsData.scss +++ b/react/src/components/dashboard/walletsData/walletsData.scss @@ -86,4 +86,7 @@ padding: 38px; background: rgba(255, 255, 255, 0.85); } +} +.table-cell-offset-16 { + padding-left: 16px; } \ No newline at end of file diff --git a/react/src/components/dashboard/walletsNative/walletsNative.render.js b/react/src/components/dashboard/walletsNative/walletsNative.render.js index 580ae42..e5411f4 100644 --- a/react/src/components/dashboard/walletsNative/walletsNative.render.js +++ b/react/src/components/dashboard/walletsNative/walletsNative.render.js @@ -27,7 +27,7 @@ const WalletsNativeRender = function() {
  • -
    +
    diff --git a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js index 5c30dad..7f6a850 100644 --- a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js +++ b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js @@ -430,8 +430,6 @@ class WalletsNativeSend extends React.Component { valid = false; } - valid = false; - return valid; } diff --git a/react/src/components/dashboard/walletsProgress/walletsProgress.render.js b/react/src/components/dashboard/walletsProgress/walletsProgress.render.js index d1b19cc..a2c11a2 100644 --- a/react/src/components/dashboard/walletsProgress/walletsProgress.render.js +++ b/react/src/components/dashboard/walletsProgress/walletsProgress.render.js @@ -56,15 +56,13 @@ export const CoinIsBusyRender = function() { export const ChainActivationNotificationRender = function() { return ( -
    +
    -

    - { translate('INDEX.ACTIVATING_CHAIN') } - { this.renderActivatingBestChainProgress() } +

    { translate('INDEX.ACTIVATING_CHAIN') } { this.renderActivatingBestChainProgress() }

    { this.renderLB('INDEX.KMD_STARTED') }

    @@ -75,7 +73,7 @@ export const WalletsProgressRender = function() { return ( -
    + { this.renderExportKeys() }
    } @@ -165,7 +104,7 @@ export const SettingsRender = function() {
    this.openTab('ImportKeys', 5) } - className={ 'panel' + (this.state.nativeOnly ? ' hide' : '') }> + className={ 'panel' + (!this.state.nativeOnly ? ' hide' : '') }> } From a01a9434f25e252895964803eb6e9a04b2c37df5 Mon Sep 17 00:00:00 2001 From: Miika Turunen Date: Fri, 8 Sep 2017 00:26:32 +0300 Subject: [PATCH 55/83] Revert test code --- react/src/components/dashboard/settings/settings.render.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react/src/components/dashboard/settings/settings.render.js b/react/src/components/dashboard/settings/settings.render.js index bd2d70c..2886646 100644 --- a/react/src/components/dashboard/settings/settings.render.js +++ b/react/src/components/dashboard/settings/settings.render.js @@ -104,7 +104,7 @@ export const SettingsRender = function() {
    this.openTab('ImportKeys', 5) } - className={ 'panel' + (!this.state.nativeOnly ? ' hide' : '') }> + className={ 'panel' + (this.state.nativeOnly ? ' hide' : '') }>
    { translate('INDEX.IMPORT_KEYS') } From dacdab347cbae7ca259fbc80adcb8dccf4681c1c Mon Sep 17 00:00:00 2001 From: pbca26 Date: Sat, 9 Sep 2017 22:41:20 +0300 Subject: [PATCH 56/83] basilisk send btn lift balance gt 0 condition --- assets/mainWindow/js/loading.js | 17 +++++++++-------- react/src/actions/actions/jumblr.js | 4 ++-- .../dashboard/walletsNav/walletsNav.render.js | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/assets/mainWindow/js/loading.js b/assets/mainWindow/js/loading.js index e35f48c..f9619c3 100644 --- a/assets/mainWindow/js/loading.js +++ b/assets/mainWindow/js/loading.js @@ -191,10 +191,8 @@ function startKMDPassive() { window.startKMDNative('KMD', true); - setTimeout(function() { - window.createWindow('open'); - window.hide(); - }, 1000); + window.createWindow('open'); + window.hide(); } function closeMainWindow(isKmdOnly, isCustom) { @@ -206,12 +204,15 @@ function closeMainWindow(isKmdOnly, isCustom) { if (!isCustom) { window.startKMDNative(isKmdOnly ? 'KMD' : null); + + setTimeout(function() { + window.createWindow('open'); + window.hide(); + }, 3000); } - setTimeout(function() { - window.createWindow('open'); - window.hide(); - }, 3000); + window.createWindow('open'); + window.hide(); } function quitApp() { diff --git a/react/src/actions/actions/jumblr.js b/react/src/actions/actions/jumblr.js index 5e8373b..8dc7a61 100644 --- a/react/src/actions/actions/jumblr.js +++ b/react/src/actions/actions/jumblr.js @@ -117,7 +117,7 @@ function dumpPrivkey(coin, key) { }); } -export function importPrivkey(coin, key) { +export function importPrivkey(coin, key, rescan = false) { return new Promise((resolve, reject) => { const payload = { mode: null, @@ -126,7 +126,7 @@ export function importPrivkey(coin, key) { params: [ key, '', - false + rescan ], }; diff --git a/react/src/components/dashboard/walletsNav/walletsNav.render.js b/react/src/components/dashboard/walletsNav/walletsNav.render.js index 85892f6..6fae2e2 100644 --- a/react/src/components/dashboard/walletsNav/walletsNav.render.js +++ b/react/src/components/dashboard/walletsNav/walletsNav.render.js @@ -52,7 +52,7 @@ export const WalletsNavWithWalletRender = function() { onClick={ this.props.ActiveCoin.mode !== 'native' ? this.toggleSendReceiveCoinForms : this.toggleNativeWalletTransactions }> { translate('INDEX.TRANSACTIONS') } - { this.checkTotalBalance() > 0 && + { ((this.props.ActiveCoin.mode === 'full' && this.checkTotalBalance() > 0) || this.props.ActiveCoin.mode === 'basilisk') && +

    Import key

    +
    +
    +
    + Two forms below allow you to import either Iguana Core / ICO passphrase (seed) or WIF (Wallet Import Format) key. +
    +
    + Passphrase / seed +

    + Notice: importing a passphrase will trigger a full wallet rescan.  + This process can take hours to rescan the whole blockchain. +

    +
    +
    + + + + +
    +
    + + +
    +
    + { this.state.passphraseAddress && this.state.passphraseWif && +
    +

    + Address: { this.state.passphraseAddress } + +

    +

    + WIF: { this.state.passphraseWif } + +

    +
    + } +
    +
    or
    +
    + WIF (Wallet Import Format) +
    + + +
    + Trigger rescan + +
    +
    +
    +
    + + +
    + +
    +
    +
    +
    +
    +
    + + ); +}; \ No newline at end of file diff --git a/react/src/components/dashboard/importKeyModal/importKeyModal.scss b/react/src/components/dashboard/importKeyModal/importKeyModal.scss new file mode 100644 index 0000000..2d9f692 --- /dev/null +++ b/react/src/components/dashboard/importKeyModal/importKeyModal.scss @@ -0,0 +1,33 @@ +.modal-import-key { + .modal-dialog { + width: 70%; + max-height: 90vh; + overflow-y: auto; + overflow-x: hidden; + } + .line { + padding: 50px 0 40px 0; + text-transform: uppercase; + font-weight: bold; + } + .line:before { + content: ''; + display: inline-block; + height: 1px; + width: 47%; + background: #ccc; + margin-right: 10px; + position: relative; + top: -4px; + } + .line:after { + content: ''; + display: inline-block; + height: 1px; + width: 47%; + background: #ccc; + margin-left: 10px; + position: relative; + top: -4px; + } +} \ No newline at end of file diff --git a/react/src/components/dashboard/jumblr/jumblr.js b/react/src/components/dashboard/jumblr/jumblr.js index b7962ae..760151e 100755 --- a/react/src/components/dashboard/jumblr/jumblr.js +++ b/react/src/components/dashboard/jumblr/jumblr.js @@ -285,7 +285,9 @@ class Jumblr extends React.Component { importPrivkey(this.props.ActiveCoin.coin, _genKeys.wif) .then((json) => { - if (!json.id && !json.result && !json.error) { + if (!json.id && + !json.result && + !json.error) { _jumblrSecretAddress.push(_genKeys); this.setState(Object.assign({}, this.state, { jumblrSecretAddressImport: _jumblrSecretAddress, @@ -344,7 +346,9 @@ class Jumblr extends React.Component { importPrivkey(this.props.ActiveCoin.coin, _genKeys.wif) .then((json) => { - if (!json.id && !json.result && !json.error) { + if (!json.id && + !json.result && + !json.error) { // console.warn('importPrivkey', json); setJumblrAddress( this.props.ActiveCoin.coin, diff --git a/react/src/components/dashboard/main/dashboard.js b/react/src/components/dashboard/main/dashboard.js index a186339..00f56a6 100755 --- a/react/src/components/dashboard/main/dashboard.js +++ b/react/src/components/dashboard/main/dashboard.js @@ -45,9 +45,7 @@ const mapStateToProps = (state) => { ActiveCoin: { mode: state.ActiveCoin.mode, }, - Dashboard: { - activeSection: state.Dashboard.activeSection, - }, + Dashboard: state.Dashboard, }; }; diff --git a/react/src/components/dashboard/main/dashboard.render.js b/react/src/components/dashboard/main/dashboard.render.js index cb734fd..6fa9967 100644 --- a/react/src/components/dashboard/main/dashboard.render.js +++ b/react/src/components/dashboard/main/dashboard.render.js @@ -16,6 +16,7 @@ import About from '../about/about'; import WalletsNative from '../walletsNative/walletsNative'; import WalletsTxInfo from '../walletsTxInfo/walletsTxInfo'; import CoindDownModal from '../coindDownModal/coindDownModal'; +import ImportKeyModal from '../importKeyModal/importKeyModal'; const DashboardRender = function() { return ( @@ -25,6 +26,9 @@ const DashboardRender = function() { id="section-dashboard"> + { this.props.Dashboard.displayImportKeyModal && + + }
    diff --git a/react/src/components/dashboard/navbar/navbar.js b/react/src/components/dashboard/navbar/navbar.js index 9d5babc..0f414ce 100755 --- a/react/src/components/dashboard/navbar/navbar.js +++ b/react/src/components/dashboard/navbar/navbar.js @@ -7,6 +7,7 @@ import { startInterval, toggleSyncOnlyModal, getSyncOnlyForks, + displayImportKeyModal, logout, } from '../../../actions/actionCreators'; import Store from '../../../store'; @@ -67,6 +68,10 @@ class Navbar extends React.Component { } } + openImportKeyModal() { + Store.dispatch(displayImportKeyModal(true)); + } + openDropMenu() { this.setState(Object.assign({}, this.state, { openDropMenu: !this.state.openDropMenu, @@ -126,6 +131,7 @@ class Navbar extends React.Component { return NavbarRender.call(this); } } + const mapStateToProps = (state) => { return { ActiveCoin: { diff --git a/react/src/components/dashboard/navbar/navbar.render.js b/react/src/components/dashboard/navbar/navbar.render.js index eed8d1b..a61321f 100644 --- a/react/src/components/dashboard/navbar/navbar.render.js +++ b/react/src/components/dashboard/navbar/navbar.render.js @@ -64,6 +64,13 @@ const NavbarRender = function() { } + { this.state.nativeOnly && +
  • + + Import key + +
  • + }
  • this.dashboardChangeSection('atomic') }> Atomic Explorer diff --git a/react/src/components/dashboard/sendCoin/sendCoin.js b/react/src/components/dashboard/sendCoin/sendCoin.js index ede761e..4d3ce8b 100644 --- a/react/src/components/dashboard/sendCoin/sendCoin.js +++ b/react/src/components/dashboard/sendCoin/sendCoin.js @@ -833,7 +833,7 @@ class SendCoin extends React.Component { valid = false; } - if ((this.props.ActiveCoin.mode === 'basilisk' && Number(this.state.amount) > Number(this.state.sendFromAmount)) || + /*if ((this.props.ActiveCoin.mode === 'basilisk' && Number(this.state.amount) > Number(this.state.sendFromAmount)) || (this.props.ActiveCoin.mode === 'full' && Number(this.state.amount) > Number(this.checkBalance()))) { Store.dispatch( triggerToaster( @@ -843,7 +843,7 @@ class SendCoin extends React.Component { ) ); valid = false; - } + }*/ return valid; } diff --git a/react/src/components/dashboard/walletsProgress/walletsProgress.js b/react/src/components/dashboard/walletsProgress/walletsProgress.js index b70c776..d70c8fb 100644 --- a/react/src/components/dashboard/walletsProgress/walletsProgress.js +++ b/react/src/components/dashboard/walletsProgress/walletsProgress.js @@ -44,11 +44,16 @@ class WalletsProgress extends React.Component { if (_progress) { if ((!_progress.blocks && !_progress.longestchain) || - (_progress.blocks < _progress.longestchain)) { + (_progress.blocks < _progress.longestchain) || + this.props.ActiveCoin.rescanInProgress) { return ChainActivationNotificationRender.call(this); } } else { - return null; + if (this.props.ActiveCoin.rescanInProgress) { + return ChainActivationNotificationRender.call(this); + } else { + return null; + } } } @@ -131,9 +136,28 @@ class WalletsProgress extends React.Component { return TranslationComponentsRender.call(this, translationID); } + renderRescanProgress() { + if (this.props.Settings.debugLog.indexOf('Still rescanning') > -1 && + this.props.ActiveCoin.rescanInProgress) { + const temp = this.props.Settings.debugLog.split(' '); + let currentProgress; + + for (let i = 0; i < temp.length; i++) { + if (temp[i].indexOf('Progress=') > -1) { + currentProgress = Number(temp[i].replace('Progress=', '')) * 100; + } + } + + return currentProgress; + } else { + return null; + } + } + renderActivatingBestChainProgress() { if (this.props.Settings && - this.props.Settings.debugLog) { + this.props.Settings.debugLog && + !this.props.ActiveCoin.rescanInProgress) { if (this.props.Settings.debugLog.indexOf('UpdateTip') > -1 && !this.props.ActiveCoin.progress && !this.props.ActiveCoin.progress.blocks) { @@ -246,6 +270,7 @@ const mapStateToProps = (state) => { mode: state.ActiveCoin.mode, coin: state.ActiveCoin.coin, progress: state.ActiveCoin.progress, + rescanInProgress: state.ActiveCoin.rescanInProgress, }, }; }; diff --git a/react/src/components/dashboard/walletsProgress/walletsProgress.render.js b/react/src/components/dashboard/walletsProgress/walletsProgress.render.js index a2c11a2..4ea4f60 100644 --- a/react/src/components/dashboard/walletsProgress/walletsProgress.render.js +++ b/react/src/components/dashboard/walletsProgress/walletsProgress.render.js @@ -18,23 +18,43 @@ export const SyncErrorBlocksRender = function() { }; export const SyncPercentageRender = function(syncPercentage) { - return ( -
    - { syncPercentage } | { this.props.ActiveCoin.progress.blocks } / { this.props.ActiveCoin.progress.longestchain } | { translate('INDEX.CONNECTIONS') }: { this.props.ActiveCoin.progress.connections } -
    - ); + if (this.props.ActiveCoin.rescanInProgress) { + return ( +
    + Please wait until rescan process is finished +
    + ); + } else { + return ( +
    + { syncPercentage } | { this.props.ActiveCoin.progress.blocks } / { this.props.ActiveCoin.progress.longestchain } | { translate('INDEX.CONNECTIONS') }: { this.props.ActiveCoin.progress.connections } +
    + ); + } }; export const LoadingBlocksRender = function() { - return ( -
    - { translate('INDEX.LOADING_BLOCKS') } -
    - ); + if (this.props.ActiveCoin.rescanInProgress) { + return ( +
    + Please wait until rescan process is finished +
    + ); + } else { + return ( +
    + { translate('INDEX.LOADING_BLOCKS') } +
    + ); + } }; export const TranslationComponentsRender = function(translationID) { @@ -62,7 +82,7 @@ export const ChainActivationNotificationRender = function() { type="button"> × -

    { translate('INDEX.ACTIVATING_CHAIN') } { this.renderActivatingBestChainProgress() } +

    { translate('INDEX.ACTIVATING_CHAIN') } { this.props.ActiveCoin.rescanInProgress ? (this.renderRescanProgress() ? `: ${this.renderRescanProgress().toFixed(2)}% (rescanning blocks)` : '(rescanning blocks)') : this.renderActivatingBestChainProgress() }

    { this.renderLB('INDEX.KMD_STARTED') }

  • diff --git a/react/src/components/overrides.scss b/react/src/components/overrides.scss index a066bd0..0f942bb 100644 --- a/react/src/components/overrides.scss +++ b/react/src/components/overrides.scss @@ -398,4 +398,8 @@ select{ .page-content-native { position: relative; top: -20px; +} + +.bold { + font-weight: bold; } \ No newline at end of file diff --git a/react/src/reducers/activeCoin.js b/react/src/reducers/activeCoin.js index dc65043..914bc3f 100644 --- a/react/src/reducers/activeCoin.js +++ b/react/src/reducers/activeCoin.js @@ -38,6 +38,7 @@ export function ActiveCoin(state = { mainBasiliskAddress: null, activeAddress: null, progress: null, + rescanInProgress: false, }, action) { switch (action.type) { case DASHBOARD_ACTIVE_COIN_CHANGE: @@ -59,6 +60,7 @@ export function ActiveCoin(state = { opids: state.opids, activeBasiliskAddress: state.activeBasiliskAddress, progress: state.progress, + rescanInProgress: state.rescanInProgress, }; let _coins = state.coins; _coins[state.coin] = _coinDataToStore; @@ -81,6 +83,7 @@ export function ActiveCoin(state = { opids: _coinData.opids, activeBasiliskAddress: _coinData.activeBasiliskAddress, progress: _coinData.progress, + rescanInProgress: _coinData.rescanInProgress, }; } else { if (state.coin) { @@ -100,6 +103,7 @@ export function ActiveCoin(state = { opids: state.opids, activeBasiliskAddress: state.activeBasiliskAddress, progress: state.progress, + rescanInProgress: state.rescanInProgress, }; let _coins = state.coins; _coins[state.coin] = _coinData; @@ -117,6 +121,7 @@ export function ActiveCoin(state = { showTransactionInfoTxIndex: null, activeSection: 'default', progress: null, + rescanInProgress: false, }; } else { return { @@ -131,6 +136,7 @@ export function ActiveCoin(state = { showTransactionInfoTxIndex: null, activeSection: 'default', progress: null, + rescanInProgress: false, }; } } @@ -227,6 +233,7 @@ export function ActiveCoin(state = { txhistory: action.txhistory, balance: action.balance, addresses: action.addresses, + rescanInProgress: action.rescanInProgress, }; } default: diff --git a/react/src/reducers/dashboard.js b/react/src/reducers/dashboard.js index 1bdf115..895738b 100644 --- a/react/src/reducers/dashboard.js +++ b/react/src/reducers/dashboard.js @@ -5,7 +5,8 @@ import { TOGGLE_NOTIFICATIONS_MODAL, DISPLAY_COIND_DOWN_MODAL, DISPLAY_CLAIM_INTEREST_MODAL, - DASHBOARD_SYNC_ONLY_UPDATE + DASHBOARD_SYNC_ONLY_UPDATE, + DISPLAY_IMPORT_KEY_MODAL, } from '../actions/storeType'; export function Dashboard(state = { @@ -16,6 +17,7 @@ export function Dashboard(state = { displayCoindDownModal: false, displayClaimInterestModal: false, skipFullDashboardUpdate: false, + displayImportKeyModal: false, }, action) { switch (action.type) { case DASHBOARD_SECTION_CHANGE: @@ -45,6 +47,12 @@ export function Dashboard(state = { displayClaimInterestModal: action.displayClaimInterestModal, }; break; + case DISPLAY_IMPORT_KEY_MODAL: + return { + ...state, + displayImportKeyModal: action.displayImportKeyModal, + }; + break; case DASHBOARD_SYNC_ONLY_UPDATE: return { ...state, diff --git a/react/src/styles/index.scss b/react/src/styles/index.scss index a276e12..8cd3155 100644 --- a/react/src/styles/index.scss +++ b/react/src/styles/index.scss @@ -37,6 +37,7 @@ @import '../components/dashboard/settings/settings.scss'; @import '../components/dashboard/walletsData/walletsData.scss'; @import '../components/dashboard/claimInterestModal/claimInterestModal.scss'; +@import '../components/dashboard/importKeyModal/importKeyModal.scss'; @import '../components/dashboard/jumblr/jumblr.scss'; @import '../components/dashboard/qrModal/qrModal.scss'; @import '../components/dashboard/coindDownModal/coindDownModal.scss'; diff --git a/react/src/translate/en.js b/react/src/translate/en.js index 7bd8aed..2155737 100644 --- a/react/src/translate/en.js +++ b/react/src/translate/en.js @@ -76,7 +76,7 @@ export const _lang = { 'RESCAN_SM': 'rescanning blocks', 'REINDEX': 'reindexing blocks from disk', 'BLOCKS_SM': 'blocks', - 'LOADING_BLOCKS': 'Loading blocks...it can take up to 15 min to load blocks', + 'LOADING_BLOCKS': 'Loading data please wait...', 'WEAK_SEED': 'Weak seed!', 'YOUR_SEED_MUST_CONTAIN': 'Your seed must contain:', 'YOUR_SEED_MUST_CONTAIN1': '- at least 1 upper case letter', @@ -707,5 +707,6 @@ export const _lang = { 'SUPERNET': 'SUPERNET (SUPERNET)', 'WLC': 'WIRELESS (WIRELESS)', }, + // 'CHIPS': 'CHIPS (CHIPS)', }, }; \ No newline at end of file diff --git a/react/src/util/coinHelper.js b/react/src/util/coinHelper.js index 87eb3f7..6c0ad3f 100644 --- a/react/src/util/coinHelper.js +++ b/react/src/util/coinHelper.js @@ -90,6 +90,10 @@ export function getCoinTitle(coin) { coinlogo = 'SUPERNET'; coinname = 'SUPERNET'; break; + case 'CHIPS': + coinlogo = 'SUPERNET'; + coinname = 'CHIPS'; + break; case 'REVS': coinlogo = 'REVS'; coinname = 'REVS'; diff --git a/react/src/util/crypto/gen/cryptojs.sha256.js b/react/src/util/crypto/gen/cryptojs.sha256.js index 8209973..2779846 100755 --- a/react/src/util/crypto/gen/cryptojs.sha256.js +++ b/react/src/util/crypto/gen/cryptojs.sha256.js @@ -34,6 +34,7 @@ // Public API var SHA256 = C.SHA256 = function (message, options) { var digestbytes = util.wordsToBytes(SHA256._sha256(message)); + return options && options.asBytes ? digestbytes : options && options.asString ? Binary.bytesToString(digestbytes) : util.bytesToHex(digestbytes); From 7cac689a9530a317237beeba8338b0323aa4a08d Mon Sep 17 00:00:00 2001 From: pbca26 Date: Sun, 10 Sep 2017 17:51:32 +0300 Subject: [PATCH 58/83] kmd passive disable daemon down modal; switch toaster message --- react/src/actions/actions/nativeSyncInfo.js | 33 ++++++++++++++----- .../coindDownModal/coindDownModal.js | 17 +++++++++- .../importKeyModal/importKeyModal.js | 2 +- 3 files changed, 42 insertions(+), 10 deletions(-) diff --git a/react/src/actions/actions/nativeSyncInfo.js b/react/src/actions/actions/nativeSyncInfo.js index 86ffcee..d4689da 100644 --- a/react/src/actions/actions/nativeSyncInfo.js +++ b/react/src/actions/actions/nativeSyncInfo.js @@ -149,14 +149,31 @@ export function getSyncInfoNative(coin, skipDebug, skipRemote, suppressErrors) { } else { if (!json && Config.cli.default) { - dispatch( - triggerToaster( - 'Komodod is down', - 'Critical Error', - 'error', - true - ) - ); + let _kmdMainPassiveMode; + + try { + _kmdMainPassiveMode = window.require('electron').remote.getCurrentWindow().kmdMainPassiveMode; + } catch (e) {} + + if (!_kmdMainPassiveMode) { + dispatch( + triggerToaster( + 'Komodod is down', + 'Critical Error', + 'error', + true + ) + ); + } else { + dispatch( + triggerToaster( + 'Please make sure to run komodod manually', + 'Connection error', + 'warning', + true + ) + ); + } if (coin === 'KMD') { dispatch(getDebugLog('komodo', 50)); diff --git a/react/src/components/dashboard/coindDownModal/coindDownModal.js b/react/src/components/dashboard/coindDownModal/coindDownModal.js index f468156..b18fbfb 100644 --- a/react/src/components/dashboard/coindDownModal/coindDownModal.js +++ b/react/src/components/dashboard/coindDownModal/coindDownModal.js @@ -11,6 +11,7 @@ class CoindDownModal extends React.Component { this.state = { display: false, debugLogCrash: null, + kmdMainPassiveMode: false, }; this.dismiss = this.dismiss.bind(this); } @@ -19,6 +20,18 @@ class CoindDownModal extends React.Component { Store.dispatch(toggleCoindDownModal(false)); } + componentWillMount() { + let _kmdMainPassiveMode; + + try { + _kmdMainPassiveMode = window.require('electron').remote.getCurrentWindow().kmdMainPassiveMode; + } catch (e) {} + + this.setState(Object.assign({}, this.state, { + kmdMainPassiveMode: _kmdMainPassiveMode, + })); + } + componentWillReceiveProps(nextProps) { if (this.props.displayCoindDownModal !== nextProps.displayCoindDownModal) { this.setState(Object.assign({}, this.state, { @@ -28,13 +41,15 @@ class CoindDownModal extends React.Component { } render() { - if (this.state.display) { + if (this.state.display && + !this.state.kmdMainPassiveMode) { return CoindDownModalRender.call(this); } return null; } } + const mapStateToProps = (state) => { return { ActiveCoin: { diff --git a/react/src/components/dashboard/importKeyModal/importKeyModal.js b/react/src/components/dashboard/importKeyModal/importKeyModal.js index d4e2014..7244ca4 100755 --- a/react/src/components/dashboard/importKeyModal/importKeyModal.js +++ b/react/src/components/dashboard/importKeyModal/importKeyModal.js @@ -142,7 +142,7 @@ class ImportKeyModal extends React.Component { Store.dispatch(getDashboardUpdateState(null, this.props.ActiveCoin.coin, true)); Store.dispatch( triggerToaster( - 'Address imported. Wallet rescan is in progress. Please wait until it\s finished.', + 'Address imported. Wallet rescan is in progress. Please wait until it is finished.', translate('TOASTR.WALLET_NOTIFICATION'), 'info', false From 9c5396ac9d43df6c4d967072b2446b8db496f60b Mon Sep 17 00:00:00 2001 From: Miika Turunen Date: Sun, 10 Sep 2017 22:36:25 +0300 Subject: [PATCH 59/83] Split settings tabs to components --- .../settings/settings.appSettings.js | 322 +++++++++++++ .../dashboard/settings/settings.cliPanel.js | 206 +++++++++ .../settings/settings.debugLogPanel.js | 114 +++++ .../dashboard/settings/settings.importKeys.js | 1 - .../components/dashboard/settings/settings.js | 431 +----------------- .../dashboard/settings/settings.render.js | 167 +------ .../settings/settings.supportPanel.js | 82 ++++ 7 files changed, 744 insertions(+), 579 deletions(-) create mode 100644 react/src/components/dashboard/settings/settings.appSettings.js create mode 100644 react/src/components/dashboard/settings/settings.cliPanel.js create mode 100644 react/src/components/dashboard/settings/settings.debugLogPanel.js create mode 100644 react/src/components/dashboard/settings/settings.supportPanel.js diff --git a/react/src/components/dashboard/settings/settings.appSettings.js b/react/src/components/dashboard/settings/settings.appSettings.js new file mode 100644 index 0000000..d455557 --- /dev/null +++ b/react/src/components/dashboard/settings/settings.appSettings.js @@ -0,0 +1,322 @@ +import React from 'react'; +import { connect } from 'react-redux'; +import { translate } from '../../../translate/translate'; +import Config from '../../../config'; +import { + iguanaActiveHandle, + getAppConfig, + getAppInfo, + resetAppConfig, + saveAppConfig, + skipFullDashboardUpdate, + triggerToaster, +} from '../../../actions/actionCreators'; +import Store from '../../../store'; + +class AppSettingsPanel extends React.Component { + constructor() { + super(); + this.state = { + appSettings: {}, + appConfigSchema: {}, + }; + this._saveAppConfig = this._saveAppConfig.bind(this); + this._resetAppConfig = this._resetAppConfig.bind(this); + this._skipFullDashboardUpdate = this._skipFullDashboardUpdate.bind(this); + this.updateInput = this.updateInput.bind(this); + } + + componentWillMount() { + try { + const _appConfigSchema = window.require('electron').remote.getCurrentWindow().appConfigSchema; + const _appSettings = this.props.Settings.appSettings ? this.props.Settings.appSettings : Object.assign({}, window.require('electron').remote.getCurrentWindow().appConfig); + + this.setState(Object.assign({}, this.state, { + appConfigSchema: _appConfigSchema, + appSettings: _appSettings, + })); + } catch(e) {} + } + + componentDidMount(props) { + if (!this.props.disableWalletSpecificUI) { + Store.dispatch(iguanaActiveHandle()); + } + + Store.dispatch(getAppConfig()); + Store.dispatch(getAppInfo()); + } + + _skipFullDashboardUpdate() { + Store.dispatch(skipFullDashboardUpdate(!this.props.Dashboard.skipFullDashboardUpdate)); + } + + _resetAppConfig() { + Store.dispatch(resetAppConfig()); + } + + _saveAppConfig() { + const _appSettings = this.state.appSettings; + let _appSettingsPristine = Object.assign({}, this.props.Settings.appSettings); + let isError = false; + let saveAfterPathCheck = false; + + for (let key in _appSettings) { + if (key.indexOf('__') === -1) { + _appSettingsPristine[key] = this.state.appConfigSchema[key] && this.state.appConfigSchema[key].type === 'number' ? Number(_appSettings[key]) : _appSettings[key]; + + if (this.state.appConfigSchema[key] && this.state.appConfigSchema[key].type === 'folder' && + _appSettings[key] && + _appSettings[key].length) { + const _testLocation = window.require('electron').remote.getCurrentWindow().testLocation; + saveAfterPathCheck = true; + + _testLocation(_appSettings[key]) + .then((res) => { + if (res === -1) { + isError = true; + Store.dispatch( + triggerToaster( + translate('TOASTR.KOMODO_DATADIR_INVALID'), + translate('INDEX.SETTINGS'), + 'error' + ) + ); + } else if (res === false) { + isError = true; + Store.dispatch( + triggerToaster( + translate('TOASTR.KOMODO_DATADIR_NOT_DIR'), + translate('INDEX.SETTINGS'), + 'error' + ) + ); + } else { + Store.dispatch(saveAppConfig(_appSettingsPristine)); + } + }); + } + } else { + const _nestedKey = key.split('__'); + _appSettingsPristine[_nestedKey[0]][_nestedKey[1]] = this.state.appConfigSchema[_nestedKey[0]][_nestedKey[1]].type === 'number' ? Number(_appSettings[key]) : _appSettings[key]; + } + } + + if (!saveAfterPathCheck) { + Store.dispatch(saveAppConfig(_appSettingsPristine)); + } + } + + + renderConfigEditForm() { + let items = []; + const _appConfig = this.state.appSettings; + for (let key in _appConfig) { + if (this.state.appConfigSchema[key] && typeof _appConfig[key] === 'object') { + if (this.state.appConfigSchema[key].display) { + items.push( + + + { this.state.appConfigSchema[key].displayName ? this.state.appConfigSchema[key].displayName : key } + { this.state.appConfigSchema[key].info && + + } + + + + ); + + for (let _key in _appConfig[key]) { + items.push( + + + { this.state.appConfigSchema[key][_key].displayName ? this.state.appConfigSchema[key][_key].displayName : _key } + { this.state.appConfigSchema[key][_key].info && + + } + + + { this.state.appConfigSchema[key][_key].type === 'number' && + this.updateInputSettings(event, key, _key) } /> + } + { (this.state.appConfigSchema[key][_key].type === 'string' || this.state.appConfigSchema[key][_key].type === 'folder') && + this.updateInputSettings(event, key, _key) } /> + } + { this.state.appConfigSchema[key][_key].type === 'boolean' && + + + + } + + + ); + } + } + } else { + if (this.state.appConfigSchema[key] && this.state.appConfigSchema[key].display) { + items.push( + + + { this.state.appConfigSchema[key].displayName ? this.state.appConfigSchema[key].displayName : key } + { this.state.appConfigSchema[key].info && + + } + + + { this.state.appConfigSchema[key].type === 'number' && + this.updateInputSettings(event, key) } /> + } + { (this.state.appConfigSchema[key].type === 'string' || this.state.appConfigSchema[key].type === 'folder') && + this.updateInputSettings(event, key) } /> + } + { this.state.appConfigSchema[key].type === 'boolean' && + + + + } + + + ); + } + } + } + + items.push( + + + KMD main sync only + + + + + + + + + ); + + return items; + } + + updateInput(e) { + this.setState({ + [e.target.name]: e.target.value, + }); + } + + updateInputSettings(e, parentKey, childKey) { + let _appSettings = this.state.appSettings; + let _appSettingsPrev = Object.assign({}, _appSettings); + + if (!childKey && this.state.appConfigSchema[parentKey].type === 'boolean') { + _appSettings[parentKey] = typeof _appSettings[parentKey] !== undefined ? !_appSettings[parentKey] : !this.state.appSettings[parentKey]; + } else if (childKey && this.state.appConfigSchema[parentKey][childKey].type === 'boolean') { + _appSettings[parentKey][childKey] = typeof _appSettings[parentKey][childKey] !== undefined ? !_appSettings[parentKey][childKey] : !this.state.appSettings[parentKey][childKey]; + } else if ((!childKey && this.state.appConfigSchema[parentKey].type === 'number') || (childKey && this.state.appConfigSchema[parentKey][childKey].type === 'number')) { + if (e.target.value === '') { + _appSettings[e.target.name] = _appSettingsPrev[e.target.name]; + } else { + _appSettings[e.target.name] = e.target.value.replace(/[^0-9]+/g, ''); + } + } else { + _appSettings[e.target.name] = e.target.value; + } + + this.setState({ + appSettings: _appSettings, + }); + } + + render() { + return ( +
    +

    + { translate('SETTINGS.CONFIG_RESTART_REQUIRED') } +

    +
    + + + { this.renderConfigEditForm() } + +
    +
    +
    + + +
    +
    +); + }; +} + +const mapStateToProps = (state) => { + return { + Settings: state.Settings, + Dashboard: { + skipFullDashboardUpdate: state.Dashboard.skipFullDashboardUpdate, + } + }; +}; + +export default connect(mapStateToProps)(AppSettingsPanel); diff --git a/react/src/components/dashboard/settings/settings.cliPanel.js b/react/src/components/dashboard/settings/settings.cliPanel.js new file mode 100644 index 0000000..3e8d5e0 --- /dev/null +++ b/react/src/components/dashboard/settings/settings.cliPanel.js @@ -0,0 +1,206 @@ +import React from 'react'; +import { connect } from 'react-redux'; +import { translate } from '../../../translate/translate'; +import { + shepherdCli, +} from '../../../actions/actionCreators'; +import Store from '../../../store'; + +class CliPanel extends React.Component { + constructor() { + super(); + this.state = { + cliCmdString: '', + cliCoin: null, + cliResponse: null, + }; + } + + renderActiveCoinsList(mode) { + const modes = [ + 'native', + 'basilisk', + 'full' + ]; + + const allCoins = this.props.Main.coins; + let items = []; + + if (allCoins) { + if (mode === 'all') { + modes.map(function(mode) { + allCoins[mode].map(function(coin) { + items.push( + + ); + }); + }); + } else { + allCoins[mode].map(function(coin) { + items.push( + + ); + }); + } + + return items; + } else { + return null; + } + } + + // TODO: rerender only if prop is changed + renderCliResponse() { + const _cliResponse = this.props.Settings.cli; + let _items = []; + + if (_cliResponse) { + let _cliResponseParsed; + let responseType; + + try { + _cliResponseParsed = JSON.parse(_cliResponse.result); + } catch(e) { + _cliResponseParsed = _cliResponse.result; + } + + if (Object.prototype.toString.call(_cliResponseParsed) === '[object Array]') { + responseType = 'array'; + + for (let i = 0; i < _cliResponseParsed.length; i++) { + _items.push( +
    { JSON.stringify(_cliResponseParsed[i], null, '\t') }
    + ); + } + } + if (Object.prototype.toString.call(_cliResponseParsed) === '[object]' || + typeof _cliResponseParsed === 'object') { + responseType = 'object'; + + _items.push( +
    { JSON.stringify(_cliResponseParsed, null, '\t') }
    + ); + } + if (Object.prototype.toString.call(_cliResponseParsed) === 'number' || + typeof _cliResponseParsed === 'boolean' || + _cliResponseParsed === 'wrong cli string format') { + responseType = 'number'; + + _items.push( +
    { _cliResponseParsed.toString() }
    + ); + } + + if (responseType !== 'number' && + responseType !== 'array' && + responseType !== 'object' && + _cliResponseParsed.indexOf('\n') > -1) { + _cliResponseParsed = _cliResponseParsed.split('\n'); + + for (let i = 0; i < _cliResponseParsed.length; i++) { + _items.push( +
    { _cliResponseParsed[i] }
    + ); + } + } + + return ( +
    +
    + { translate('SETTINGS.CLI_RESPONSE') }: +
    + { _items } +
    + ); + } else { + return null; + } + } + + execCliCmd() { + Store.dispatch( + shepherdCli( + 'passthru', + this.state.cliCoin, + this.state.cliCmdString + ) + ); + } + + updateInput = (e) => { + this.setState({ + [e.target.name]: e.target.value, + }); + } + + render() { + return ( +
    +

    { translate('INDEX.CLI_SELECT_A_COIN') }

    +
    +
    +
    + + +
    +
    + + +
    +
    + +
    +
    +
    + { this.renderCliResponse() } +
    +
    +
    +
    +); + }; +} + +const mapStateToProps = (state) => { + return { + Main: { + coins: state.Main.coins, + }, + Settings: state.Settings, + }; +}; + +export default connect(mapStateToProps)(CliPanel); diff --git a/react/src/components/dashboard/settings/settings.debugLogPanel.js b/react/src/components/dashboard/settings/settings.debugLogPanel.js new file mode 100644 index 0000000..a16e1bf --- /dev/null +++ b/react/src/components/dashboard/settings/settings.debugLogPanel.js @@ -0,0 +1,114 @@ +import React from 'react'; +import { connect } from 'react-redux'; +import { translate } from '../../../translate/translate'; +import Config from '../../../config'; +import { + getDebugLog, +} from '../../../actions/actionCreators'; +import Store from '../../../store'; + +class DebugLogPanel extends React.Component { + constructor() { + super(); + this.state = { + debugLinesCount: 10, + debugTarget: 'iguana', + nativeOnly: Config.iguanaLessMode, + }; + this.readDebugLog = this.readDebugLog.bind(this); + this.updateInput = this.updateInput.bind(this); + } + + readDebugLog() { + Store.dispatch( + getDebugLog( + this.state.debugTarget, + this.state.debugLinesCount + ) + ); + } + + renderDebugLogData() { + if (this.props.Settings.debugLog) { + const _debugLogDataRows = this.props.Settings.debugLog.split('\n'); + + if (_debugLogDataRows && + _debugLogDataRows.length) { + return _debugLogDataRows.map((_row) => +
    { _row }
    + ); + } else { + return ( + { translate('INDEX.EMPTY_DEBUG_LOG') } + ); + } + } else { + return null; + } + } + + updateInput(e) { + this.setState({ + [e.target.name]: e.target.value, + }); + } + + render() { + return ( +
    +

    { translate('INDEX.DEBUG_LOG_DESC') }

    +
    +
    +
    + + +
    +
    + + +
    +
    + +
    +
    +
    { this.renderDebugLogData() }
    +
    +
    +
    +); + }; +} + +const mapStateToProps = (state) => { + return { + Settings: state.Settings + }; +}; + +export default connect(mapStateToProps)(DebugLogPanel); diff --git a/react/src/components/dashboard/settings/settings.importKeys.js b/react/src/components/dashboard/settings/settings.importKeys.js index 4a3d31a..e4713ae 100644 --- a/react/src/components/dashboard/settings/settings.importKeys.js +++ b/react/src/components/dashboard/settings/settings.importKeys.js @@ -1,6 +1,5 @@ import React from 'react'; import { translate } from '../../../translate/translate'; -import { connect } from 'react-redux'; import { importPrivKey, } from '../../../actions/actionCreators'; diff --git a/react/src/components/dashboard/settings/settings.js b/react/src/components/dashboard/settings/settings.js index 29fa294..6101f12 100644 --- a/react/src/components/dashboard/settings/settings.js +++ b/react/src/components/dashboard/settings/settings.js @@ -4,18 +4,14 @@ import { translate } from '../../../translate/translate'; import Config from '../../../config'; import { iguanaActiveHandle, - getDebugLog, + getAppConfig, getPeersList, addPeerNode, - getAppConfig, - saveAppConfig, - resetAppConfig, getAppInfo, shepherdCli, checkForUpdateUIPromise, updateUIPromise, triggerToaster, - skipFullDashboardUpdate, } from '../../../actions/actionCreators'; import Store from '../../../store'; @@ -31,6 +27,10 @@ import WalletBackupTab from './settings.walletBackupTab'; import FiatCurrencyTab from './settings.fiatCurrency'; import ExportKeysTab from './settings.exportKeys'; import ImportKeysTab from './settings.importKeys'; +import DebugLogPanel from './settings.debugLogPanel'; +import AppSettingsPanel from './settings.appSettings'; +import CliPanel from './settings.cliPanel'; +import SupportPanel from './settings.supportPanel'; import { SocketProvider } from 'socket.io-react'; import io from 'socket.io-client'; @@ -52,15 +52,8 @@ class Settings extends React.Component { super(); this.state = { activeTab: 0, - debugLinesCount: 10, - debugTarget: 'iguana', activeTabHeight: '0', - appSettings: {}, - appConfigSchema: {}, tabElId: null, - cliCmdString: '', - cliCoin: null, - cliResponse: null, seedInputVisibility: false, nativeOnly: Config.iguanaLessMode, updatePatch: null, @@ -70,17 +63,9 @@ class Settings extends React.Component { disableWalletSpecificUI: false, }; this.updateInput = this.updateInput.bind(this); - this.readDebugLog = this.readDebugLog.bind(this); - this._saveAppConfig = this._saveAppConfig.bind(this); - this._resetAppConfig = this._resetAppConfig.bind(this); this._checkForUpdateUIPromise = this._checkForUpdateUIPromise.bind(this); this._updateUIPromise = this._updateUIPromise.bind(this); this.updateTabDimensions = this.updateTabDimensions.bind(this); - this._skipFullDashboardUpdate = this._skipFullDashboardUpdate.bind(this); - } - - _skipFullDashboardUpdate() { - Store.dispatch(skipFullDashboardUpdate(!this.props.Dashboard.skipFullDashboardUpdate)); } updateTabDimensions() { @@ -99,16 +84,6 @@ class Settings extends React.Component { componentWillMount() { socket.on('patch', msg => this.updateSocketsData(msg)); window.addEventListener('resize', this.updateTabDimensions); - - try { - const _appConfigSchema = window.require('electron').remote.getCurrentWindow().appConfigSchema; - const _appSettings = this.props.Settings.appSettings ? this.props.Settings.appSettings : Object.assign({}, window.require('electron').remote.getCurrentWindow().appConfig); - - this.setState(Object.assign({}, this.state, { - appConfigSchema: _appConfigSchema, - appSettings: _appSettings, - })); - } catch(e) {} } componentWillUnmount() { @@ -143,29 +118,6 @@ class Settings extends React.Component { } } - openExternalWindow(url) { - const remote = window.require('electron').remote; - const BrowserWindow = remote.BrowserWindow; - - const externalWindow = new BrowserWindow({ - width: 1280, - height: 800, - title: `${translate('INDEX.LOADING')}...`, - icon: remote.getCurrentWindow().iguanaIcon, - }); - - externalWindow.loadURL(url); - externalWindow.webContents.on('did-finish-load', function() { - setTimeout(function() { - externalWindow.show(); - }, 40); - }); - } - - _resetAppConfig() { - Store.dispatch(resetAppConfig()); - } - updateSocketsData(data) { if (data && data.msg && @@ -280,16 +232,6 @@ class Settings extends React.Component { } } - execCliCmd() { - Store.dispatch( - shepherdCli( - 'passthru', - this.state.cliCoin, - this.state.cliCmdString - ) - ); - } - openTab(elemId, tab) { setTimeout(() => { const _height = document.querySelector(`#${elemId} .panel-collapse .panel-body`).offsetHeight; @@ -313,15 +255,6 @@ class Settings extends React.Component { }, 100); } - readDebugLog() { - Store.dispatch( - getDebugLog( - this.state.debugTarget, - this.state.debugLinesCount - ) - ); - } - renderAppInfoTab() { const releaseInfo = this.props.Settings.appInfo && this.props.Settings.appInfo.releaseInfo; @@ -359,224 +292,20 @@ class Settings extends React.Component { return } - updateInputSettings(e, parentKey, childKey) { - let _appSettings = this.state.appSettings; - let _appSettingsPrev = Object.assign({}, _appSettings); - - if (!childKey && this.state.appConfigSchema[parentKey].type === 'boolean') { - _appSettings[parentKey] = typeof _appSettings[parentKey] !== undefined ? !_appSettings[parentKey] : !this.state.appSettings[parentKey]; - } else if (childKey && this.state.appConfigSchema[parentKey][childKey].type === 'boolean') { - _appSettings[parentKey][childKey] = typeof _appSettings[parentKey][childKey] !== undefined ? !_appSettings[parentKey][childKey] : !this.state.appSettings[parentKey][childKey]; - } else if ((!childKey && this.state.appConfigSchema[parentKey].type === 'number') || (childKey && this.state.appConfigSchema[parentKey][childKey].type === 'number')) { - if (e.target.value === '') { - _appSettings[e.target.name] = _appSettingsPrev[e.target.name]; - } else { - _appSettings[e.target.name] = e.target.value.replace(/[^0-9]+/g, ''); - } - } else { - _appSettings[e.target.name] = e.target.value; - } - - this.setState({ - appSettings: _appSettings, - }); + renderDebugLog() { + return } - _saveAppConfig() { - const _appSettings = this.state.appSettings; - let _appSettingsPristine = Object.assign({}, this.props.Settings.appSettings); - let isError = false; - let saveAfterPathCheck = false; - - for (let key in _appSettings) { - if (key.indexOf('__') === -1) { - _appSettingsPristine[key] = this.state.appConfigSchema[key].type === 'number' ? Number(_appSettings[key]) : _appSettings[key]; - - if (this.state.appConfigSchema[key].type === 'folder' && - _appSettings[key] && - _appSettings[key].length) { - const _testLocation = window.require('electron').remote.getCurrentWindow().testLocation; - saveAfterPathCheck = true; - - _testLocation(_appSettings[key]) - .then((res) => { - if (res === -1) { - isError = true; - Store.dispatch( - triggerToaster( - translate('TOASTR.KOMODO_DATADIR_INVALID'), - translate('INDEX.SETTINGS'), - 'error' - ) - ); - } else if (res === false) { - isError = true; - Store.dispatch( - triggerToaster( - translate('TOASTR.KOMODO_DATADIR_NOT_DIR'), - translate('INDEX.SETTINGS'), - 'error' - ) - ); - } else { - Store.dispatch(saveAppConfig(_appSettingsPristine)); - } - }); - } - } else { - const _nestedKey = key.split('__'); - _appSettingsPristine[_nestedKey[0]][_nestedKey[1]] = this.state.appConfigSchema[_nestedKey[0]][_nestedKey[1]].type === 'number' ? Number(_appSettings[key]) : _appSettings[key]; - } - } - - if (!saveAfterPathCheck) { - Store.dispatch(saveAppConfig(_appSettingsPristine)); - } + renderAppSettings() { + return + } + + renderCliPanel() { + return } - renderConfigEditForm() { - let items = []; - const _appConfig = this.state.appSettings; - for (let key in _appConfig) { - if (this.state.appConfigSchema[key] && typeof _appConfig[key] === 'object') { - if (this.state.appConfigSchema[key].display) { - items.push( - - - { this.state.appConfigSchema[key].displayName ? this.state.appConfigSchema[key].displayName : key } - { this.state.appConfigSchema[key].info && - - } - - - - ); - - for (let _key in _appConfig[key]) { - items.push( - - - { this.state.appConfigSchema[key][_key].displayName ? this.state.appConfigSchema[key][_key].displayName : _key } - { this.state.appConfigSchema[key][_key].info && - - } - - - { this.state.appConfigSchema[key][_key].type === 'number' && - this.updateInputSettings(event, key, _key) } /> - } - { (this.state.appConfigSchema[key][_key].type === 'string' || this.state.appConfigSchema[key][_key].type === 'folder') && - this.updateInputSettings(event, key, _key) } /> - } - { this.state.appConfigSchema[key][_key].type === 'boolean' && - - - - } - - - ); - } - } - } else { - if (this.state.appConfigSchema[key] && this.state.appConfigSchema[key].display) { - items.push( - - - { this.state.appConfigSchema[key].displayName ? this.state.appConfigSchema[key].displayName : key } - { this.state.appConfigSchema[key].info && - - } - - - { this.state.appConfigSchema[key].type === 'number' && - this.updateInputSettings(event, key) } /> - } - { (this.state.appConfigSchema[key].type === 'string' || this.state.appConfigSchema[key].type === 'folder') && - this.updateInputSettings(event, key) } /> - } - { this.state.appConfigSchema[key].type === 'boolean' && - - - - } - - - ); - } - } - } - - items.push( - - - KMD main sync only - - - - - - - - - ); - - return items; + renderSupportPanel() { + return } updateInput(e) { @@ -585,136 +314,6 @@ class Settings extends React.Component { }); } - renderDebugLogData() { - if (this.props.Settings.debugLog) { - const _debugLogDataRows = this.props.Settings.debugLog.split('\n'); - - if (_debugLogDataRows && - _debugLogDataRows.length) { - return _debugLogDataRows.map((_row) => -
    { _row }
    - ); - } else { - return ( - { translate('INDEX.EMPTY_DEBUG_LOG') } - ); - } - } else { - return null; - } - } - - // TODO: rerender only if prop is changed - renderCliResponse() { - const _cliResponse = this.props.Settings.cli; - let _items = []; - - if (_cliResponse) { - let _cliResponseParsed; - let responseType; - - try { - _cliResponseParsed = JSON.parse(_cliResponse.result); - } catch(e) { - _cliResponseParsed = _cliResponse.result; - } - - if (Object.prototype.toString.call(_cliResponseParsed) === '[object Array]') { - responseType = 'array'; - - for (let i = 0; i < _cliResponseParsed.length; i++) { - _items.push( -
    { JSON.stringify(_cliResponseParsed[i], null, '\t') }
    - ); - } - } - if (Object.prototype.toString.call(_cliResponseParsed) === '[object]' || - typeof _cliResponseParsed === 'object') { - responseType = 'object'; - - _items.push( -
    { JSON.stringify(_cliResponseParsed, null, '\t') }
    - ); - } - if (Object.prototype.toString.call(_cliResponseParsed) === 'number' || - typeof _cliResponseParsed === 'boolean' || - _cliResponseParsed === 'wrong cli string format') { - responseType = 'number'; - - _items.push( -
    { _cliResponseParsed.toString() }
    - ); - } - - if (responseType !== 'number' && - responseType !== 'array' && - responseType !== 'object' && - _cliResponseParsed.indexOf('\n') > -1) { - _cliResponseParsed = _cliResponseParsed.split('\n'); - - for (let i = 0; i < _cliResponseParsed.length; i++) { - _items.push( -
    { _cliResponseParsed[i] }
    - ); - } - } - - return ( -
    -
    - { translate('SETTINGS.CLI_RESPONSE') }: -
    - { _items } -
    - ); - } else { - return null; - } - } - - renderActiveCoinsList(mode) { - const modes = [ - 'native', - 'basilisk', - 'full' - ]; - - const allCoins = this.props.Main.coins; - let items = []; - - if (allCoins) { - if (mode === 'all') { - modes.map(function(mode) { - allCoins[mode].map(function(coin) { - items.push( - - ); - }); - }); - } else { - allCoins[mode].map(function(coin) { - items.push( - - ); - }); - } - - return items; - } else { - return null; - } - } - render() { return SettingsRender.call(this); } diff --git a/react/src/components/dashboard/settings/settings.render.js b/react/src/components/dashboard/settings/settings.render.js index 2886646..ececb05 100644 --- a/react/src/components/dashboard/settings/settings.render.js +++ b/react/src/components/dashboard/settings/settings.render.js @@ -130,50 +130,7 @@ export const SettingsRender = function() {
    -
    -

    { translate('INDEX.DEBUG_LOG_DESC') }

    -
    -
    -
    - - -
    -
    - - -
    -
    - -
    -
    -
    { this.renderDebugLogData() }
    -
    -
    -
    + { this.renderDebugLog() }
    @@ -189,28 +146,7 @@ export const SettingsRender = function() {
    -
    -

    - { translate('SETTINGS.CONFIG_RESTART_REQUIRED') } -

    -
    - - - { this.renderConfigEditForm() } - -
    -
    -
    - - -
    -
    + { this.renderAppSettings() }
    @@ -243,53 +179,7 @@ export const SettingsRender = function() {
    -
    -

    { translate('INDEX.CLI_SELECT_A_COIN') }

    -
    -
    -
    - - -
    -
    - - -
    -
    - -
    -
    -
    - { this.renderCliResponse() } -
    -
    -
    -
    + { this.renderCliPanel() }
    } @@ -306,7 +196,7 @@ export const SettingsRender = function() {
    - { this.renderAppUpdateTab() } + { this.renderAppUpdateTab() }
    @@ -322,54 +212,7 @@ export const SettingsRender = function() {
    -
    -
    -
    -
    this.openExternalWindow('http://support.supernet.org') }> - Support tickets -
    { translate('SETTINGS.SUPPORT_TICKETS') }
    -
    support.supernet.org
    -
    -
    -
    -
    this.openExternalWindow('https://sprnt.slack.com') }> - Slack -
    Slack
    -
    sprnt.slack.com
    -
    -
    -
    -
    this.openExternalWindow('http://slackinvite.supernet.org') }> - Slack invite -
    { translate('SETTINGS.GET_SLACK_INVITE') }
    -
    slackinvite.supernet.org
    -
    -
    -
    -
    this.openExternalWindow('https://github.com/SuperNETorg/Agama') }> - Github -
    Github
    -
    github.com/SuperNETorg/Agama
    -
    -
    -
    -
    + { this.renderSupportPanel() }
    diff --git a/react/src/components/dashboard/settings/settings.supportPanel.js b/react/src/components/dashboard/settings/settings.supportPanel.js new file mode 100644 index 0000000..971ff4b --- /dev/null +++ b/react/src/components/dashboard/settings/settings.supportPanel.js @@ -0,0 +1,82 @@ +import React from 'react'; +import { translate } from '../../../translate/translate'; + +class SupportPanel extends React.Component { + constructor() { + super(); + } + + openExternalWindow(url) { + const remote = window.require('electron').remote; + const BrowserWindow = remote.BrowserWindow; + + const externalWindow = new BrowserWindow({ + width: 1280, + height: 800, + title: `${translate('INDEX.LOADING')}...`, + icon: remote.getCurrentWindow().iguanaIcon, + }); + + externalWindow.loadURL(url); + externalWindow.webContents.on('did-finish-load', function() { + setTimeout(function() { + externalWindow.show(); + }, 40); + }); + } + + render() { + return ( +
    +
    +
    +
    this.openExternalWindow('http://support.supernet.org') }> + Support tickets +
    { translate('SETTINGS.SUPPORT_TICKETS') }
    +
    support.supernet.org
    +
    +
    +
    +
    this.openExternalWindow('https://sprnt.slack.com') }> + Slack +
    Slack
    +
    sprnt.slack.com
    +
    +
    +
    +
    this.openExternalWindow('http://slackinvite.supernet.org') }> + Slack invite +
    { translate('SETTINGS.GET_SLACK_INVITE') }
    +
    slackinvite.supernet.org
    +
    +
    +
    +
    this.openExternalWindow('https://github.com/SuperNETorg/Agama') }> + Github +
    Github
    +
    github.com/SuperNETorg/Agama
    +
    +
    +
    +
    +); + }; +} + +export default SupportPanel; \ No newline at end of file From 0bf22157e16fce0a02b7f882af8edbce9f64baf0 Mon Sep 17 00:00:00 2001 From: Miika Turunen Date: Sun, 10 Sep 2017 23:17:48 +0300 Subject: [PATCH 60/83] Rename components --- ...addNodeTab.js => settings.addNodePanel.js} | 4 +- .../settings.addNodeforCoin.render.js | 91 ------------------- ...appInfoTab.js => settings.appInfoPanel.js} | 4 +- ...ttings.js => settings.appSettingsPanel.js} | 0 ...pdateTab.js => settings.appUpdatePanel.js} | 4 +- ...ortKeys.js => settings.exportKeysPanel.js} | 4 +- ...rency.js => settings.fiatCurrencyPanel.js} | 4 +- ...ortKeys.js => settings.importKeysPanel.js} | 4 +- .../components/dashboard/settings/settings.js | 36 ++++---- ...upTab.js => settings.walletBackupPanel.js} | 4 +- ...letInfo.js => settings.walletInfoPanel.js} | 4 +- 11 files changed, 34 insertions(+), 125 deletions(-) rename react/src/components/dashboard/settings/{settings.addNodeTab.js => settings.addNodePanel.js} (98%) delete mode 100644 react/src/components/dashboard/settings/settings.addNodeforCoin.render.js rename react/src/components/dashboard/settings/{settings.appInfoTab.js => settings.appInfoPanel.js} (96%) rename react/src/components/dashboard/settings/{settings.appSettings.js => settings.appSettingsPanel.js} (100%) rename react/src/components/dashboard/settings/{settings.appUpdateTab.js => settings.appUpdatePanel.js} (97%) rename react/src/components/dashboard/settings/{settings.exportKeys.js => settings.exportKeysPanel.js} (98%) rename react/src/components/dashboard/settings/{settings.fiatCurrency.js => settings.fiatCurrencyPanel.js} (78%) rename react/src/components/dashboard/settings/{settings.importKeys.js => settings.importKeysPanel.js} (95%) rename react/src/components/dashboard/settings/{settings.walletBackupTab.js => settings.walletBackupPanel.js} (77%) rename react/src/components/dashboard/settings/{settings.walletInfo.js => settings.walletInfoPanel.js} (93%) diff --git a/react/src/components/dashboard/settings/settings.addNodeTab.js b/react/src/components/dashboard/settings/settings.addNodePanel.js similarity index 98% rename from react/src/components/dashboard/settings/settings.addNodeTab.js rename to react/src/components/dashboard/settings/settings.addNodePanel.js index 796f239..afc9751 100644 --- a/react/src/components/dashboard/settings/settings.addNodeTab.js +++ b/react/src/components/dashboard/settings/settings.addNodePanel.js @@ -13,7 +13,7 @@ import AddCoinOptionsCrypto from '../../addcoin/addcoinOptionsCrypto'; import AddCoinOptionsAC from '../../addcoin/addcoinOptionsAC'; import AddCoinOptionsACFiat from '../../addcoin/addcoinOptionsACFiat'; -class AppNodeTab extends React.Component { +class AddNodePanel extends React.Component { constructor() { super(); this.state = { @@ -198,4 +198,4 @@ const mapStateToProps = (state) => { }; -export default connect(mapStateToProps)(AppNodeTab); \ No newline at end of file +export default connect(mapStateToProps)(AddNodePanel); \ No newline at end of file diff --git a/react/src/components/dashboard/settings/settings.addNodeforCoin.render.js b/react/src/components/dashboard/settings/settings.addNodeforCoin.render.js deleted file mode 100644 index 14236e7..0000000 --- a/react/src/components/dashboard/settings/settings.addNodeforCoin.render.js +++ /dev/null @@ -1,91 +0,0 @@ -import React from 'react'; -import { translate } from '../../../translate/translate'; -import AddCoinOptionsCrypto from '../../addcoin/addcoinOptionsCrypto'; -import AddCoinOptionsAC from '../../addcoin/addcoinOptionsAC'; -import AddCoinOptionsACFiat from '../../addcoin/addcoinOptionsACFiat'; - -
    this.openTab('AddNodeforCoin', 1) } - className={ 'panel' + (this.state.nativeOnly ? ' hide' : '') }> - -
    -
    -
    -
    -
    -

    { translate('INDEX.USE_THIS_SECTION') }

    -
    -
    -
    - -
    -
    -
    - -
    -
    -
    - SuperNET Peers: -
    -

    { this.renderSNPeersList() }

    -
    - Raw Peers: -
    -

    { this.renderPeersList() }

    -
    -
    - -
    -
    -

    { translate('INDEX.USE_THIS_SECTION_PEER') }

    -
    -
    -
    - -
    -
    - -
    -
    -
    - -
    -
    -
    -
    -
    -
    \ No newline at end of file diff --git a/react/src/components/dashboard/settings/settings.appInfoTab.js b/react/src/components/dashboard/settings/settings.appInfoPanel.js similarity index 96% rename from react/src/components/dashboard/settings/settings.appInfoTab.js rename to react/src/components/dashboard/settings/settings.appInfoPanel.js index 48122e5..5204e41 100644 --- a/react/src/components/dashboard/settings/settings.appInfoTab.js +++ b/react/src/components/dashboard/settings/settings.appInfoPanel.js @@ -2,7 +2,7 @@ import React from 'react'; import { translate } from '../../../translate/translate'; import { connect } from 'react-redux'; -class AppInfoTab extends React.Component { +class AppInfoPanel extends React.Component { constructor() { super(); } @@ -88,4 +88,4 @@ const mapStateToProps = (state) => { }; -export default connect(mapStateToProps)(AppInfoTab); \ No newline at end of file +export default connect(mapStateToProps)(AppInfoPanel); \ No newline at end of file diff --git a/react/src/components/dashboard/settings/settings.appSettings.js b/react/src/components/dashboard/settings/settings.appSettingsPanel.js similarity index 100% rename from react/src/components/dashboard/settings/settings.appSettings.js rename to react/src/components/dashboard/settings/settings.appSettingsPanel.js diff --git a/react/src/components/dashboard/settings/settings.appUpdateTab.js b/react/src/components/dashboard/settings/settings.appUpdatePanel.js similarity index 97% rename from react/src/components/dashboard/settings/settings.appUpdateTab.js rename to react/src/components/dashboard/settings/settings.appUpdatePanel.js index 0319d9e..902a83b 100644 --- a/react/src/components/dashboard/settings/settings.appUpdateTab.js +++ b/react/src/components/dashboard/settings/settings.appUpdatePanel.js @@ -11,7 +11,7 @@ let updateProgressBar = { patch: -1, }; -class AppUpdateTab extends React.Component { +class AppUpdatePanel extends React.Component { constructor() { super(); this.state = { @@ -133,4 +133,4 @@ const mapStateToProps = (state) => { }; -export default connect(mapStateToProps)(AppUpdateTab); +export default connect(mapStateToProps)(AppUpdatePanel); diff --git a/react/src/components/dashboard/settings/settings.exportKeys.js b/react/src/components/dashboard/settings/settings.exportKeysPanel.js similarity index 98% rename from react/src/components/dashboard/settings/settings.exportKeys.js rename to react/src/components/dashboard/settings/settings.exportKeysPanel.js index c35a34e..53e2a1c 100644 --- a/react/src/components/dashboard/settings/settings.exportKeys.js +++ b/react/src/components/dashboard/settings/settings.exportKeysPanel.js @@ -7,7 +7,7 @@ import { } from '../../../actions/actionCreators'; import Store from '../../../store'; -class ExportKeysTab extends React.Component { +class ExportKeysPanel extends React.Component { constructor() { super(); this.state = { @@ -219,4 +219,4 @@ const mapStateToProps = (state) => { }; -export default connect(mapStateToProps)(ExportKeysTab); \ No newline at end of file +export default connect(mapStateToProps)(ExportKeysPanel); \ No newline at end of file diff --git a/react/src/components/dashboard/settings/settings.fiatCurrency.js b/react/src/components/dashboard/settings/settings.fiatCurrencyPanel.js similarity index 78% rename from react/src/components/dashboard/settings/settings.fiatCurrency.js rename to react/src/components/dashboard/settings/settings.fiatCurrencyPanel.js index 28c4310..4cce17d 100644 --- a/react/src/components/dashboard/settings/settings.fiatCurrency.js +++ b/react/src/components/dashboard/settings/settings.fiatCurrencyPanel.js @@ -2,7 +2,7 @@ import React from 'react'; import { translate } from '../../../translate/translate'; import { connect } from 'react-redux'; -class FiatCurrencyTab extends React.Component { +class FiatCurrencyPanel extends React.Component { constructor() { super(); } @@ -21,4 +21,4 @@ const mapStateToProps = (state) => { }; -export default connect(mapStateToProps)(FiatCurrencyTab); \ No newline at end of file +export default connect(mapStateToProps)(FiatCurrencyPanel); \ No newline at end of file diff --git a/react/src/components/dashboard/settings/settings.importKeys.js b/react/src/components/dashboard/settings/settings.importKeysPanel.js similarity index 95% rename from react/src/components/dashboard/settings/settings.importKeys.js rename to react/src/components/dashboard/settings/settings.importKeysPanel.js index e4713ae..8a26ae9 100644 --- a/react/src/components/dashboard/settings/settings.importKeys.js +++ b/react/src/components/dashboard/settings/settings.importKeysPanel.js @@ -5,7 +5,7 @@ import { } from '../../../actions/actionCreators'; import Store from '../../../store'; -class ImportKeysTab extends React.Component { +class ImportKeysPanel extends React.Component { constructor() { super(); this.state = { @@ -64,4 +64,4 @@ class ImportKeysTab extends React.Component { }; } -export default ImportKeysTab; \ No newline at end of file +export default ImportKeysPanel; \ No newline at end of file diff --git a/react/src/components/dashboard/settings/settings.js b/react/src/components/dashboard/settings/settings.js index 6101f12..b05259e 100644 --- a/react/src/components/dashboard/settings/settings.js +++ b/react/src/components/dashboard/settings/settings.js @@ -19,18 +19,18 @@ import { SettingsRender, } from './settings.render'; -import AppUpdateTab from './settings.appUpdateTab'; -import AppInfoTab from './settings.appInfoTab'; -import WalletInfoTab from './settings.walletInfo'; -import AddNodeTab from './settings.addNodeTab'; -import WalletBackupTab from './settings.walletBackupTab'; -import FiatCurrencyTab from './settings.fiatCurrency'; -import ExportKeysTab from './settings.exportKeys'; -import ImportKeysTab from './settings.importKeys'; -import DebugLogPanel from './settings.debugLogPanel'; -import AppSettingsPanel from './settings.appSettings'; +import AppUpdatePanel from './settings.appUpdatePanel'; +import AppInfoPanel from './settings.appInfoPanel'; +import AddNodePanel from './settings.addNodePanel'; +import AppSettingsPanel from './settings.appSettingsPanel'; import CliPanel from './settings.cliPanel'; +import DebugLogPanel from './settings.debugLogPanel'; +import FiatCurrencyPanel from './settings.fiatCurrencyPanel'; +import ExportKeysPanel from './settings.exportKeysPanel'; +import ImportKeysPanel from './settings.importKeysPanel'; import SupportPanel from './settings.supportPanel'; +import WalletInfoPanel from './settings.walletInfoPanel'; +import WalletBackupPanel from './settings.walletBackupPanel'; import { SocketProvider } from 'socket.io-react'; import io from 'socket.io-client'; @@ -259,37 +259,37 @@ class Settings extends React.Component { const releaseInfo = this.props.Settings.appInfo && this.props.Settings.appInfo.releaseInfo; if (releaseInfo) { - return + return } return null; } renderAppUpdateTab() { - return + return } renderWalletInfo() { - return + return } renderAddNode() { - return + return } renderWalletBackup() { - return + return } renderFiatCurrency() { - return + return } renderExportKeys() { - return + return } renderImportKeys() { - return + return } renderDebugLog() { diff --git a/react/src/components/dashboard/settings/settings.walletBackupTab.js b/react/src/components/dashboard/settings/settings.walletBackupPanel.js similarity index 77% rename from react/src/components/dashboard/settings/settings.walletBackupTab.js rename to react/src/components/dashboard/settings/settings.walletBackupPanel.js index 7043286..d0da2a7 100644 --- a/react/src/components/dashboard/settings/settings.walletBackupTab.js +++ b/react/src/components/dashboard/settings/settings.walletBackupPanel.js @@ -2,7 +2,7 @@ import React from 'react'; import { translate } from '../../../translate/translate'; import { connect } from 'react-redux'; -class WalletBackupTab extends React.Component { +class WalletBackupPanel extends React.Component { constructor() { super(); } @@ -21,4 +21,4 @@ const mapStateToProps = (state) => { }; -export default connect(mapStateToProps)(WalletBackupTab); \ No newline at end of file +export default connect(mapStateToProps)(WalletBackupPanel); \ No newline at end of file diff --git a/react/src/components/dashboard/settings/settings.walletInfo.js b/react/src/components/dashboard/settings/settings.walletInfoPanel.js similarity index 93% rename from react/src/components/dashboard/settings/settings.walletInfo.js rename to react/src/components/dashboard/settings/settings.walletInfoPanel.js index e0c12eb..612ffd2 100644 --- a/react/src/components/dashboard/settings/settings.walletInfo.js +++ b/react/src/components/dashboard/settings/settings.walletInfoPanel.js @@ -2,7 +2,7 @@ import React from 'react'; import { translate } from '../../../translate/translate'; import { connect } from 'react-redux'; -class WalletInfoTab extends React.Component { +class WalletInfoPanel extends React.Component { constructor() { super(); } @@ -58,4 +58,4 @@ const mapStateToProps = (state) => { }; -export default connect(mapStateToProps)(WalletInfoTab); \ No newline at end of file +export default connect(mapStateToProps)(WalletInfoPanel); \ No newline at end of file From 98f45af92228fcdb8f548d1c314ee607a8860a7e Mon Sep 17 00:00:00 2001 From: Miika Turunen Date: Mon, 11 Sep 2017 00:31:38 +0300 Subject: [PATCH 61/83] Split settings tabs to components --- .../settings/settings.appUpdatePanel.js | 17 +++ .../components/dashboard/settings/settings.js | 132 ------------------ 2 files changed, 17 insertions(+), 132 deletions(-) diff --git a/react/src/components/dashboard/settings/settings.appUpdatePanel.js b/react/src/components/dashboard/settings/settings.appUpdatePanel.js index 902a83b..3a07da2 100644 --- a/react/src/components/dashboard/settings/settings.appUpdatePanel.js +++ b/react/src/components/dashboard/settings/settings.appUpdatePanel.js @@ -5,8 +5,14 @@ import Config from '../../../config'; import { getPeersList, checkForUpdateUIPromise, + updateUIPromise, } from '../../../actions/actionCreators'; +import { SocketProvider } from 'socket.io-react'; +import io from 'socket.io-client'; + +const socket = io.connect(`http://127.0.0.1:${Config.agamaPort}`); + let updateProgressBar = { patch: -1, }; @@ -17,6 +23,9 @@ class AppUpdatePanel extends React.Component { this.state = { updatePatch: null, updateLog: [], + updateProgressPatch: null, + updatePatch: null, + updateBins: null, }; this._checkForUpdateUIPromise = this._checkForUpdateUIPromise.bind(this); this._updateUIPromise = this._updateUIPromise.bind(this); @@ -24,6 +33,14 @@ class AppUpdatePanel extends React.Component { } + componentWillMount() { + socket.on('patch', msg => this.updateSocketsData = (msg) => {}); + } + + componentWillUnmount() { + socket.removeAllListeners('patch', msg => this.updateSocketsData(msg)); + } + checkNodes() { if (this.state.getPeersCoin) { Store.dispatch(getPeersList(this.state.getPeersCoin.split('|')[0])); diff --git a/react/src/components/dashboard/settings/settings.js b/react/src/components/dashboard/settings/settings.js index b05259e..42434f6 100644 --- a/react/src/components/dashboard/settings/settings.js +++ b/react/src/components/dashboard/settings/settings.js @@ -9,8 +9,6 @@ import { addPeerNode, getAppInfo, shepherdCli, - checkForUpdateUIPromise, - updateUIPromise, triggerToaster, } from '../../../actions/actionCreators'; import Store from '../../../store'; @@ -32,14 +30,6 @@ import SupportPanel from './settings.supportPanel'; import WalletInfoPanel from './settings.walletInfoPanel'; import WalletBackupPanel from './settings.walletBackupPanel'; -import { SocketProvider } from 'socket.io-react'; -import io from 'socket.io-client'; - -const socket = io.connect(`http://127.0.0.1:${Config.agamaPort}`); -let updateProgressBar = { - patch: -1, -}; - /* TODO: 1) pre-select active coin in add node tab @@ -56,15 +46,9 @@ class Settings extends React.Component { tabElId: null, seedInputVisibility: false, nativeOnly: Config.iguanaLessMode, - updatePatch: null, - updateBins: null, - updateLog: [], - updateProgressPatch: null, disableWalletSpecificUI: false, }; this.updateInput = this.updateInput.bind(this); - this._checkForUpdateUIPromise = this._checkForUpdateUIPromise.bind(this); - this._updateUIPromise = this._updateUIPromise.bind(this); this.updateTabDimensions = this.updateTabDimensions.bind(this); } @@ -82,12 +66,10 @@ class Settings extends React.Component { } componentWillMount() { - socket.on('patch', msg => this.updateSocketsData(msg)); window.addEventListener('resize', this.updateTabDimensions); } componentWillUnmount() { - socket.removeAllListeners('patch', msg => this.updateSocketsData(msg)); window.removeEventListener('resize', this.updateTabDimensions); if (!this.state.disableWalletSpecificUI) { @@ -118,120 +100,6 @@ class Settings extends React.Component { } } - updateSocketsData(data) { - if (data && - data.msg && - data.msg.type === 'ui') { - - if (data.msg.status === 'progress' && - data.msg.progress && - data.msg.progress < 100) { - this.setState(Object.assign({}, this.state, { - updateProgressPatch: data.msg.progress, - })); - updateProgressBar.patch = data.msg.progress; - } else { - if (data.msg.status === 'progress' && - data.msg.progress && - data.msg.progress === 100) { - let _updateLog = []; - _updateLog.push(`${translate('INDEX.UI_UPDATE_DOWNLOADED')}...`); - this.setState(Object.assign({}, this.state, { - updateLog: _updateLog, - })); - updateProgressBar.patch = 100; - } - - if (data.msg.status === 'done') { - let _updateLog = []; - _updateLog.push(translate('INDEX.UI_UPDATED')); - this.setState(Object.assign({}, this.state, { - updateLog: _updateLog, - updatePatch: null, - })); - updateProgressBar.patch = -1; - } - - if (data.msg.status === 'error') { - let _updateLog = []; - _updateLog.push(translate('INDEX.UI_UPDATE_ERROR')); - this.setState(Object.assign({}, this.state, { - updateLog: _updateLog, - })); - updateProgressBar.patch = -1; - } - } - } else { - if (data && - data.msg) { - let _updateLog = this.state.updateLog; - _updateLog.push(data.msg); - this.setState(Object.assign({}, this.state, { - updateLog: _updateLog, - })); - } - } - } - - _checkForUpdateUIPromise() { - let _updateLog = []; - _updateLog.push(translate('INDEX.CHECKING_UI_UPDATE')); - this.setState(Object.assign({}, this.state, { - updateLog: _updateLog, - })); - - checkForUpdateUIPromise() - .then((res) => { - let _updateLog = this.state.updateLog; - _updateLog.push(res.result === 'update' ? (`${translate('INDEX.NEW_UI_UPDATE')} ${res.version.remote}`) : translate('INDEX.YOU_HAVE_LATEST_UI')); - this.setState(Object.assign({}, this.state, { - updatePatch: res.result === 'update' ? true : false, - updateLog: _updateLog, - })); - }); - } - - _updateUIPromise() { - updateProgressBar.patch = 0; - let _updateLog = []; - _updateLog.push(`${translate('INDEX.DOWNLOADING_UI_UPDATE')}...`); - this.setState(Object.assign({}, this.state, { - updateLog: _updateLog, - })); - - updateUIPromise(); - } - - renderUpdateStatus() { - let items = []; - let patchProgressBar = null; - const _updateLogLength = this.state.updateLog.length; - - for (let i = 0; i < _updateLogLength; i++) { - items.push( -
    { this.state.updateLog[i] }
    - ); - } - - if (_updateLogLength) { - return ( -
    -
    -
    { translate('SETTINGS.PROGRESS') }:
    -
    { items }
    -
    -1 ? 'progress progress-sm' : 'hide' }> -
    -
    -
    -
    - ); - } else { - return null; - } - } - openTab(elemId, tab) { setTimeout(() => { const _height = document.querySelector(`#${elemId} .panel-collapse .panel-body`).offsetHeight; From 865398dfcb7c69176693216201fb76bdef6ef10b Mon Sep 17 00:00:00 2001 From: pbca26 Date: Mon, 11 Sep 2017 17:25:36 +0300 Subject: [PATCH 62/83] sidebar coin sort, kmd native at the top --- react/src/components/dashboard/coinTile/coinTileItem.js | 9 +++++++++ .../components/dashboard/walletsNav/walletsNav.render.js | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/react/src/components/dashboard/coinTile/coinTileItem.js b/react/src/components/dashboard/coinTile/coinTileItem.js index 368f009..55c9070 100644 --- a/react/src/components/dashboard/coinTile/coinTileItem.js +++ b/react/src/components/dashboard/coinTile/coinTileItem.js @@ -45,6 +45,7 @@ class CoinTileItem extends React.Component { let _coinSelected = false; let _mode; let _coin; + let _coinMode = {}; const modes = [ 'native', 'basilisk', @@ -60,8 +61,16 @@ class CoinTileItem extends React.Component { _coin = coin; _mode = mode; } + _coinMode[coin] = mode; }); + + if (_coinMode['KMD'] && + _coinMode['KMD'] === 'native') { + _coin = 'KMD'; + _mode = 'native'; + } }); + setTimeout(() => { this._dashboardChangeActiveCoin(_coin, _mode); }, 100); diff --git a/react/src/components/dashboard/walletsNav/walletsNav.render.js b/react/src/components/dashboard/walletsNav/walletsNav.render.js index 6fae2e2..b22e212 100644 --- a/react/src/components/dashboard/walletsNav/walletsNav.render.js +++ b/react/src/components/dashboard/walletsNav/walletsNav.render.js @@ -52,7 +52,7 @@ export const WalletsNavWithWalletRender = function() { onClick={ this.props.ActiveCoin.mode !== 'native' ? this.toggleSendReceiveCoinForms : this.toggleNativeWalletTransactions }> { translate('INDEX.TRANSACTIONS') } - { ((this.props.ActiveCoin.mode === 'full' && this.checkTotalBalance() > 0) || this.props.ActiveCoin.mode === 'basilisk') && + { (((this.props.ActiveCoin.mode === 'full' || this.props.ActiveCoin.mode === 'native') && this.checkTotalBalance() > 0) || this.props.ActiveCoin.mode === 'basilisk') && - -
    -
    { this.renderDebugLogData() }
    -
    - +
    + + + Show app runtime log + +
    + { !this.state.toggleAppRuntimeLog && +
    +
    + + +
    +
    + + +
    +
    + +
    +
    +
    { this.renderDebugLogData() }
    +
    +
    + } + { this.state.toggleAppRuntimeLog && +
    { this.renderAppRuntimeLog() }
    + } diff --git a/react/src/components/dashboard/settings/settings.scss b/react/src/components/dashboard/settings/settings.scss index f6297d8..bc1a47c 100644 --- a/react/src/components/dashboard/settings/settings.scss +++ b/react/src/components/dashboard/settings/settings.scss @@ -69,6 +69,12 @@ .toggle { position: relative; top: 4px; + + .title { + position: relative; + top: -12px; + left: 12px; + } } table { width: 100%; diff --git a/react/src/components/dashboard/walletsNav/walletsNav.js b/react/src/components/dashboard/walletsNav/walletsNav.js index b8eca55..fbcb274 100644 --- a/react/src/components/dashboard/walletsNav/walletsNav.js +++ b/react/src/components/dashboard/walletsNav/walletsNav.js @@ -132,7 +132,7 @@ const mapStateToProps = (state) => { balance: state.ActiveCoin.balance, cache: state.ActiveCoin.cache, activeSection: state.ActiveCoin.activeSection, - activeAddress: state.ActiveCoin.activeAddress + activeAddress: state.ActiveCoin.activeAddress, }, Dashboard: { activeHandle: state.Dashboard.activeHandle, diff --git a/react/src/components/dashboard/walletsNav/walletsNav.render.js b/react/src/components/dashboard/walletsNav/walletsNav.render.js index b22e212..7e71cfc 100644 --- a/react/src/components/dashboard/walletsNav/walletsNav.render.js +++ b/react/src/components/dashboard/walletsNav/walletsNav.render.js @@ -52,14 +52,13 @@ export const WalletsNavWithWalletRender = function() { onClick={ this.props.ActiveCoin.mode !== 'native' ? this.toggleSendReceiveCoinForms : this.toggleNativeWalletTransactions }> { translate('INDEX.TRANSACTIONS') } - { (((this.props.ActiveCoin.mode === 'full' || this.props.ActiveCoin.mode === 'native') && this.checkTotalBalance() > 0) || this.props.ActiveCoin.mode === 'basilisk') && - - } + - -
    -
    { this.renderDebugLogData() }
    -
    - +
    + + + Show app runtime log + +
    + { !this.state.toggleAppRuntimeLog && +
    +
    + + +
    +
    + + +
    +
    + +
    +
    +
    { this.renderDebugLogData() }
    +
    +
    + } + { this.state.toggleAppRuntimeLog && +
    { this.renderAppRuntimeLog() }
    + } ); }; diff --git a/react/src/components/dashboard/settings/settings.js b/react/src/components/dashboard/settings/settings.js index 8147b0f..4351455 100644 --- a/react/src/components/dashboard/settings/settings.js +++ b/react/src/components/dashboard/settings/settings.js @@ -47,52 +47,8 @@ class Settings extends React.Component { seedInputVisibility: false, nativeOnly: Config.iguanaLessMode, disableWalletSpecificUI: false, - appRuntimeLog: [], - toggleAppRuntimeLog: false, }; this.updateInput = this.updateInput.bind(this); - this.getAppRuntimeLog = this.getAppRuntimeLog.bind(this); - this.toggleAppRuntimeLog = this.toggleAppRuntimeLog.bind(this); - this.renderAppRuntimeLog = this.renderAppRuntimeLog.bind(this); - } - - renderAppRuntimeLog() { - let _items = []; - const _appRuntimeLog = this.state.appRuntimeLog; - - for (let i = 0; i < _appRuntimeLog.length; i++) { - _items.push( -

    - { secondsToString(_appRuntimeLog[i].time, true) } - { JSON.stringify(_appRuntimeLog[i].msg, null, '').replace('\\n', ' ') } -

    - ); - } - - return _items; - } - - toggleAppRuntimeLog() { - this.setState(Object.assign({}, this.state, { - toggleAppRuntimeLog: !this.state.toggleAppRuntimeLog, - })); - - this.getAppRuntimeLog(); - } - - getAppRuntimeLog() { - let _appRuntimeLog; - - try { - _appRuntimeLog = window.require('electron').remote.getCurrentWindow().getAppRuntimeLog; - } catch (e) {} - - _appRuntimeLog() - .then((json) => { - this.setState(Object.assign({}, this.state, { - appRuntimeLog: json, - })); - }); } componentDidMount(props) { diff --git a/react/src/components/dashboard/settings/settings.render.js b/react/src/components/dashboard/settings/settings.render.js index ac15a9c..33682a8 100644 --- a/react/src/components/dashboard/settings/settings.render.js +++ b/react/src/components/dashboard/settings/settings.render.js @@ -129,72 +129,8 @@ export const SettingsRender = function() {
    -
    -

    { translate('INDEX.DEBUG_LOG_DESC') }

    -
    - - - Show app runtime log - -
    - { !this.state.toggleAppRuntimeLog && -
    -
    - - -
    -
    - - -
    -
    - -
    -
    -
    { this.renderDebugLogData() }
    -
    -
    - } - { this.state.toggleAppRuntimeLog && -
    { this.renderAppRuntimeLog() }
    - } -
    + style={{ height: this.state.activeTab === 6 ? `auto` : '0' }}> + { this.renderDebugLog() }
    From c0dc58a1e2d2f729652a52d70986f9168b4ce053 Mon Sep 17 00:00:00 2001 From: Miika Turunen Date: Tue, 12 Sep 2017 23:33:35 +0300 Subject: [PATCH 66/83] Fixed import --- .../src/components/dashboard/settings/settings.debugLogPanel.js | 1 + react/src/components/dashboard/settings/settings.js | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/react/src/components/dashboard/settings/settings.debugLogPanel.js b/react/src/components/dashboard/settings/settings.debugLogPanel.js index bb39fdc..ff061b2 100644 --- a/react/src/components/dashboard/settings/settings.debugLogPanel.js +++ b/react/src/components/dashboard/settings/settings.debugLogPanel.js @@ -2,6 +2,7 @@ import React from 'react'; import { connect } from 'react-redux'; import { translate } from '../../../translate/translate'; import Config from '../../../config'; +import { secondsToString } from '../../../util/time'; import { getDebugLog, } from '../../../actions/actionCreators'; diff --git a/react/src/components/dashboard/settings/settings.js b/react/src/components/dashboard/settings/settings.js index 4351455..59d5343 100644 --- a/react/src/components/dashboard/settings/settings.js +++ b/react/src/components/dashboard/settings/settings.js @@ -13,7 +13,6 @@ import { } from '../../../actions/actionCreators'; import Store from '../../../store'; -import { secondsToString } from '../../../util/time'; import { SettingsRender, } from './settings.render'; From a32b711ec544c6c52cf3627a31fdb461af197c4b Mon Sep 17 00:00:00 2001 From: Miika Turunen Date: Tue, 12 Sep 2017 23:36:48 +0300 Subject: [PATCH 67/83] Remove tests --- .../dashboard/accordion/accordion.js | 140 ------------------ .../dashboard/accordion/loginModal.render.js | 67 --------- 2 files changed, 207 deletions(-) delete mode 100755 react/src/components/dashboard/accordion/accordion.js delete mode 100644 react/src/components/dashboard/accordion/loginModal.render.js diff --git a/react/src/components/dashboard/accordion/accordion.js b/react/src/components/dashboard/accordion/accordion.js deleted file mode 100755 index 631f815..0000000 --- a/react/src/components/dashboard/accordion/accordion.js +++ /dev/null @@ -1,140 +0,0 @@ -import React from 'react'; -import AnimateMixin from 'react-animate'; -/** - * Accordion object that maintains a list of content containers and their collapsed or expanded state - * @type {*|Function} - */ -class Accordion extends React.Component { - /** - * Mixin the AnimateMixin - */ - mixins: [AnimateMixin], - /** - * Get the initial state - * @returns {{itemMap: {}}} - */ - getInitialState: function() { - //map item indexes and their initial states - var itemMap = this.props.items.map(function( i, idx ) { - return { - animating: false, - open: idx === 0, - content:i.content, - header:i.header - }; - }); - - return { - itemMap: itemMap - } - - }, - /** - * Event handler for clicking on an accordion header - * @param idx - * @param event - */ - toggle: function( idx, event ) { - var _this = this, currentHeight = this.getParentHeight(event), - scrollHeight = this.getParentScrollHeight(event), newHeight, - itemMap = this.state.itemMap; - - //toggle animation for this item - itemMap[idx].animating = true; - this.setState({itemMap: itemMap}); - - //choose the right the new height - newHeight = currentHeight >= 25 ? "25px" : scrollHeight + "px"; - - //send off to the animation library - this.animate( - idx + "toggle", - {height: currentHeight + "px"}, - {height: newHeight}, - 250, - { - //when it's done, toggle animating bool - onComplete: function() { - var newMap = _this.state.itemMap; - newMap[idx].animating = false; - newMap[idx].open = newHeight !== "25px"; - _this.setState({itemMap: newMap}); - } - } - ); - - }, - /** - * Get the clientHeight of the parent element from a triggered event - * @param event - * @returns {number} - */ - getParentHeight: function( event ) { - return event.target.parentNode.clientHeight; - }, - /** - * Get the scrollHeight of the parent element from a trigger event - * @param event - * @returns {number} - */ - getParentScrollHeight: function( event ) { - return event.target.parentNode.scrollHeight; - }, - /** - * Define our default header style - * @returns {{height: string, backgroundColor: string, cursor: string}} - */ - getItemHeaderStyle: function() { - return { - height: "25px", - backgroundColor: "#f9f9f9", - cursor: "pointer" - }; - }, - /** - *The default style for each accordion item - */ - getDefaultItemStyle: function() { - return { - borderRadius: "3px", - marginBottom: "5px", - overflow: "hidden", - border: "1px solid #cecece" - } - }, - /** - * Render - * @returns {XML} - */ - render: function() { - var _this = this; - var items = this.props.items; - - //add the content to the accordion container - var contents = items.map(function( i, idx ) { - - //calculate the current style - var itemStyle = _this.getDefaultItemStyle(); - if ( _this.state.itemMap[idx].animating ) { - itemStyle.height = _this.getAnimatedStyle(idx + "toggle").height; - } else { - itemStyle.height = _this.state.itemMap[idx].open ? "auto" : "25px" - } - - return
    -
    - {i.header} -
    - {i.content} -
    - }); - - return ( -
    - {contents} -
    - ); - } -}); - -export default Accordion; \ No newline at end of file diff --git a/react/src/components/dashboard/accordion/loginModal.render.js b/react/src/components/dashboard/accordion/loginModal.render.js deleted file mode 100644 index 6933a95..0000000 --- a/react/src/components/dashboard/accordion/loginModal.render.js +++ /dev/null @@ -1,67 +0,0 @@ -import React from 'react'; -import { translate } from '../../../translate/translate'; - -const LoginModalRender = function () { - return ( -
    - -
    - ); -}; - -export default LoginModalRender; \ No newline at end of file From 15dd26fae9750afb846fcac459d9b25935791aa4 Mon Sep 17 00:00:00 2001 From: Miika Turunen Date: Wed, 13 Sep 2017 00:04:30 +0300 Subject: [PATCH 68/83] Check that peerIP is filled, fix import keys update input function --- .../settings/settings.addNodePanel.js | 26 +++---------------- .../settings/settings.importKeysPanel.js | 2 +- 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/react/src/components/dashboard/settings/settings.addNodePanel.js b/react/src/components/dashboard/settings/settings.addNodePanel.js index afc9751..091981f 100644 --- a/react/src/components/dashboard/settings/settings.addNodePanel.js +++ b/react/src/components/dashboard/settings/settings.addNodePanel.js @@ -78,7 +78,7 @@ class AddNodePanel extends React.Component { } addNode() { - if (this.state.addNodeCoin) { + if (this.state.addNodeCoin && this.state.addPeerIP) { Store.dispatch( addPeerNode( this.state.addNodeCoin.split('|')[0], @@ -89,29 +89,9 @@ class AddNodePanel extends React.Component { } updateInput(e) { - if (e.target.name === 'wifkeysPassphrase') { - // remove any empty chars from the start/end of the string - const newValue = e.target.value; - - clearTimeout(this.state.trimPassphraseTimer); - - const _trimPassphraseTimer = setTimeout(() => { - this.setState({ - wifkeysPassphrase: newValue ? newValue.trim() : '', // hardcoded field name - }); - }, 2000); - - this.resizeLoginTextarea(); - - this.setState({ - trimPassphraseTimer: _trimPassphraseTimer, - [e.target.name]: newValue, - }); - } else { this.setState({ [e.target.name]: e.target.value, }); - } } render() { @@ -145,11 +125,11 @@ class AddNodePanel extends React.Component {
    SuperNET Peers:
    -

    { this.renderSNPeersList() }

    +
    { this.renderSNPeersList() }
    Raw Peers:
    -

    { this.renderPeersList() }

    +
    { this.renderPeersList() }
    diff --git a/react/src/components/dashboard/settings/settings.importKeysPanel.js b/react/src/components/dashboard/settings/settings.importKeysPanel.js index 8a26ae9..698a673 100644 --- a/react/src/components/dashboard/settings/settings.importKeysPanel.js +++ b/react/src/components/dashboard/settings/settings.importKeysPanel.js @@ -18,7 +18,7 @@ class ImportKeysPanel extends React.Component { Store.dispatch(importPrivKey(this.state.importWifKey)); } - updateInput(e) { + updateInput = (e) => { this.setState({ [e.target.name]: e.target.value, }); From 9765bffe17cfa65d66faa89c91398812c17dcb98 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Wed, 13 Sep 2017 14:36:20 +0300 Subject: [PATCH 69/83] skip dashboard update if wallets tab is not selected --- .../dashboard/coinTile/coinTileItem.js | 131 +++++++++--------- 1 file changed, 67 insertions(+), 64 deletions(-) diff --git a/react/src/components/dashboard/coinTile/coinTileItem.js b/react/src/components/dashboard/coinTile/coinTileItem.js index 55c9070..ca009d0 100644 --- a/react/src/components/dashboard/coinTile/coinTileItem.js +++ b/react/src/components/dashboard/coinTile/coinTileItem.js @@ -79,86 +79,89 @@ class CoinTileItem extends React.Component { } dispatchCoinActions(coin, mode) { - if (mode === 'native') { - Store.dispatch(iguanaActiveHandle(true)); - const _propsDashboard = this.props.ActiveCoin; - const syncPercentage = _propsDashboard && _propsDashboard.progress && (parseFloat(parseInt(_propsDashboard.progress.blocks, 10) * 100 / parseInt(_propsDashboard.progress.longestchain, 10)).toFixed(2)).replace('NaN', 0); + if (this.props.Dashboard && + this.props.Dashboard.activeSection === 'wallets') { + if (mode === 'native') { + Store.dispatch(iguanaActiveHandle(true)); + const _propsDashboard = this.props.ActiveCoin; + const syncPercentage = _propsDashboard && _propsDashboard.progress && (parseFloat(parseInt(_propsDashboard.progress.blocks, 10) * 100 / parseInt(_propsDashboard.progress.longestchain, 10)).toFixed(2)).replace('NaN', 0); + + if ((syncPercentage < 100 && + !this.props.Dashboard.displayCoindDownModal) || + this.props.ActiveCoin.rescanInProgress) { + if (coin === 'KMD') { + Store.dispatch(getDebugLog('komodo', 50)); + } else { + Store.dispatch(getDebugLog('komodo', 50, coin)); + } + } + + if (!this.props.Dashboard.displayCoindDownModal && + _propsDashboard.progress && + _propsDashboard.progress.blocks && + _propsDashboard.progress.longestchain && + syncPercentage && + (Config.iguanaLessMode || syncPercentage >= NATIVE_MIN_SYNC_PERCENTAGE_THRESHOLD)) { + Store.dispatch( + getSyncInfoNative( + coin, + true, + this.props.Dashboard.skipFullDashboardUpdate, + this.props.ActiveCoin.rescanInProgress + ) + ); - if ((syncPercentage < 100 && - !this.props.Dashboard.displayCoindDownModal) || - this.props.ActiveCoin.rescanInProgress) { - if (coin === 'KMD') { - Store.dispatch(getDebugLog('komodo', 50)); + if (!this.props.Dashboard.skipFullDashboardUpdate) { + Store.dispatch(getDashboardUpdate(coin, _propsDashboard)); + } } else { - Store.dispatch(getDebugLog('komodo', 50, coin)); + Store.dispatch( + getSyncInfoNative( + coin, + null, + this.props.Dashboard.skipFullDashboardUpdate, + this.props.ActiveCoin.rescanInProgress + ) + ); } } + if (mode === 'full') { + Store.dispatch(iguanaActiveHandle(true)); + Store.dispatch(getSyncInfo(coin)); + Store.dispatch(iguanaEdexBalance(coin, mode)); + Store.dispatch(getAddressesByAccount(coin, mode)); + Store.dispatch(getFullTransactionsList(coin)); + } + if (mode === 'basilisk') { + const useAddress = this.props.ActiveCoin.mainBasiliskAddress ? this.props.ActiveCoin.mainBasiliskAddress : this.props.Dashboard.activeHandle[coin]; + + Store.dispatch(iguanaActiveHandle(true)); - if (!this.props.Dashboard.displayCoindDownModal && - _propsDashboard.progress && - _propsDashboard.progress.blocks && - _propsDashboard.progress.longestchain && - syncPercentage && - (Config.iguanaLessMode || syncPercentage >= NATIVE_MIN_SYNC_PERCENTAGE_THRESHOLD)) { Store.dispatch( - getSyncInfoNative( + getKMDAddressesNative( coin, - true, - this.props.Dashboard.skipFullDashboardUpdate, - this.props.ActiveCoin.rescanInProgress + mode, + useAddress ) ); - if (!this.props.Dashboard.skipFullDashboardUpdate) { - Store.dispatch(getDashboardUpdate(coin, _propsDashboard)); - } - } else { Store.dispatch( - getSyncInfoNative( - coin, - null, - this.props.Dashboard.skipFullDashboardUpdate, - this.props.ActiveCoin.rescanInProgress + getShepherdCache( + JSON.parse(sessionStorage.getItem('IguanaActiveAccount')).pubkey, + coin ) ); - } - } - if (mode === 'full') { - Store.dispatch(iguanaActiveHandle(true)); - Store.dispatch(getSyncInfo(coin)); - Store.dispatch(iguanaEdexBalance(coin, mode)); - Store.dispatch(getAddressesByAccount(coin, mode)); - Store.dispatch(getFullTransactionsList(coin)); - } - if (mode === 'basilisk') { - const useAddress = this.props.ActiveCoin.mainBasiliskAddress ? this.props.ActiveCoin.mainBasiliskAddress : this.props.Dashboard.activeHandle[coin]; - - Store.dispatch(iguanaActiveHandle(true)); - Store.dispatch( - getKMDAddressesNative( - coin, - mode, - useAddress - ) - ); - - Store.dispatch( - getShepherdCache( - JSON.parse(sessionStorage.getItem('IguanaActiveAccount')).pubkey, - coin - ) - ); + if (this.props && + this.props.Dashboard && + this.props.Dashboard.activeHandle && + this.props.Dashboard.activeHandle[coin]) { + if (!this.props.ActiveCoin.addresses) { + Store.dispatch(getAddressesByAccount(coin, mode)); + } - if (this.props && - this.props.Dashboard && - this.props.Dashboard.activeHandle && - this.props.Dashboard.activeHandle[coin]) { - if (!this.props.ActiveCoin.addresses) { - Store.dispatch(getAddressesByAccount(coin, mode)); + Store.dispatch(getBasiliskTransactionsList(coin, useAddress)); } - - Store.dispatch(getBasiliskTransactionsList(coin, useAddress)); } } } From 640e03fe1415947abda0d22025936fc81545c324 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Wed, 13 Sep 2017 14:54:15 +0300 Subject: [PATCH 70/83] fixed code formatting --- .../settings/settings.addNodePanel.js | 3 +- .../settings/settings.appInfoPanel.js | 3 +- .../settings/settings.appSettingsPanel.js | 5 +- .../settings/settings.appUpdatePanel.js | 66 +++++++++---------- .../dashboard/settings/settings.cliPanel.js | 4 +- .../settings/settings.debugLogPanel.js | 4 +- .../settings/settings.exportKeysPanel.js | 3 +- .../settings/settings.fiatCurrencyPanel.js | 3 +- .../settings/settings.importKeysPanel.js | 4 +- .../components/dashboard/settings/settings.js | 17 +++-- .../dashboard/settings/settings.render.js | 9 ++- .../settings/settings.supportPanel.js | 2 +- .../settings/settings.walletBackupPanel.js | 3 +- .../settings/settings.walletInfoPanel.js | 3 +- 14 files changed, 61 insertions(+), 68 deletions(-) diff --git a/react/src/components/dashboard/settings/settings.addNodePanel.js b/react/src/components/dashboard/settings/settings.addNodePanel.js index 091981f..67ac130 100644 --- a/react/src/components/dashboard/settings/settings.addNodePanel.js +++ b/react/src/components/dashboard/settings/settings.addNodePanel.js @@ -173,9 +173,8 @@ class AddNodePanel extends React.Component { const mapStateToProps = (state) => { return { - Settings: state.Settings, + Settings: state.Settings, }; - }; export default connect(mapStateToProps)(AddNodePanel); \ No newline at end of file diff --git a/react/src/components/dashboard/settings/settings.appInfoPanel.js b/react/src/components/dashboard/settings/settings.appInfoPanel.js index 5204e41..030caf4 100644 --- a/react/src/components/dashboard/settings/settings.appInfoPanel.js +++ b/react/src/components/dashboard/settings/settings.appInfoPanel.js @@ -83,9 +83,8 @@ class AppInfoPanel extends React.Component { const mapStateToProps = (state) => { return { - Settings: state.Settings, + Settings: state.Settings, }; - }; export default connect(mapStateToProps)(AppInfoPanel); \ No newline at end of file diff --git a/react/src/components/dashboard/settings/settings.appSettingsPanel.js b/react/src/components/dashboard/settings/settings.appSettingsPanel.js index d455557..77b982f 100644 --- a/react/src/components/dashboard/settings/settings.appSettingsPanel.js +++ b/react/src/components/dashboard/settings/settings.appSettingsPanel.js @@ -106,7 +106,6 @@ class AppSettingsPanel extends React.Component { Store.dispatch(saveAppConfig(_appSettingsPristine)); } } - renderConfigEditForm() { let items = []; @@ -306,7 +305,7 @@ class AppSettingsPanel extends React.Component { onClick={ this._resetAppConfig }>Reset to default -); + ); }; } @@ -315,7 +314,7 @@ const mapStateToProps = (state) => { Settings: state.Settings, Dashboard: { skipFullDashboardUpdate: state.Dashboard.skipFullDashboardUpdate, - } + }, }; }; diff --git a/react/src/components/dashboard/settings/settings.appUpdatePanel.js b/react/src/components/dashboard/settings/settings.appUpdatePanel.js index 3a07da2..b7230b0 100644 --- a/react/src/components/dashboard/settings/settings.appUpdatePanel.js +++ b/react/src/components/dashboard/settings/settings.appUpdatePanel.js @@ -30,7 +30,6 @@ class AppUpdatePanel extends React.Component { this._checkForUpdateUIPromise = this._checkForUpdateUIPromise.bind(this); this._updateUIPromise = this._updateUIPromise.bind(this); this.checkNodes = this.checkNodes.bind(this); - } componentWillMount() { @@ -108,46 +107,45 @@ class AppUpdatePanel extends React.Component { render() { return ( -
    -
    -
    { translate('INDEX.UI_UPDATE') }
    -
    - - -
    -
    -
    -
    { translate('INDEX.BINS_UPDATE') }
    -
    - - -
    -
    -
    - { this.renderUpdateStatus() } -
    +
    +
    +
    { translate('INDEX.UI_UPDATE') }
    +
    + +
    +
    +
    +
    { translate('INDEX.BINS_UPDATE') }
    +
    + + +
    +
    +
    + { this.renderUpdateStatus() } +
    +
    ); }; } const mapStateToProps = (state) => { return { - Settings: state.Settings, + Settings: state.Settings, }; - }; export default connect(mapStateToProps)(AppUpdatePanel); diff --git a/react/src/components/dashboard/settings/settings.cliPanel.js b/react/src/components/dashboard/settings/settings.cliPanel.js index 3e8d5e0..312dcb2 100644 --- a/react/src/components/dashboard/settings/settings.cliPanel.js +++ b/react/src/components/dashboard/settings/settings.cliPanel.js @@ -134,7 +134,7 @@ class CliPanel extends React.Component { ) ); } - + updateInput = (e) => { this.setState({ [e.target.name]: e.target.value, @@ -190,7 +190,7 @@ class CliPanel extends React.Component {
    -); + ); }; } diff --git a/react/src/components/dashboard/settings/settings.debugLogPanel.js b/react/src/components/dashboard/settings/settings.debugLogPanel.js index ff061b2..4fb3408 100644 --- a/react/src/components/dashboard/settings/settings.debugLogPanel.js +++ b/react/src/components/dashboard/settings/settings.debugLogPanel.js @@ -167,13 +167,13 @@ class DebugLogPanel extends React.Component {
    { this.renderAppRuntimeLog() }
    } -); + ); }; } const mapStateToProps = (state) => { return { - Settings: state.Settings + Settings: state.Settings, }; }; diff --git a/react/src/components/dashboard/settings/settings.exportKeysPanel.js b/react/src/components/dashboard/settings/settings.exportKeysPanel.js index 53e2a1c..4e1b64a 100644 --- a/react/src/components/dashboard/settings/settings.exportKeysPanel.js +++ b/react/src/components/dashboard/settings/settings.exportKeysPanel.js @@ -214,9 +214,8 @@ const mapStateToProps = (state) => { ActiveCoin: { coin: state.ActiveCoin.coin, }, - Settings: state.Settings, + Settings: state.Settings, }; - }; export default connect(mapStateToProps)(ExportKeysPanel); \ No newline at end of file diff --git a/react/src/components/dashboard/settings/settings.fiatCurrencyPanel.js b/react/src/components/dashboard/settings/settings.fiatCurrencyPanel.js index 4cce17d..ad61436 100644 --- a/react/src/components/dashboard/settings/settings.fiatCurrencyPanel.js +++ b/react/src/components/dashboard/settings/settings.fiatCurrencyPanel.js @@ -16,9 +16,8 @@ class FiatCurrencyPanel extends React.Component { const mapStateToProps = (state) => { return { - Settings: state.Settings, + Settings: state.Settings, }; - }; export default connect(mapStateToProps)(FiatCurrencyPanel); \ No newline at end of file diff --git a/react/src/components/dashboard/settings/settings.importKeysPanel.js b/react/src/components/dashboard/settings/settings.importKeysPanel.js index 698a673..e395871 100644 --- a/react/src/components/dashboard/settings/settings.importKeysPanel.js +++ b/react/src/components/dashboard/settings/settings.importKeysPanel.js @@ -60,8 +60,8 @@ class ImportKeysPanel extends React.Component { -); - }; + ); + } } export default ImportKeysPanel; \ No newline at end of file diff --git a/react/src/components/dashboard/settings/settings.js b/react/src/components/dashboard/settings/settings.js index 59d5343..32c276d 100644 --- a/react/src/components/dashboard/settings/settings.js +++ b/react/src/components/dashboard/settings/settings.js @@ -58,7 +58,7 @@ class Settings extends React.Component { Store.dispatch(getAppConfig()); Store.dispatch(getAppInfo()); - document.getElementById('section-iguana-wallet-settings').setAttribute("style", "height:auto; min-height: 100%"); + document.getElementById('section-iguana-wallet-settings').setAttribute('style', 'height:auto; min-height: 100%'); } componentWillReceiveProps(props) { @@ -72,11 +72,10 @@ class Settings extends React.Component { } openTab(elemId, tab) { - this.setState(Object.assign({}, this.state, { - activeTab: tab, - tabElId: elemId, - })); - + this.setState(Object.assign({}, this.state, { + activeTab: tab, + tabElId: elemId, + })); } updateInput(e) { @@ -84,7 +83,7 @@ class Settings extends React.Component { [e.target.name]: e.target.value, }); } - + renderAppInfoTab() { const releaseInfo = this.props.Settings.appInfo && this.props.Settings.appInfo.releaseInfo; @@ -129,9 +128,9 @@ class Settings extends React.Component { renderAppSettings() { return } - + renderCliPanel() { - return + return } renderSupportPanel() { diff --git a/react/src/components/dashboard/settings/settings.render.js b/react/src/components/dashboard/settings/settings.render.js index 33682a8..0372343 100644 --- a/react/src/components/dashboard/settings/settings.render.js +++ b/react/src/components/dashboard/settings/settings.render.js @@ -52,6 +52,7 @@ export const SettingsRender = function() { } { !this.props.disableWalletSpecificUI &&
    this.openTab('DumpWallet', 2) } className={ 'panel' + (this.state.nativeOnly ? ' hide' : '') }> @@ -64,11 +65,12 @@ export const SettingsRender = function() { className={ 'panel-collapse collapse' + (this.state.activeTab === 2 ? ' in' : '') } style={{ height: this.state.activeTab === 2 ? `auto` : '0' }}> { this.renderWalletBackup() } -
    + } { !this.props.disableWalletSpecificUI &&
    this.openTab('FiatCurrencySettings', 3) } className={ 'panel' + (this.state.nativeOnly ? ' hide' : '') }> @@ -80,7 +82,8 @@ export const SettingsRender = function() {
    - { this.renderFiatCurrency() }
    + { this.renderFiatCurrency() } +
    } { !this.props.disableWalletSpecificUI && @@ -199,7 +202,7 @@ export const SettingsRender = function() { { this.renderAppUpdateTab() } - +
    -); + ); }; } diff --git a/react/src/components/dashboard/settings/settings.walletBackupPanel.js b/react/src/components/dashboard/settings/settings.walletBackupPanel.js index d0da2a7..e86ca8f 100644 --- a/react/src/components/dashboard/settings/settings.walletBackupPanel.js +++ b/react/src/components/dashboard/settings/settings.walletBackupPanel.js @@ -16,9 +16,8 @@ class WalletBackupPanel extends React.Component { const mapStateToProps = (state) => { return { - Settings: state.Settings, + Settings: state.Settings, }; - }; export default connect(mapStateToProps)(WalletBackupPanel); \ No newline at end of file diff --git a/react/src/components/dashboard/settings/settings.walletInfoPanel.js b/react/src/components/dashboard/settings/settings.walletInfoPanel.js index 612ffd2..29fda9d 100644 --- a/react/src/components/dashboard/settings/settings.walletInfoPanel.js +++ b/react/src/components/dashboard/settings/settings.walletInfoPanel.js @@ -53,9 +53,8 @@ const mapStateToProps = (state) => { return { Main: { activeHandle: state.Main.activeHandle, - } + }, }; - }; export default connect(mapStateToProps)(WalletInfoPanel); \ No newline at end of file From 950e96ce3145547e4012f31aa92aeb8c4db59634 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Wed, 13 Sep 2017 15:16:27 +0300 Subject: [PATCH 71/83] settings hide wallet backup and fiat tabs --- react/src/components/dashboard/settings/settings.render.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/react/src/components/dashboard/settings/settings.render.js b/react/src/components/dashboard/settings/settings.render.js index 0372343..5a999d1 100644 --- a/react/src/components/dashboard/settings/settings.render.js +++ b/react/src/components/dashboard/settings/settings.render.js @@ -52,10 +52,9 @@ export const SettingsRender = function() { } { !this.props.disableWalletSpecificUI &&
    this.openTab('DumpWallet', 2) } - className={ 'panel' + (this.state.nativeOnly ? ' hide' : '') }> + className={ 'hide panel' + (this.state.nativeOnly ? ' hide' : '') }>
    { translate('INDEX.WALLET_BACKUP') } @@ -70,10 +69,9 @@ export const SettingsRender = function() { } { !this.props.disableWalletSpecificUI &&
    this.openTab('FiatCurrencySettings', 3) } - className={ 'panel' + (this.state.nativeOnly ? ' hide' : '') }> + className={ 'hide panel' + (this.state.nativeOnly ? ' hide' : '') }>
    { translate('INDEX.FIAT_CURRENCY') } From 8cd975b706d9c510088b93fecd6638d3b78833c1 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Wed, 13 Sep 2017 17:59:20 +0300 Subject: [PATCH 72/83] err no longestchain, err no blocks alt. wording --- .../walletsProgress/walletsProgress.js | 34 ++++++++++++++----- .../walletsProgress/walletsProgress.render.js | 32 +++++++++-------- react/src/translate/en.js | 3 +- 3 files changed, 44 insertions(+), 25 deletions(-) diff --git a/react/src/components/dashboard/walletsProgress/walletsProgress.js b/react/src/components/dashboard/walletsProgress/walletsProgress.js index d70c8fb..3887d0f 100644 --- a/react/src/components/dashboard/walletsProgress/walletsProgress.js +++ b/react/src/components/dashboard/walletsProgress/walletsProgress.js @@ -2,7 +2,6 @@ import React from 'react'; import { connect } from 'react-redux'; import { translate } from '../../../translate/translate'; import { - SyncErrorLongestChainRender, SyncErrorBlocksRender, SyncPercentageRender, LoadingBlocksRender, @@ -15,9 +14,33 @@ import { class WalletsProgress extends React.Component { constructor() { super(); + this.state = { + prevProgress: {}, + }; this.isFullySynced = this.isFullySynced.bind(this); } + componentWillReceiveProps(props) { + if (props.ActiveCoin && + props.ActiveCoin.progress && + Number(props.ActiveCoin.progress.longestchain) === 0) { + let _progress = props.ActiveCoin.progress; + + if (this.state.prevProgress && + this.state.prevProgress.longestchain && + Number(this.state.prevProgress.longestchain) > 0) { + _progress.longestchain = this.state.prevProgress.longestchain; + } + this.setState(Object.assign({}, this.state, { + prevProgress: _progress, + })); + } else { + this.setState(Object.assign({}, this.state, { + prevProgress: props.ActiveCoin.progress, + })); + } + } + isFullySynced() { const _progress = this.props.ActiveCoin.progress; @@ -96,6 +119,7 @@ class WalletsProgress extends React.Component { renderSyncPercentagePlaceholder() { const _progress = this.props.ActiveCoin.progress; + console.warn('renderSyncPercentagePlaceholder', _progress); // activating best chain if (_progress && @@ -112,12 +136,6 @@ class WalletsProgress extends React.Component { } } - if (_progress && - _progress.blocks > 0 && - _progress.longestchain === 0) { - return SyncErrorLongestChainRender.call(this); - } - if (_progress && _progress.blocks === 0) { return SyncErrorBlocksRender.call(this); @@ -125,7 +143,7 @@ class WalletsProgress extends React.Component { if (_progress && _progress.blocks) { - const syncPercentage = (parseFloat(parseInt(_progress.blocks, 10) * 100 / parseInt(_progress.longestchain, 10)).toFixed(2) + '%').replace('NaN', 0); + const syncPercentage = (parseFloat(parseInt(_progress.blocks, 10) * 100 / parseInt(Number(_progress.longestchain) || Number(this.state.prevProgress.longestchain), 10)).toFixed(2) + '%').replace('NaN', 0); return SyncPercentageRender.call(this, syncPercentage === 1000 ? 100 : syncPercentage); } diff --git a/react/src/components/dashboard/walletsProgress/walletsProgress.render.js b/react/src/components/dashboard/walletsProgress/walletsProgress.render.js index 4ea4f60..14e5f9c 100644 --- a/react/src/components/dashboard/walletsProgress/walletsProgress.render.js +++ b/react/src/components/dashboard/walletsProgress/walletsProgress.render.js @@ -1,14 +1,6 @@ import React from 'react'; import { translate } from '../../../translate/translate'; -export const SyncErrorLongestChainRender = function() { - return ( -
    - { translate('INDEX.SYNC_ERR_LONGESTCHAIN') } -
    - ); -}; - export const SyncErrorBlocksRender = function() { return (
    @@ -27,13 +19,23 @@ export const SyncPercentageRender = function(syncPercentage) {
    ); } else { - return ( -
    - { syncPercentage } | { this.props.ActiveCoin.progress.blocks } / { this.props.ActiveCoin.progress.longestchain } | { translate('INDEX.CONNECTIONS') }: { this.props.ActiveCoin.progress.connections } -
    - ); + if (syncPercentage === 'Infinity%') { + return ( +
    + Blocks: { this.props.ActiveCoin.progress.blocks } | { translate('INDEX.CONNECTIONS') }: { this.props.ActiveCoin.progress.connections } +
    + ); + } else { + return ( +
    + { syncPercentage === '100.00%' ? '100%' : syncPercentage } | { this.props.ActiveCoin.progress.blocks } / { this.props.ActiveCoin.progress.longestchain } | { translate('INDEX.CONNECTIONS') }: { this.props.ActiveCoin.progress.connections } +
    + ); + } } }; diff --git a/react/src/translate/en.js b/react/src/translate/en.js index e667d3d..91d31c3 100644 --- a/react/src/translate/en.js +++ b/react/src/translate/en.js @@ -121,8 +121,7 @@ export const _lang = { 'PREVIOUS': 'Previous', 'NEXT': 'Next', 'ENTRIES_SM': 'entries', - 'SYNC_ERR_LONGESTCHAIN': 'Unable to get current sync progress. Err: no longestchain param in response', - 'SYNC_ERR_BLOCKS': 'Unable to get current sync progress. Err: no blocks param in response', + 'SYNC_ERR_BLOCKS': 'Connecting to peers...', 'COIN_IS_BUSY': 'Coin is busy processing', 'REFRESHING_BASILISK_NET': 'Refreshing Basilisk Network Connections', 'SELECT_A_COIN': 'Select Coin to add to Agama Wallet', From 24a983a3fad374e28e1cf53f9dd12817f2e0dcca Mon Sep 17 00:00:00 2001 From: pbca26 Date: Wed, 13 Sep 2017 19:58:21 +0300 Subject: [PATCH 73/83] verifying blocks message --- .../dashboard/walletsProgress/walletsProgress.js | 16 ++++++++++------ .../walletsProgress/walletsProgress.render.js | 8 ++++++++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/react/src/components/dashboard/walletsProgress/walletsProgress.js b/react/src/components/dashboard/walletsProgress/walletsProgress.js index 3887d0f..c95ca8e 100644 --- a/react/src/components/dashboard/walletsProgress/walletsProgress.js +++ b/react/src/components/dashboard/walletsProgress/walletsProgress.js @@ -8,6 +8,7 @@ import { TranslationComponentsRender, CoinIsBusyRender, ChainActivationNotificationRender, + VerifyingBlocksRender, WalletsProgressRender } from './walletsProgress.render'; @@ -119,20 +120,23 @@ class WalletsProgress extends React.Component { renderSyncPercentagePlaceholder() { const _progress = this.props.ActiveCoin.progress; - console.warn('renderSyncPercentagePlaceholder', _progress); // activating best chain if (_progress && _progress.code && _progress.code === -28 && this.props.Settings.debugLog) { - const _parseProgress = this.parseActivatingBestChainProgress(); + if (_progress.message !== 'Verifying blocks...') { + const _parseProgress = this.parseActivatingBestChainProgress(); - if (_parseProgress && - _parseProgress[1]) { - return SyncPercentageRender.call(this, _parseProgress[1] === 1000 ? 100 : _parseProgress[1].toFixed(2)); + if (_parseProgress && + _parseProgress[1]) { + return SyncPercentageRender.call(this, _parseProgress[1] === 1000 ? 100 : _parseProgress[1].toFixed(2)); + } else { + return LoadingBlocksRender.call(this); + } } else { - return LoadingBlocksRender.call(this); + return VerifyingBlocksRender.call(this); } } diff --git a/react/src/components/dashboard/walletsProgress/walletsProgress.render.js b/react/src/components/dashboard/walletsProgress/walletsProgress.render.js index 14e5f9c..c4ce931 100644 --- a/react/src/components/dashboard/walletsProgress/walletsProgress.render.js +++ b/react/src/components/dashboard/walletsProgress/walletsProgress.render.js @@ -1,6 +1,14 @@ import React from 'react'; import { translate } from '../../../translate/translate'; +export const VerifyingBlocksRender = function() { + return ( +
    + Verifying blocks... +
    + ); +}; + export const SyncErrorBlocksRender = function() { return (
    From 7aa041b4525e095ae3b11a1770a4a1444afd8c2b Mon Sep 17 00:00:00 2001 From: pbca26 Date: Wed, 13 Sep 2017 20:40:47 +0300 Subject: [PATCH 74/83] verifying blocks / activating best chain cond. fix --- .../dashboard/walletsProgress/walletsProgress.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/react/src/components/dashboard/walletsProgress/walletsProgress.js b/react/src/components/dashboard/walletsProgress/walletsProgress.js index c95ca8e..81efe7c 100644 --- a/react/src/components/dashboard/walletsProgress/walletsProgress.js +++ b/react/src/components/dashboard/walletsProgress/walletsProgress.js @@ -126,7 +126,7 @@ class WalletsProgress extends React.Component { _progress.code && _progress.code === -28 && this.props.Settings.debugLog) { - if (_progress.message !== 'Verifying blocks...') { + if (_progress.message == 'Activating best chain...') { const _parseProgress = this.parseActivatingBestChainProgress(); if (_parseProgress && @@ -135,7 +135,7 @@ class WalletsProgress extends React.Component { } else { return LoadingBlocksRender.call(this); } - } else { + } else if (_progress.message === 'Verifying blocks...') { return VerifyingBlocksRender.call(this); } } @@ -146,7 +146,8 @@ class WalletsProgress extends React.Component { } if (_progress && - _progress.blocks) { + _progress.blocks && + _progress.blocks > 0) { const syncPercentage = (parseFloat(parseInt(_progress.blocks, 10) * 100 / parseInt(Number(_progress.longestchain) || Number(this.state.prevProgress.longestchain), 10)).toFixed(2) + '%').replace('NaN', 0); return SyncPercentageRender.call(this, syncPercentage === 1000 ? 100 : syncPercentage); } From d491c9a88f2d9a60a25de4546ae4748f538784e5 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Wed, 13 Sep 2017 23:31:43 +0300 Subject: [PATCH 75/83] settings export keys addr copy btn --- .../src/components/dashboard/jumblr/jumblr.js | 6 ------ .../settings/settings.exportKeysPanel.js | 18 ++++++++++++++++-- react/src/translate/en.js | 10 +++++----- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/react/src/components/dashboard/jumblr/jumblr.js b/react/src/components/dashboard/jumblr/jumblr.js index 760151e..75d93a9 100755 --- a/react/src/components/dashboard/jumblr/jumblr.js +++ b/react/src/components/dashboard/jumblr/jumblr.js @@ -128,12 +128,6 @@ class Jumblr extends React.Component { }); } - /*toggleAddressGenMod() { - this.setState({ - jumblrDepositAddressPBased: !this.state.jumblrDepositAddressPBased, - }); - }*/ - generateJumblrSecretAddress() { let _jumblrSecretAddress = []; let _apiSuccessCount = 0; diff --git a/react/src/components/dashboard/settings/settings.exportKeysPanel.js b/react/src/components/dashboard/settings/settings.exportKeysPanel.js index 4e1b64a..7c59ea5 100644 --- a/react/src/components/dashboard/settings/settings.exportKeysPanel.js +++ b/react/src/components/dashboard/settings/settings.exportKeysPanel.js @@ -4,6 +4,7 @@ import { connect } from 'react-redux'; import { encryptWallet, settingsWifkeyState, + copyCoinAddress, } from '../../../actions/actionCreators'; import Store from '../../../store'; @@ -19,6 +20,7 @@ class ExportKeysPanel extends React.Component { this.exportWifKeys = this.exportWifKeys.bind(this); this.exportWifKeysRaw = this.exportWifKeysRaw.bind(this); this.toggleSeedInputVisibility = this.toggleSeedInputVisibility.bind(this); + this._copyCoinAddress = this._copyCoinAddress.bind(this); this.updateInput = this.updateInput.bind(this); } @@ -59,6 +61,10 @@ class ExportKeysPanel extends React.Component { } } + _copyCoinAddress(address) { + Store.dispatch(copyCoinAddress(address)); + } + renderWifKeys() { let items = []; @@ -80,8 +86,16 @@ class ExportKeysPanel extends React.Component { (i === 1 && _key.indexOf('wif') > -1)) { items.push( - { _key } - { _wifKeys[_key] } + { _key.replace('wif', ' WIF') } + + { _wifKeys[_key] } + + ); } diff --git a/react/src/translate/en.js b/react/src/translate/en.js index 91d31c3..88f1910 100644 --- a/react/src/translate/en.js +++ b/react/src/translate/en.js @@ -278,12 +278,12 @@ export const _lang = { 'WALLET_BACKUP': 'Wallet Backup', 'FIAT_CURRENCY': 'Fiat Currency', 'EXPORT_KEYS': 'Export Keys', - 'ONLY_ACTIVE_WIF_KEYS': 'Only the active coin wallet wif keys will be shown here.
    ' + - 'If you don\'t see a wif key for the coin you are looking for please active it by adding it from EasyDEX Dashboard.
    ' + - 'You can use these wif keys to import to another coin wallets.', + 'ONLY_ACTIVE_WIF_KEYS': 'Only the active coin wallet WIF keys will be shown here.
    ' + + 'If you don\'t see a WIF key for the coin you are looking for please active it by adding it from EasyDEX Dashboard.
    ' + + 'You can use these WIF keys to import to another coin wallets.', 'PLEASE_KEEP_KEYS_SAFE': 'Please keep these keys extra safe and secure.', 'PASSPHRASE': 'Passphrase', - 'GET_WIF_KEYS': 'Get Wif Keys', + 'GET_WIF_KEYS': 'Get WIF Keys', 'IMPORT_KEYS': 'Import Keys', 'IMPORT_KEYS_DESC_P1': 'This section allows you to import private key of all iguana supported coins, Assetchain, Geckochain, or PAXchain by the wallet.', 'IMPORT_KEYS_DESC_P2': 'It is not mandatory to have that coin active in the wallet for which you are executing import private key process.', @@ -590,7 +590,7 @@ export const _lang = { 'SUPPORT_TICKETS': 'Support tickets', 'GET_SLACK_INVITE': 'Get Slack invite', 'ADDRESS_LIST': 'Address list', - 'WIF_KEY_LIST': 'Wif key list', + 'WIF_KEY_LIST': 'WIF (Wallet Import Format) key list', 'CLI_RESPONSE': 'CLI response', 'PASSPHRASE_REQ': 'Passphrase is required.', 'SAVE_APP_CONFIG': 'Save app config', From 83a89467ebed78f4112d074a18715cdc27860198 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Fri, 15 Sep 2017 00:50:25 +0300 Subject: [PATCH 76/83] basilisk fallback message --- assets/mainWindow/js/init.js | 5 ++++ .../walletsBalance/walletsBalance.js | 25 +++++++++++++++++-- .../walletsBalance/walletsBalance.render.js | 2 ++ .../dashboard/walletsData/walletsData.js | 2 ++ .../walletsData/walletsData.render.js | 1 + 5 files changed, 33 insertions(+), 2 deletions(-) diff --git a/assets/mainWindow/js/init.js b/assets/mainWindow/js/init.js index b7f1414..612ba1d 100644 --- a/assets/mainWindow/js/init.js +++ b/assets/mainWindow/js/init.js @@ -3,6 +3,11 @@ $(document).ready(function() { var window = remote.getCurrentWindow(); var appConf = remote.getCurrentWindow().appConfig; + if (!appConf.experimentalFeatures) { + $('#normalStartBtn').hide(); + $('.dropdown-menu').css('right', '34.8%'); + } + $('#pulse').jRoll({ radius: 100, animation: 'pulse' diff --git a/react/src/components/dashboard/walletsBalance/walletsBalance.js b/react/src/components/dashboard/walletsBalance/walletsBalance.js index 3a37d8f..7508115 100755 --- a/react/src/components/dashboard/walletsBalance/walletsBalance.js +++ b/react/src/components/dashboard/walletsBalance/walletsBalance.js @@ -15,15 +15,36 @@ class WalletsBalance extends React.Component { super(); this.state = { currentAddress: null, + isExplorerData: false, }; this.isFullySynced = this.isFullySynced.bind(this); this.refreshBalance = this.refreshBalance.bind(this); } componentWillReceiveProps(props) { - if (!this.state.currentAddress && - this.props.ActiveCoin.activeAddress) { + if (this.props.ActiveCoin.activeAddress) { + const _mode = this.props.ActiveCoin.mode; + let _isExplorerData = false; + + if (_mode === 'basilisk') { + if (this.props.ActiveCoin.cache) { + const _cache = this.props.ActiveCoin.cache; + const _coin = this.props.ActiveCoin.coin; + const _address = this.props.ActiveCoin.activeAddress; + + if (_address && + _cache[_coin] && + _cache[_coin][_address] && + _cache[_coin][_address].getbalance && + _cache[_coin][_address].getbalance.data && + _cache[_coin][_address].getbalance.data.source) { + _isExplorerData = true; + } + } + } + this.setState(Object.assign({}, this.state, { + isExplorerData: _isExplorerData, currentAddress: this.props.ActiveCoin.activeAddress, })); } diff --git a/react/src/components/dashboard/walletsBalance/walletsBalance.render.js b/react/src/components/dashboard/walletsBalance/walletsBalance.render.js index 39b9f63..1513a6b 100644 --- a/react/src/components/dashboard/walletsBalance/walletsBalance.render.js +++ b/react/src/components/dashboard/walletsBalance/walletsBalance.render.js @@ -108,6 +108,8 @@ const WalletsBalanceRender = function() {
    + +
    Notice: balance is fetched from KMD explorer as a fallback measure!
    ); }; diff --git a/react/src/components/dashboard/walletsData/walletsData.js b/react/src/components/dashboard/walletsData/walletsData.js index c0975ec..747ad58 100644 --- a/react/src/components/dashboard/walletsData/walletsData.js +++ b/react/src/components/dashboard/walletsData/walletsData.js @@ -54,6 +54,7 @@ class WalletsData extends React.Component { searchTerm: null, coin: null, txhistory: null, + isExplorerData: false, }; this.toggleBasiliskActionsMenu = this.toggleBasiliskActionsMenu.bind(this); @@ -344,6 +345,7 @@ class WalletsData extends React.Component { (this.state.coin && this.state.coin !== this.props.ActiveCoin.coin) || (JSON.stringify(this.props.ActiveCoin.txhistory) !== JSON.stringify(this.state.txhistory))) {*/ _stateChange = Object.assign({}, _stateChange, { + isExplorerData: this.props.ActiveCoin.txhistory[0].source ? true : false, itemsList: this.props.ActiveCoin.txhistory, filteredItemsList: this.filterTransactions(this.props.ActiveCoin.txhistory, this.state.searchTerm), txhistory: this.props.ActiveCoin.txhistory, diff --git a/react/src/components/dashboard/walletsData/walletsData.render.js b/react/src/components/dashboard/walletsData/walletsData.render.js index 6aa4c8e..5ef4129 100644 --- a/react/src/components/dashboard/walletsData/walletsData.render.js +++ b/react/src/components/dashboard/walletsData/walletsData.render.js @@ -249,6 +249,7 @@ export const WalletsDataRender = function() {

    { translate('INDEX.TRANSACTION_HISTORY') }

    +
    Notice: transactions list is fetched from KMD explorer as a fallback measure!
    { this.shouldDisplayAddressList() && From d1ca8bf73dfc11d4710d33fcc5d4d9e46ed20994 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Fri, 15 Sep 2017 02:06:42 +0300 Subject: [PATCH 77/83] hide exp settings --- assets/mainWindow/css/loading.css | 12 ++++++++++-- assets/mainWindow/js/init.js | 1 + assets/mainWindow/js/loading.js | 6 +++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/assets/mainWindow/css/loading.css b/assets/mainWindow/css/loading.css index 50c3a92..8bb4d5a 100644 --- a/assets/mainWindow/css/loading.css +++ b/assets/mainWindow/css/loading.css @@ -41,11 +41,11 @@ body.loading-window { } body.agama-default-window-height { - height: 300px !important; + height: 355px !important; } body.agama-app-settings-window { - height: 820px; + height: 700px; } .agama-logo { @@ -453,4 +453,12 @@ button.toast-close-button { .dropdown-menu li { cursor: pointer; margin: 5px 0; +} + +.iguana-less { + height: 570px !important; +} +.iguana-less #iguanaCorePort, +.iguana-less #useBasiliskInstance { + display: none; } \ No newline at end of file diff --git a/assets/mainWindow/js/init.js b/assets/mainWindow/js/init.js index 612ba1d..224f074 100644 --- a/assets/mainWindow/js/init.js +++ b/assets/mainWindow/js/init.js @@ -6,6 +6,7 @@ $(document).ready(function() { if (!appConf.experimentalFeatures) { $('#normalStartBtn').hide(); $('.dropdown-menu').css('right', '34.8%'); + $('#nativeOnlyBtnCarret').css('margin-right', '0'); } $('#pulse').jRoll({ diff --git a/assets/mainWindow/js/loading.js b/assets/mainWindow/js/loading.js index c50cb4d..51d01c8 100644 --- a/assets/mainWindow/js/loading.js +++ b/assets/mainWindow/js/loading.js @@ -16,13 +16,17 @@ function initSettingsForm() { let appConfSchema = remote.getCurrentWindow().appConfigSchema; _configCopy = Object.assign({}, appConf); + if (!appConf.experimentalFeatures) { + $('.agama-app-settings-window').addClass('iguana-less'); + } + let _htmlOut = ''; for (let key in appConf) { if (appConfSchema[key] && appConfSchema[key].initDisplay) { _htmlOut = ` ${_htmlOut} - +
    ${appConfSchema[key].displayName}`; From 3757952defaddaffbb64e32d4911819259d8eb27 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Fri, 15 Sep 2017 02:14:21 +0300 Subject: [PATCH 78/83] jira ag-12 --- .../src/components/dashboard/settings/settings.debugLogPanel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react/src/components/dashboard/settings/settings.debugLogPanel.js b/react/src/components/dashboard/settings/settings.debugLogPanel.js index 4fb3408..e0b89c5 100644 --- a/react/src/components/dashboard/settings/settings.debugLogPanel.js +++ b/react/src/components/dashboard/settings/settings.debugLogPanel.js @@ -42,7 +42,7 @@ class DebugLogPanel extends React.Component { _items.push(

    { secondsToString(_appRuntimeLog[i].time, true) } - { JSON.stringify(_appRuntimeLog[i].msg, null, '').replace('\\n', ' ') } + { JSON.stringify(_appRuntimeLog[i].msg, null, '') }

    ); } From 08589ae17c5451eab15652abeee570aa96fe91b7 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Fri, 15 Sep 2017 21:49:53 +0300 Subject: [PATCH 79/83] rename instantdex to dex --- react/src/translate/en.js | 2 +- react/src/util/coinHelper.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/react/src/translate/en.js b/react/src/translate/en.js index 88f1910..99d6cd0 100644 --- a/react/src/translate/en.js +++ b/react/src/translate/en.js @@ -693,7 +693,7 @@ export const _lang = { 'COQUI': 'COQUI (COQUI)', 'CRYPTO': 'CRYPTO (CRYPTO)', 'HODL': 'HODL (HODL)', - 'DEX': 'InstantDEX (DEX)', + 'DEX': 'DEX (DEX)', 'JUMBLR': 'JUMBLR (JUMBLR)', 'KV': 'KV (KV)', 'MGW': 'MultiGateway (MGW)', diff --git a/react/src/util/coinHelper.js b/react/src/util/coinHelper.js index 6c0ad3f..5d582ee 100644 --- a/react/src/util/coinHelper.js +++ b/react/src/util/coinHelper.js @@ -36,7 +36,7 @@ export function getCoinTitle(coin) { break; case 'DEX': coinlogo = 'dex'; - coinname = 'InstantDEX'; + coinname = 'DEX'; break; case 'DOGE': coinlogo = 'dogecoin'; From 9feb422edcd1b6a0c8e645bced01c7c3329e143a Mon Sep 17 00:00:00 2001 From: pbca26 Date: Sat, 16 Sep 2017 09:05:41 +0300 Subject: [PATCH 80/83] coind down modal min error threshold --- react/src/actions/actions/nativeSyncInfo.js | 16 +++++++++++++--- react/src/actions/storeType.js | 5 +++-- .../dashboard/coindDownModal/coindDownModal.js | 6 +++++- react/src/reducers/activeCoin.js | 10 ++++++++++ react/src/translate/en.js | 2 +- 5 files changed, 32 insertions(+), 7 deletions(-) diff --git a/react/src/actions/actions/nativeSyncInfo.js b/react/src/actions/actions/nativeSyncInfo.js index d4689da..21fcabc 100644 --- a/react/src/actions/actions/nativeSyncInfo.js +++ b/react/src/actions/actions/nativeSyncInfo.js @@ -1,4 +1,7 @@ -import { SYNCING_NATIVE_MODE } from '../storeType'; +import { + SYNCING_NATIVE_MODE, + DASHBOARD_ACTIVE_COIN_GETINFO_FAILURE +} from '../storeType'; import { triggerToaster, getPassthruAgent, @@ -7,6 +10,12 @@ import { } from '../actionCreators'; import Config from '../../config'; +export function nativeGetinfoFailureState() { + return { + type: DASHBOARD_ACTIVE_COIN_GETINFO_FAILURE, + } +} + // TODO: use debug.log instead export function getSyncInfoNativeKMD(skipDebug, json, skipRemote) { if (skipRemote) { @@ -156,14 +165,15 @@ export function getSyncInfoNative(coin, skipDebug, skipRemote, suppressErrors) { } catch (e) {} if (!_kmdMainPassiveMode) { - dispatch( + dispatch(nativeGetinfoFailureState()); + /* dispatch( triggerToaster( 'Komodod is down', 'Critical Error', 'error', true ) - ); + ); */ } else { dispatch( triggerToaster( diff --git a/react/src/actions/storeType.js b/react/src/actions/storeType.js index 7599e0e..7a7bdfb 100644 --- a/react/src/actions/storeType.js +++ b/react/src/actions/storeType.js @@ -20,8 +20,8 @@ export const BASILISK_CONNECTION = 'BASILISK_CONNECTION'; export const SYNCING_FULL_MODE = 'SYNCING_FULL_MODE'; export const SYNCING_NATIVE_MODE = 'SYNCING_NATIVE_MODE'; export const ACTIVE_COIN_GET_ADDRESSES = 'ACTIVE_COIN_GET_ADDRESSES'; -export const START_INTERVAL= 'START_INTERVAL'; -export const STOP_INTERVAL= 'STOP_INTERVAL'; +export const START_INTERVAL = 'START_INTERVAL'; +export const STOP_INTERVAL = 'STOP_INTERVAL'; export const DASHBOARD_ACTIVE_SECTION = 'DASHBOARD_ACTIVE_SECTION'; export const DASHBOARD_ACTIVE_TXINFO_MODAL = 'DASHBOARD_ACTIVE_TXINFO_MODAL'; export const DASHBOARD_ACTIVE_COIN_NATIVE_BALANCE = 'DASHBOARD_ACTIVE_COIN_NATIVE_BALANCE'; @@ -30,6 +30,7 @@ export const DASHBOARD_ACTIVE_COIN_NATIVE_OPIDS = 'DASHBOARD_ACTIVE_COIN_NATIVE_ export const DASHBOARD_ACTIVE_COIN_SENDTO = 'DASHBOARD_ACTIVE_COIN_SENDTO'; export const DASHBOARD_ACTIVE_COIN_GET_CACHE = 'DASHBOARD_ACTIVE_COIN_GET_CACHE'; export const DASHBOARD_ACTIVE_COIN_MAIN_BASILISK_ADDR = 'DASHBOARD_ACTIVE_COIN_MAIN_BASILISK_ADDR'; +export const DASHBOARD_ACTIVE_COIN_GETINFO_FAILURE = 'DASHBOARD_ACTIVE_COIN_GETINFO_FAILURE'; export const DASHBOARD_UPDATE = 'DASHBOARD_UPDATE'; export const DASHBOARD_SYNC_ONLY_UPDATE = 'DASHBOARD_SYNC_ONLY_UPDATE'; export const VIEW_CACHE_DATA = 'VIEW_CACHE_DATA'; diff --git a/react/src/components/dashboard/coindDownModal/coindDownModal.js b/react/src/components/dashboard/coindDownModal/coindDownModal.js index b18fbfb..1c5937c 100644 --- a/react/src/components/dashboard/coindDownModal/coindDownModal.js +++ b/react/src/components/dashboard/coindDownModal/coindDownModal.js @@ -5,6 +5,8 @@ import Store from '../../../store'; import CoindDownModalRender from './coindDownModal.render'; +const COIND_DOWN_MODAL_FETCH_FAILURES_THRESHOLD = 5; + class CoindDownModal extends React.Component { constructor() { super(); @@ -42,7 +44,8 @@ class CoindDownModal extends React.Component { render() { if (this.state.display && - !this.state.kmdMainPassiveMode) { + !this.state.kmdMainPassiveMode && + this.props.ActiveCoin.getinfoFetchFailures >= COIND_DOWN_MODAL_FETCH_FAILURES_THRESHOLD) { return CoindDownModalRender.call(this); } @@ -55,6 +58,7 @@ const mapStateToProps = (state) => { ActiveCoin: { mode: state.ActiveCoin.mode, coin: state.ActiveCoin.coin, + getinfoFetchFailures: state.ActiveCoin.getinfoFetchFailures, }, displayCoindDownModal: state.Dashboard.displayCoindDownModal, debugLog: state.Settings.debugLog, diff --git a/react/src/reducers/activeCoin.js b/react/src/reducers/activeCoin.js index 914bc3f..5df873d 100644 --- a/react/src/reducers/activeCoin.js +++ b/react/src/reducers/activeCoin.js @@ -14,6 +14,7 @@ import { DASHBOARD_ACTIVE_COIN_GET_CACHE, DASHBOARD_ACTIVE_COIN_MAIN_BASILISK_ADDR, DASHBOARD_ACTIVE_ADDRESS, + DASHBOARD_ACTIVE_COIN_GETINFO_FAILURE, SYNCING_FULL_MODE, SYNCING_NATIVE_MODE, DASHBOARD_UPDATE, @@ -39,6 +40,7 @@ export function ActiveCoin(state = { activeAddress: null, progress: null, rescanInProgress: false, + getinfoFetchFailures: 0, }, action) { switch (action.type) { case DASHBOARD_ACTIVE_COIN_CHANGE: @@ -223,6 +225,14 @@ export function ActiveCoin(state = { return { ...state, progress: action.progress, + getinfoFetchFailures: !action.progress ? state.getinfoFetchFailures + 1 : 0, + }; + case DASHBOARD_ACTIVE_COIN_GETINFO_FAILURE: + console.warn('_getinfoFetchFailures', state.getinfoFetchFailures + 1); + + return { + ...state, + getinfoFetchFailures: state.getinfoFetchFailures + 1, }; case DASHBOARD_UPDATE: if (state.coin === action.coin) { diff --git a/react/src/translate/en.js b/react/src/translate/en.js index 99d6cd0..fc02070 100644 --- a/react/src/translate/en.js +++ b/react/src/translate/en.js @@ -378,7 +378,7 @@ export const _lang = { 'THIS_SCREEN_DOESNT_REFRESH': 'This screen does not auto refresh. ' + 'You will need to hit the Refresh button on the top right corner of the screen to get latest Jumblr data.', 'FEW_SECURITY_NOTES': 'Few Security Notes for your Privacy and Anonymity of funds', - 'FEW_SECURITY_NOTES_DESC1': 'Jumblr addresses addresses are your Private Addresses.', + 'FEW_SECURITY_NOTES_DESC1': 'Jumblr addresses are your Private Addresses.', 'FEW_SECURITY_NOTES_DESC2': 'DO NOT SHARE your Jumblr addresses with anyone.', 'FEW_SECURITY_NOTES_DESC3': 'Jumblr addresses are like YOUR PASSWORD. Keep them safe, secure and hidden.', 'FEW_SECURITY_NOTES_DESC4': 'Only YOU should know your Jumblr Address. Nobody else.', From 32c33cb4e1c65793d2106e2cbb2bb2f00393513d Mon Sep 17 00:00:00 2001 From: pbca26 Date: Sat, 16 Sep 2017 17:37:12 +0300 Subject: [PATCH 81/83] activating best chain progress handling fix --- react/src/actions/actions/nativeSyncInfo.js | 49 +++++++++++++------ .../walletsProgress/walletsProgress.js | 25 +++++++--- .../walletsProgress/walletsProgress.render.js | 5 +- react/src/reducers/activeCoin.js | 2 - 4 files changed, 55 insertions(+), 26 deletions(-) diff --git a/react/src/actions/actions/nativeSyncInfo.js b/react/src/actions/actions/nativeSyncInfo.js index 21fcabc..783fbe5 100644 --- a/react/src/actions/actions/nativeSyncInfo.js +++ b/react/src/actions/actions/nativeSyncInfo.js @@ -18,6 +18,8 @@ export function nativeGetinfoFailureState() { // TODO: use debug.log instead export function getSyncInfoNativeKMD(skipDebug, json, skipRemote) { + let _json = json; + if (skipRemote) { return dispatch => { dispatch(getSyncInfoNativeState(Config.iguanaLessMode ? json.info : json )); @@ -44,11 +46,15 @@ export function getSyncInfoNativeKMD(skipDebug, json, skipRemote) { ) );*/ console.warn('remote kmd node fetch failed', true); - dispatch(getSyncInfoNativeState({ remoteKMDNode: null })); + _json = _json.error; + _json['remoteKMDNode'] = null; + dispatch(getSyncInfoNativeState(_json)); }) .then(response => response.json()) .then(json => { - dispatch(getSyncInfoNativeState({ remoteKMDNode: Config.iguanaLessMode ? json.info : json })); + _json = _json.error; + _json['remoteKMDNode'] = json.info; + dispatch(getSyncInfoNativeState(_json)); }) .then(function() { if (!skipDebug) { @@ -60,23 +66,34 @@ export function getSyncInfoNativeKMD(skipDebug, json, skipRemote) { } function getSyncInfoNativeState(json, coin, skipDebug, skipRemote) { - if (coin === 'KMD' && - json && - json.error && - json.error.message.indexOf('Activating best') === -1) { - return getSyncInfoNativeKMD(skipDebug, json, skipRemote); + /*if (!json.remoteKMDNode) { + json = { error: { code: -28, message: 'Activating best chain...' } }; + }*/ + + if (json.remoteKMDNode) { + return { + type: SYNCING_NATIVE_MODE, + progress: json, + } } else { - if (json && + if (coin === 'KMD' && + json && json.error && - Config.cli.default) { - return { - type: SYNCING_NATIVE_MODE, - progress: json.error, - } + json.error.message.indexOf('Activating best') > -1) { + return getSyncInfoNativeKMD(skipDebug, json, skipRemote); } else { - return { - type: SYNCING_NATIVE_MODE, - progress: json.result ? json.result : json, + if (json && + json.error && + Config.cli.default) { + return { + type: SYNCING_NATIVE_MODE, + progress: json.error, + } + } else { + return { + type: SYNCING_NATIVE_MODE, + progress: json.result ? json.result : json, + } } } } diff --git a/react/src/components/dashboard/walletsProgress/walletsProgress.js b/react/src/components/dashboard/walletsProgress/walletsProgress.js index 81efe7c..7daaf05 100644 --- a/react/src/components/dashboard/walletsProgress/walletsProgress.js +++ b/react/src/components/dashboard/walletsProgress/walletsProgress.js @@ -107,14 +107,27 @@ class WalletsProgress extends React.Component { } if (temp[i].indexOf('progress=') > -1) { currentProgress = Number(temp[i].replace('progress=', '')) * 1000; - currentProgress = currentProgress >= 100 ? 100 : currentProgress; + if (currentProgress > 100) { + currentProgress = Number(temp[i].replace('progress=', '')) * 100; + } } } - return [ - currentBestChain, - currentProgress - ]; + if (this.props.ActiveCoin.progress.remoteKMDNode && + this.props.ActiveCoin.progress.remoteKMDNode.blocks) { + const longestHeight = this.props.ActiveCoin.progress.remoteKMDNode.blocks; + + return [ + currentBestChain, + currentProgress, + longestHeight + ]; + } else { + return [ + currentBestChain, + currentProgress + ]; + } } } @@ -131,7 +144,7 @@ class WalletsProgress extends React.Component { if (_parseProgress && _parseProgress[1]) { - return SyncPercentageRender.call(this, _parseProgress[1] === 1000 ? 100 : _parseProgress[1].toFixed(2)); + return SyncPercentageRender.call(this, _parseProgress[1].toFixed(2) + '%', _parseProgress[0], _parseProgress[2] ? _parseProgress[2] : null); } else { return LoadingBlocksRender.call(this); } diff --git a/react/src/components/dashboard/walletsProgress/walletsProgress.render.js b/react/src/components/dashboard/walletsProgress/walletsProgress.render.js index c4ce931..a3d6dfe 100644 --- a/react/src/components/dashboard/walletsProgress/walletsProgress.render.js +++ b/react/src/components/dashboard/walletsProgress/walletsProgress.render.js @@ -17,7 +17,7 @@ export const SyncErrorBlocksRender = function() { ); }; -export const SyncPercentageRender = function(syncPercentage) { +export const SyncPercentageRender = function(syncPercentage, currentBlock, maxHeight) { if (this.props.ActiveCoin.rescanInProgress) { return (
    ); } else { + // if (this.props.ActiveCoin.progress) return (
    - { syncPercentage === '100.00%' ? '100%' : syncPercentage } | { this.props.ActiveCoin.progress.blocks } / { this.props.ActiveCoin.progress.longestchain } | { translate('INDEX.CONNECTIONS') }: { this.props.ActiveCoin.progress.connections } + { syncPercentage === '100.00%' ? '100%' : syncPercentage } | { this.props.ActiveCoin.progress.blocks || currentBlock } / { this.props.ActiveCoin.progress.longestchain || maxHeight } | { translate('INDEX.CONNECTIONS') }: { this.props.ActiveCoin.progress.connections }
    ); } diff --git a/react/src/reducers/activeCoin.js b/react/src/reducers/activeCoin.js index 5df873d..57ee12a 100644 --- a/react/src/reducers/activeCoin.js +++ b/react/src/reducers/activeCoin.js @@ -228,8 +228,6 @@ export function ActiveCoin(state = { getinfoFetchFailures: !action.progress ? state.getinfoFetchFailures + 1 : 0, }; case DASHBOARD_ACTIVE_COIN_GETINFO_FAILURE: - console.warn('_getinfoFetchFailures', state.getinfoFetchFailures + 1); - return { ...state, getinfoFetchFailures: state.getinfoFetchFailures + 1, From 49fb98887c251307147bcb41393cb3c70e67cbe1 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Sat, 16 Sep 2017 19:52:25 +0300 Subject: [PATCH 82/83] progress render hide blocks placeholder cond. --- .../dashboard/walletsProgress/walletsProgress.render.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/react/src/components/dashboard/walletsProgress/walletsProgress.render.js b/react/src/components/dashboard/walletsProgress/walletsProgress.render.js index a3d6dfe..96ae9e5 100644 --- a/react/src/components/dashboard/walletsProgress/walletsProgress.render.js +++ b/react/src/components/dashboard/walletsProgress/walletsProgress.render.js @@ -36,12 +36,11 @@ export const SyncPercentageRender = function(syncPercentage, currentBlock, maxHe
    ); } else { - // if (this.props.ActiveCoin.progress) return (
    - { syncPercentage === '100.00%' ? '100%' : syncPercentage } | { this.props.ActiveCoin.progress.blocks || currentBlock } / { this.props.ActiveCoin.progress.longestchain || maxHeight } | { translate('INDEX.CONNECTIONS') }: { this.props.ActiveCoin.progress.connections } + { syncPercentage === '100.00%' ? '100%' : syncPercentage } | { this.props.ActiveCoin.progress.blocks || currentBlock } / { this.props.ActiveCoin.progress.longestchain || maxHeight } | { translate('INDEX.CONNECTIONS') }: { this.props.ActiveCoin.progress.connections }
    ); } From 0b1fc5c42a0d6c6ea1c2626148e876034d85c8e1 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Sun, 17 Sep 2017 13:32:24 +0300 Subject: [PATCH 83/83] loading window css height fix --- assets/mainWindow/css/loading.css | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/assets/mainWindow/css/loading.css b/assets/mainWindow/css/loading.css index 8bb4d5a..5fbddc8 100644 --- a/assets/mainWindow/css/loading.css +++ b/assets/mainWindow/css/loading.css @@ -1,7 +1,5 @@ body { - overflow: hidden !important; border: solid 1px #ccc; - height: 300px; user-select: none; cursor: default; } @@ -21,27 +19,15 @@ body { margin: auto; } -.pulse-loader { - position: absolute; - top: 10px; - left: -100px; - margin: 80px 50px; - width: 400px !important; -} - body.agamaMode { background-color: rgba(33, 33, 33, 0.85); padding-top: 40px; color: #fff; - height: 300px; -} - -body.loading-window { - height: 355px; } +body.loading-window, body.agama-default-window-height { - height: 355px !important; + height: 355px; } body.agama-app-settings-window { @@ -455,8 +441,8 @@ button.toast-close-button { margin: 5px 0; } -.iguana-less { - height: 570px !important; +body.iguana-less { + height: 570px; } .iguana-less #iguanaCorePort, .iguana-less #useBasiliskInstance {