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. 9
      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
- jumblr
- zcashparams folder check
- claim interest modal
v0.2.0.21a-beta
--------------

9
react/src/actions/actions/nativeSyncInfo.js

@ -182,7 +182,12 @@ export function getSyncInfoNative(coin, skipDebug) {
true
)
);
if (coin === 'KMD') {
dispatch(getDebugLog('komodo', 50));
} else {
dispatch(getDebugLog('komodo', 50, coin));
}
dispatch(toggleCoindDownModal(true));
} else {
json = JSON.parse(json);
@ -190,7 +195,11 @@ export function getSyncInfoNative(coin, skipDebug) {
if (json.error &&
json.error.message.indexOf('Activating best') === -1) {
if (coin === 'KMD') {
dispatch(getDebugLog('komodo', 1));
} else {
dispatch(getDebugLog('komodo', 1, coin));
}
}
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 = {
'herdname': target,
'lastLines': linesCount
};
if (acName) {
payload['ac'] = acName;
}
return dispatch => {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/debuglog`, {
method: 'POST',

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

@ -16,7 +16,7 @@ const CoindDownModalRender = function () {
onClick={ this.dismiss }>
<span>×</span>
</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 className="modal-body">
<div className="vertical-align text-center">

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

@ -371,7 +371,7 @@ export const JumblrRender = function() {
<WalletsNativeSend
{...this.props}
renderFormOnly="true"
nativeActiveSection="send" />
activeSection="send" />
</div>
</div>
</div>
@ -476,7 +476,7 @@ export const JumblrRender = function() {
<div className={ 'tab-pane' + (this.state.activeTab === 1 ? ' active' : '') }>
<ReceiveCoin
{...this.props.ActiveCoin}
nativeActiveSection="receive"
activeSection="receive"
renderTableOnly="true" />
</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.hasNoAmount) {
if (!this.hasNoAmount(address)) {
items.push(
AddressItemRender.call(this, address, type)
);
@ -207,10 +207,10 @@ class ReceiveCoin extends React.Component {
}
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
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);
}

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

@ -64,13 +64,8 @@ export const AddressItemRender = function(address, type) {
export const _ReceiveCoinTableRender = function() {
return (
<span>
{ this.checkTotalBalance() === 0 &&
{ this.checkTotalBalance() !== 0 &&
<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">
<input
type="checkbox"
@ -79,6 +74,11 @@ export const _ReceiveCoinTableRender = function() {
className="slider"
onClick={ this.toggleVisibleAddress }></div>
</label>
<div
className="toggle-label margin-right-15 pointer"
onClick={ this.toggleVisibleAddress }>
{ translate('INDEX.TOGGLE_ZERO_ADDRESSES') }
</div>
</div>
}
<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() {
return this.isNativeMode() && this.props.ActiveCoin.nativeActiveSection === 'default';
return this.isNativeMode() && this.props.ActiveCoin.activeSection === 'default';
}
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.mode === 'native' &&
this.props.ActiveCoin.nativeActiveSection === 'default'
this.props.ActiveCoin.activeSection === 'default'
)) {
return WalletsDataRender.call(this);
} 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 { connect } from 'react-redux';
import WalletsNativeInfoRender from './walletsInfo.render';
import { toggleClaimInterestModal } from '../../../actions/actionCreators';
import Store from '../../../store';
import WalletsNativeInfoRender from './walletsNativeInfo.render';
class WalletsNativeInfo extends React.Component {
constructor() {
@ -18,7 +18,7 @@ class WalletsNativeInfo extends React.Component {
if (this.props &&
this.props.Dashboard &&
this.props.Dashboard.progress &&
this.props.ActiveCoin.nativeActiveSection === 'settings') {
this.props.ActiveCoin.activeSection === 'settings') {
return WalletsNativeInfoRender.call(this);
}
@ -30,7 +30,7 @@ const mapStateToProps = (state) => {
return {
ActiveCoin: {
coin: state.ActiveCoin.coin,
nativeActiveSection: state.ActiveCoin.nativeActiveSection,
activeSection: state.ActiveCoin.activeSection,
},
Dashboard: {
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 ClaimInterestModal from '../claimInterestModal/claimInterestModal';
const WalletsNativeInfoRender = function() {
const WalletsInfoRender = function() {
return (
<div>
<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 WalletsBalance from '../walletsBalance/walletsBalance';
import WalletsNativeInfo from '../walletsNativeInfo/walletsNativeInfo';
import WalletsInfo from '../walletsInfo/walletsInfo';
import WalletsNativeSend from '../walletsNativeSend/walletsNativeSend';
import WalletsProgress from '../walletsProgress/walletsProgress';
import WalletsData from '../walletsData/walletsData';
@ -34,7 +34,7 @@ const WalletsNativeRender = function() {
<ReceiveCoin />
<WalletsData />
<WalletsNativeSend />
<WalletsNativeInfo />
<WalletsInfo />
</div>
</div>
</div>

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

@ -352,7 +352,7 @@ class WalletsNativeSend extends React.Component {
render() {
if (this.props &&
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);
}

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

@ -71,7 +71,7 @@ class WalletsNav extends React.Component {
if (this.props.ActiveCoin.mode === 'native') {
Store.dispatch(
toggleDashboardActiveSection(
this.props.ActiveCoin.nativeActiveSection === 'settings' ? 'default' : 'settings'
this.props.ActiveCoin.activeSection === 'settings' ? 'default' : 'settings'
)
);
} else {
@ -91,7 +91,7 @@ class WalletsNav extends React.Component {
if (this.props.ActiveCoin.mode === 'native') {
Store.dispatch(
toggleDashboardActiveSection(
this.props.ActiveCoin.nativeActiveSection === 'send' ? 'default' : 'send'
this.props.ActiveCoin.activeSection === 'send' ? 'default' : 'send'
)
);
} else {
@ -103,7 +103,7 @@ class WalletsNav extends React.Component {
if (this.props.ActiveCoin.mode === 'native') {
Store.dispatch(
toggleDashboardActiveSection(
this.props.ActiveCoin.nativeActiveSection === 'receive' ? 'default' : 'receive'
this.props.ActiveCoin.activeSection === 'receive' ? 'default' : 'receive'
)
);
} 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
// into the rest of the components
(!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];
return WalletsTxInfoRender.call(this, txInfo);
}

9
react/src/components/overrides.scss

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

14
react/src/reducers/activeCoin.js

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

Loading…
Cancel
Save