Browse Source

Merge branch 'redux' into feature/prop-refactor

# Conflicts:
#	react/src/components/dashboard/walletsInfo/walletsInfo.js
#	react/src/components/dashboard/walletsNative/walletsNative.render.js
all-modes
Miika Turunen 8 years ago
parent
commit
4af1c1baf6
  1. 1
      react/change.log
  2. 13
      react/src/actions/actions/nativeSyncInfo.js
  3. 6
      react/src/actions/actions/settings.js
  4. 2
      react/src/components/dashboard/coindDownModal/coindDownModal.render.js
  5. 4
      react/src/components/dashboard/jumblr/jumblr.render.js
  6. 6
      react/src/components/dashboard/receiveCoin/receiveCoin.js
  7. 12
      react/src/components/dashboard/receiveCoin/receiveCoin.render.js
  8. 2
      react/src/components/dashboard/walletsBalance/walletsBalance.js
  9. 2
      react/src/components/dashboard/walletsData/walletsData.js
  10. 6
      react/src/components/dashboard/walletsInfo/walletsInfo.js
  11. 4
      react/src/components/dashboard/walletsInfo/walletsInfo.render.js
  12. 4
      react/src/components/dashboard/walletsNative/walletsNative.render.js
  13. 2
      react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js
  14. 6
      react/src/components/dashboard/walletsNav/walletsNav.js
  15. 2
      react/src/components/dashboard/walletsTxInfo/walletsTxInfo.js
  16. 9
      react/src/components/overrides.scss
  17. 14
      react/src/reducers/activeCoin.js

1
react/change.log

@ -19,6 +19,7 @@ UI:
- added coqui assetchain - added coqui assetchain
- jumblr - jumblr
- zcashparams folder check - zcashparams folder check
- claim interest modal
v0.2.0.21a-beta v0.2.0.21a-beta
-------------- --------------

13
react/src/actions/actions/nativeSyncInfo.js

@ -182,7 +182,12 @@ export function getSyncInfoNative(coin, skipDebug) {
true true
) )
); );
dispatch(getDebugLog('komodo', 50));
if (coin === 'KMD') {
dispatch(getDebugLog('komodo', 50));
} else {
dispatch(getDebugLog('komodo', 50, coin));
}
dispatch(toggleCoindDownModal(true)); dispatch(toggleCoindDownModal(true));
} else { } else {
json = JSON.parse(json); json = JSON.parse(json);
@ -190,7 +195,11 @@ export function getSyncInfoNative(coin, skipDebug) {
if (json.error && if (json.error &&
json.error.message.indexOf('Activating best') === -1) { json.error.message.indexOf('Activating best') === -1) {
dispatch(getDebugLog('komodo', 1)); if (coin === 'KMD') {
dispatch(getDebugLog('komodo', 1));
} else {
dispatch(getDebugLog('komodo', 1, coin));
}
} }
if (Config.debug) { if (Config.debug) {

6
react/src/actions/actions/settings.js

@ -167,12 +167,16 @@ function getDebugLogState(json) {
} }
} }
export function getDebugLog(target, linesCount) { export function getDebugLog(target, linesCount, acName) {
const payload = { const payload = {
'herdname': target, 'herdname': target,
'lastLines': linesCount 'lastLines': linesCount
}; };
if (acName) {
payload['ac'] = acName;
}
return dispatch => { return dispatch => {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/debuglog`, { return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/debuglog`, {
method: 'POST', method: 'POST',

2
react/src/components/dashboard/coindDownModal/coindDownModal.render.js

@ -16,7 +16,7 @@ const CoindDownModalRender = function () {
onClick={ this.dismiss }> onClick={ this.dismiss }>
<span>×</span> <span>×</span>
</button> </button>
<h4 className="modal-title white">Komodod is down!</h4> <h4 className="modal-title white">{ this.props.ActiveCoin.coin === 'KMD' ? 'Komodod' : `Komodod / ${this.props.ActiveCoin.coin}` } is down!</h4>
</div> </div>
<div className="modal-body"> <div className="modal-body">
<div className="vertical-align text-center"> <div className="vertical-align text-center">

4
react/src/components/dashboard/jumblr/jumblr.render.js

@ -371,7 +371,7 @@ export const JumblrRender = function() {
<WalletsNativeSend <WalletsNativeSend
{...this.props} {...this.props}
renderFormOnly="true" renderFormOnly="true"
nativeActiveSection="send" /> activeSection="send" />
</div> </div>
</div> </div>
</div> </div>
@ -476,7 +476,7 @@ export const JumblrRender = function() {
<div className={ 'tab-pane' + (this.state.activeTab === 1 ? ' active' : '') }> <div className={ 'tab-pane' + (this.state.activeTab === 1 ? ' active' : '') }>
<ReceiveCoin <ReceiveCoin
{...this.props.ActiveCoin} {...this.props.ActiveCoin}
nativeActiveSection="receive" activeSection="receive"
renderTableOnly="true" /> renderTableOnly="true" />
</div> </div>
</div> </div>

6
react/src/components/dashboard/receiveCoin/receiveCoin.js

@ -188,7 +188,7 @@ class ReceiveCoin extends React.Component {
} }
if (this.state.hideZeroAddresses) { if (this.state.hideZeroAddresses) {
if (!this.hasNoAmount) { if (!this.hasNoAmount(address)) {
items.push( items.push(
AddressItemRender.call(this, address, type) AddressItemRender.call(this, address, type)
); );
@ -207,10 +207,10 @@ class ReceiveCoin extends React.Component {
} }
render() { render() {
// TODO nativeActiveSection === 'receive' should be removed when native mode is fully merged // TODO activeSection === 'receive' should be removed when native mode is fully merged
// into the rest of the components // into the rest of the components
if (this.props && if (this.props &&
(this.props.receive || (this.isNativeMode() && this.props.nativeActiveSection === 'receive'))) { (this.props.receive || (this.isNativeMode() && this.props.activeSection === 'receive'))) {
return ReceiveCoinRender.call(this); return ReceiveCoinRender.call(this);
} }

12
react/src/components/dashboard/receiveCoin/receiveCoin.render.js

@ -64,13 +64,8 @@ export const AddressItemRender = function(address, type) {
export const _ReceiveCoinTableRender = function() { export const _ReceiveCoinTableRender = function() {
return ( return (
<span> <span>
{ this.checkTotalBalance() === 0 && { this.checkTotalBalance() !== 0 &&
<div className="text-left padding-top-10 padding-bottom-10"> <div className="text-left padding-top-10 padding-bottom-10">
<div
className="toggle-label margin-right-15 pointer"
onClick={ this.toggleVisibleAddress }>
{ translate('INDEX.TOGGLE_ZERO_ADDRESSES') }
</div>
<label className="switch"> <label className="switch">
<input <input
type="checkbox" type="checkbox"
@ -79,6 +74,11 @@ export const _ReceiveCoinTableRender = function() {
className="slider" className="slider"
onClick={ this.toggleVisibleAddress }></div> onClick={ this.toggleVisibleAddress }></div>
</label> </label>
<div
className="toggle-label margin-right-15 pointer"
onClick={ this.toggleVisibleAddress }>
{ translate('INDEX.TOGGLE_ZERO_ADDRESSES') }
</div>
</div> </div>
} }
<table className="table table-hover dataTable table-striped"> <table className="table table-hover dataTable table-striped">

2
react/src/components/dashboard/walletsBalance/walletsBalance.js

@ -168,7 +168,7 @@ class WalletsBalance extends React.Component {
} }
isNativeBalanceActive() { isNativeBalanceActive() {
return this.isNativeMode() && this.props.ActiveCoin.nativeActiveSection === 'default'; return this.isNativeMode() && this.props.ActiveCoin.activeSection === 'default';
} }
isNonNativeBalanceActive() { isNonNativeBalanceActive() {

2
react/src/components/dashboard/walletsData/walletsData.js

@ -639,7 +639,7 @@ class WalletsData extends React.Component {
!this.props.ActiveCoin.receive !this.props.ActiveCoin.receive
) || ( ) || (
this.props.ActiveCoin.mode === 'native' && this.props.ActiveCoin.mode === 'native' &&
this.props.ActiveCoin.nativeActiveSection === 'default' this.props.ActiveCoin.activeSection === 'default'
)) { )) {
return WalletsDataRender.call(this); return WalletsDataRender.call(this);
} else { } else {

6
react/src/components/dashboard/walletsNativeInfo/walletsNativeInfo.js → react/src/components/dashboard/walletsInfo/walletsInfo.js

@ -1,8 +1,8 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import WalletsNativeInfoRender from './walletsInfo.render';
import { toggleClaimInterestModal } from '../../../actions/actionCreators'; import { toggleClaimInterestModal } from '../../../actions/actionCreators';
import Store from '../../../store'; import Store from '../../../store';
import WalletsNativeInfoRender from './walletsNativeInfo.render';
class WalletsNativeInfo extends React.Component { class WalletsNativeInfo extends React.Component {
constructor() { constructor() {
@ -18,7 +18,7 @@ class WalletsNativeInfo extends React.Component {
if (this.props && if (this.props &&
this.props.Dashboard && this.props.Dashboard &&
this.props.Dashboard.progress && this.props.Dashboard.progress &&
this.props.ActiveCoin.nativeActiveSection === 'settings') { this.props.ActiveCoin.activeSection === 'settings') {
return WalletsNativeInfoRender.call(this); return WalletsNativeInfoRender.call(this);
} }
@ -30,7 +30,7 @@ const mapStateToProps = (state) => {
return { return {
ActiveCoin: { ActiveCoin: {
coin: state.ActiveCoin.coin, coin: state.ActiveCoin.coin,
nativeActiveSection: state.ActiveCoin.nativeActiveSection, activeSection: state.ActiveCoin.activeSection,
}, },
Dashboard: { Dashboard: {
progress: state.Dashboard.progress progress: state.Dashboard.progress

4
react/src/components/dashboard/walletsNativeInfo/walletsNativeInfo.render.js → react/src/components/dashboard/walletsInfo/walletsInfo.render.js

@ -2,7 +2,7 @@ import React from 'react';
import { translate } from '../../../translate/translate'; import { translate } from '../../../translate/translate';
import ClaimInterestModal from '../claimInterestModal/claimInterestModal'; import ClaimInterestModal from '../claimInterestModal/claimInterestModal';
const WalletsNativeInfoRender = function() { const WalletsInfoRender = function() {
return ( return (
<div> <div>
<div className="col-xlg-6 col-md-4"> <div className="col-xlg-6 col-md-4">
@ -156,4 +156,4 @@ const WalletsNativeInfoRender = function() {
); );
}; };
export default WalletsNativeInfoRender; export default WalletsInfoRender;

4
react/src/components/dashboard/walletsNative/walletsNative.render.js

@ -1,6 +1,6 @@
import React from 'react'; import React from 'react';
import WalletsBalance from '../walletsBalance/walletsBalance'; import WalletsBalance from '../walletsBalance/walletsBalance';
import WalletsNativeInfo from '../walletsNativeInfo/walletsNativeInfo'; import WalletsInfo from '../walletsInfo/walletsInfo';
import WalletsNativeSend from '../walletsNativeSend/walletsNativeSend'; import WalletsNativeSend from '../walletsNativeSend/walletsNativeSend';
import WalletsProgress from '../walletsProgress/walletsProgress'; import WalletsProgress from '../walletsProgress/walletsProgress';
import WalletsData from '../walletsData/walletsData'; import WalletsData from '../walletsData/walletsData';
@ -34,7 +34,7 @@ const WalletsNativeRender = function() {
<ReceiveCoin /> <ReceiveCoin />
<WalletsData /> <WalletsData />
<WalletsNativeSend /> <WalletsNativeSend />
<WalletsNativeInfo /> <WalletsInfo />
</div> </div>
</div> </div>
</div> </div>

2
react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js

@ -352,7 +352,7 @@ class WalletsNativeSend extends React.Component {
render() { render() {
if (this.props && if (this.props &&
this.props.ActiveCoin && this.props.ActiveCoin &&
(this.props.ActiveCoin.nativeActiveSection === 'send' || this.props.nativeActiveSection === 'send')) { (this.props.ActiveCoin.activeSection === 'send' || this.props.activeSection === 'send')) {
return WalletsNativeSendRender.call(this); return WalletsNativeSendRender.call(this);
} }

6
react/src/components/dashboard/walletsNav/walletsNav.js

@ -71,7 +71,7 @@ class WalletsNav extends React.Component {
if (this.props.ActiveCoin.mode === 'native') { if (this.props.ActiveCoin.mode === 'native') {
Store.dispatch( Store.dispatch(
toggleDashboardActiveSection( toggleDashboardActiveSection(
this.props.ActiveCoin.nativeActiveSection === 'settings' ? 'default' : 'settings' this.props.ActiveCoin.activeSection === 'settings' ? 'default' : 'settings'
) )
); );
} else { } else {
@ -91,7 +91,7 @@ class WalletsNav extends React.Component {
if (this.props.ActiveCoin.mode === 'native') { if (this.props.ActiveCoin.mode === 'native') {
Store.dispatch( Store.dispatch(
toggleDashboardActiveSection( toggleDashboardActiveSection(
this.props.ActiveCoin.nativeActiveSection === 'send' ? 'default' : 'send' this.props.ActiveCoin.activeSection === 'send' ? 'default' : 'send'
) )
); );
} else { } else {
@ -103,7 +103,7 @@ class WalletsNav extends React.Component {
if (this.props.ActiveCoin.mode === 'native') { if (this.props.ActiveCoin.mode === 'native') {
Store.dispatch( Store.dispatch(
toggleDashboardActiveSection( toggleDashboardActiveSection(
this.props.ActiveCoin.nativeActiveSection === 'receive' ? 'default' : 'receive' this.props.ActiveCoin.activeSection === 'receive' ? 'default' : 'receive'
) )
); );
} else { } else {

2
react/src/components/dashboard/walletsTxInfo/walletsTxInfo.js

@ -44,7 +44,7 @@ class WalletsTxInfo extends React.Component {
// TODO the conditions below should be merged once the native mode components are fully merged // TODO the conditions below should be merged once the native mode components are fully merged
// into the rest of the components // into the rest of the components
(!this.isNativeMode() || (!this.isNativeMode() ||
(this.isNativeMode() && this.props.ActiveCoin.nativeActiveSection === 'default'))) { (this.isNativeMode() && this.props.ActiveCoin.activeSection === 'default'))) {
const txInfo = sortByDate(this.props.ActiveCoin.txhistory)[this.props.ActiveCoin.showTransactionInfoTxIndex]; const txInfo = sortByDate(this.props.ActiveCoin.txhistory)[this.props.ActiveCoin.showTransactionInfoTxIndex];
return WalletsTxInfoRender.call(this, txInfo); return WalletsTxInfoRender.call(this, txInfo);
} }

9
react/src/components/overrides.scss

@ -629,12 +629,19 @@ select{
> div { > div {
height: 100%; height: 100%;
} }
.form-group {
&.form-material {
&.floating {
height: 80%;
}
}
}
.page-content { .page-content {
width: 90%; width: 90%;
height: 100%; height: 100%;
textarea { textarea {
min-height: 200px; height: 100%;
} }
} }
} }

14
react/src/reducers/activeCoin.js

@ -27,7 +27,7 @@ export function ActiveCoin(state = {
send: false, send: false,
receive: false, receive: false,
balance: 0, balance: 0,
nativeActiveSection: 'default', activeSection: 'default',
showTransactionInfo: false, showTransactionInfo: false,
showTransactionInfoTxIndex: null, showTransactionInfoTxIndex: null,
txhistory: [], txhistory: [],
@ -53,7 +53,7 @@ export function ActiveCoin(state = {
receive: state.receive, receive: state.receive,
showTransactionInfo: state.showTransactionInfo, showTransactionInfo: state.showTransactionInfo,
showTransactionInfoTxIndex: state.showTransactionInfoTxIndex, showTransactionInfoTxIndex: state.showTransactionInfoTxIndex,
nativeActiveSection: state.nativeActiveSection, activeSection: state.activeSection,
lastSendToResponse: state.lastSendToResponse, lastSendToResponse: state.lastSendToResponse,
mainBasiliskAddress: state.mainBasiliskAddress, mainBasiliskAddress: state.mainBasiliskAddress,
opids: state.opids, opids: state.opids,
@ -73,7 +73,7 @@ export function ActiveCoin(state = {
receive: _coinData.receive, receive: _coinData.receive,
showTransactionInfo: _coinData.showTransactionInfo, showTransactionInfo: _coinData.showTransactionInfo,
showTransactionInfoTxIndex: _coinData.showTransactionInfoTxIndex, showTransactionInfoTxIndex: _coinData.showTransactionInfoTxIndex,
nativeActiveSection: _coinData.nativeActiveSection, activeSection: _coinData.activeSection,
lastSendToResponse: _coinData.lastSendToResponse, lastSendToResponse: _coinData.lastSendToResponse,
mainBasiliskAddress: _coinData.mainBasiliskAddress, mainBasiliskAddress: _coinData.mainBasiliskAddress,
opids: _coinData.opids, opids: _coinData.opids,
@ -91,7 +91,7 @@ export function ActiveCoin(state = {
receive: state.receive, receive: state.receive,
showTransactionInfo: state.showTransactionInfo, showTransactionInfo: state.showTransactionInfo,
showTransactionInfoTxIndex: state.showTransactionInfoTxIndex, showTransactionInfoTxIndex: state.showTransactionInfoTxIndex,
nativeActiveSection: state.nativeActiveSection, activeSection: state.activeSection,
lastSendToResponse: state.lastSendToResponse, lastSendToResponse: state.lastSendToResponse,
mainBasiliskAddress: state.mainBasiliskAddress, mainBasiliskAddress: state.mainBasiliskAddress,
opids: state.opids, opids: state.opids,
@ -110,7 +110,7 @@ export function ActiveCoin(state = {
receive: false, receive: false,
showTransactionInfo: false, showTransactionInfo: false,
showTransactionInfoTxIndex: null, showTransactionInfoTxIndex: null,
nativeActiveSection: 'default', activeSection: 'default',
}); });
} else { } else {
return Object.assign({}, state, { return Object.assign({}, state, {
@ -122,7 +122,7 @@ export function ActiveCoin(state = {
receive: false, receive: false,
showTransactionInfo: false, showTransactionInfo: false,
showTransactionInfoTxIndex: null, showTransactionInfoTxIndex: null,
nativeActiveSection: 'default', activeSection: 'default',
}); });
} }
} }
@ -151,7 +151,7 @@ export function ActiveCoin(state = {
}); });
case DASHBOARD_ACTIVE_SECTION: case DASHBOARD_ACTIVE_SECTION:
return Object.assign({}, state, { return Object.assign({}, state, {
nativeActiveSection: action.section, activeSection: action.section,
}); });
case DASHBOARD_ACTIVE_TXINFO_MODAL: case DASHBOARD_ACTIVE_TXINFO_MODAL:
return Object.assign({}, state, { return Object.assign({}, state, {

Loading…
Cancel
Save