Browse Source

Merge branch 'redux' into tx-history-improvements

# Conflicts:
#	react/src/components/dashboard/walletsBalance/walletsBalance.js
#	react/src/components/dashboard/walletsData/walletsData.js
#	react/src/components/dashboard/walletsData/walletsData.render.js
all-modes
petitPapillon 8 years ago
parent
commit
3e4e948dff
  1. 4
      assets/mainWindow/css/loading.css
  2. 7
      assets/mainWindow/js/loading.js
  3. 13
      react/change.log
  4. 17
      react/src/actions/actionCreators.js
  5. 2
      react/src/actions/actions/addCoin.js
  6. 6
      react/src/actions/actions/addressBalance.js
  7. 6
      react/src/actions/actions/atomic.js
  8. 7
      react/src/actions/actions/basiliskCache.js
  9. 6
      react/src/actions/actions/basiliskProcessAddress.js
  10. 2
      react/src/actions/actions/basiliskTxHistory.js
  11. 6
      react/src/actions/actions/cli.js
  12. 6
      react/src/actions/actions/coinList.js
  13. 6
      react/src/actions/actions/createWallet.js
  14. 2
      react/src/actions/actions/dexCoins.js
  15. 6
      react/src/actions/actions/edexBalance.js
  16. 6
      react/src/actions/actions/edexGetTx.js
  17. 2
      react/src/actions/actions/fullTxHistory.js
  18. 5
      react/src/actions/actions/getAddrByAccount.js
  19. 5
      react/src/actions/actions/iguanaHelpers.js
  20. 6
      react/src/actions/actions/iguanaInstance.js
  21. 6
      react/src/actions/actions/log.js
  22. 18
      react/src/actions/actions/logout.js
  23. 2
      react/src/actions/actions/nativeBalance.js
  24. 2
      react/src/actions/actions/nativeNewAddress.js
  25. 2
      react/src/actions/actions/nativeSend.js
  26. 21
      react/src/actions/actions/nativeSyncInfo.js
  27. 2
      react/src/actions/actions/nativeTxHistory.js
  28. 6
      react/src/actions/actions/notary.js
  29. 2
      react/src/actions/actions/sendFullBasilisk.js
  30. 49
      react/src/actions/actions/settings.js
  31. 6
      react/src/actions/actions/syncInfo.js
  32. 6
      react/src/actions/actions/syncOnly.js
  33. 6
      react/src/actions/actions/sysInfo.js
  34. 6
      react/src/actions/actions/update.js
  35. 2
      react/src/actions/actions/walletAuth.js
  36. 2
      react/src/actions/storeType.js
  37. 2
      react/src/components/addcoin/addcoin.js
  38. 4
      react/src/components/addcoin/addcoin.render.js
  39. 2
      react/src/components/addcoin/addcoin.scss
  40. 2
      react/src/components/addcoin/addcoinOptionsCrypto.js
  41. 24
      react/src/components/addcoin/coin-selectors.render.js
  42. 20
      react/src/components/dashboard/about/about.js
  43. 2
      react/src/components/dashboard/atomic/atomic.render.js
  44. 8
      react/src/components/dashboard/coinTile/coinTileItem.js
  45. 47
      react/src/components/dashboard/coindDownModal/coindDownModal.js
  46. 46
      react/src/components/dashboard/coindDownModal/coindDownModal.render.js
  47. 4
      react/src/components/dashboard/main/dashboard.render.js
  48. 3
      react/src/components/dashboard/navbar/navbar.js
  49. 2
      react/src/components/dashboard/notifications/notifications.js
  50. 13
      react/src/components/dashboard/sendCoin/sendCoin.js
  51. 71
      react/src/components/dashboard/settings/settings.js
  52. 10
      react/src/components/dashboard/settings/settings.render.js
  53. 2
      react/src/components/dashboard/walletsBalance/walletsBalance.js
  54. 26
      react/src/components/dashboard/walletsBalance/walletsBalance.render.js
  55. 20
      react/src/components/dashboard/walletsData/walletsData.js
  56. 14
      react/src/components/dashboard/walletsData/walletsData.render.js
  57. 7
      react/src/components/dashboard/walletsNative/walletsNative.js
  58. 2
      react/src/components/dashboard/walletsNav/walletsNav.js
  59. 72
      react/src/components/dashboard/walletsProgress/walletsProgress.js
  60. 4
      react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js
  61. 2
      react/src/components/login/login.js
  62. 15
      react/src/components/login/login.render.js
  63. 25
      react/src/components/login/login.scss
  64. 65
      react/src/components/overrides.scss
  65. 12
      react/src/config.js
  66. 9
      react/src/reducers/dashboard.js
  67. 12
      react/src/reducers/index.js
  68. 6
      react/src/translate/translate.js

4
assets/mainWindow/css/loading.css

@ -106,3 +106,7 @@ body.agamaMode {
.btn:last-child { .btn:last-child {
margin-left: 20px; margin-left: 20px;
} }
.btn.btn-primary.btn-close-app {
margin: 0;
}

7
assets/mainWindow/js/loading.js

@ -6,6 +6,13 @@
window.hide(); window.hide();
} }
function quitApp() {
const remote = require('electron').remote;
const window = remote.getCurrentWindow();
window.forseCloseApp();
}
function normalStart() { function normalStart() {
const remote = require('electron').remote; const remote = require('electron').remote;
let appConf = remote.getCurrentWindow().appConfig; let appConf = remote.getCurrentWindow().appConfig;

13
react/change.log

@ -1,3 +1,16 @@
v0.2.0.22a-beta
--------------
UI:
- fixed activating best chain progress update
- prevent running two agama instances
- cli passphru fix
- fixed logout bug
- minor placeholders fixes
- hide address dropdown if wallet has only one address
- komodod crash report modal
- values rounding (up to 6 decimals)
- add coin multi ui reflow fix
v0.2.0.21a-beta v0.2.0.21a-beta
-------------- --------------
UI: UI:

17
react/src/actions/actionCreators.js

@ -1,7 +1,6 @@
import 'whatwg-fetch'; import 'whatwg-fetch';
import 'bluebird'; import 'bluebird';
import _config from '../config';
import { translate } from '../translate/translate'; import { translate } from '../translate/translate';
import { import {
GET_ACTIVE_COINS, GET_ACTIVE_COINS,
@ -26,6 +25,7 @@ import {
DASHBOARD_ACTIVE_COIN_CHANGE, DASHBOARD_ACTIVE_COIN_CHANGE,
ACTIVE_COIN_GET_ADDRESSES, ACTIVE_COIN_GET_ADDRESSES,
DASHBOARD_ACTIVE_COIN_NATIVE_TXHISTORY, DASHBOARD_ACTIVE_COIN_NATIVE_TXHISTORY,
DISPLAY_COIND_DOWN_MODAL,
START_INTERVAL, START_INTERVAL,
STOP_INTERVAL STOP_INTERVAL
} from './storeType'; } from './storeType';
@ -68,14 +68,6 @@ export * from './actions/iguanaHelpers';
export * from './actions/cli'; export * from './actions/cli';
export * from './actions/update'; export * from './actions/update';
export let Config;
try {
Config = window.require('electron').remote.getCurrentWindow().appConfig;
} catch (e) {
Config = _config;
}
export function changeActiveAddress(address) { export function changeActiveAddress(address) {
return { return {
type: DASHBOARD_ACTIVE_ADDRESS, type: DASHBOARD_ACTIVE_ADDRESS,
@ -360,3 +352,10 @@ export function stopInterval(name, intervals) {
name, name,
} }
} }
export function toggleCoindDownModal(display) {
return {
type: DISPLAY_COIND_DOWN_MODAL,
displayCoindDownModal: display,
}
}

2
react/src/actions/actions/addCoin.js

@ -1,7 +1,7 @@
import { translate } from '../../translate/translate'; import { translate } from '../../translate/translate';
import Config from '../../config';
import { import {
triggerToaster, triggerToaster,
Config,
toggleAddcoinModal, toggleAddcoinModal,
getDexCoins, getDexCoins,
startIguanaInstance, startIguanaInstance,

6
react/src/actions/actions/addressBalance.js

@ -1,9 +1,6 @@
import { import { ACTIVE_COIN_GET_ADDRESSES } from '../storeType';
ACTIVE_COIN_GET_ADDRESSES
} from '../storeType';
import { import {
triggerToaster, triggerToaster,
Config,
shepherdGroomPost, shepherdGroomPost,
getPassthruAgent, getPassthruAgent,
iguanaHashHex iguanaHashHex
@ -12,6 +9,7 @@ import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState
} from './log'; } from './log';
import Config from '../../config';
function getKMDAddressesNativeState(json) { function getKMDAddressesNativeState(json) {
return { return {

6
react/src/actions/actions/atomic.js

@ -1,12 +1,10 @@
import { ATOMIC } from '../storeType'; import { ATOMIC } from '../storeType';
import { import { triggerToaster } from '../actionCreators';
triggerToaster,
Config
} from '../actionCreators';
import { import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState
} from './log'; } from './log';
import Config from '../../config';
export function atomic(payload) { export function atomic(payload) {
return dispatch => { return dispatch => {

7
react/src/actions/actions/basiliskCache.js

@ -1,15 +1,12 @@
import { DASHBOARD_ACTIVE_COIN_GET_CACHE } from '../storeType'; import { DASHBOARD_ACTIVE_COIN_GET_CACHE } from '../storeType';
import { import { triggerToaster } from '../actionCreators';
triggerToaster,
Config
} from '../actionCreators';
import { import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState
} from './log'; } from './log';
import Config from '../../config';
// TODO: rewrite cache API to use POST // TODO: rewrite cache API to use POST
export function deleteCacheFile(_payload) { export function deleteCacheFile(_payload) {
return dispatch => { return dispatch => {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/groom`, { return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/groom`, {

6
react/src/actions/actions/basiliskProcessAddress.js

@ -1,12 +1,10 @@
import { translate } from '../../translate/translate'; import { translate } from '../../translate/translate';
import { import { triggerToaster } from '../actionCreators';
triggerToaster,
Config
} from '../actionCreators';
import { import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState
} from './log'; } from './log';
import Config from '../../config';
export function checkAddressBasilisk(coin, address) { export function checkAddressBasilisk(coin, address) {
const payload = { const payload = {

2
react/src/actions/actions/basiliskTxHistory.js

@ -1,12 +1,12 @@
import { import {
triggerToaster, triggerToaster,
Config,
getNativeTxHistoryState getNativeTxHistoryState
} from '../actionCreators'; } from '../actionCreators';
import { import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState
} from './log'; } from './log';
import Config from '../../config';
export function getBasiliskTransactionsList(coin, address) { export function getBasiliskTransactionsList(coin, address) {
const pubkey = JSON.parse(sessionStorage.getItem('IguanaActiveAccount')).pubkey; const pubkey = JSON.parse(sessionStorage.getItem('IguanaActiveAccount')).pubkey;

6
react/src/actions/actions/cli.js

@ -1,12 +1,10 @@
import { import { triggerToaster } from '../actionCreators';
triggerToaster,
Config
} from '../actionCreators';
import { CLI } from '../storeType'; import { CLI } from '../storeType';
import { import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState
} from './log'; } from './log';
import Config from '../../config';
export function shepherdCliPromise(mode, chain, cmd) { export function shepherdCliPromise(mode, chain, cmd) {
const _payload = { const _payload = {

6
react/src/actions/actions/coinList.js

@ -1,11 +1,9 @@
import { import { triggerToaster } from '../actionCreators';
triggerToaster,
Config
} from '../actionCreators';
import { import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState
} from './log'; } from './log';
import Config from '../../config';
export function shepherdGetCoinList() { export function shepherdGetCoinList() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {

6
react/src/actions/actions/createWallet.js

@ -1,12 +1,10 @@
import { translate } from '../../translate/translate'; import { translate } from '../../translate/translate';
import { import { triggerToaster } from '../actionCreators';
triggerToaster,
Config
} from '../actionCreators';
import { import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState
} from './log'; } from './log';
import Config from '../../config';
function createNewWalletState(json) { function createNewWalletState(json) {
if (json && if (json &&

2
react/src/actions/actions/dexCoins.js

@ -1,12 +1,12 @@
import { import {
triggerToaster, triggerToaster,
Config,
dashboardCoinsState dashboardCoinsState
} from '../actionCreators'; } from '../actionCreators';
import { import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState
} from './log'; } from './log';
import Config from '../../config';
export function getDexCoins() { export function getDexCoins() {
const _payload = { const _payload = {

6
react/src/actions/actions/edexBalance.js

@ -1,12 +1,10 @@
import { DASHBOARD_ACTIVE_COIN_BALANCE } from '../storeType'; import { DASHBOARD_ACTIVE_COIN_BALANCE } from '../storeType';
import { import { triggerToaster } from '../actionCreators';
triggerToaster,
Config
} from '../actionCreators';
import { import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState
} from './log'; } from './log';
import Config from '../../config';
export function iguanaEdexBalance(coin) { export function iguanaEdexBalance(coin) {
const _payload = { const _payload = {

6
react/src/actions/actions/edexGetTx.js

@ -1,11 +1,9 @@
import { import { triggerToaster } from '../actionCreators';
triggerToaster,
Config
} from '../actionCreators';
import { import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState
} from './log'; } from './log';
import Config from '../../config';
export function edexGetTransaction(data, dispatch) { export function edexGetTransaction(data, dispatch) {
const payload = { const payload = {

2
react/src/actions/actions/fullTxHistory.js

@ -1,12 +1,12 @@
import { import {
triggerToaster, triggerToaster,
Config,
getNativeTxHistoryState getNativeTxHistoryState
} from '../actionCreators'; } from '../actionCreators';
import { import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState
} from './log'; } from './log';
import Config from '../../config';
export function getFullTransactionsList(coin) { export function getFullTransactionsList(coin) {
const payload = { const payload = {

5
react/src/actions/actions/getAddrByAccount.js

@ -1,12 +1,9 @@
import { ACTIVE_COIN_GET_ADDRESSES } from '../storeType'; import { ACTIVE_COIN_GET_ADDRESSES } from '../storeType';
import {
triggerToaster,
Config
} from '../actionCreators';
import { import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState
} from './log'; } from './log';
import Config from '../../config';
export function getAddressesByAccountState(json, coin, mode) { export function getAddressesByAccountState(json, coin, mode) {
if (mode === 'full' || if (mode === 'full' ||

5
react/src/actions/actions/iguanaHelpers.js

@ -1,11 +1,8 @@
import {
triggerToaster,
Config
} from '../actionCreators';
import { import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState
} from './log'; } from './log';
import Config from '../../config';
import { checkAC } from '../../components/addcoin/payload'; import { checkAC } from '../../components/addcoin/payload';
export function getPassthruAgent(coin) { export function getPassthruAgent(coin) {

6
react/src/actions/actions/iguanaInstance.js

@ -1,11 +1,9 @@
import { import { triggerToaster } from '../actionCreators';
triggerToaster,
Config
} from '../actionCreators';
import { import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState
} from './log'; } from './log';
import Config from '../../config';
export function restartIguanaInstance(pmid) { export function restartIguanaInstance(pmid) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {

6
react/src/actions/actions/log.js

@ -1,8 +1,6 @@
import { LOG_GUI_HTTP } from '../storeType'; import { LOG_GUI_HTTP } from '../storeType';
import { import { triggerToaster } from '../actionCreators';
triggerToaster, import Config from '../../config';
Config
} from '../actionCreators';
export function logGuiHttp(payload) { export function logGuiHttp(payload) {
return dispatch => { return dispatch => {

18
react/src/actions/actions/logout.js

@ -1,14 +1,15 @@
import { LOGIN } from '../storeType';
import { import {
triggerToaster, LOGIN,
Config LOGOUT
} from '../actionCreators'; } from '../storeType';
import { triggerToaster } from '../actionCreators';
import Config from '../../config';
import { import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState
} from './log'; } from './log';
function logoutState(json, dispatch) { function logoutState(json) {
sessionStorage.removeItem('IguanaActiveAccount'); sessionStorage.removeItem('IguanaActiveAccount');
return { return {
@ -17,6 +18,12 @@ function logoutState(json, dispatch) {
} }
} }
function logoutResetAppState() {
return {
type: LOGOUT,
}
}
export function logout() { export function logout() {
return dispatch => { return dispatch => {
dispatch(walletLock()); dispatch(walletLock());
@ -68,6 +75,7 @@ function walletLock() {
'response': json, 'response': json,
})); }));
dispatch(logoutState(json)); dispatch(logoutState(json));
dispatch(logoutResetAppState());
}) })
} }
} }

2
react/src/actions/actions/nativeBalance.js

@ -1,9 +1,9 @@
import { DASHBOARD_ACTIVE_COIN_NATIVE_BALANCE } from '../storeType'; import { DASHBOARD_ACTIVE_COIN_NATIVE_BALANCE } from '../storeType';
import { import {
triggerToaster, triggerToaster,
Config,
getPassthruAgent getPassthruAgent
} from '../actionCreators'; } from '../actionCreators';
import Config from '../../config';
import { import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState

2
react/src/actions/actions/nativeNewAddress.js

@ -1,10 +1,10 @@
import { translate } from '../../translate/translate'; import { translate } from '../../translate/translate';
import { import {
triggerToaster, triggerToaster,
Config,
getPassthruAgent, getPassthruAgent,
getKMDAddressesNative getKMDAddressesNative
} from '../actionCreators'; } from '../actionCreators';
import Config from '../../config';
import { import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState

2
react/src/actions/actions/nativeSend.js

@ -2,7 +2,6 @@ import { DASHBOARD_ACTIVE_COIN_NATIVE_OPIDS } from '../storeType';
import { translate } from '../../translate/translate'; import { translate } from '../../translate/translate';
import { import {
triggerToaster, triggerToaster,
Config,
getPassthruAgent, getPassthruAgent,
iguanaHashHex iguanaHashHex
} from '../actionCreators'; } from '../actionCreators';
@ -10,6 +9,7 @@ import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState
} from './log'; } from './log';
import Config from '../../config';
export function sendNativeTx(coin, _payload) { export function sendNativeTx(coin, _payload) {
let ajaxDataToHex; let ajaxDataToHex;

21
react/src/actions/actions/nativeSyncInfo.js

@ -1,14 +1,15 @@
import { SYNCING_NATIVE_MODE } from '../storeType'; import { SYNCING_NATIVE_MODE } from '../storeType';
import { import {
triggerToaster, triggerToaster,
Config,
getPassthruAgent, getPassthruAgent,
getDebugLog getDebugLog,
toggleCoindDownModal
} from '../actionCreators'; } from '../actionCreators';
import { import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState
} from './log'; } from './log';
import Config from '../../config';
export function getSyncInfoNativeKMD(skipDebug) { export function getSyncInfoNativeKMD(skipDebug) {
const coin = 'KMD'; const coin = 'KMD';
@ -63,7 +64,8 @@ export function getSyncInfoNativeKMD(skipDebug) {
function getSyncInfoNativeState(json, coin, skipDebug) { function getSyncInfoNativeState(json, coin, skipDebug) {
if (coin === 'KMD' && if (coin === 'KMD' &&
json && json &&
json.error) { json.error &&
json.error.message.indexOf('Activating best') === -1) {
return getSyncInfoNativeKMD(skipDebug); return getSyncInfoNativeKMD(skipDebug);
} else { } else {
if (json && if (json &&
@ -71,12 +73,12 @@ function getSyncInfoNativeState(json, coin, skipDebug) {
Config.cli.default) { Config.cli.default) {
return { return {
type: SYNCING_NATIVE_MODE, type: SYNCING_NATIVE_MODE,
progress: Config.cli.default ? json.error : json, progress: json.error,
} }
} else { } else {
return { return {
type: SYNCING_NATIVE_MODE, type: SYNCING_NATIVE_MODE,
progress: Config.cli.default ? json.result : json, progress: json.result ? json.result : json,
} }
} }
} }
@ -156,13 +158,20 @@ export function getSyncInfoNative(coin, skipDebug) {
'Komodod is down', 'Komodod is down',
'Critical Error', 'Critical Error',
'error', 'error',
false true
) )
); );
dispatch(getDebugLog('komodo', 50));
dispatch(toggleCoindDownModal(true));
} else { } else {
json = JSON.parse(json); json = JSON.parse(json);
} }
if (json.error &&
json.error.message.indexOf('Activating best') === -1) {
dispatch(getDebugLog('komodo', 1));
}
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'success', 'status': 'success',

2
react/src/actions/actions/nativeTxHistory.js

@ -1,9 +1,9 @@
import { import {
triggerToaster, triggerToaster,
Config,
getPassthruAgent, getPassthruAgent,
getNativeTxHistoryState getNativeTxHistoryState
} from '../actionCreators'; } from '../actionCreators';
import Config from '../../config';
import { import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState

6
react/src/actions/actions/notary.js

@ -3,10 +3,8 @@ import {
DASHBOARD_GET_NOTARIES_LIST DASHBOARD_GET_NOTARIES_LIST
} from '../storeType'; } from '../storeType';
import { translate } from '../../translate/translate'; import { translate } from '../../translate/translate';
import { import { triggerToaster } from '../actionCreators';
triggerToaster, import Config from '../../config';
Config
} from '../actionCreators';
import { import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState

2
react/src/actions/actions/sendFullBasilisk.js

@ -2,9 +2,9 @@ import { DASHBOARD_ACTIVE_COIN_SENDTO } from '../storeType';
import { translate } from '../../translate/translate'; import { translate } from '../../translate/translate';
import { import {
triggerToaster, triggerToaster,
Config,
getDispatch getDispatch
} from '../actionCreators'; } from '../actionCreators';
import Config from '../../config';
import { import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState

49
react/src/actions/actions/settings.js

@ -6,10 +6,8 @@ import {
LOAD_APP_CONFIG LOAD_APP_CONFIG
} from '../storeType'; } from '../storeType';
import { translate } from '../../translate/translate'; import { translate } from '../../translate/translate';
import { import { triggerToaster } from '../actionCreators';
triggerToaster, import Config from '../../config';
Config
} from '../actionCreators';
import { import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState
@ -378,7 +376,16 @@ export function saveAppConfig(_payload) {
); );
}) })
.then(response => response.json()) .then(response => response.json())
.then(json => dispatch(getAppConfig())) .then(json => {
dispatch(getAppConfig());
dispatch(
triggerToaster(
'Settings are saved',
translate('TOASTR.SETTINGS_NOTIFICATION'),
'success'
)
);
})
} }
} }
@ -411,3 +418,35 @@ export function getAppConfig() {
.then(json => dispatch(getAppConfigState(json))) .then(json => dispatch(getAppConfigState(json)))
} }
} }
export function resetAppConfig() {
return dispatch => {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/appconf/reset`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
})
.catch(function(error) {
console.log(error);
dispatch(
triggerToaster(
'resetAppConfig',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {
dispatch(getAppConfig());
dispatch(
triggerToaster(
'Settings are reset to default',
translate('TOASTR.SETTINGS_NOTIFICATION'),
'success'
)
);
})
}
}

6
react/src/actions/actions/syncInfo.js

@ -1,8 +1,6 @@
import { SYNCING_FULL_MODE } from '../storeType'; import { SYNCING_FULL_MODE } from '../storeType';
import { import { triggerToaster } from '../actionCreators';
triggerToaster, import Config from '../../config';
Config
} from '../actionCreators';
import { import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState

6
react/src/actions/actions/syncOnly.js

@ -3,10 +3,8 @@ import {
SYNC_ONLY_DATA SYNC_ONLY_DATA
} from '../storeType'; } from '../storeType';
import { translate } from '../../translate/translate'; import { translate } from '../../translate/translate';
import { import Config from '../../config';
triggerToaster, import { triggerToaster } from '../actionCreators';
Config
} from '../actionCreators';
import { import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState

6
react/src/actions/actions/sysInfo.js

@ -1,7 +1,5 @@
import { import { triggerToaster } from '../actionCreators';
triggerToaster, import Config from '../../config';
Config
} from '../actionCreators';
import { import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState

6
react/src/actions/actions/update.js

@ -1,7 +1,5 @@
import { import { triggerToaster } from '../actionCreators';
Config, import Config from '../../config';
triggerToaster
} from '../actionCreators';
import { import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState

2
react/src/actions/actions/walletAuth.js

@ -3,9 +3,9 @@ import {
ACTIVE_HANDLE ACTIVE_HANDLE
} from '../storeType'; } from '../storeType';
import { translate } from '../../translate/translate'; import { translate } from '../../translate/translate';
import Config from '../../config';
import { import {
triggerToaster, triggerToaster,
Config,
getMainAddressState, getMainAddressState,
updateErrosStack updateErrosStack
} from '../actionCreators'; } from '../actionCreators';

2
react/src/actions/storeType.js

@ -43,3 +43,5 @@ export const DASHBOARD_ACTIVE_ADDRESS = 'DASHBOARD_ACTIVE_ADDRESS';
export const LOAD_APP_INFO = 'LOAD_APP_INFO'; export const LOAD_APP_INFO = 'LOAD_APP_INFO';
export const LOG_GUI_HTTP = 'LOG_GUI_HTTP'; export const LOG_GUI_HTTP = 'LOG_GUI_HTTP';
export const CLI = 'CLI'; export const CLI = 'CLI';
export const LOGOUT = 'LOGOUT';
export const DISPLAY_COIND_DOWN_MODAL = 'DISPLAY_COIND_DOWN_MODAL';

2
react/src/components/addcoin/addcoin.js

@ -1,7 +1,7 @@
import React from 'react'; import React from 'react';
import { translate } from '../../translate/translate'; import { translate } from '../../translate/translate';
import Config from '../../config';
import { import {
Config,
addCoin, addCoin,
toggleAddcoinModal, toggleAddcoinModal,
triggerToaster, triggerToaster,

4
react/src/components/addcoin/addcoin.render.js

@ -42,7 +42,7 @@ const AddCoinRender = function() {
</button> </button>
</span> </span>
{ this.renderCoinSelectors() } { this.renderCoinSelectors() }
<div className={ 'text-align-center vertical-margin-20 horizontal-margin-0 ' + (this.hasMoreThanOneCoin() ? 'col-sm-12' : 'hide') }> <div className={ 'text-align-center vertical-margin-20 horizontal-margin-0 padding-bottom-20 ' + (this.hasMoreThanOneCoin() ? 'col-sm-12' : 'hide') }>
<button <button
type="button" type="button"
className="btn btn-primary col-sm-4 float-none" className="btn btn-primary col-sm-4 float-none"
@ -62,7 +62,7 @@ const AddCoinRender = function() {
<strong>Komodo Daemon</strong> { translate('INDEX.NATIVE_MODE_DESC2') }&nbsp; <strong>Komodo Daemon</strong> { translate('INDEX.NATIVE_MODE_DESC2') }&nbsp;
<i>Iguana Daemon</i> { translate('INDEX.NATIVE_MODE_DESC3') }. <i>Iguana Daemon</i> { translate('INDEX.NATIVE_MODE_DESC3') }.
</p> </p>
<div className="alert alert-icon alert-primary"> <div className="alert alert-icon alert-primary margin-top-20">
<i className="icon md-info-outline"></i> <i className="icon md-info-outline"></i>
<strong>{ translate('INDEX.NATIVE_MODE') }</strong> { translate('INDEX.NATIVE_MODE_DESC4') }&nbsp; <strong>{ translate('INDEX.NATIVE_MODE') }</strong> { translate('INDEX.NATIVE_MODE_DESC4') }&nbsp;
<strong>{ translate('INDEX.NATIVE_MODE_DESC5') }</strong>,&nbsp; <strong>{ translate('INDEX.NATIVE_MODE_DESC5') }</strong>,&nbsp;

2
react/src/components/addcoin/addcoin.scss

@ -3,7 +3,7 @@
} }
.vertical-margin-20 { .vertical-margin-20 {
margin-top: 20px; margin-top: 10px;
margin-bottom: 20px; margin-bottom: 20px;
} }

2
react/src/components/addcoin/addcoinOptionsCrypto.js

@ -1,6 +1,6 @@
import React from 'react'; import React from 'react';
import { translate } from '../../translate/translate'; import { translate } from '../../translate/translate';
import { Config } from '../../actions/actionCreators'; import Config from '../../config';
class AddCoinOptionsCrypto extends React.Component { class AddCoinOptionsCrypto extends React.Component {
constructor(props) { constructor(props) {

24
react/src/components/addcoin/coin-selectors.render.js

@ -11,8 +11,12 @@ const CoinSelectorsRender = function(item, coin, i) {
<div <div
className={ this.hasMoreThanOneCoin() ? 'multi' : 'single' } className={ this.hasMoreThanOneCoin() ? 'multi' : 'single' }
key={ `add-coin-${i}` }> key={ `add-coin-${i}` }>
<div className="col-sm-8"> <div
<div className="form-group"> className={ this.hasMoreThanOneCoin() ? 'col-sm-10' : 'col-sm-8' }
style={{ paddingLeft: !this.hasMoreThanOneCoin() ? '0' : '15px' }}>
<div
className={ this.hasMoreThanOneCoin() && (item.mode === '-1' || item.mode === -1) ? 'col-sm-6 form-group' : 'form-group' }
style={{ paddingLeft: this.hasMoreThanOneCoin() ? '0' : '15px' }}>
<select <select
className="form-control form-material" className="form-control form-material"
name="selectedCoin" name="selectedCoin"
@ -25,6 +29,20 @@ const CoinSelectorsRender = function(item, coin, i) {
<AddCoinOptionsACFiat appSettings={ this.props.Settings } /> <AddCoinOptionsACFiat appSettings={ this.props.Settings } />
</select> </select>
</div> </div>
<div className={ this.hasMoreThanOneCoin() && (item.mode === '-1' || item.mode === -1) ? 'col-sm-6' : 'hide' }>
<div className="toggle-box padding-bottom-10">
<select
className="form-control form-material"
name="daemonParam"
onChange={ (event) => this.updateDaemonParam(event, i) }
autoFocus>
<option>Daemon param: none</option>
<option value="silent">Daemon param: background process</option>
<option value="reindex">Daemon param: reindex</option>
<option value="rescan">Daemon param: rescan</option>
</select>
</div>
</div>
</div> </div>
<div className={ this.hasMoreThanOneCoin() ? 'hide' : 'col-sm-4' }> <div className={ this.hasMoreThanOneCoin() ? 'hide' : 'col-sm-4' }>
<button <button
@ -137,7 +155,7 @@ const CoinSelectorsRender = function(item, coin, i) {
<i className="fa fa-trash-o"></i> <i className="fa fa-trash-o"></i>
</button> </button>
</div> </div>
<div className={ item.mode === '-1' || item.mode === -1 ? 'col-sm-5' : 'hide' }> <div className={ !this.hasMoreThanOneCoin() && (item.mode === '-1' || item.mode === -1) ? 'col-sm-5 padding-bottom-30' : 'hide' }>
<div className="toggle-box padding-top-3 padding-bottom-10"> <div className="toggle-box padding-top-3 padding-bottom-10">
<select <select
className="form-control form-material" className="form-control form-material"

20
react/src/components/dashboard/about/about.js

@ -6,9 +6,10 @@ class About extends React.Component {
<div className="page margin-left-0"> <div className="page margin-left-0">
<div className="page-content"> <div className="page-content">
<h2>About Agama</h2> <h2>About Agama</h2>
<p>Agama Wallet is a desktop app that you can use to manage multiple cryptocurrency wallets. When you set up a <p>
Agama Wallet is a desktop app that you can use to manage multiple cryptocurrency wallets. When you set up a
wallet, you can configure it to operate in one of the following modes: wallet, you can configure it to operate in one of the following modes:
</p>
<ul> <ul>
<li> <li>
<span className="font-weight-600">Basilisk Mode</span>:&nbsp; <span className="font-weight-600">Basilisk Mode</span>:&nbsp;
@ -32,13 +33,13 @@ class About extends React.Component {
<li> <li>
<span className="font-weight-600">BarterDEX</span>:&nbsp; <span className="font-weight-600">BarterDEX</span>:&nbsp;
Easily exchange cryptocurrencies via a Easily exchange cryptocurrencies via a
shapeshift-like service. shapeshift-like service.&nbsp;
<a href="https://supernet.org/en/technology/whitepapers/easydex-a-practical-native-dex" target="_blank"> <a href="https://supernet.org/en/technology/whitepapers/easydex-a-practical-native-dex" target="_blank">
(BarterDEX A Practical Native DEX) (BarterDEX A Practical Native DEX)
</a> </a>
</li> </li>
<li> <li>
<span className="font-weight-600">Atomic Exporer</span>:&nbsp; <span className="font-weight-600">Atomic Exporer</span>: &nbsp;
A universal local explorer ensures you don't A universal local explorer ensures you don't
have query information from a centralized have query information from a centralized
server. server.
@ -50,13 +51,13 @@ class About extends React.Component {
but you should make proper backups. We do not recommend using it as the primarily wallet for your cryptocurrencies. but you should make proper backups. We do not recommend using it as the primarily wallet for your cryptocurrencies.
</span> </span>
<br/> <br/><br/>
<span className="font-weight-600">Testers</span>:&nbsp; <div className="font-weight-600">Testers</div>
You can help us test Agama. Just <a target="_blank" href="https://supernet.org/en/products/agama-wallet">download and install the latest release</a>. You can help us test Agama. Just <a target="_blank" href="https://supernet.org/en/products/agama-wallet">download and install the latest release</a>.
Then, report any bugs you encounter to our developers on the #testing-agama Slack channel. Then, report any bugs you encounter to our developers on the <a target="_blank" href="https://sprnt.slack.com/messages/C0HT9MH96/">#testing-agama</a> Slack channel.
Your help is greatly appreciated! Your help is greatly appreciated!
<br /><br />
Agama also supports the following desktop apps: Agama also supports the following desktop apps:
<ul> <ul>
<li> <li>
@ -64,10 +65,9 @@ class About extends React.Component {
and lower fees. and lower fees.
</li> </li>
<li> <li>
<span className="font-weight-600">BarterDEX</span> <span className="font-weight-600">BarterDEX</span>: A decentralized coin exchange.
</li> </li>
</ul> </ul>
</p>
</div> </div>
</div> </div>
); );

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

@ -7,7 +7,7 @@ import AddCoinOptionsACFiat from '../../addcoin/addcoinOptionsACFiat';
const AtomicRender = function () { const AtomicRender = function () {
return ( return (
<div className="page margin-left-0"> <div className="page margin-left-0 full-height">
<div className="page-content"> <div className="page-content">
<div className="row"> <div className="row">
<div className="col-xlg-12 col-md-12"> <div className="col-xlg-12 col-md-12">

8
react/src/components/dashboard/coinTile/coinTileItem.js

@ -1,6 +1,5 @@
import React from 'react'; import React from 'react';
import { import {
Config,
dashboardChangeActiveCoin, dashboardChangeActiveCoin,
iguanaActiveHandle, iguanaActiveHandle,
getAddressesByAccount, getAddressesByAccount,
@ -21,6 +20,7 @@ import {
getDebugLog getDebugLog
} from '../../../actions/actionCreators'; } from '../../../actions/actionCreators';
import Store from '../../../store'; import Store from '../../../store';
import Config from '../../../config';
import CoinTileItemRender from './coinTileItem.render'; import CoinTileItemRender from './coinTileItem.render';
@ -46,10 +46,12 @@ class CoinTileItem extends React.Component {
const _propsDashboard = this.props.Dashboard; 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 syncPercentage = _propsDashboard && _propsDashboard.progress && (parseFloat(parseInt(_propsDashboard.progress.blocks, 10) * 100 / parseInt(this.props.Dashboard.progress.longestchain, 10)).toFixed(2)).replace('NaN', 0);
if (syncPercentage < 100) { if (syncPercentage < 100 &&
!this.props.Dashboard.displayCoindDownModal) {
Store.dispatch(getDebugLog('komodo', 10)); Store.dispatch(getDebugLog('komodo', 10));
} }
if (_propsDashboard.progress && if (!this.props.Dashboard.displayCoindDownModal &&
_propsDashboard.progress &&
_propsDashboard.progress.blocks && _propsDashboard.progress.blocks &&
_propsDashboard.progress.longestchain && _propsDashboard.progress.longestchain &&
syncPercentage && syncPercentage &&

47
react/src/components/dashboard/coindDownModal/coindDownModal.js

@ -0,0 +1,47 @@
import React from 'react';
import { toggleCoindDownModal } from '../../../actions/actionCreators';
import Store from '../../../store';
import CoindDownModalRender from './coindDownModal.render';
class CoindDownModal extends React.Component {
constructor(props) {
super(props);
this.state = {
display: false,
debugLogCrash: null,
};
this.dismiss = this.dismiss.bind(this);
}
dismiss() {
Store.dispatch(toggleCoindDownModal(false));
}
componentWillReceiveProps(props) {
const coindDownModalProps = props ? props.Dashboard : null;
if (coindDownModalProps &&
coindDownModalProps.displayCoindDownModal !== this.state.display) {
this.setState(Object.assign({}, this.state, {
display: coindDownModalProps.displayCoindDownModal,
}));
setTimeout(() => {
this.setState(Object.assign({}, this.state, {
display: coindDownModalProps.displayCoindDownModal,
}));
}, 100);
}
}
render() {
if (this.state.display) {
return CoindDownModalRender.call(this);
}
return null;
}
}
export default CoindDownModal;

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

@ -0,0 +1,46 @@
import React from 'react';
import { translate } from '../../../translate/translate';
const CoindDownModalRender = function () {
return (
<div>
<div
className={ 'modal modal-3d-sign coind-down-modal ' + (this.state.display ? 'show in' : 'fade hide') }
id="AddCoinDilogModel-login">
<div className="modal-dialog modal-center modal-lg">
<div className="modal-content">
<div className="modal-header bg-orange-a400 wallet-send-header">
<button
type="button"
className="close white"
onClick={ this.dismiss }>
<span>×</span>
</button>
<h4 className="modal-title white">Komodod is down!</h4>
</div>
<div className="modal-body">
<div className="vertical-align text-center">
<div className="page-content vertical-align-middle">
<strong>Debug.log (last 50 lines)</strong>
<div className="form-group form-material floating">
<textarea
className="form-control"
value={ this.props.Settings.debugLog }></textarea>
</div>
<button
type="button"
className="btn btn-primary btn-block"
id="loginbtn"
onClick={ this.dismiss }>OK</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div className={ 'modal-backdrop ' + (this.state.display ? 'show in' : 'fade hide') }></div>
</div>
);
};
export default CoindDownModalRender;

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

@ -15,6 +15,7 @@ import ReceiveCoin from '../receiveCoin/receiveCoin';
import About from '../about/about'; import About from '../about/about';
import WalletsNative from '../walletsNative/walletsNative'; import WalletsNative from '../walletsNative/walletsNative';
import WalletsTxInfo from '../walletsTxInfo/walletsTxInfo'; import WalletsTxInfo from '../walletsTxInfo/walletsTxInfo';
import CoindDownModal from '../coindDownModal/coindDownModal';
const DashboardRender = function() { const DashboardRender = function() {
return ( return (
@ -23,6 +24,7 @@ const DashboardRender = function() {
className={ this.isSectionActive('wallets') ? 'page-main' : '' } className={ this.isSectionActive('wallets') ? 'page-main' : '' }
id="section-dashboard"> id="section-dashboard">
<Navbar {...this.props} /> <Navbar {...this.props} />
<CoindDownModal {...this.props} />
<div className={ this.isSectionActive('wallets') ? 'show' : 'hide' }> <div className={ this.isSectionActive('wallets') ? 'show' : 'hide' }>
<CoinTile {...this.props} /> <CoinTile {...this.props} />
<WalletsNav {...this.props} /> <WalletsNav {...this.props} />
@ -37,7 +39,7 @@ const DashboardRender = function() {
<div className={ this.isSectionActive('edex') ? 'show' : 'hide' }> <div className={ this.isSectionActive('edex') ? 'show' : 'hide' }>
<EDEX {...this.props} /> <EDEX {...this.props} />
</div> </div>
<div className={ this.isSectionActive('atomic') ? 'show' : 'hide' }> <div className={ this.isSectionActive('atomic') ? 'show full-height' : 'hide' }>
<Atomic {...this.props} /> <Atomic {...this.props} />
</div> </div>
<div className={ this.isSectionActive('jumblr') ? 'show' : 'hide' }> <div className={ this.isSectionActive('jumblr') ? 'show' : 'hide' }>

3
react/src/components/dashboard/navbar/navbar.js

@ -7,9 +7,9 @@ import {
toggleSyncOnlyModal, toggleSyncOnlyModal,
getSyncOnlyForks, getSyncOnlyForks,
logout, logout,
Config
} from '../../../actions/actionCreators'; } from '../../../actions/actionCreators';
import Store from '../../../store'; import Store from '../../../store';
import Config from '../../../config';
import NavbarRender from './navbar.render'; import NavbarRender from './navbar.render';
@ -81,6 +81,7 @@ class Navbar extends React.Component {
) )
); );
Store.dispatch(logout()); Store.dispatch(logout());
location.reload();
} }
openSyncOnlyModal() { openSyncOnlyModal() {

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

@ -1,6 +1,6 @@
import React from 'react'; import React from 'react';
import { sortByDate } from '../../../util/sort'; import { sortByDate } from '../../../util/sort';
import { Config } from '../../../actions/actionCreators'; import Config from '../../../config';
import { import {
NotificationsByTypeRender, NotificationsByTypeRender,
NotificationsModalRender, NotificationsModalRender,

13
react/src/components/dashboard/sendCoin/sendCoin.js

@ -94,7 +94,8 @@ class SendCoin extends React.Component {
} }
componentWillReceiveProps(props) { componentWillReceiveProps(props) {
if (!this.state.sendFrom && if (this.state &&
!this.state.sendFrom &&
this.props.ActiveCoin.activeAddress) { this.props.ActiveCoin.activeAddress) {
this.setState(Object.assign({}, this.state, { this.setState(Object.assign({}, this.state, {
sendFrom: this.props.ActiveCoin.activeAddress, sendFrom: this.props.ActiveCoin.activeAddress,
@ -440,7 +441,7 @@ class SendCoin extends React.Component {
json.completed === true) { json.completed === true) {
Store.dispatch( Store.dispatch(
triggerToaster( triggerToaster(
translate('TOASTR.SIGNED_TX_GENERATED') + '.', translate('TOASTR.SIGNED_TX_GENERATED'),
translate('TOASTR.WALLET_NOTIFICATION'), translate('TOASTR.WALLET_NOTIFICATION'),
'success' 'success'
) )
@ -482,7 +483,7 @@ class SendCoin extends React.Component {
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
Store.dispatch( Store.dispatch(
triggerToaster( triggerToaster(
translate('TOASTR.GETTING_TXID_INFO') + '.', translate('TOASTR.GETTING_TXID_INFO'),
translate('TOASTR.WALLET_NOTIFICATION'), translate('TOASTR.WALLET_NOTIFICATION'),
'info' 'info'
) )
@ -540,7 +541,7 @@ class SendCoin extends React.Component {
Store.dispatch( Store.dispatch(
triggerToaster( triggerToaster(
translate('TOASTR.AWAITING_TX_RESP') + '...', `${translate('TOASTR.AWAITING_TX_RESP')}...`,
translate('TOASTR.WALLET_NOTIFICATION'), translate('TOASTR.WALLET_NOTIFICATION'),
'info' 'info'
) )
@ -549,7 +550,7 @@ class SendCoin extends React.Component {
function waterfallUTXOProcess() { function waterfallUTXOProcess() {
Store.dispatch( Store.dispatch(
triggerToaster( triggerToaster(
translate('TOASTR.PROCESSING_UTXO') + '...', `${translate('TOASTR.PROCESSING_UTXO')}...`,
translate('TOASTR.WALLET_NOTIFICATION'), translate('TOASTR.WALLET_NOTIFICATION'),
'info' 'info'
) )
@ -590,7 +591,7 @@ class SendCoin extends React.Component {
Store.dispatch(sendToAddressStateAlt(json)); Store.dispatch(sendToAddressStateAlt(json));
Store.dispatch( Store.dispatch(
triggerToaster( triggerToaster(
`${translate('TOASTR.SIGNED_TX_GENERATED_FAIL')}.`, `${translate('TOASTR.SIGNED_TX_GENERATED_FAIL')}`,
translate('TOASTR.WALLET_NOTIFICATION'), translate('TOASTR.WALLET_NOTIFICATION'),
'error' 'error'
) )

71
react/src/components/dashboard/settings/settings.js

@ -1,7 +1,7 @@
import React from 'react'; import React from 'react';
import { translate } from '../../../translate/translate'; import { translate } from '../../../translate/translate';
import Config from '../../../config';
import { import {
Config,
iguanaActiveHandle, iguanaActiveHandle,
encryptWallet, encryptWallet,
settingsWifkeyState, settingsWifkeyState,
@ -11,10 +11,11 @@ import {
addPeerNode, addPeerNode,
getAppConfig, getAppConfig,
saveAppConfig, saveAppConfig,
resetAppConfig,
getAppInfo, getAppInfo,
shepherdCli, shepherdCli,
checkForUpdateUIPromise, checkForUpdateUIPromise,
updateUIPromise updateUIPromise,
} from '../../../actions/actionCreators'; } from '../../../actions/actionCreators';
import Store from '../../../store'; import Store from '../../../store';
@ -49,7 +50,7 @@ class Settings extends React.Component {
activeTabHeight: '0', activeTabHeight: '0',
appSettings: {}, appSettings: {},
tabElId: null, tabElId: null,
cliCmdString: null, cliCmdString: '',
cliCoin: null, cliCoin: null,
cliResponse: null, cliResponse: null,
exportWifKeysRaw: false, exportWifKeysRaw: false,
@ -72,6 +73,7 @@ class Settings extends React.Component {
this.renderPeersList = this.renderPeersList.bind(this); this.renderPeersList = this.renderPeersList.bind(this);
this.renderSNPeersList = this.renderSNPeersList.bind(this); this.renderSNPeersList = this.renderSNPeersList.bind(this);
this._saveAppConfig = this._saveAppConfig.bind(this); this._saveAppConfig = this._saveAppConfig.bind(this);
this._resetAppConfig = this._resetAppConfig.bind(this);
this.exportWifKeysRaw = this.exportWifKeysRaw.bind(this); this.exportWifKeysRaw = this.exportWifKeysRaw.bind(this);
this.toggleSeedInputVisibility = this.toggleSeedInputVisibility.bind(this); this.toggleSeedInputVisibility = this.toggleSeedInputVisibility.bind(this);
this._checkForUpdateUIPromise = this._checkForUpdateUIPromise.bind(this); this._checkForUpdateUIPromise = this._checkForUpdateUIPromise.bind(this);
@ -97,6 +99,10 @@ class Settings extends React.Component {
} }
} }
_resetAppConfig() {
Store.dispatch(resetAppConfig());
}
resizeLoginTextarea() { resizeLoginTextarea() {
// auto-size textarea // auto-size textarea
setTimeout(() => { setTimeout(() => {
@ -473,11 +479,14 @@ class Settings extends React.Component {
); );
} }
// TODO: rerender only if prop is changed
renderCliResponse() { renderCliResponse() {
const _cliResponse = this.props.Settings.cli; const _cliResponse = this.props.Settings.cli;
let _items = [];
if (_cliResponse) { if (_cliResponse) {
let _cliResponseParsed; let _cliResponseParsed;
let responseType;
try { try {
_cliResponseParsed = JSON.parse(_cliResponse.result); _cliResponseParsed = JSON.parse(_cliResponse.result);
@ -485,44 +494,42 @@ class Settings extends React.Component {
_cliResponseParsed = _cliResponse.result; _cliResponseParsed = _cliResponse.result;
} }
let __cliResponseParsed; if (Object.prototype.toString.call(_cliResponseParsed) === '[object Array]') {
if (typeof _cliResponseParsed !== 'object' && responseType = 'array';
typeof _cliResponseParsed !== 'number' &&
_cliResponseParsed !== 'wrong cli string format' &&
_cliResponseParsed.indexOf('\r\n') > -1) {
_cliResponseParsed = _cliResponseParsed.split('\r\n') ;
} else if (
typeof _cliResponseParsed !== 'object' &&
typeof _cliResponseParsed !== 'number' &&
_cliResponseParsed !== 'wrong cli string format' &&
_cliResponseParsed.indexOf('\n') > -1
) {
__cliResponseParsed = _cliResponseParsed.split('\n') ;
} else {
__cliResponseParsed = _cliResponseParsed;
}
let _items = [];
if (__cliResponseParsed.length && for (let i = 0; i < _cliResponseParsed.length; i++) {
__cliResponseParsed !== 'wrong cli string format') {
for (let i = 0; i < __cliResponseParsed.length; i++) {
_items.push( _items.push(
<div key={ `cli-response-${Math.random(0, 9) * 10}` }>{ typeof __cliResponseParsed[i] === 'object' ? JSON.stringify(__cliResponseParsed[i], null, '\t') : __cliResponseParsed[i] }</div> <div key={ `cli-response-${Math.random(0, 9) * 10}` }>{ JSON.stringify(_cliResponseParsed[i], null, '\t') }</div>
); );
} }
} else { }
if (typeof _cliResponseParsed === 'object') { if (Object.prototype.toString.call(_cliResponseParsed) === '[object]' ||
typeof _cliResponseParsed === 'object') {
responseType = 'object';
_items.push( _items.push(
<div key={ `cli-response-${Math.random(0, 9) * 10}` }>{ JSON.stringify(__cliResponseParsed, null, '\t') }</div> <div key={ `cli-response-${Math.random(0, 9) * 10}` }>{ JSON.stringify(_cliResponseParsed, null, '\t') }</div>
); );
} else if (typeof _cliResponseParsed === 'string' || typeof _cliResponseParsed === 'number' || _cliResponseParsed === 'wrong cli string format') { }
if (Object.prototype.toString.call(_cliResponseParsed) === 'number' ||
typeof _cliResponseParsed === 'boolean' ||
_cliResponseParsed === 'wrong cli string format') {
responseType = 'number';
_items.push( _items.push(
<div key={ `cli-response-${Math.random(0, 9) * 10}` }>{ __cliResponseParsed }</div> <div key={ `cli-response-${Math.random(0, 9) * 10}` }>{ _cliResponseParsed.toString() }</div>
); );
} else { }
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( _items.push(
<div key={ `cli-response-${Math.random(0, 9) * 10}` }>{ translate('INDEX.NO_DATA_AVAILABLE') }</div> <div key={ `cli-response-${Math.random(0, 9) * 10}` }>{ _cliResponseParsed[i] }</div>
); );
} }
} }

10
react/src/components/dashboard/settings/settings.render.js

@ -338,7 +338,7 @@ export const SettingsRender = function() {
className={ 'panel-collapse collapse' + (this.state.activeTab === 4 ? ' in' : '') } className={ 'panel-collapse collapse' + (this.state.activeTab === 4 ? ' in' : '') }
style={{ height: this.state.activeTab === 4 ? `${this.state.activeTabHeight}px` : '0' }}> style={{ height: this.state.activeTab === 4 ? `${this.state.activeTabHeight}px` : '0' }}>
<div className="panel-body"> <div className="panel-body">
<p> <div>
<div className="padding-bottom-20">{ this.renderLB('INDEX.ONLY_ACTIVE_WIF_KEYS') }</div> <div className="padding-bottom-20">{ this.renderLB('INDEX.ONLY_ACTIVE_WIF_KEYS') }</div>
<div className="padding-bottom-20"> <div className="padding-bottom-20">
<i>{ this.renderLB('SETTINGS.EXPORT_KEYS_NOTE') }</i> <i>{ this.renderLB('SETTINGS.EXPORT_KEYS_NOTE') }</i>
@ -346,7 +346,7 @@ export const SettingsRender = function() {
<strong> <strong>
<i>{ translate('INDEX.PLEASE_KEEP_KEYS_SAFE') }</i> <i>{ translate('INDEX.PLEASE_KEEP_KEYS_SAFE') }</i>
</strong> </strong>
</p> </div>
<div className="col-sm-12"></div> <div className="col-sm-12"></div>
<form <form
className="wifkeys-form" className="wifkeys-form"
@ -538,6 +538,10 @@ export const SettingsRender = function() {
type="button" type="button"
className="btn btn-primary waves-effect waves-light" className="btn btn-primary waves-effect waves-light"
onClick={ this._saveAppConfig }>{ translate('SETTINGS.SAVE_APP_CONFIG') }</button> onClick={ this._saveAppConfig }>{ translate('SETTINGS.SAVE_APP_CONFIG') }</button>
<button
type="button"
className="btn btn-primary waves-effect waves-light margin-left-30"
onClick={ this._resetAppConfig }>Reset to default</button>
</div> </div>
</div> </div>
</div> </div>
@ -570,7 +574,7 @@ export const SettingsRender = function() {
name="cliCoin" name="cliCoin"
id="settingsCliOptions" id="settingsCliOptions"
onChange={ this.updateInput }> onChange={ this.updateInput }>
<option value="">{ translate('INDEX.CLI_NATIVE_COIN') }</option> <option>{ translate('INDEX.CLI_NATIVE_COIN') }</option>
{ this.renderActiveCoinsList('native') } { this.renderActiveCoinsList('native') }
</select> </select>
<label <label

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

@ -95,7 +95,7 @@ class WalletsBalance extends React.Component {
const _translationComponents = translate(_translationID).split('<br>'); const _translationComponents = translate(_translationID).split('<br>');
return _translationComponents.map((_translation) => return _translationComponents.map((_translation) =>
<span key={_translation}> <span key={ `translate-${Math.random(0, 9) * 10}` }>
{_translation} {_translation}
<br /> <br />
</span> </span>

26
react/src/components/dashboard/walletsBalance/walletsBalance.render.js

@ -1,5 +1,7 @@
import React from 'react'; import React from 'react';
import { translate } from '../../../translate/translate'; import { translate } from '../../../translate/translate';
import { formatValue } from '../../../util/formatValue';
import Config from '../../../config';
const WalletsBalanceRender = function() { const WalletsBalanceRender = function() {
return ( return (
@ -30,12 +32,14 @@ const WalletsBalanceRender = function() {
<i className="icon fa-eye font-size-24 vertical-align-bottom margin-right-5"></i> <i className="icon fa-eye font-size-24 vertical-align-bottom margin-right-5"></i>
{ this.isNativeMode() ? translate('INDEX.TRANSPARENT_BALANCE') : translate('INDEX.BALANCE') } { this.isNativeMode() ? translate('INDEX.TRANSPARENT_BALANCE') : translate('INDEX.BALANCE') }
</div> </div>
<span className="pull-right padding-top-10 font-size-22"> <span
className="pull-right padding-top-10 font-size-22"
title={ Config.roundValues ? this.renderBalance('main') : null }>
{ this.isNativeMode() ? { this.isNativeMode() ?
this.props.ActiveCoin.balance.transparent ? this.props.ActiveCoin.balance.transparent : '-' this.props.ActiveCoin.balance.transparent ? this.props.ActiveCoin.balance.transparent : '-'
: :
<span> <span>
{ this.renderBalance('main') } { this.props.ActiveCoin.coin } { Config.roundValues ? formatValue('round', this.renderBalance('main'), -6) : this.renderBalance('main') } { this.props.ActiveCoin.coin }
</span> </span>
} }
</span> </span>
@ -54,8 +58,10 @@ const WalletsBalanceRender = function() {
<i className="icon fa-eye-slash font-size-24 vertical-align-bottom margin-right-5"></i> <i className="icon fa-eye-slash font-size-24 vertical-align-bottom margin-right-5"></i>
{ translate('INDEX.Z_BALANCE') } { translate('INDEX.Z_BALANCE') }
</div> </div>
<span className="pull-right padding-top-10 font-size-22"> <span
{ this.props.ActiveCoin.balance.private ? this.props.ActiveCoin.balance.private : '-' } className="pull-right padding-top-10 font-size-22"
title={ Config.roundValues ? this.props.ActiveCoin.balance.private : null }>
{ this.props.ActiveCoin.balance.private ? (Config.roundValues ? formatValue('round', this.props.ActiveCoin.balance.private, -6) : this.props.ActiveCoin.balance.private) : '-' }
</span> </span>
</div> </div>
</div> </div>
@ -73,13 +79,15 @@ const WalletsBalanceRender = function() {
<i className="icon fa-money font-size-24 vertical-align-bottom margin-right-5"></i> <i className="icon fa-money font-size-24 vertical-align-bottom margin-right-5"></i>
{ translate('INDEX.INTEREST_EARNED') } { translate('INDEX.INTEREST_EARNED') }
</div> </div>
<span className="pull-right padding-top-10 font-size-22"> <span
className="pull-right padding-top-10 font-size-22"
title={ Config.roundValues ? this.renderBalance('interest') : null }>
{ this.isNativeMode() ? { this.isNativeMode() ?
this.props.Dashboard.progress this.props.Dashboard.progress
&& this.props.Dashboard.progress.interest ? this.props.Dashboard.progress.interest : '-' && this.props.Dashboard.progress.interest ? this.props.Dashboard.progress.interest : '-'
: :
<span> <span>
{this.renderBalance('interest')} {this.props.ActiveCoin.coin} { Config.roundValues ? formatValue('round', this.renderBalance('interest'), -6) : this.renderBalance('interest') } { this.props.ActiveCoin.coin }
</span> </span>
} }
</span> </span>
@ -99,12 +107,14 @@ const WalletsBalanceRender = function() {
<i className="icon fa-bullseye font-size-24 vertical-align-bottom margin-right-5"></i> <i className="icon fa-bullseye font-size-24 vertical-align-bottom margin-right-5"></i>
{ translate('INDEX.TOTAL_BALANCE') } { translate('INDEX.TOTAL_BALANCE') }
</div> </div>
<span className="pull-right padding-top-10 font-size-22"> <span
className="pull-right padding-top-10 font-size-22"
title={ Config.roundValues ? this.renderBalance('total') : null }>
{ this.isNativeMode() ? { this.isNativeMode() ?
this.props.ActiveCoin.balance.total ? this.props.ActiveCoin.balance.total : '-' this.props.ActiveCoin.balance.total ? this.props.ActiveCoin.balance.total : '-'
: :
<span> <span>
{ this.renderBalance('total') } { this.props.ActiveCoin.coin } { Config.roundValues ? formatValue('round', this.renderBalance('total'), -6) : this.renderBalance('total') } { this.props.ActiveCoin.coin }
</span> </span>
} }
</span> </span>

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

@ -1,8 +1,9 @@
import React from 'react'; import React from 'react';
import { translate } from '../../../translate/translate'; import { translate } from '../../../translate/translate';
import { sortByDate } from '../../../util/sort'; import { sortByDate } from '../../../util/sort';
import { formatValue } from '../../../util/formatValue';
import Config from '../../../config';
import { import {
Config,
basiliskRefresh, basiliskRefresh,
basiliskConnection, basiliskConnection,
toggleDashboardTxInfoModal, toggleDashboardTxInfoModal,
@ -321,16 +322,21 @@ class WalletsData extends React.Component {
} }
} }
// TODO: add basilisk first run check, display no data if second run
renderTxHistoryList() { renderTxHistoryList() {
if (this.state.itemsList === 'loading') { if (this.state.itemsList === 'loading') {
if (!this.isNativeMode() || this.isFullySynced()) { if (!this.isNativeMode() || this.isFullySynced()) {
return ( return (
<div>{ translate('INDEX.LOADING_HISTORY') }...</div> <tr>
<td colSpan="6">{ translate('INDEX.LOADING_HISTORY') }...</td>
</tr>
); );
} }
} else if (this.state.itemsList === 'no data') { } else if (this.state.itemsList === 'no data') {
return ( return (
<div>{ translate('INDEX.NO_DATA') }</div> <tr>
<td colSpan="6">{ translate('INDEX.NO_DATA') }</td>
</tr>
); );
} else if (this.state.itemsList && this.state.itemsList.length) { } else if (this.state.itemsList && this.state.itemsList.length) {
return TxHistoryListRender.call(this); return TxHistoryListRender.call(this);
@ -392,6 +398,8 @@ class WalletsData extends React.Component {
_amount = _cache && _cache[_coin] && _cache[_coin][address] && _cache[_coin][address].getbalance.data && _cache[_coin][address].getbalance.data.balance ? _cache[_coin][address].getbalance.data.balance : 'N/A'; _amount = _cache && _cache[_coin] && _cache[_coin][address] && _cache[_coin][address].getbalance.data && _cache[_coin][address].getbalance.data.balance ? _cache[_coin][address].getbalance.data.balance : 'N/A';
} }
_amount = formatValue('round', _amount, -6);
items.push( items.push(
AddressItemRender.call(this, address, type, _amount, _coin) AddressItemRender.call(this, address, type, _amount, _coin)
); );
@ -425,7 +433,11 @@ class WalletsData extends React.Component {
return _addresses.public[i].amount; return _addresses.public[i].amount;
} else { } else {
const address = _addresses.public[i].address; const address = _addresses.public[i].address;
return _cache && _cache[_coin] && _cache[_coin][address] && _cache[_coin][address].getbalance.data && _cache[_coin][address].getbalance.data.balance ? _cache[_coin][address].getbalance.data.balance : 'N/A'; let _amount = _cache && _cache[_coin] && _cache[_coin][address] && _cache[_coin][address].getbalance.data && _cache[_coin][address].getbalance.data.balance ? _cache[_coin][address].getbalance.data.balance : 'N/A';
_amount = formatValue('round', _amount, -6);
return _amount;
} }
} }
} }

14
react/src/components/dashboard/walletsData/walletsData.render.js

@ -6,6 +6,8 @@ import WalletsNotariesList from '../walletsNotariesList/walletsNotariesList';
import WalletsCacheData from '../walletsCacheData/walletsCacheData'; import WalletsCacheData from '../walletsCacheData/walletsCacheData';
import ReactTable from 'react-table'; import ReactTable from 'react-table';
import TablePaginationRenderer from './pagination'; import TablePaginationRenderer from './pagination';
import { formatValue } from '../../../util/formatValue';
import Config from '../../../config';
// TODO: clean basilisk dropdown menu // TODO: clean basilisk dropdown menu
@ -58,6 +60,11 @@ export const AddressItemRender = function(address, type, amount, coin) {
}; };
export const AddressListRender = function() { export const AddressListRender = function() {
const isMultiPublicAddress = this.props.ActiveCoin.addresses && this.props.ActiveCoin.addresses.public && this.props.ActiveCoin.addresses.public.length > 1;
const isMultiPrivateAddress = this.props.ActiveCoin.addresses && this.props.ActiveCoin.addresses.private && this.props.ActiveCoin.addresses.private.length > 1;
if (isMultiPublicAddress ||
isMultiPrivateAddress) {
return ( return (
<div className={ `btn-group bootstrap-select form-control form-material showkmdwalletaddrs show-tick ${(this.state.addressSelectorOpen ? 'open' : '')}` }> <div className={ `btn-group bootstrap-select form-control form-material showkmdwalletaddrs show-tick ${(this.state.addressSelectorOpen ? 'open' : '')}` }>
<button <button
@ -80,6 +87,9 @@ export const AddressListRender = function() {
</div> </div>
</div> </div>
); );
} else {
return null;
}
}; };
export const TxTypeRender = function(category) { export const TxTypeRender = function(category) {
@ -146,7 +156,7 @@ export const WalletsDataRender = function() {
<WalletsNotariesList {...this.props} /> <WalletsNotariesList {...this.props} />
<WalletsCacheData {...this.props} /> <WalletsCacheData {...this.props} />
<div id="edexcoin_dashboardinfo"> <div id="edexcoin_dashboardinfo">
<div className="col-xs-12 margin-top-20"> <div className="col-xs-12 margin-top-20 backround-gray">
<div className="panel nav-tabs-horizontal"> <div className="panel nav-tabs-horizontal">
<div> <div>
<div className="col-xlg-12 col-lg-12 col-sm-12 col-xs-12"> <div className="col-xlg-12 col-lg-12 col-sm-12 col-xs-12">
@ -162,7 +172,7 @@ export const WalletsDataRender = function() {
</div> </div>
{ !this.isNativeMode() ? { !this.isNativeMode() ?
<div <div
className={ 'dropdown' + (this.state.basiliskActionsMenu ? ' open' : '') } className={ 'dropdown basilisk-actions' + (this.state.basiliskActionsMenu ? ' open' : '') }
onClick={ this.toggleBasiliskActionsMenu }> onClick={ this.toggleBasiliskActionsMenu }>
<a className="dropdown-toggle btn-xs btn-default"> <a className="dropdown-toggle btn-xs btn-default">
<i className="icon fa-magic margin-right-10"></i> { translate('INDEX.BASILISK_ACTIONS') } <i className="icon fa-magic margin-right-10"></i> { translate('INDEX.BASILISK_ACTIONS') }

7
react/src/components/dashboard/walletsNative/walletsNative.js

@ -1,11 +1,8 @@
import React from 'react'; import React from 'react';
import WalletsNativeRender from './walletsNative.render'; import WalletsNativeRender from './walletsNative.render';
import { translate } from '../../../translate/translate'; import { translate } from '../../../translate/translate';
import { triggerToaster } from '../../../actions/actionCreators';
import { import Config from '../../../config';
Config,
triggerToaster
} from '../../../actions/actionCreators';
import Store from '../../../store'; import Store from '../../../store';
import { SocketProvider } from 'socket.io-react'; import { SocketProvider } from 'socket.io-react';

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

@ -1,6 +1,5 @@
import React from 'react'; import React from 'react';
import { import {
Config,
copyCoinAddress, copyCoinAddress,
iguanaEdexBalance, iguanaEdexBalance,
toggleSendCoinForm, toggleSendCoinForm,
@ -9,6 +8,7 @@ import {
toggleDashboardActiveSection toggleDashboardActiveSection
} from '../../../actions/actionCreators'; } from '../../../actions/actionCreators';
import Store from '../../../store'; import Store from '../../../store';
import Config from '../../../config';
import { import {
WalletsNavNoWalletRender, WalletsNavNoWalletRender,
WalletsNavWithWalletRender WalletsNavWithWalletRender

72
react/src/components/dashboard/walletsProgress/walletsProgress.js

@ -47,7 +47,58 @@ class WalletsProgress extends React.Component {
} }
} }
parseActivatingBestChainProgress() {
let _debugLogLine;
if (this.props.Settings.debugLog.indexOf('\n') > -1) {
const _debugLogMulti = this.props.Settings.debugLog.split('\n');
for (let i = 0; i < _debugLogMulti.length; i++) {
if (_debugLogMulti[i].indexOf('progress=') > -1) {
_debugLogLine = _debugLogMulti[i];
}
}
} else {
_debugLogLine = this.props.Settings.debugLog;
}
if (_debugLogLine) {
const temp = _debugLogLine.split(' ');
let currentBestChain;
let currentProgress;
for (let i = 0; i < temp.length; i++) {
if (temp[i].indexOf('height=') > -1) {
currentBestChain = temp[i].replace('height=', '');
}
if (temp[i].indexOf('progress=') > -1) {
currentProgress = Number(temp[i].replace('progress=', '')) * 1000;
}
}
return [
currentBestChain,
currentProgress
];
}
}
renderSyncPercentagePlaceholder() { renderSyncPercentagePlaceholder() {
// activating best chain
if (this.props.Dashboard.progress &&
this.props.Dashboard.progress.code &&
this.props.Dashboard.progress.code === -28 &&
this.props.Settings.debugLog) {
const _progress = this.parseActivatingBestChainProgress();
if (_progress &&
_progress[1]) {
return SyncPercentageRender.call(this, _progress[1].toFixed(2));
} else {
return LoadingBlocksRender.call(this);
}
}
if (this.props.Dashboard.progress && if (this.props.Dashboard.progress &&
this.props.Dashboard.progress.blocks > 0 && this.props.Dashboard.progress.blocks > 0 &&
this.props.Dashboard.progress.longestchain === 0) { this.props.Dashboard.progress.longestchain === 0) {
@ -120,9 +171,30 @@ class WalletsProgress extends React.Component {
} }
} }
// activating best chain
if (this.props.Dashboard.progress &&
this.props.Dashboard.progress.code &&
this.props.Dashboard.progress.code === -28 &&
this.props.Settings.debugLog) {
const _blocks = this.parseActivatingBestChainProgress();
if (_blocks &&
_blocks[0]) {
return (
`: ${_blocks[0]} (current block)`
);
} else {
return null;
}
} else {
if (currentProgress) {
return ( return (
`: ${currentProgress}% (${ translate('INDEX.RESCAN_SM') })` `: ${currentProgress}% (${ translate('INDEX.RESCAN_SM') })`
); );
} else {
return null;
}
}
} else if ( } else if (
this.props.Settings.debugLog.indexOf('LoadExternalBlockFile:') > -1 || this.props.Settings.debugLog.indexOf('LoadExternalBlockFile:') > -1 ||
this.props.Settings.debugLog.indexOf('Reindexing block file') > -1 this.props.Settings.debugLog.indexOf('Reindexing block file') > -1

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

@ -1,6 +1,8 @@
import React from 'react'; import React from 'react';
import { translate } from '../../../translate/translate'; import { translate } from '../../../translate/translate';
import { secondsToString } from '../../../util/time'; import { secondsToString } from '../../../util/time';
import { formatValue } from '../../../util/formatValue';
import Config from '../../../config';
const WalletsTxInfoRender = function(txInfo) { const WalletsTxInfoRender = function(txInfo) {
return ( return (
@ -55,7 +57,7 @@ const WalletsTxInfoRender = function(txInfo) {
<tr> <tr>
<td>{ translate('TX_INFO.AMOUNT') }</td> <td>{ translate('TX_INFO.AMOUNT') }</td>
<td> <td>
{ txInfo.amount } { Config.roundValues ? formatValue('round', txInfo.amount, -10) : txInfo.amount }
</td> </td>
</tr> </tr>
<tr> <tr>

2
react/src/components/login/login.js

@ -1,6 +1,5 @@
import React from 'react'; import React from 'react';
import { import {
Config,
toggleAddcoinModal, toggleAddcoinModal,
iguanaWalletPassphrase, iguanaWalletPassphrase,
iguanaActiveHandle, iguanaActiveHandle,
@ -11,6 +10,7 @@ import {
createNewWallet, createNewWallet,
triggerToaster triggerToaster
} from '../../actions/actionCreators'; } from '../../actions/actionCreators';
import Config from '../../config';
import Store from '../../store'; import Store from '../../store';
import { PassPhraseGenerator } from '../../util/crypto/passphrasegenerator'; import { PassPhraseGenerator } from '../../util/crypto/passphrasegenerator';
import SwallModalRender from './swall-modal.render'; import SwallModalRender from './swall-modal.render';

15
react/src/components/login/login.render.js

@ -159,33 +159,36 @@ const LoginRender = function () {
<div className="form-group form-material floating"> <div className="form-group form-material floating">
<div <div
className="radio-custom radio-default radio-inline" className="radio-custom radio-default radio-inline"
onClick={ () => this.generateNewSeed(256) }> onClick={ () =>this.state.bitsOption !== 256 && this.generateNewSeed(256) }>
<input <input
type="radio" type="radio"
name="PassPhraseOptions" name="PassPhraseOptions"
checked={ this.state.bitsOption === 256 }/> checked={ this.state.bitsOption === 256 }
readOnly />
<label htmlFor="PassPhraseOptionsIguana"> <label htmlFor="PassPhraseOptionsIguana">
{ translate('LOGIN.IGUANA_SEED') } { translate('LOGIN.IGUANA_SEED') }
</label> </label>
</div> </div>
<div <div
className="radio-custom radio-default radio-inline" className="radio-custom radio-default radio-inline"
onClick={ () => this.generateNewSeed(160) }> onClick={ () => this.state.bitsOption !== 160 && this.generateNewSeed(160) }>
<input <input
type="radio" type="radio"
name="PassPhraseOptions" name="PassPhraseOptions"
checked={ this.state.bitsOption === 160 }/> checked={ this.state.bitsOption === 160 }
readOnly />
<label htmlFor="PassPhraseOptionsWaves"> <label htmlFor="PassPhraseOptionsWaves">
{ translate('LOGIN.WAVES_SEED') } { translate('LOGIN.WAVES_SEED') }
</label> </label>
</div> </div>
<div <div
className="radio-custom radio-default radio-inline" className="radio-custom radio-default radio-inline"
onClick={ () => this.generateNewSeed(128) }> onClick={ () => this.state.bitsOption !== 128 && this.generateNewSeed(128) }>
<input <input
type="radio" type="radio"
name="PassPhraseOptions" name="PassPhraseOptions"
checked={ this.state.bitsOption === 128 }/> checked={ this.state.bitsOption === 128 }
readOnly />
<label htmlFor="PassPhraseOptionsNXT"> <label htmlFor="PassPhraseOptionsNXT">
{ translate('LOGIN.NXT_SEED') } { translate('LOGIN.NXT_SEED') }
</label> </label>

25
react/src/components/login/login.scss

@ -16,6 +16,17 @@
} }
button { button {
&.copy-floating-label {
position: absolute;
font-weight: 500;
font-size: 14px;
top: -22px;
right: 0;
background-color: #757575;
border: 0;
cursor: pointer;
z-index: 1000;
}
&.swal2-confirm-container { &.swal2-confirm-container {
background-color: rgb(48, 133, 214); background-color: rgb(48, 133, 214);
border-left-color: rgb(48, 133, 214); border-left-color: rgb(48, 133, 214);
@ -111,14 +122,8 @@ input[type="password"] {
margin-right: auto; margin-right: auto;
} }
button.copy-floating-label { .register-form {
position: absolute; .floating-label {
font-weight: 500; font-size: 13px;
font-size: 11.2px; }
top: -11px;
right: 0;
background-color: #757575;
border: 0;
cursor: pointer;
z-index: 1000;
} }

65
react/src/components/overrides.scss

@ -40,13 +40,16 @@ body {
.panel-title { .panel-title {
cursor: pointer; cursor: pointer;
cursor: hand; cursor: hand;
}
.panel-title:before { &:before {
content: '\F273'; content: '\F273';
} }
.panel-title.collapsed:before { &.collapsed {
&:before {
content: '\F278'; content: '\F278';
} }
}
}
} }
#section-dashboard { #section-dashboard {
@ -145,9 +148,10 @@ body {
.display-sync-only-coins-toggle { .display-sync-only-coins-toggle {
cursor: pointer; cursor: pointer;
}
.display-sync-only-coins-toggle:hover { &:hover {
color: #ffa726; color: #ffa726;
}
} }
.btn-add-coin-item, .btn-add-coin-item,
@ -197,13 +201,17 @@ body {
margin-right: 8%; margin-right: 8%;
padding: 0; padding: 0;
.input.to-labelauty+label { .input{
&.to-labelauty+label {
max-width: 136px; max-width: 136px;
} }
} }
.col-lg-4:last-child { }
.col-lg-4 {
&:last-child {
margin-right: 0; margin-right: 0;
} }
}
.col-sm-1 { .col-sm-1 {
width: 44px; width: 44px;
padding: 0; padding: 0;
@ -244,9 +252,11 @@ body {
width: 80%; width: 80%;
margin: 0 auto; margin: 0 auto;
} }
.padding-bottom-60:last-child { .padding-bottom-60 {
&:last-child {
padding-bottom: 0 !important; padding-bottom: 0 !important;
} }
}
} }
#SettingsAccordion { #SettingsAccordion {
@ -593,3 +603,42 @@ select{
.navbar-brand { .navbar-brand {
padding: 22px 15px; padding: 22px 15px;
} }
.panel-actions {
.progress {
width: inherit;
}
}
.basilisk-actions {
.caret {
margin-left: 10px;
margin-top: -2px;
}
}
.clipboard-edexaddr {
margin-left: 10px;
}
.coind-down-modal {
.modal-body {
height: 60vh;
> div {
height: 100%;
}
.page-content {
width: 90%;
height: 100%;
textarea {
min-height: 200px;
}
}
}
}
.backround-gray {
background: #f3f4f5;
}

12
react/src/config.js

@ -1,4 +1,5 @@
module.exports = { let Config;
let _config = {
iguanaCorePort: 7778, iguanaCorePort: 7778,
agamaPort: 17777, agamaPort: 17777,
enableCacheApi: true, enableCacheApi: true,
@ -11,4 +12,13 @@ module.exports = {
default: true default: true
}, },
iguanaLessMode: true, iguanaLessMode: true,
roundValues: true,
}; };
try {
Config = window.require('electron').remote.getCurrentWindow().appConfig;
} catch (e) {
Config = _config;
}
export default Config;

9
react/src/reducers/dashboard.js

@ -8,7 +8,8 @@ import {
DASHBOARD_CONNECT_NOTARIES, DASHBOARD_CONNECT_NOTARIES,
VIEW_CACHE_DATA, VIEW_CACHE_DATA,
LOG_GUI_HTTP, LOG_GUI_HTTP,
TOGGLE_NOTIFICATIONS_MODAL TOGGLE_NOTIFICATIONS_MODAL,
DISPLAY_COIND_DOWN_MODAL
} from '../actions/storeType'; } from '../actions/storeType';
const HTTP_STACK_MAX_ENTRIES = 150; // limit stack mem length to N records per type const HTTP_STACK_MAX_ENTRIES = 150; // limit stack mem length to N records per type
@ -36,6 +37,7 @@ export function Dashboard(state = {
failedToConnectNodes: null, failedToConnectNodes: null,
}, },
guiLog: {}, guiLog: {},
displayCoindDownModal: false,
}, action) { }, action) {
switch (action.type) { switch (action.type) {
case DASHBOARD_SECTION_CHANGE: case DASHBOARD_SECTION_CHANGE:
@ -97,6 +99,11 @@ export function Dashboard(state = {
return Object.assign({}, state, { return Object.assign({}, state, {
guiLog: newLogState, guiLog: newLogState,
}); });
case DISPLAY_COIND_DOWN_MODAL:
return Object.assign({}, state, {
displayCoindDownModal: action.displayCoindDownModal,
});
break;
default: default:
return state; return state;
} }

12
react/src/reducers/index.js

@ -12,7 +12,7 @@ import { Interval } from './interval';
import { SyncOnly } from './syncOnly'; import { SyncOnly } from './syncOnly';
import { Errors } from './errors'; import { Errors } from './errors';
const rootReducer = combineReducers({ const appReducer = combineReducers({
AddCoin, AddCoin,
toaster, toaster,
Main, Main,
@ -26,4 +26,14 @@ const rootReducer = combineReducers({
routing: routerReducer, routing: routerReducer,
}); });
// reset app state on logout
const initialState = appReducer({}, {});
const rootReducer = (state, action) => {
if (action.type === 'LOGOUT') {
state = initialState;
}
return appReducer(state, action);
}
export default rootReducer; export default rootReducer;

6
react/src/translate/translate.js

@ -2,7 +2,7 @@ import { _lang } from './en';
import Config from '../config'; import Config from '../config';
export function translate(langID) { export function translate(langID) {
let defaultLang = Config.defaultLang; let defaultLang = Config.defaultLang || 'EN';
if (langID && if (langID &&
langID.indexOf('.') > -1) { langID.indexOf('.') > -1) {
@ -13,12 +13,12 @@ export function translate(langID) {
_lang[defaultLang][langIDComponents[0]][langIDComponents[1]]) { _lang[defaultLang][langIDComponents[0]][langIDComponents[1]]) {
return _lang[defaultLang][langIDComponents[0]][langIDComponents[1]]; return _lang[defaultLang][langIDComponents[0]][langIDComponents[1]];
} else { } else {
console.log('Missing translation in js/' + defaultLang.toLowerCase() + '.js ' + langID); console.warn('Missing translation in js/' + defaultLang.toLowerCase() + '.js ' + langID);
return '--> ' + langID + ' <--'; return '--> ' + langID + ' <--';
} }
} else { } else {
if (langID.length) { if (langID.length) {
console.log('Missing translation in js/' + defaultLang.toLowerCase() + '.js ' + langID); console.warn('Missing translation in js/' + defaultLang.toLowerCase() + '.js ' + langID);
return '--> ' + langID + ' <--'; return '--> ' + langID + ' <--';
} }
} }

Loading…
Cancel
Save