diff --git a/react/change.log b/react/change.log index 534043b..c376a6b 100644 --- a/react/change.log +++ b/react/change.log @@ -10,6 +10,9 @@ UI: - komodod crash report modal - values rounding (up to 6 decimals) - add coin multi ui reflow fix +- reset app setting to default +- manual balance / transactions list refresh +- quick access dropdown on login to open settings / about / sync only modals v0.2.0.21a-beta -------------- diff --git a/react/src/actions/actionCreators.js b/react/src/actions/actionCreators.js index baf8d37..f070101 100644 --- a/react/src/actions/actionCreators.js +++ b/react/src/actions/actionCreators.js @@ -25,6 +25,7 @@ import { DASHBOARD_ACTIVE_COIN_CHANGE, ACTIVE_COIN_GET_ADDRESSES, DASHBOARD_ACTIVE_COIN_NATIVE_TXHISTORY, + DISPLAY_LOGIN_SETTINGS_MODAL, DISPLAY_COIND_DOWN_MODAL, START_INTERVAL, STOP_INTERVAL @@ -358,4 +359,11 @@ export function toggleCoindDownModal(display) { type: DISPLAY_COIND_DOWN_MODAL, displayCoindDownModal: display, } +} + +export function toggleLoginSettingsModal(display) { + return { + type: DISPLAY_LOGIN_SETTINGS_MODAL, + displayLoginSettingsModal: display, + } } \ No newline at end of file diff --git a/react/src/actions/actions/basiliskCache.js b/react/src/actions/actions/basiliskCache.js index 07a5713..00d4087 100644 --- a/react/src/actions/actions/basiliskCache.js +++ b/react/src/actions/actions/basiliskCache.js @@ -67,10 +67,11 @@ export function fetchNewCacheData(_payload) { _coin = `&coin=${_payload.coin}`, _calls = `&calls=${_payload.calls}`, _address = _payload.address ? (`&address=${_payload.address}`) : '', + _skip = _payload.skip ? (`&skip=${_payload.skip}`) : '', _iguanaInstancePort = Config.useBasiliskInstance ? `&port=${Config.iguanaCorePort + 1}` : ''; return dispatch => { - return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/${_route}${_userpass}${_pubkey}${_coin}${_calls}${_address}${_iguanaInstancePort}`, { + return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/${_route}${_userpass}${_pubkey}${_coin}${_calls}${_address}${_skip}${_iguanaInstancePort}`, { method: 'GET', headers: { 'Content-Type': 'application/json', diff --git a/react/src/actions/storeType.js b/react/src/actions/storeType.js index d00021b..23deb33 100644 --- a/react/src/actions/storeType.js +++ b/react/src/actions/storeType.js @@ -44,4 +44,5 @@ export const LOAD_APP_INFO = 'LOAD_APP_INFO'; export const LOG_GUI_HTTP = 'LOG_GUI_HTTP'; export const CLI = 'CLI'; export const LOGOUT = 'LOGOUT'; -export const DISPLAY_COIND_DOWN_MODAL = 'DISPLAY_COIND_DOWN_MODAL'; \ No newline at end of file +export const DISPLAY_COIND_DOWN_MODAL = 'DISPLAY_COIND_DOWN_MODAL'; +export const DISPLAY_LOGIN_SETTINGS_MODAL = 'DISPLAY_LOGIN_SETTINGS_MODAL'; \ No newline at end of file diff --git a/react/src/components/dashboard/loginSettingsModal/loginSettingsModal.js b/react/src/components/dashboard/loginSettingsModal/loginSettingsModal.js new file mode 100755 index 0000000..cea9312 --- /dev/null +++ b/react/src/components/dashboard/loginSettingsModal/loginSettingsModal.js @@ -0,0 +1,32 @@ +import React from 'react'; +import { getCoinTitle } from '../../../util/coinHelper'; +import { translate } from '../../../translate/translate'; +import { toggleLoginSettingsModal } from '../../../actions/actionCreators'; +import Store from '../../../store'; + +import { LoginSettingsModalRender } from './loginSettingsModal.render'; + +class LoginSettingsModal extends React.Component { + constructor(props) { + super(props); + this.state = { + }; + this.closeLoginSettingsModal = this.closeLoginSettingsModal.bind(this); + } + + closeLoginSettingsModal() { + Store.dispatch(toggleLoginSettingsModal(false)); + } + + render() { + if (this.props && + this.props.Main && + this.props.Main.displayLoginSettingsModal) { + return LoginSettingsModalRender.call(this); + } else { + return null; + } + } +} + +export default LoginSettingsModal; \ No newline at end of file diff --git a/react/src/components/dashboard/loginSettingsModal/loginSettingsModal.render.js b/react/src/components/dashboard/loginSettingsModal/loginSettingsModal.render.js new file mode 100644 index 0000000..8a59705 --- /dev/null +++ b/react/src/components/dashboard/loginSettingsModal/loginSettingsModal.render.js @@ -0,0 +1,34 @@ +import React from 'react'; +import { translate } from '../../../translate/translate'; +import About from '../about/about'; +import Settings from '../settings/settings'; + +export const LoginSettingsModalRender = function() { + return ( +
+
+
+
+
+ { this.props.section === 'settings' && + + } + { this.props.section === 'about' && + + } +
+
+ +
+
+
+
+
+
+ ); +}; \ No newline at end of file diff --git a/react/src/components/dashboard/settings/settings.js b/react/src/components/dashboard/settings/settings.js index c1031cf..3d5f74d 100644 --- a/react/src/components/dashboard/settings/settings.js +++ b/react/src/components/dashboard/settings/settings.js @@ -62,6 +62,7 @@ class Settings extends React.Component { updateProgressPatch: null, wifkeysPassphrase: '', trimPassphraseTimer: null, + disableWalletSpecificUI: null, }; this.exportWifKeys = this.exportWifKeys.bind(this); this.updateInput = this.updateInput.bind(this); @@ -82,7 +83,9 @@ class Settings extends React.Component { } componentDidMount() { - Store.dispatch(iguanaActiveHandle()); + if (!this.props.disableWalletSpecificUI) { + Store.dispatch(iguanaActiveHandle()); + } Store.dispatch(getAppConfig()); Store.dispatch(getAppInfo()); } @@ -95,6 +98,7 @@ class Settings extends React.Component { activeTab: this.state.activeTab, activeTabHeight: _height, tabElId: this.state.tabElId, + disableWalletSpecificUI: props.disableWalletSpecificUI, })); } } diff --git a/react/src/components/dashboard/settings/settings.render.js b/react/src/components/dashboard/settings/settings.render.js index 5988490..c6a0ddc 100644 --- a/react/src/components/dashboard/settings/settings.render.js +++ b/react/src/components/dashboard/settings/settings.render.js @@ -156,57 +156,59 @@ export const SettingsRender = function() {
-
this.openTab('WalletInfo', 0) } - className={ 'panel' + (this.state.nativeOnly ? ' hide' : '') }> -
- - { translate('INDEX.WALLET_INFO') } - -
+ { !this.props.disableWalletSpecificUI &&
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{ translate('INDEX.KEY') }{ translate('INDEX.VALUE') }
pubkey{ this.props.Main.activeHandle.pubkey }
btcpubkey{ this.props.Main.activeHandle.btcpubkey }
rmd160{ this.props.Main.activeHandle.rmd160 }
NXT{ this.props.Main.activeHandle.NXT }
notary{ this.props.Main.activeHandle.notary }
status{ this.props.Main.activeHandle.status }
+ id="WalletInfo" + onClick={ () => this.openTab('WalletInfo', 0) } + className={ 'panel' + (this.state.nativeOnly ? ' hide' : '') }> +
+ + { translate('INDEX.WALLET_INFO') } + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{ translate('INDEX.KEY') }{ translate('INDEX.VALUE') }
pubkey{ this.props.Main.activeHandle.pubkey }
btcpubkey{ this.props.Main.activeHandle.btcpubkey }
rmd160{ this.props.Main.activeHandle.rmd160 }
NXT{ this.props.Main.activeHandle.NXT }
notary{ this.props.Main.activeHandle.notary }
status{ this.props.Main.activeHandle.status }
+
-
- + } + { !this.props.disableWalletSpecificUI &&
this.openTab('AddNodeforCoin', 1) } @@ -292,7 +294,8 @@ export const SettingsRender = function() {
- + } + { !this.props.disableWalletSpecificUI &&
this.openTab('DumpWallet', 2) } @@ -308,7 +311,8 @@ export const SettingsRender = function() {
Wallet Backup section to be updated soon.
- + } + { !this.props.disableWalletSpecificUI &&
this.openTab('FiatCurrencySettings', 3) } @@ -324,7 +328,8 @@ export const SettingsRender = function() {
Fiat currency settings section to be updated soon.
- + } + { !this.props.disableWalletSpecificUI &&
this.openTab('ExportKeys', 4) } @@ -401,7 +406,8 @@ export const SettingsRender = function() {
- + } + { !this.props.disableWalletSpecificUI &&
this.openTab('ImportKeys', 5) } @@ -450,6 +456,7 @@ export const SettingsRender = function() {
+ }
{ this.renderAppInfoTab() } -
this.openTab('Cli', 9) } - className={ 'panel' + (!this.props.Main.coins.native.length ? ' hide' : '') }> -
- - CLI - -
+ { this.props.Main && this.props.Main.coins.native &&
-
-

{ translate('INDEX.CLI_SELECT_A_COIN') }

-
-
-
- - -
-
- - -
-
- -
-
-
- { this.renderCliResponse() } + id="Cli" + onClick={ () => this.openTab('Cli', 9) } + className={ 'panel' + (!this.props.Main.coins.native.length ? ' hide' : '') }> + +
+
+

{ translate('INDEX.CLI_SELECT_A_COIN') }

+
+ +
+ +
-
- +
+ + +
+
+ +
+
+
+ { this.renderCliResponse() } +
+
+ +
-
+ } { this.renderAppUpdateTab() }
diff --git a/react/src/components/dashboard/walletsBalance/walletsBalance.js b/react/src/components/dashboard/walletsBalance/walletsBalance.js index 1dab912..c0f79c5 100755 --- a/react/src/components/dashboard/walletsBalance/walletsBalance.js +++ b/react/src/components/dashboard/walletsBalance/walletsBalance.js @@ -1,12 +1,31 @@ import React from 'react'; import { translate } from '../../../translate/translate'; +import { + fetchNewCacheData, + getKMDBalanceTotal, + iguanaEdexBalance +} from '../../../actions/actionCreators'; +import Store from '../../../store'; import WalletsBalanceRender from './walletsBalance.render'; class WalletsBalance extends React.Component { constructor(props) { super(props); + this.state = { + currentAddress: null, + }; this.isFullySynced = this.isFullySynced.bind(this); + this.refreshBalance = this.refreshBalance.bind(this); + } + + componentWillReceiveProps(props) { + if (!this.state.currentAddress && + this.props.ActiveCoin.activeAddress) { + this.setState(Object.assign({}, this.state, { + currentAddress: this.props.ActiveCoin.activeAddress, + })); + } } isFullySynced() { @@ -21,6 +40,30 @@ class WalletsBalance extends React.Component { } } + refreshBalance() { + const _mode = this.props.ActiveCoin.mode; + const _coin = this.props.ActiveCoin.coin; + + switch(_mode) { + case 'basilisk': + Store.dispatch(fetchNewCacheData({ + 'pubkey': this.props.Dashboard.activeHandle.pubkey, + 'allcoins': false, + 'coin': this.props.ActiveCoin.coin, + 'calls': 'getbalance', + 'skip': true, + 'address': this.state.currentAddress, + })); + break; + case 'native': + Store.dispatch(getKMDBalanceTotal(_coin)); + break; + case 'full': + Store.dispatch(iguanaEdexBalance(_coin)); + break; + } + } + renderBalance(type) { let _balance = '0'; const _mode = this.props.ActiveCoin.mode; diff --git a/react/src/components/dashboard/walletsBalance/walletsBalance.render.js b/react/src/components/dashboard/walletsBalance/walletsBalance.render.js index 5a97998..6ce2b32 100644 --- a/react/src/components/dashboard/walletsBalance/walletsBalance.render.js +++ b/react/src/components/dashboard/walletsBalance/walletsBalance.render.js @@ -26,6 +26,9 @@ const WalletsBalanceRender = function() {
+
diff --git a/react/src/components/dashboard/walletsData/walletsData.js b/react/src/components/dashboard/walletsData/walletsData.js index 2dffcd5..84dc35d 100644 --- a/react/src/components/dashboard/walletsData/walletsData.js +++ b/react/src/components/dashboard/walletsData/walletsData.js @@ -17,7 +17,9 @@ import { getDexNotaries, deleteCacheFile, fetchNewCacheData, - fetchUtxoCache + fetchUtxoCache, + getNativeTxHistory, + getFullTransactionsList } from '../../../actions/actionCreators'; import Store from '../../../store'; import { @@ -61,6 +63,7 @@ class WalletsData extends React.Component { this.restartBasiliskInstance = this.restartBasiliskInstance.bind(this); this.basiliskRefreshActionOne = this.basiliskRefreshActionOne.bind(this); this.handleClickOutside = this.handleClickOutside.bind(this); + this.refreshTxHistory = this.refreshTxHistory.bind(this); socket.on('messages', msg => this.updateSocketsData(msg)); } @@ -137,6 +140,30 @@ class WalletsData extends React.Component { } } + refreshTxHistory() { + const _mode = this.props.ActiveCoin.mode; + const _coin = this.props.ActiveCoin.coin; + + switch(_mode) { + case 'basilisk': + Store.dispatch(fetchNewCacheData({ + 'pubkey': this.props.Dashboard.activeHandle.pubkey, + 'allcoins': false, + 'coin': _coin, + 'calls': 'listtransactions', + 'skip': true, + 'address': this.state.currentAddress, + })); + break; + case 'native': + Store.dispatch(getNativeTxHistory(_coin)); + break; + case 'full': + Store.dispatch(getFullTransactionsList(_coin)); + break; + } + } + removeAndFetchNewCache() { Store.dispatch(deleteCacheFile({ 'pubkey': this.props.Dashboard.activeHandle.pubkey, diff --git a/react/src/components/dashboard/walletsData/walletsData.render.js b/react/src/components/dashboard/walletsData/walletsData.render.js index f7e6fbb..078e2b0 100644 --- a/react/src/components/dashboard/walletsData/walletsData.render.js +++ b/react/src/components/dashboard/walletsData/walletsData.render.js @@ -157,6 +157,9 @@ export const WalletsDataRender = function() {
+
+ { this.renderSwallModal() }
@@ -16,12 +20,34 @@ const LoginRender = function () { alt="SuperNET Iguana" />
-
- - { translate('LOGIN.DISPLAY_SYNC_ONLY') } - +
diff --git a/react/src/components/login/login.scss b/react/src/components/login/login.scss index ed3e5c3..4b07173 100644 --- a/react/src/components/login/login.scss +++ b/react/src/components/login/login.scss @@ -126,4 +126,30 @@ input[type="password"] { .floating-label { font-size: 13px; } +} + +.login-settings-dropdown { + font-size: 16px; + + .dropdown-menu { + left: 42%; + top: inherit; + } +} + +.login-settings-dropdown-trigger { + cursor: pointer; +} + +.login-settings-modal { + .modal-body { + overflow-y: scroll; + color: #757575; + } + .panel-title { + color: #757575; + } + a { + color: #fb8c00; + } } \ No newline at end of file diff --git a/react/src/components/overrides.scss b/react/src/components/overrides.scss index 55cd8a3..5bee66c 100644 --- a/react/src/components/overrides.scss +++ b/react/src/components/overrides.scss @@ -641,4 +641,11 @@ select{ .backround-gray { background: #f3f4f5; +} + +.manual-balance-refresh, +.manual-txhistory-refresh { + position: absolute; + right: 4px; + top: 3px; } \ No newline at end of file diff --git a/react/src/reducers/main.js b/react/src/reducers/main.js index f000ae6..0381ef1 100644 --- a/react/src/reducers/main.js +++ b/react/src/reducers/main.js @@ -1,12 +1,14 @@ import { GET_ACTIVE_COINS, LOGIN, - ACTIVE_HANDLE + ACTIVE_HANDLE, + DISPLAY_LOGIN_SETTINGS_MODAL } from '../actions/storeType'; export function Main(state = { isLoggedIn: false, activeCoins: [], + displayLoginSettingsModal: false, }, action) { switch (action.type) { case GET_ACTIVE_COINS: @@ -23,6 +25,10 @@ export function Main(state = { isLoggedIn: action.isLoggedIn, activeHandle: action.handle, }); + case DISPLAY_LOGIN_SETTINGS_MODAL: + return Object.assign({}, state, { + displayLoginSettingsModal: action.displayLoginSettingsModal, + }); default: return state; } diff --git a/react/src/store.js b/react/src/store.js index acd567c..1047d99 100644 --- a/react/src/store.js +++ b/react/src/store.js @@ -3,6 +3,7 @@ import thunkMiddleware from 'redux-thunk'; import createLogger from 'redux-logger'; import { syncHistoryWithStore } from 'react-router-redux'; import { browserHistory } from 'react-router'; +import Config from './config'; import rootReducer from './reducers/index'; @@ -19,7 +20,7 @@ const defaultState = { /* eslint-disable no-underscore-dangle */ const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; -const enhancers = composeEnhancers(applyMiddleware(thunkMiddleware, loggerMiddleware)); +const enhancers = Config.debug || Config.dev ? composeEnhancers(applyMiddleware(thunkMiddleware, loggerMiddleware)) : composeEnhancers(applyMiddleware(thunkMiddleware)); const store = createStore( rootReducer, defaultState,