From 7b81d9d3f030ff2a8ad569aaed073dcaaec5f8f3 Mon Sep 17 00:00:00 2001 From: brandonkimmmm Date: Thu, 8 Jul 2021 17:31:28 +0900 Subject: [PATCH 01/21] init fix for empty tier buf --- server/init.js | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/server/init.js b/server/init.js index d862883ec8..367cb6a7f6 100644 --- a/server/init.js +++ b/server/init.js @@ -16,7 +16,7 @@ const { HOLLAEX_NETWORK_BASE_URL, HOLLAEX_NETWORK_PATH_ACTIVATE } = require('./constants'); -const { each, isNumber, difference } = require('lodash'); +const { isNumber, difference } = require('lodash'); let nodeLib; @@ -111,17 +111,21 @@ const checkStatus = () => { ]); } }) - .then(([exchange, tiers, status]) => { + .then(async ([exchange, tiers, status]) => { loggerInit.info('init/checkStatus/activation', exchange.name, exchange.active); + const exchangePairs = []; - each(exchange.coins, (coin) => { + + for (let coin of exchange.coins) { configuration.coins[coin.symbol] = coin; - }); - each(exchange.pairs, (pair) => { + } + + for (let pair of exchange.pairs) { exchangePairs.push(pair.name); configuration.pairs[pair.name] = pair; - }); - each(tiers, async (tier) => { + } + + for (let tier of tiers) { const makerDiff = difference(exchangePairs, Object.keys(tier.fees.maker)); const takerDiff = difference(exchangePairs, Object.keys(tier.fees.taker)); @@ -130,7 +134,8 @@ const checkStatus = () => { maker: {}, taker: {} }; - each(exchangePairs, (pair) => { + + for (let pair of exchangePairs) { if (!isNumber(tier.fees.maker[pair])) { fees.maker[pair] = DEFAULT_FEES[exchange.collateral_level].maker; } else { @@ -142,7 +147,7 @@ const checkStatus = () => { } else { fees.taker[pair] = tier.fees.taker[pair]; } - }); + } const t = await tier.update({ fees }, { fields: ['fees'] }); @@ -150,7 +155,8 @@ const checkStatus = () => { } else { configuration.tiers[tier.id] = tier.dataValues; } - }); + } + configuration.kit.info = { name: exchange.name, active: exchange.active, @@ -166,6 +172,7 @@ const checkStatus = () => { status: true, initialized: status.initialized }; + const networkNodeLib = new Network({ apiUrl: HOLLAEX_NETWORK_ENDPOINT, baseUrl: HOLLAEX_NETWORK_BASE_URL, @@ -188,9 +195,11 @@ const checkStatus = () => { }) .then(([ users, networkNodeLib ]) => { loggerInit.info('init/checkStatus/activation', users.length, 'users deactivated'); - each(users, (user) => { + + for (let user of users) { frozenUsers[user.dataValues.id] = true; - }); + } + publisher.publish( CONFIGURATION_CHANNEL, JSON.stringify({ From 0cd5ef03e9d3faaf2cd0522d554d524d05c8eb34 Mon Sep 17 00:00:00 2001 From: Amir Hossein Salar Date: Thu, 8 Jul 2021 13:08:59 +0430 Subject: [PATCH 02/21] fix for default strings issue in toggle fields --- web/src/containers/UserSettings/AudioForm.js | 10 ++++++++++ web/src/containers/UserSettings/NotificationForm.js | 3 +++ web/src/containers/UserSettings/RiskForm.js | 1 + 3 files changed, 14 insertions(+) diff --git a/web/src/containers/UserSettings/AudioForm.js b/web/src/containers/UserSettings/AudioForm.js index 52f01c1eaa..ae73363ef1 100644 --- a/web/src/containers/UserSettings/AudioForm.js +++ b/web/src/containers/UserSettings/AudioForm.js @@ -13,6 +13,7 @@ export const generateAudioCueFormValues = () => ({ stringId: 'USER_SETTINGS.AUDIO_CUE_FORM.ALL_AUDIO', label: STRINGS['USER_SETTINGS.AUDIO_CUE_FORM.ALL_AUDIO'], className: 'toggle-wrapper-all', + options: STRINGS['DEFAULT_TOGGLE_OPTIONS'], }, public_trade: { type: 'toggle', @@ -20,6 +21,7 @@ export const generateAudioCueFormValues = () => ({ label: STRINGS['USER_SETTINGS.AUDIO_CUE_FORM.PUBLIC_TRADE_AUDIO'], className: 'toggle-wrapper', disabled: false, + options: STRINGS['DEFAULT_TOGGLE_OPTIONS'], }, order_partially_completed: { type: 'toggle', @@ -27,6 +29,7 @@ export const generateAudioCueFormValues = () => ({ label: STRINGS['USER_SETTINGS.AUDIO_CUE_FORM.ORDERS_PARTIAL_AUDIO'], className: 'toggle-wrapper', disabled: false, + options: STRINGS['DEFAULT_TOGGLE_OPTIONS'], }, order_placed: { type: 'toggle', @@ -34,6 +37,7 @@ export const generateAudioCueFormValues = () => ({ label: STRINGS['USER_SETTINGS.AUDIO_CUE_FORM.ORDERS_PLACED_AUDIO'], className: 'toggle-wrapper', disabled: false, + options: STRINGS['DEFAULT_TOGGLE_OPTIONS'], }, order_canceled: { type: 'toggle', @@ -41,6 +45,7 @@ export const generateAudioCueFormValues = () => ({ label: STRINGS['USER_SETTINGS.AUDIO_CUE_FORM.ORDERS_CANCELED_AUDIO'], className: 'toggle-wrapper', disabled: false, + options: STRINGS['DEFAULT_TOGGLE_OPTIONS'], }, order_completed: { type: 'toggle', @@ -48,6 +53,7 @@ export const generateAudioCueFormValues = () => ({ label: STRINGS['USER_SETTINGS.AUDIO_CUE_FORM.ORDERS_COMPLETED_AUDIO'], className: 'toggle-wrapper', disabled: false, + options: STRINGS['DEFAULT_TOGGLE_OPTIONS'], }, click_amounts: { type: 'toggle', @@ -55,6 +61,7 @@ export const generateAudioCueFormValues = () => ({ label: STRINGS['USER_SETTINGS.AUDIO_CUE_FORM.CLICK_AMOUNTS_AUDIO'], className: 'toggle-wrapper', disabled: false, + options: STRINGS['DEFAULT_TOGGLE_OPTIONS'], }, get_quote_quick_trade: { type: 'toggle', @@ -62,6 +69,7 @@ export const generateAudioCueFormValues = () => ({ label: STRINGS['USER_SETTINGS.AUDIO_CUE_FORM.GET_QUICK_TRADE_AUDIO'], className: 'toggle-wrapper', disabled: false, + options: STRINGS['DEFAULT_TOGGLE_OPTIONS'], }, quick_trade_success: { type: 'toggle', @@ -69,6 +77,7 @@ export const generateAudioCueFormValues = () => ({ label: STRINGS['USER_SETTINGS.AUDIO_CUE_FORM.SUCCESS_QUICK_TRADE_AUDIO'], className: 'toggle-wrapper', disabled: false, + options: STRINGS['DEFAULT_TOGGLE_OPTIONS'], }, quick_trade_timeout: { type: 'toggle', @@ -76,6 +85,7 @@ export const generateAudioCueFormValues = () => ({ label: STRINGS['USER_SETTINGS.AUDIO_CUE_FORM.QUICK_TRADE_TIMEOUT_AUDIO'], className: 'toggle-wrapper', disabled: false, + options: STRINGS['DEFAULT_TOGGLE_OPTIONS'], }, }); diff --git a/web/src/containers/UserSettings/NotificationForm.js b/web/src/containers/UserSettings/NotificationForm.js index 180ac83404..5e53518d28 100644 --- a/web/src/containers/UserSettings/NotificationForm.js +++ b/web/src/containers/UserSettings/NotificationForm.js @@ -13,12 +13,14 @@ export const generateNotificationFormValues = () => ({ stringId: 'USER_SETTINGS.NOTIFICATION_FORM.POPUP_ORDER_CONFIRMATION', label: STRINGS['USER_SETTINGS.NOTIFICATION_FORM.POPUP_ORDER_CONFIRMATION'], className: 'toggle-wrapper', + options: STRINGS['DEFAULT_TOGGLE_OPTIONS'], }, popup_order_completed: { type: 'toggle', stringId: 'USER_SETTINGS.NOTIFICATION_FORM.POPUP_ORDER_COMPLETED', label: STRINGS['USER_SETTINGS.NOTIFICATION_FORM.POPUP_ORDER_COMPLETED'], className: 'toggle-wrapper', + options: STRINGS['DEFAULT_TOGGLE_OPTIONS'], }, popup_order_partially_filled: { type: 'toggle', @@ -26,6 +28,7 @@ export const generateNotificationFormValues = () => ({ label: STRINGS['USER_SETTINGS.NOTIFICATION_FORM.POPUP_ORDER_PARTIALLY_FILLED'], className: 'toggle-wrapper', + options: STRINGS['DEFAULT_TOGGLE_OPTIONS'], }, }); diff --git a/web/src/containers/UserSettings/RiskForm.js b/web/src/containers/UserSettings/RiskForm.js index f8d97957fa..24569796d8 100644 --- a/web/src/containers/UserSettings/RiskForm.js +++ b/web/src/containers/UserSettings/RiskForm.js @@ -77,6 +77,7 @@ export const generateWarningFormValues = () => ({ label: STRINGS['USER_SETTINGS.RISK_MANAGEMENT.WARNING_POP_UP'], // className: 'toggle-wrapper', toggleOnly: true, + options: STRINGS['DEFAULT_TOGGLE_OPTIONS'], }, }); From 88c5108bfae6964e9ca24f126977259216ff3e6f Mon Sep 17 00:00:00 2001 From: Amir Hossein Salar Date: Thu, 8 Jul 2021 14:29:30 +0430 Subject: [PATCH 03/21] fix for default favicon issue --- web/public/favicon.ico | Bin 1086 -> 318 bytes web/public/index.html | 1 + web/public/manifest.json | 7 +++++++ 3 files changed, 8 insertions(+) diff --git a/web/public/favicon.ico b/web/public/favicon.ico index 950555a3df7ff02903f225bbc1866c0b7a3b309f..550d600ee8531545eb17aa6d73e63280c6329287 100644 GIT binary patch literal 318 zcmb`9F%Ezr5CjMC0aVt6%GgN4WBiVViQh5tfyi+b7Iq5Ry`9bFz|`-(N8V&$lvyQB zs4@)IVQa3Y+nUd1rtEMX>to}W81#zm#}rKzOxT7wHH4g`hM2Pk=X#^~>ZQOJ-O^Mi Axc~qF literal 1086 zcmds$J8pwO5Qc|G?+B#SmeRNZu0un?tKl#R0SDpHQsf}O0T7Rp#?EACqeXTc%L=6z zeLG@?pAoY^01~?nZ@~5=oK%2!05~xYj3a~cv_2Jp5Az3}U>ojVU;CxFY1_8NqA0K| z%Nr0`-uHd9Z5!zmvn;#Q#&OJRx~`*TSscSK z&~;rLh5^GcbSJir+hx0t+IF1`MH^*_F z&Wg^+G)<)Qxkl5phuUjzkVk%_sw($Qp66ozo3F@gRaJ5Skq7^R>V4neX+`26k@{YC LK)SQ|kN3uJuf6!6 diff --git a/web/public/index.html b/web/public/index.html index 25357445ec..b436c70d2e 100644 --- a/web/public/index.html +++ b/web/public/index.html @@ -7,6 +7,7 @@ + diff --git a/web/public/manifest.json b/web/public/manifest.json index 395840319b..60b067f857 100644 --- a/web/public/manifest.json +++ b/web/public/manifest.json @@ -1,6 +1,13 @@ { "short_name": "hollaex", "name": "hollaex", + "icons": [ + { + "src": "favicon.ico", + "sizes": "16x16", + "type": "image/ico" + } + ], "start_url": "./index.html", "display": "standalone", "theme_color": "#000000", From aa9446669210a9d9e53d0a9cdd8dd2cc777d10f4 Mon Sep 17 00:00:00 2001 From: Amir Hossein Salar Date: Thu, 8 Jul 2021 14:39:23 +0430 Subject: [PATCH 04/21] add helpdesk plugin error callback --- web/src/actions/appActions.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/src/actions/appActions.js b/web/src/actions/appActions.js index 14169047eb..c2665eb75e 100644 --- a/web/src/actions/appActions.js +++ b/web/src/actions/appActions.js @@ -141,6 +141,11 @@ export const openContactForm = () => { .then(({ data: { url } }) => { window.open(url, '_blank'); return setNotification(CONTACT_FORM, { helpdesk }, false); + }) + .catch(() => { + if (helpdesk) { + window.open(helpdesk, '_blank'); + } }); } else if (helpdesk) { window.open(helpdesk, '_blank'); From 4770e6593c9208cd64675f3f0b3d8ae55b5b412c Mon Sep 17 00:00:00 2001 From: Ali Beikverdi Date: Fri, 9 Jul 2021 14:35:20 +0900 Subject: [PATCH 05/21] version update --- server/api/swagger/swagger.yaml | 2 +- server/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/api/swagger/swagger.yaml b/server/api/swagger/swagger.yaml index 757ca5626d..819816bee2 100644 --- a/server/api/swagger/swagger.yaml +++ b/server/api/swagger/swagger.yaml @@ -1,6 +1,6 @@ swagger: "2.0" info: - version: "2.1.13" + version: "2.1.14" title: HollaEx Kit host: api.hollaex.com basePath: /v2 diff --git a/server/package.json b/server/package.json index 57df4c102f..2ff70691f1 100644 --- a/server/package.json +++ b/server/package.json @@ -1,5 +1,5 @@ { - "version": "2.1.13", + "version": "2.1.14", "private": false, "description": "HollaEx Kit", "keywords": [ From 8543a5d54665277401f04e6cd2e3e214f1114826 Mon Sep 17 00:00:00 2001 From: Amir Hossein Salar Date: Fri, 9 Jul 2021 11:28:40 +0430 Subject: [PATCH 06/21] change for the authContainer and blue help button logic --- web/src/actions/appActions.js | 6 +- web/src/containers/AuthContainer/index.js | 61 ++++++++++++++++++- .../containers/HelpfulResourcesForm/index.js | 12 ++-- 3 files changed, 70 insertions(+), 9 deletions(-) diff --git a/web/src/actions/appActions.js b/web/src/actions/appActions.js index c2665eb75e..94f5c2fa10 100644 --- a/web/src/actions/appActions.js +++ b/web/src/actions/appActions.js @@ -126,7 +126,7 @@ export const closeSnackDialog = (id) => ({ payload: { dialogId: id }, }); -export const openContactForm = () => { +export const openHelpdesk = () => { const { app: { helpdeskInfo: { has_helpdesk, helpdesk_endpoint }, @@ -155,6 +155,10 @@ export const openContactForm = () => { return setNotification(CONTACT_FORM, { helpdesk }, false); }; +export const openContactForm = () => { + return openHelpfulResourcesForm(); +}; + export const openHelpfulResourcesForm = (data = {}) => setNotification(HELPFUL_RESOURCES_FORM, data, true); diff --git a/web/src/containers/AuthContainer/index.js b/web/src/containers/AuthContainer/index.js index fa683f5255..b24744ad8e 100644 --- a/web/src/containers/AuthContainer/index.js +++ b/web/src/containers/AuthContainer/index.js @@ -5,11 +5,16 @@ import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import withConfig from 'components/ConfigProvider/withConfig'; -import { AppFooter } from '../../components'; +import { AppFooter, Dialog } from 'components'; +import { HelpfulResourcesForm } from 'containers'; import { FLEX_CENTER_CLASSES } from '../../config/constants'; import { getClasesForLanguage } from '../../utils/string'; import { getThemeClass } from '../../utils/theme'; -import { getExchangeInfo } from '../../actions/appActions'; +import { + getExchangeInfo, + closeNotification, + HELPFUL_RESOURCES_FORM, +} from 'actions/appActions'; import ThemeProvider from '../ThemeProvider'; // const checkPath = (path) => { @@ -42,20 +47,50 @@ class AuthContainer extends Component { this.state = { isExpired: false, isTrial: false, + dialogIsOpen: false, }; } + UNSAFE_componentWillReceiveProps(nextProps) { + if ( + nextProps.activeNotification.timestamp !== + this.props.activeNotification.timestamp + ) { + if (nextProps.activeNotification.type === HELPFUL_RESOURCES_FORM) { + this.onOpenDialog(); + } else { + this.onCloseDialog(); + } + } else if ( + !nextProps.activeNotification.timestamp && + this.state.dialogIsOpen + ) { + this.onCloseDialog(); + } + } + componentDidMount() { this.props.getExchangeInfo(); } + onOpenDialog = () => { + this.setState({ dialogIsOpen: true }); + }; + + onCloseDialog = () => { + this.setState({ dialogIsOpen: false }); + this.props.closeNotification(); + }; + render() { + const { dialogIsOpen } = this.state; const { activeLanguage, activeTheme, children, constants = { captcha: {} }, icons: ICONS = {}, + activeNotification, } = this.props; const languageClasses = getClasesForLanguage(activeLanguage); const childWithLanguageClasses = React.Children.map(children, (child) => @@ -88,6 +123,26 @@ class AuthContainer extends Component { {childWithLanguageClasses} + + {dialogIsOpen && + activeNotification.type === HELPFUL_RESOURCES_FORM && ( + + )} + {!isMobile ? (
({ activeTheme: store.app.theme, info: store.app.info, constants: store.app.constants, + activeNotification: store.app.activeNotification, }); const mapDispatchToProps = (dispatch) => ({ getExchangeInfo: bindActionCreators(getExchangeInfo, dispatch), + closeNotification: bindActionCreators(closeNotification, dispatch), }); export default connect( diff --git a/web/src/containers/HelpfulResourcesForm/index.js b/web/src/containers/HelpfulResourcesForm/index.js index 31050b0f8f..7bf81f0c75 100644 --- a/web/src/containers/HelpfulResourcesForm/index.js +++ b/web/src/containers/HelpfulResourcesForm/index.js @@ -9,7 +9,7 @@ import STRINGS from '../../config/localizedStrings'; import { sendSupportMail, NOTIFICATIONS, - openContactForm, + openHelpdesk, } from 'actions/appActions'; import withConfig from 'components/ConfigProvider/withConfig'; import { EditWrapper } from 'components'; @@ -51,9 +51,9 @@ class HelpfulResourcesForm extends Component { }); }; openNewForm = () => { - const { openContactForm, onClose } = this.props; + const { openHelpdesk, onClose } = this.props; onClose(); - openContactForm({ category: 'bug' }); + openHelpdesk({ category: 'bug' }); }; render() { @@ -61,7 +61,7 @@ class HelpfulResourcesForm extends Component { onClose, icons: ICONS, constants: { links: { api_doc_link = '' } = {} }, - openContactForm, + openHelpdesk, } = this.props; const { submited } = this.state; @@ -93,7 +93,7 @@ class HelpfulResourcesForm extends Component { {STRINGS.formatString( STRINGS['HELP_RESOURCE_GUIDE.TEXT'], {STRINGS['HELP_RESOURCE_GUIDE.CONTACT_US']} @@ -144,7 +144,7 @@ const mapStateToProps = (store) => ({ }); const mapDispatchToProps = (dispatch) => ({ - openContactForm: bindActionCreators(openContactForm, dispatch), + openHelpdesk: bindActionCreators(openHelpdesk, dispatch), }); export default connect( From 128693d1016c9f3d8b6431ee54b9c19635083142 Mon Sep 17 00:00:00 2001 From: Amir Hossein Salar Date: Fri, 9 Jul 2021 15:31:01 +0430 Subject: [PATCH 07/21] change for the check balance validation in the withdrawal form --- web/src/components/Form/validations.js | 20 ++++++++++++-------- web/src/config/lang/en.js | 2 +- web/src/containers/Withdraw/formUtils.js | 8 +------- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/web/src/components/Form/validations.js b/web/src/components/Form/validations.js index aa8f3bea53..59b15c335b 100644 --- a/web/src/components/Form/validations.js +++ b/web/src/components/Form/validations.js @@ -1,3 +1,4 @@ +import React from 'react'; import validator from 'validator'; import WAValidator from 'multicoin-address-validator'; import math from 'mathjs'; @@ -121,7 +122,7 @@ export const step = (step, message) => (value = 0) => math.larger(math.mod(math.bignumber(value), math.bignumber(step)), 0) ? message || STRINGS.formatString(STRINGS['VALIDATIONS.STEP'], step) : undefined; -export const checkBalance = (available, message, fee = 0) => (value = 0) => { +export const checkBalance = (available, coinName, fee = 0) => (value = 0) => { const operation = fee > 0 ? math.number( @@ -133,13 +134,16 @@ export const checkBalance = (available, message, fee = 0) => (value = 0) => { : value; if (operation > available) { - const errorMessage = - message || - STRINGS.formatString( - STRINGS['VALIDATIONS.INVALID_BALANCE'], - available, - operation - ); + const errorMessage = coinName + ? STRINGS.formatString( + STRINGS['WITHDRAWALS_LOWER_BALANCE'], + {`${operation} ${coinName}`} + ) + : STRINGS.formatString( + STRINGS['VALIDATIONS.INVALID_BALANCE'], + available, + operation + ); return errorMessage; } return undefined; diff --git a/web/src/config/lang/en.js b/web/src/config/lang/en.js index b352afaca4..570a9166b4 100644 --- a/web/src/config/lang/en.js +++ b/web/src/config/lang/en.js @@ -862,7 +862,7 @@ export default { WITHDRAWALS_MAX_VALUE_ERROR: 'The transaction is too big to send. Try a smaller amount.', WITHDRAWALS_LOWER_BALANCE: - 'You don’t have enough {0} in your balance to send that transaction', + 'Insufficient balance to proceed. This transaction requires {0}.', WITHDRAWALS_FEE_TOO_LARGE: 'The fee is more than {0}% of your total transaction', WITHDRAWALS_BTC_INVALID_ADDRESS: diff --git a/web/src/containers/Withdraw/formUtils.js b/web/src/containers/Withdraw/formUtils.js index f44d269c75..3cc79563ef 100644 --- a/web/src/containers/Withdraw/formUtils.js +++ b/web/src/containers/Withdraw/formUtils.js @@ -146,13 +146,7 @@ export const generateFormValues = ( } // FIX add according fee // amountValidate.push(checkBalance(available, STRINGS.formatString(STRINGS["WITHDRAWALS_LOWER_BALANCE"], fullname), fee)); - amountValidate.push( - checkBalance( - available, - STRINGS.formatString(STRINGS['WITHDRAWALS_LOWER_BALANCE'], fullname), - 0 - ) - ); + amountValidate.push(checkBalance(available, fullname, 0)); fields.amount = { type: 'number', From 26f1d67c0cd17ffe0fcdd5206fd298106a205fc9 Mon Sep 17 00:00:00 2001 From: Amir Hossein Salar Date: Mon, 12 Jul 2021 11:42:30 +0430 Subject: [PATCH 08/21] change for address validation logic --- web/package.json | 1 - web/src/components/Form/validations.js | 52 +++++--------------------- 2 files changed, 9 insertions(+), 44 deletions(-) diff --git a/web/package.json b/web/package.json index 2374d623c4..b4852a7e33 100644 --- a/web/package.json +++ b/web/package.json @@ -12,7 +12,6 @@ "array-move": "3.0.1", "awesome-phonenumber": "2.43.0", "axios": "0.21.1", - "bchaddrjs": "0.3.2", "bluebird": "3.5.5", "classnames": "2.2.6", "color": "3.1.3", diff --git a/web/src/components/Form/validations.js b/web/src/components/Form/validations.js index 59b15c335b..31869552f0 100644 --- a/web/src/components/Form/validations.js +++ b/web/src/components/Form/validations.js @@ -2,7 +2,6 @@ import React from 'react'; import validator from 'validator'; import WAValidator from 'multicoin-address-validator'; import math from 'mathjs'; -import bchaddr from 'bchaddrjs'; import { roundNumber } from '../../utils/currency'; import STRINGS from '../../config/localizedStrings'; import { getDecimals } from 'utils/utils'; @@ -35,52 +34,19 @@ export const username = (value = '') => !usernameRegEx.test(value) ? STRINGS['INVALID_USERNAME'] : undefined; export const validAddress = (symbol = '', message, network) => { - let currency = symbol.toUpperCase(); + const currency = network ? network.toUpperCase() : symbol.toUpperCase(); return (address) => { - let valid = true; + let valid; - if (network) { - valid = WAValidator.validate(address, network); - // switch (network) { - // case 'ethereum': - // valid = WAValidator.validate(address, 'eth'); - // break; - // case 'stellar': - // valid = WAValidator.validate(address, 'xlm'); - // break; - // case 'tron': - // valid = WAValidator.validate(address, 'trx'); - // break; - // default: - // break; - // } - } else { - const supported = WAValidator.findCurrency(symbol); + try { + const supported = WAValidator.findCurrency(currency); if (supported) { - // this library recognizes this currency - switch (currency) { - case 'BTC': - valid = WAValidator.validate(address, currency); - break; - case 'BCH': - try { - bchaddr.toLegacyAddress(address); - valid = true; - } catch (err) { - valid = false; - } - break; - case 'ETH': - valid = WAValidator.validate(address, currency); - break; - case 'XRP': - valid = WAValidator.validate(address, currency); - break; - default: - valid = WAValidator.validate(address, currency); - break; - } + valid = WAValidator.validate(address, currency); + } else { + valid = true; } + } catch (err) { + valid = true; } return !valid From fcb85f6de7acc45aedd4886962e31b3f3fcbe66c Mon Sep 17 00:00:00 2001 From: Amir Hossein Salar Date: Mon, 12 Jul 2021 11:44:07 +0430 Subject: [PATCH 09/21] fix for fee calculation logic in wallet withdrawal form --- web/src/components/Form/validations.js | 7 +------ web/src/containers/Withdraw/formUtils.js | 21 ++++++++++++++++++--- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/web/src/components/Form/validations.js b/web/src/components/Form/validations.js index 31869552f0..ac49eac5fc 100644 --- a/web/src/components/Form/validations.js +++ b/web/src/components/Form/validations.js @@ -91,12 +91,7 @@ export const step = (step, message) => (value = 0) => export const checkBalance = (available, coinName, fee = 0) => (value = 0) => { const operation = fee > 0 - ? math.number( - math.add( - math.fraction(value), - math.multiply(math.fraction(value), math.fraction(fee)) - ) - ) + ? math.number(math.add(math.fraction(value), math.fraction(fee))) : value; if (operation > available) { diff --git a/web/src/containers/Withdraw/formUtils.js b/web/src/containers/Withdraw/formUtils.js index 3cc79563ef..36b12ad3e8 100644 --- a/web/src/containers/Withdraw/formUtils.js +++ b/web/src/containers/Withdraw/formUtils.js @@ -61,12 +61,27 @@ export const generateFormValues = ( networks, selectedNetwork ) => { - const { fullname, min, increment_unit, withdrawal_limits = {} } = - coins[symbol] || DEFAULT_COIN_DATA; + const { + fullname, + min, + increment_unit, + withdrawal_limits = {}, + withdrawal_fee, + withdrawal_fees, + } = coins[symbol] || DEFAULT_COIN_DATA; let MAX = withdrawal_limits[verification_level]; if (withdrawal_limits[verification_level] === 0) MAX = ''; if (withdrawal_limits[verification_level] === -1) MAX = 0; + let fee; + if (withdrawal_fees && selectedNetwork && withdrawal_fees[selectedNetwork]) { + fee = withdrawal_fees[selectedNetwork]; + } else if (coins[symbol]) { + fee = withdrawal_fee; + } else { + fee = 0; + } + const fields = {}; if (networks) { @@ -146,7 +161,7 @@ export const generateFormValues = ( } // FIX add according fee // amountValidate.push(checkBalance(available, STRINGS.formatString(STRINGS["WITHDRAWALS_LOWER_BALANCE"], fullname), fee)); - amountValidate.push(checkBalance(available, fullname, 0)); + amountValidate.push(checkBalance(available, fullname, fee)); fields.amount = { type: 'number', From 401fe6e62bd88e2064fd726d768307141115a85a Mon Sep 17 00:00:00 2001 From: brandonkimmmm Date: Mon, 12 Jul 2021 17:33:32 +0900 Subject: [PATCH 10/21] add x-forwarded-for and kit-version in create user request header --- server/api/controllers/user.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/api/controllers/user.js b/server/api/controllers/user.js index 942c6db2c4..f79ae6ef7d 100644 --- a/server/api/controllers/user.js +++ b/server/api/controllers/user.js @@ -1,5 +1,6 @@ 'use strict'; +const { version } = require('../../package.json'); const { isEmail, isUUID } = require('validator'); const toolsLib = require('hollaex-tools-lib'); const { sendEmail } = require('../../mail'); @@ -105,7 +106,12 @@ const signUpUser = (req, res) => { }, { transaction }) .then((user) => { return all([ - toolsLib.user.createUserOnNetwork(email), + toolsLib.user.createUserOnNetwork(email, { + additionalHeaders: { + 'x-forwarded-for': req.headers['x-forwarded-for'], + 'kit-version': version + } + }), user ]); }) From 89c8e33c13b13f2f2a68f26327becd760aa5e7f7 Mon Sep 17 00:00:00 2001 From: brandonkimmmm Date: Mon, 12 Jul 2021 17:44:59 +0900 Subject: [PATCH 11/21] package.json kit, node branch update --- server/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/package.json b/server/package.json index 2ff70691f1..3c1fed0ee7 100644 --- a/server/package.json +++ b/server/package.json @@ -28,8 +28,8 @@ "flat": "5.0.0", "geoip-lite": "1.4.1", "helmet": "3.12.0", - "hollaex-node-lib": "github:bitholla/hollaex-node-lib#2.4", - "hollaex-tools-lib": "github:bitholla/hollaex-tools-lib#2.7", + "hollaex-node-lib": "github:bitholla/hollaex-node-lib#2.5", + "hollaex-tools-lib": "github:bitholla/hollaex-tools-lib#2.8", "http": "0.0.0", "install": "0.10.4", "json2csv": "4.5.4", From 10eba1a069df04c6b8f345486cef96e4b10d31e2 Mon Sep 17 00:00:00 2001 From: Amir Hossein Salar Date: Mon, 12 Jul 2021 15:30:15 +0430 Subject: [PATCH 12/21] change for check status network field --- web/src/components/CheckDeposit/index.js | 73 +++++++++++++------ .../TransactionsHistory/HistoryDisplay.js | 5 +- 2 files changed, 54 insertions(+), 24 deletions(-) diff --git a/web/src/components/CheckDeposit/index.js b/web/src/components/CheckDeposit/index.js index cae88225ef..a06071f02a 100644 --- a/web/src/components/CheckDeposit/index.js +++ b/web/src/components/CheckDeposit/index.js @@ -8,6 +8,7 @@ import { STATIC_ICONS } from 'config/icons'; import renderFields from '../../components/Form/factoryFields'; import withConfig from 'components/ConfigProvider/withConfig'; import { required } from '../Form/validations'; +import { getNetworkLabelByKey } from 'utils/wallet'; const FORM_NAME = 'CheckDeposit'; @@ -22,6 +23,7 @@ const CheckDeposit = ({ submitting, valid, error, + formValues, ...props }) => { const coinOptions = []; @@ -35,32 +37,57 @@ const CheckDeposit = ({ } }); - const formFields = { - transaction_id: { - type: 'text', - placeholder: STRINGS['DEPOSIT_STATUS.SEARCH_FIELD_LABEL'], - label: STRINGS['DEPOSIT_STATUS.TRANSACTION_ID'], - validate: [required], - fullWidth: true, - }, - currency: { + const formFields = {}; + formFields.transaction_id = { + type: 'text', + placeholder: STRINGS['DEPOSIT_STATUS.SEARCH_FIELD_LABEL'], + label: STRINGS['DEPOSIT_STATUS.TRANSACTION_ID'], + validate: [required], + fullWidth: true, + }; + + formFields.currency = { + type: 'select', + placeholder: STRINGS['DEPOSIT_STATUS.CURRENCY_FIELD_LABEL'], + label: STRINGS['COINS'], + options: coinOptions, + validate: [required], + fullWidth: true, + }; + + if ( + formValues && + formValues.currency && + coins[formValues.currency] && + coins[formValues.currency].network + ) { + const { network: networks = '' } = coins[formValues.currency]; + const networkOptions = networks.split(',').map((network) => ({ + value: network, + label: getNetworkLabelByKey(network), + })); + + formFields.network = { type: 'select', - placeholder: STRINGS['DEPOSIT_STATUS.CURRENCY_FIELD_LABEL'], - label: STRINGS['COINS'], - options: coinOptions, + placeholder: STRINGS['WITHDRAWALS_FORM_NETWORK_PLACEHOLDER'], + label: STRINGS['WITHDRAWALS_FORM_NETWORK_LABEL'], validate: [required], + options: networkOptions, fullWidth: true, - }, - address: { - type: 'text', - placeholder: STRINGS['DEPOSIT_STATUS.ADDRESS_FIELD_LABEL'], - label: - STRINGS[ - 'USER_VERIFICATION.USER_DOCUMENTATION_FORM.FORM_FIELDS.ADDRESS_LABEL' - ], - validate: [required], - fullWidth: true, - }, + }; + } else if (formValues) { + delete formValues.network; + } + + formFields.address = { + type: 'text', + placeholder: STRINGS['DEPOSIT_STATUS.ADDRESS_FIELD_LABEL'], + label: + STRINGS[ + 'USER_VERIFICATION.USER_DOCUMENTATION_FORM.FORM_FIELDS.ADDRESS_LABEL' + ], + validate: [required], + fullWidth: true, }; return ( diff --git a/web/src/containers/TransactionsHistory/HistoryDisplay.js b/web/src/containers/TransactionsHistory/HistoryDisplay.js index a9d9500fb1..6964f28d6f 100644 --- a/web/src/containers/TransactionsHistory/HistoryDisplay.js +++ b/web/src/containers/TransactionsHistory/HistoryDisplay.js @@ -43,7 +43,10 @@ const HistoryDisplay = (props) => { setLoading(true); setInitialValues(params); setMessage(''); - return searchTransaction(params) + return searchTransaction({ + ...params, + network: params.network ? params.network : params.currency, + }) .then((res) => { setLoading(false); if (res) { From a61d1141f8b583f3fdc2d0f9e93e2c0663592c33 Mon Sep 17 00:00:00 2001 From: Ali Beikverdi Date: Mon, 12 Jul 2021 20:55:05 +0900 Subject: [PATCH 13/21] version update --- server/api/swagger/swagger.yaml | 2 +- server/package.json | 2 +- version | 2 +- web/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/api/swagger/swagger.yaml b/server/api/swagger/swagger.yaml index 819816bee2..ab868746be 100644 --- a/server/api/swagger/swagger.yaml +++ b/server/api/swagger/swagger.yaml @@ -1,6 +1,6 @@ swagger: "2.0" info: - version: "2.1.14" + version: "2.1.15" title: HollaEx Kit host: api.hollaex.com basePath: /v2 diff --git a/server/package.json b/server/package.json index 3c1fed0ee7..081389416c 100644 --- a/server/package.json +++ b/server/package.json @@ -1,5 +1,5 @@ { - "version": "2.1.14", + "version": "2.1.15", "private": false, "description": "HollaEx Kit", "keywords": [ diff --git a/version b/version index b8424e111f..9b3176bcf2 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.1.13 \ No newline at end of file +2.1.15 \ No newline at end of file diff --git a/web/package.json b/web/package.json index ff5e202d69..edbcb11086 100644 --- a/web/package.json +++ b/web/package.json @@ -1,6 +1,6 @@ { "name": "hollaex-kit", - "version": "2.1.13", + "version": "2.1.15", "private": true, "dependencies": { "@ant-design/compatible": "1.0.5", From 0a1b3213b451abcb4e5c5167c490d29e165eddb1 Mon Sep 17 00:00:00 2001 From: ram Date: Mon, 12 Jul 2021 21:56:05 +0530 Subject: [PATCH 14/21] Changes for admin theme and cleanup bugs --- web/src/config/lang/en.js | 1 + .../Admin/AdminFinancials/index.css | 28 +++++----- .../containers/Admin/AdminFinancials/index.js | 2 +- web/src/containers/Admin/AppWrapper/index.css | 10 ++-- web/src/containers/Admin/AppWrapper/index.js | 1 + web/src/containers/Admin/Deposits/index.css | 26 +++++----- web/src/containers/Admin/MoveToDash/index.js | 13 ++++- web/src/containers/Admin/Plugins/index.css | 2 +- web/src/containers/Admin/Roles/index.css | 26 +++++----- .../containers/Admin/SetupWizard/index.css | 2 +- web/src/containers/Admin/Tiers/index.css | 20 +++---- web/src/containers/Admin/User/index.css | 52 +++++++++---------- .../containers/Admin/Verification/index.css | 6 +-- .../UserSecurity/DeveloperSection.js | 2 +- .../UserSecurity/_UserSecurity.scss | 7 +++ web/src/containers/UserSecurity/index.js | 11 ++-- web/src/index.css | 25 +++++---- 17 files changed, 130 insertions(+), 104 deletions(-) diff --git a/web/src/config/lang/en.js b/web/src/config/lang/en.js index 570a9166b4..66060aef10 100644 --- a/web/src/config/lang/en.js +++ b/web/src/config/lang/en.js @@ -1468,4 +1468,5 @@ export default { FEE_REDUCTION: 'Fee reduction', // new FEE_REDUCTION_DESCRIPTION: '*your account has a fee discount applied to it. The reduction is applied to the trading fees based on your account.', // new + CHANGE_PASSWORD_FAILED: 'changing password failed', // new }; diff --git a/web/src/containers/Admin/AdminFinancials/index.css b/web/src/containers/Admin/AdminFinancials/index.css index 77fd872cbb..67ab877448 100644 --- a/web/src/containers/Admin/AdminFinancials/index.css +++ b/web/src/containers/Admin/AdminFinancials/index.css @@ -86,7 +86,7 @@ width: 100%; } .admin-earnings-container .content-wrapper .ant-tabs { - color: #ffffff; + color: var(--admin_panel_main_font); } .admin-earnings-container .ant-tabs-nav .ant-tabs-ink-bar { height: 6px; @@ -104,11 +104,11 @@ } .admin-earnings-container .ant-tabs-nav .ant-tabs-tab { font-size: 15px; - color: #ffffff; + color: var(--admin_panel_main_font); font-weight: bold; } .admin-earnings-container .ant-tabs-nav .ant-tabs-tab:hover { - color: #ffffff; + color: var(--admin_panel_main_font); } .admin-earnings-container .ant-tabs-nav::before { border-bottom: none; @@ -129,8 +129,8 @@ .admin-earnings-container .download-btn { width: 100px; font-weight: bold; - background-color: #0000ff; - color: #ffffff; + background-color: #202980; + color: var(--admin_panel_main_font); border-color: #ffffff; text-decoration: underline; cursor: pointer; @@ -149,23 +149,23 @@ } .admin-earnings-container .ant-table-thead > tr > th { - background-color: #4e4efb; - color: #ffffff; + background-color: var(--admin_panel_table_thead); + color: var(--admin_panel_main_font); padding: 0rem 1rem; } .admin-earnings-container .ant-table-tbody > tr > td { - background-color: #0000d1; - color: #ffffff; - border-bottom: 1px solid #0000d1; + background-color: var(--admin_panel_table_tbody); + color: var(--admin_panel_main_font); + border-bottom: 1px solid var(--admin_panel_table_tbody); } .admin-earnings-container .ant-table-tbody > tr.ant-table-placeholder:hover > td { - background-color: #0000ff; + background-color: var(--admin_panel_table_tbody_hover); } .admin-earnings-container .ant-table-tbody > tr.ant-table-row:hover > td { - background-color: #0000ff; + background-color: var(--admin_panel_table_tbody_hover); } .admin-earnings-container .ant-empty @@ -181,7 +181,7 @@ stroke: #7d9ac9; } .admin-earnings-container .ant-empty .ant-empty-description { - color: #ffffff; + color: var(--admin_panel_main_font); } .admin-earnings-container .ant-table-pagination.ant-pagination { margin: 16px 0; @@ -208,7 +208,7 @@ margin-top: 10px; } .admin-earnings-container .ant-picker { - background-color: blue; + background-color: var(--admin_panel_input); } .admin-earnings-container .ant-picker input { color: white; diff --git a/web/src/containers/Admin/AdminFinancials/index.js b/web/src/containers/Admin/AdminFinancials/index.js index 1b87caa372..3540c9322b 100644 --- a/web/src/containers/Admin/AdminFinancials/index.js +++ b/web/src/containers/Admin/AdminFinancials/index.js @@ -19,7 +19,7 @@ const AdminFinancials = ({ router }) => {
- +
diff --git a/web/src/containers/Admin/AppWrapper/index.css b/web/src/containers/Admin/AppWrapper/index.css index e32e01547e..de77c13509 100644 --- a/web/src/containers/Admin/AppWrapper/index.css +++ b/web/src/containers/Admin/AppWrapper/index.css @@ -45,7 +45,7 @@ margin: 24px; } .ant-layout-content .content-wrapper { - background-color: #0000d1; + background-color: var(--admin_panel_content_background); overflow-y: auto; margin: 0px; padding: 0px 24px; @@ -107,7 +107,7 @@ min-height: calc(100vh - 38px) !important; } .ant-layout .ant-layout-content { - background-color: #0000ff; + background-color: var(--admin_panel_title_background); flex-direction: column; margin-left: 310px; padding: 0px; @@ -116,7 +116,7 @@ color: #ffffff; } .ant-layout-sider .ant-layout-sider-children .ant-menu { - background-color: #0000ff; + background-color: var(--admin_panel_sidebar_background); color: #ffffff; } .ant-layout-sider @@ -129,7 +129,7 @@ background-color: #0000ff; } .ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected { - background-color: #0000ff; + background-color: var(--admin_panel_sidebar_background); } .menu-wrapper { border-right: 1px solid #c4c4c4; @@ -214,7 +214,7 @@ margin: 0.2rem 3rem 0.2rem 3rem; } .admin-content-wrapper { - background-color: #0000d1; + background-color: #202980; margin-top: 1rem; } .link-icon { diff --git a/web/src/containers/Admin/AppWrapper/index.js b/web/src/containers/Admin/AppWrapper/index.js index b8952c4ba7..4ff0d4d10f 100644 --- a/web/src/containers/Admin/AppWrapper/index.js +++ b/web/src/containers/Admin/AppWrapper/index.js @@ -44,6 +44,7 @@ import { checkRole } from '../../../utils/token'; import MobileDetect from 'mobile-detect'; import MobileSider from './mobileSider'; import './index.css'; +import '../../../.././src/admin_theme_variables.css'; import 'antd/dist/antd.css'; import { requestMyPlugins } from '../Plugins/action'; diff --git a/web/src/containers/Admin/Deposits/index.css b/web/src/containers/Admin/Deposits/index.css index 5d814b7ded..e0e7ea1e36 100644 --- a/web/src/containers/Admin/Deposits/index.css +++ b/web/src/containers/Admin/Deposits/index.css @@ -47,7 +47,7 @@ .ant-select-single:not(.ant-select-customize-input) .ant-select-selector, .admin-deposit-wrapper .filters-wrapper-filters .ant-picker { - background-color: #0000ff; + background-color: var(--admin_panel_input); color: #ffffff; } .admin-deposit-wrapper .filters-wrapper-filters { @@ -132,15 +132,15 @@ .Validate-Dismiss-popup { padding: 1rem; - color: #FFFFFF; + color: #ffffff; } .Validate-Dismiss-popup .ant-btn { - color: #FFFFFF; + color: #ffffff; } -.Validate-Dismiss-popup .title{ - font-size: 24px; - font-weight: bold; +.Validate-Dismiss-popup .title { + font-size: 24px; + font-weight: bold; } .Validate-Dismiss-popup .confirm-container { border: 1px solid #ffffff; @@ -154,18 +154,18 @@ position: relative; } .Validate-Dismiss-popup .field-label { - color: #FFFFFF; + color: #ffffff; } .Validate-Dismiss-popup .edit-link-wrapper { - position: relative; + position: relative; } .Validate-Dismiss-popup .edit-link { - position: absolute; - bottom: 28px; - right: 16px; - text-decoration: underline; + position: absolute; + bottom: 28px; + right: 16px; + text-decoration: underline; cursor: pointer; } .Validate-Dismiss-popup .ant-input { width: 80%; -} \ No newline at end of file +} diff --git a/web/src/containers/Admin/MoveToDash/index.js b/web/src/containers/Admin/MoveToDash/index.js index adeb40882d..12c264b9d0 100644 --- a/web/src/containers/Admin/MoveToDash/index.js +++ b/web/src/containers/Admin/MoveToDash/index.js @@ -5,7 +5,16 @@ import { ReactSVG } from 'react-svg'; import { STATIC_ICONS } from 'config/icons'; import './index.css'; -const MoveToDash = () => { +const MoveToDash = ({ path }) => { + let data = ''; + if (path) { + data = path.split('/')[2]; + if (data === 'apikeys') { + data = 'mypage/apikey'; + } else if (data === 'financials') { + data = 'financial'; + } + } return (
@@ -17,7 +26,7 @@ const MoveToDash = () => { />
diff --git a/web/src/containers/Admin/Plugins/index.css b/web/src/containers/Admin/Plugins/index.css index e75806e7fb..f13caae6cc 100644 --- a/web/src/containers/Admin/Plugins/index.css +++ b/web/src/containers/Admin/Plugins/index.css @@ -90,7 +90,7 @@ border-top: none; border-bottom: 1px solid #ffffff; border-radius: 0px; - background-color: #0000d1; + background-color: var(--admin_panel_input); color: #c4c4c4; box-shadow: none; } diff --git a/web/src/containers/Admin/Roles/index.css b/web/src/containers/Admin/Roles/index.css index 1f09623bea..86dfb50be6 100644 --- a/web/src/containers/Admin/Roles/index.css +++ b/web/src/containers/Admin/Roles/index.css @@ -10,7 +10,7 @@ } .admin-roles-wrapper .revoke-btn { background-color: #f28041; - color: #ffffff; + color: var(--admin_panel_main_font); } .admin-roles-wrapper .line-separator { background-color: #c4c4c4; @@ -53,27 +53,27 @@ color: #ffffff; } .admin-roles-wrapper .table-wrapper .ant-table-thead > tr > th { - background-color: #4e4efb; - color: #ffffff; + background-color: var(--admin_panel_table_thead); + color: var(--admin_panel_main_font); } .admin-roles-wrapper .table-wrapper .ant-table-tbody > tr > td { - background-color: #0000d1; - color: #ffffff; - border-bottom: 1px solid #0000d1; + background-color: var(--admin_panel_table_tbody); + color: var(--admin_panel_main_font); + border-bottom: 1px solid var(--admin_panel_table_tbody); } .admin-roles-wrapper .table-wrapper .ant-table-tbody > tr.ant-table-placeholder:hover > td { - background-color: #0000ff; + background-color: var(--admin_panel_table_tbody_hover); } .admin-roles-wrapper .table-wrapper .ant-table-tbody > tr.ant-table-row:hover > td { - background-color: #0000ff; + background-color: var(--admin_panel_table_tbody_hover); } .admin-roles-wrapper .table-wrapper @@ -95,7 +95,7 @@ stroke: #7d9ac9; } .admin-roles-wrapper .table-wrapper .ant-empty .ant-empty-description { - color: #ffffff; + color: var(--admin_panel_main_font); } .admin-roles-wrapper .ant-table-pagination.ant-pagination { margin: 16px 0; @@ -110,7 +110,7 @@ } .admin-roles-wrapper .sub-title { - color: #ffffff; + color: var(--admin_panel_main_font); } .admin-roles-wrapper .ant-form .ant-select .ant-select-selector { height: 30px; @@ -140,18 +140,18 @@ .upgrade-section { background-color: #3333ff; - color: #ffffff; + color: var(--admin_panel_main_font); padding: 20px; } .upgrade-section .button-wrapper .ant-btn { background-color: #e97c00; - color: #ffffff; + color: var(--admin_panel_main_font); font-size: 14px !important; } .admin-roles-wrapper .role-description-box .upgrade-text { position: absolute; z-index: 100; - color: #ffffff; + color: var(--admin_panel_main_font); top: 55px; left: 12px; } diff --git a/web/src/containers/Admin/SetupWizard/index.css b/web/src/containers/Admin/SetupWizard/index.css index 19935988f1..276af380d7 100644 --- a/web/src/containers/Admin/SetupWizard/index.css +++ b/web/src/containers/Admin/SetupWizard/index.css @@ -273,7 +273,7 @@ .ant-input, .ant-input-number, .ant-select-single:not(.ant-select-customize-input) .ant-select-selector { - background-color: #0000ff; + background-color: var(--admin_panel_input); color: #c4c4c4; } .ant-input-affix-wrapper:hover, diff --git a/web/src/containers/Admin/Tiers/index.css b/web/src/containers/Admin/Tiers/index.css index bc75126774..3719514f3f 100644 --- a/web/src/containers/Admin/Tiers/index.css +++ b/web/src/containers/Admin/Tiers/index.css @@ -4,7 +4,7 @@ max-width: 50rem; min-width: 25rem; padding: 12px; - color: #ffffff; + color: var(--admin_panel_main_font); } .tiers-container:last-child { border-bottom: 1px solid #c4c4c4; @@ -60,7 +60,7 @@ width: 4rem; } .admin-link-highlight { - color: #ffffff; + color: var(--admin_panel_main_font); text-decoration: underline; cursor: pointer; } @@ -72,19 +72,19 @@ padding: 0px !important; } .admin-tiers-wrapper .ant-table-thead > tr > th { - background-color: #4e4efb; - color: #ffffff; + background-color: var(--admin_panel_table_thead); + color: var(--admin_panel_main_font); } .admin-tiers-wrapper .ant-table-tbody > tr > td { - background-color: #0000d1; - color: #ffffff; + background-color: var(--admin_panel_table_tbody); + color: var(--admin_panel_main_font); border-bottom: 1px solid #c4c4c4; } .admin-tiers-wrapper .ant-table-tbody > tr.ant-table-placeholder:hover > td { - background-color: #0000ff; + background-color: var(--admin_panel_table_tbody_hover); } .admin-tiers-wrapper .ant-table-tbody > tr.ant-table-row:hover > td { - background-color: #0000ff; + background-color: var(--admin_panel_table_tbody_hover); } .admin-tiers-wrapper .ant-empty .ant-empty-image .ant-empty-img-simple-ellipse, .admin-tiers-wrapper .ant-empty .ant-empty-image .ant-empty-img-simple-path { @@ -94,7 +94,7 @@ stroke: #7d9ac9; } .admin-tiers-wrapper .ant-empty .ant-empty-description { - color: #ffffff; + color: var(--admin_panel_main_font); } .admin-tiers-wrapper .ant-table-pagination.ant-pagination { margin: 16px 0; @@ -104,7 +104,7 @@ } .admin-tiers-wrapper h1, .admin-tiers-wrapper h3 { - color: #ffffff; + color: var(--admin_panel_main_font); } .admin-tiers-wrapper .ant-pagination-item-active, diff --git a/web/src/containers/Admin/User/index.css b/web/src/containers/Admin/User/index.css index 69a437a3fd..b2c1b9bc78 100644 --- a/web/src/containers/Admin/User/index.css +++ b/web/src/containers/Admin/User/index.css @@ -25,11 +25,11 @@ .admin-tiers-wrapper .ant-tabs-nav .ant-tabs-tab, .user-container .ant-tabs-nav .ant-tabs-tab { font-size: 15px; - color: #ffffff; + color: var(--admin_panel_main_font); font-weight: bold; } .user-container .ant-tabs-nav .ant-tabs-tab:hover { - color: #ffffff; + color: var(--admin_panel_main_font); } .admin-tiers-wrapper .ant-tabs-nav::before, .admin-user-content .ant-tabs-nav::before, @@ -37,19 +37,19 @@ border-bottom: 1px solid #ffffff; } .admin-user-container .ant-table-thead > tr > th { - background-color: #4e4efb; - color: #ffffff; + background-color: var(--admin_panel_table_thead); + color: var(--admin_panel_main_font); } .admin-user-container .ant-table-tbody > tr > td { - background-color: #0000d1; - color: #ffffff; - border-bottom: 1px solid #0000d1; + background-color: var(--admin_panel_table_tbody); + color: var(--admin_panel_main_font); + border-bottom: 1px solid var(--admin_panel_table_tbody); } .admin-user-container .ant-table-tbody > tr.ant-table-placeholder:hover > td { - background-color: #0000ff; + background-color: var(--admin_panel_table_tbody_hover); } .admin-user-container .ant-table-tbody > tr.ant-table-row:hover > td { - background-color: #0000ff; + background-color: var(--admin_panel_table_tbody_hover); } .admin-user-container .ant-empty .ant-empty-image .ant-empty-img-simple-ellipse, .admin-user-container .ant-empty .ant-empty-image .ant-empty-img-simple-path { @@ -59,7 +59,7 @@ stroke: #7d9ac9; } .admin-user-container .ant-empty .ant-empty-description { - color: #ffffff; + color: var(--admin_panel_main_font); } .admin-user-container .admin-wallet-icon { margin-right: 1rem; @@ -77,25 +77,25 @@ color: #c4c4c4; } .admin-user-content .ant-breadcrumb a:hover { - color: #ffffff; + color: var(--admin_panel_main_font); } .admin-user-content .ant-breadcrumb > span:last-child { - color: #ffffff; + color: var(--admin_panel_main_font); } .admin-user-content .ant-breadcrumb > span:last-child a { - color: #ffffff; + color: var(--admin_panel_main_font); } .user-icon { margin-right: 5px; width: 3rem; } .user-details { - color: #ffffff; + color: var(--admin_panel_main_font); font-size: 18px; margin: 10px 0px; } .user-details .user-seperator { - background-color: #ffffff; + background-color: var(--admin_panel_main_font); height: 20px; margin: 0px 14px; width: 1px; @@ -119,7 +119,7 @@ .about-info .percentage-txt { font-size: 42px; letter-spacing: 0px; - color: #ffffff; + color: var(--admin_panel_main_font); opacity: 0.6; } .about-info .percentage-txt-active { @@ -185,7 +185,7 @@ display: flex; } .admin-content-wrapper .blue-link { - color: #ffffff !important; + color: var(--admin_panel_main_font) !important; text-decoration: underline; } .admin-content-wrapper h1, @@ -198,7 +198,7 @@ .admin-user-container .ant-modal-body h3, .user-data-form h1, .user-data-form h3 { - color: #ffffff; + color: var(--admin_panel_main_font); } .user-info-container, .user-role-container, @@ -210,10 +210,10 @@ .user-info-container { width: 25rem; } -.user-role-container { -} -.user-level-container { +/* .user-role-container { } +.user-level-container { */ +/* } */ .user-info-separator { border-right: 1px solid #c4c4c4; margin: 0rem 2rem; @@ -236,8 +236,8 @@ .user-data-form .ant-picker-input > input, .user-data-form .ant-picker, .user-data-form .ant-input-number-input { - background-color: #0000ff; - color: #ffffff !important; + background-color: var(--admin_panel_input); + color: var(--admin_panel_main_font) !important; } .download-csv-table { border: 1px solid #ffffff; @@ -274,12 +274,12 @@ } .header-section { border-bottom: 1px solid rgb(211, 211, 211, 0.3); - background-color: #0000c1; + background-color: var(--admin_panel_header_section); } .modal-confirm-title { font-size: 20px; font-weight: bold; - color: #ffffff; + color: var(--admin_panel_main_font); } .user-role-container .user-icon { font-size: 30px; @@ -349,7 +349,7 @@ height: 23px !important; } .user_meta-form .user-form-wrapper .ant-picker { - background-color: #0000ff; + background-color: var(--admin_panel_input); } .user_meta-form .user-form-wrapper .ant-picker-input > input, .user_meta-form .user-form-wrapper .ant-picker-suffix { diff --git a/web/src/containers/Admin/Verification/index.css b/web/src/containers/Admin/Verification/index.css index a3f52cae07..8685edb284 100644 --- a/web/src/containers/Admin/Verification/index.css +++ b/web/src/containers/Admin/Verification/index.css @@ -49,7 +49,7 @@ .ant-card, .ant-card-head, .ant-card-type-inner .ant-card-head { - background-color: #0000ff; + background-color: var(--admin_panel_card_background); color: #ffffff; } .ant-card-bordered { @@ -65,7 +65,7 @@ .ant-modal-header, .ant-modal-content, .ant-modal-confirm-body .ant-modal-confirm-content { - background-color: #0000ff; + background-color: var(--admin_panel_modal_background); color: #ffffff; } .ant-modal-close-icon path { @@ -92,7 +92,7 @@ .verification-form .ant-select-single:not(.ant-select-customize-input) .ant-select-selector { - background-color: #0000ff; + background-color: var(--admin_panel_input); color: #ffffff; } .verification-form .ant-upload-text-icon path { diff --git a/web/src/containers/UserSecurity/DeveloperSection.js b/web/src/containers/UserSecurity/DeveloperSection.js index 8d56f90659..91e164c27d 100644 --- a/web/src/containers/UserSecurity/DeveloperSection.js +++ b/web/src/containers/UserSecurity/DeveloperSection.js @@ -116,7 +116,7 @@ export const TokenCreatedInfo = ({ token }) => {
-
+
diff --git a/web/src/containers/UserSecurity/_UserSecurity.scss b/web/src/containers/UserSecurity/_UserSecurity.scss index 7710b2f732..64654d106b 100644 --- a/web/src/containers/UserSecurity/_UserSecurity.scss +++ b/web/src/containers/UserSecurity/_UserSecurity.scss @@ -135,6 +135,13 @@ $svg--padding: $svg--size - $svg-small--size; .popup_info-text { font-size: $font-size-subtext; } + .secret_key { + .action_notification-wrapper { + .action_notification-text { + margin-left: 1rem !important; + } + } + } } .token-no-otp { diff --git a/web/src/containers/UserSecurity/index.js b/web/src/containers/UserSecurity/index.js index 1743f5aa32..1ce326dc84 100644 --- a/web/src/containers/UserSecurity/index.js +++ b/web/src/containers/UserSecurity/index.js @@ -3,6 +3,7 @@ import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import { SubmissionError } from 'redux-form'; import { isMobile } from 'react-device-detect'; +import { message } from 'antd'; import { openContactForm } from 'actions/appActions'; import { resetPassword, @@ -363,9 +364,13 @@ class UserVerification extends Component { }); }) .catch((err) => { - const _error = err.response.data - ? err.response.data.message - : err.message; + const _error = + err.response && err.response.data + ? err.response.data.message + : err.message; + if (!_error) { + message.error(STRINGS['CHANGE_PASSWORD_FAILED']); + } throw new SubmissionError({ _error }); }); }; diff --git a/web/src/index.css b/web/src/index.css index eae14a1962..7425eb4621 100644 --- a/web/src/index.css +++ b/web/src/index.css @@ -342,8 +342,8 @@ table th { height: auto; flex: 1; } .app_container.layout-mobile .app_container-content { - min-height: calc( 100vh - 10rem); - max-height: calc( 100vh - 10rem); + min-height: calc( 100vh - 10rem); + max-height: calc( 100vh - 10rem); max-width: 100vw; overflow-y: scroll; } .app_container.layout-mobile .app_container-content.no_bottom_navigation { @@ -356,8 +356,8 @@ table th { .app_container.layout-mobile .app_container-content .app_container-main.no_bottom_navigation { height: 100%; } .app_container.layout-mobile .content-with-bar { - min-height: calc( 100vh - 17rem); - max-height: calc( 100vh - 17rem); + min-height: calc( 100vh - 17rem); + max-height: calc( 100vh - 17rem); max-width: 100vw; padding: 1rem; margin: 0; @@ -865,6 +865,9 @@ table th { .popup_info-wrapper .popup_info-text { font-size: 1rem; } +.popup_info-wrapper .secret_key .action_notification-wrapper .action_notification-text { + margin-left: 1rem !important; } + .token-no-otp { color: var(--labels_inactive-button); cursor: not-allowed !important; } @@ -2684,8 +2687,8 @@ table th { .layout-mobile .quote-container { background-color: transparent; overflow-y: scroll; - min-height: calc( 100vh - 17rem); - max-height: calc( 100vh - 17rem); } + min-height: calc( 100vh - 17rem); + max-height: calc( 100vh - 17rem); } .layout-mobile .quote-container .quick_trade-wrapper { flex: 1 1; min-width: 95vw; @@ -2832,7 +2835,7 @@ table th { .layout-mobile .presentation_container.verification_container { padding-top: 0 !important; - max-height: calc( 100vh - 10rem); } + max-height: calc( 100vh - 10rem); } .layout-mobile .presentation_container.verification_container .header-content { font-size: 13px !important; } @@ -7069,14 +7072,14 @@ table th { right: 0 !important; min-width: 100vw; max-width: 100vw; - min-height: calc( 100vh - 4rem); - max-height: calc( 100vh - 4rem); + min-height: calc( 100vh - 4rem); + max-height: calc( 100vh - 4rem); border-radius: 0 !important; padding: 0 !important; } .layout-mobile .ReactModal__Content .dialog-mobile-content { padding: 2.5rem !important; - min-height: calc( 100vh - 8rem); - max-height: calc( 100vh - 8rem); + min-height: calc( 100vh - 8rem); + max-height: calc( 100vh - 8rem); display: flex; } .layout-mobile.LogoutModal .ReactModal__Content { From d7f003ce34d64998d39b7cabe5f2c62828373dea Mon Sep 17 00:00:00 2001 From: ram Date: Mon, 12 Jul 2021 22:17:20 +0530 Subject: [PATCH 15/21] fix for theme variables --- web/src/admin_theme_variables.css | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 web/src/admin_theme_variables.css diff --git a/web/src/admin_theme_variables.css b/web/src/admin_theme_variables.css new file mode 100644 index 0000000000..0b7986a38f --- /dev/null +++ b/web/src/admin_theme_variables.css @@ -0,0 +1,19 @@ +:root { + --admin_panel_title_background: #27339d; + --admin_panel_sidebar_background: #27339d; + --admin_panel_content_background: #202980; + + --admin_panel_header_section: #13198d; + + --admin_panel_table_thead: #040e6d; + --admin_panel_table_tbody: #101a78; + --admin_panel_table_tbody_hover: #0e1769; + + --admin_panel_main_font: #ffffff; + + --admin_panel_modal_background: #27339d; + --admin_panel_modal_border: #27339d; + --admin_panel_card_background: #27339d; + + --admin_panel_input: #202980; +} From d76e7b89fc5b928dda6b6188be7487148294e514 Mon Sep 17 00:00:00 2001 From: ram Date: Tue, 13 Jul 2021 20:38:30 +0530 Subject: [PATCH 16/21] fix for admin theme --- web/src/containers/Admin/AdminFinancials/index.css | 2 +- web/src/containers/Admin/Verification/index.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/containers/Admin/AdminFinancials/index.css b/web/src/containers/Admin/AdminFinancials/index.css index 67ab877448..1ef7202c84 100644 --- a/web/src/containers/Admin/AdminFinancials/index.css +++ b/web/src/containers/Admin/AdminFinancials/index.css @@ -41,7 +41,7 @@ position: relative; bottom: 13px; left: 3px; - background-color: blue; + background-color: var(--admin_panel_modal_background); width: 16rem; } .settle-modal-page .modal-button { diff --git a/web/src/containers/Admin/Verification/index.css b/web/src/containers/Admin/Verification/index.css index 8685edb284..b8a2dbca82 100644 --- a/web/src/containers/Admin/Verification/index.css +++ b/web/src/containers/Admin/Verification/index.css @@ -56,7 +56,7 @@ border: 1px solid #c4c4c4; } .ant-modal-header { - border: 1px solid #0000ff; + border: 1px solid var(--admin_panel_modal_border); } .ant-modal-header .ant-modal-title { color: #ffffff; From 93673a8b5252a5fd5108f4ff8baa9299b97bf055 Mon Sep 17 00:00:00 2001 From: Amir Hossein Salar Date: Wed, 14 Jul 2021 15:54:08 +0430 Subject: [PATCH 17/21] change for market list price and volume columns --- web/src/containers/TradeTabs/components/MarketRow.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/src/containers/TradeTabs/components/MarketRow.js b/web/src/containers/TradeTabs/components/MarketRow.js index 409becc168..fcead56625 100644 --- a/web/src/containers/TradeTabs/components/MarketRow.js +++ b/web/src/containers/TradeTabs/components/MarketRow.js @@ -74,6 +74,9 @@ class MarketRow extends Component { {formatToCurrency(ticker.close, increment_price)} + + {pairTwo.symbol ? pairTwo.symbol.toUpperCase() : ''} + @@ -96,7 +99,10 @@ class MarketRow extends Component { )} - {ticker.volume} + + {ticker.volume} + {symbol.toUpperCase()} + Date: Wed, 14 Jul 2021 15:58:20 +0430 Subject: [PATCH 18/21] change for the market card layout --- web/src/containers/TradeTabs/_TradeTabs.scss | 5 -- .../TradeTabs/components/MarketCard.js | 65 ++++++++++--------- web/src/index.css | 3 - 3 files changed, 36 insertions(+), 37 deletions(-) diff --git a/web/src/containers/TradeTabs/_TradeTabs.scss b/web/src/containers/TradeTabs/_TradeTabs.scss index c335f74c5b..0d01ba5116 100644 --- a/web/src/containers/TradeTabs/_TradeTabs.scss +++ b/web/src/containers/TradeTabs/_TradeTabs.scss @@ -133,11 +133,6 @@ $trade-tab--arrow-size: 0.4rem; font-weight: bold; } - .trade_tab-ticker-container { - flex-direction: column; - align-items: flex-end; - } - .price-diff-down { color: $sell; padding: 0 5px; diff --git a/web/src/containers/TradeTabs/components/MarketCard.js b/web/src/containers/TradeTabs/components/MarketCard.js index 31a16ad981..5a278c6cbd 100644 --- a/web/src/containers/TradeTabs/components/MarketCard.js +++ b/web/src/containers/TradeTabs/components/MarketCard.js @@ -80,38 +80,45 @@ class MarketCard extends Component { {fullname}/{pairTwo.fullname}
- -
- +
+
+
+
{formatToCurrency(ticker.close, increment_price)} - +
+
+ {pairTwo.symbol ? pairTwo.symbol.toUpperCase() : ''} +
-
- -
-
- - {(state) => ( -
-
- {priceDifferencePercent} +
+
+ + {(state) => ( +
+
+ {priceDifferencePercent} +
-
- )} - -
-
- {ticker.volume && `${ticker.volume} ${symbol.toUpperCase()}`} + )} + +
+
+ Vol: + + {ticker.volume && + `${ticker.volume} ${symbol.toUpperCase()}`} + +
diff --git a/web/src/index.css b/web/src/index.css index eae14a1962..5545fe927d 100644 --- a/web/src/index.css +++ b/web/src/index.css @@ -3636,9 +3636,6 @@ table th { color: var(--labels_important-active-labels-text-graphics); font-size: 1.8rem; font-weight: bold; } - .trade_tabs-container .trade_tab-ticker-container { - flex-direction: column; - align-items: flex-end; } .trade_tabs-container .price-diff-down { color: var(--trading_selling-related-elements); padding: 0 5px; From 49282a3adfe693cdeb4ae920b5e47d167108f13c Mon Sep 17 00:00:00 2001 From: ram Date: Wed, 14 Jul 2021 20:42:09 +0530 Subject: [PATCH 19/21] fix for unboxing layout and other bugs --- web/src/admin_theme_variables.css | 1 + web/src/containers/Admin/Deposits/index.css | 2 +- .../Admin/SetupWizard/TradingInterface.js | 21 +++++++++++++++++++ web/src/containers/Admin/UserBalance/index.js | 1 + .../Admin/Verification/DataDisplay.js | 2 +- 5 files changed, 25 insertions(+), 2 deletions(-) diff --git a/web/src/admin_theme_variables.css b/web/src/admin_theme_variables.css index 0b7986a38f..2edf50e19d 100644 --- a/web/src/admin_theme_variables.css +++ b/web/src/admin_theme_variables.css @@ -8,6 +8,7 @@ --admin_panel_table_thead: #040e6d; --admin_panel_table_tbody: #101a78; --admin_panel_table_tbody_hover: #0e1769; + --admin_panel_row_expand_icon: #101a78; --admin_panel_main_font: #ffffff; diff --git a/web/src/containers/Admin/Deposits/index.css b/web/src/containers/Admin/Deposits/index.css index e0e7ea1e36..143d2d0396 100644 --- a/web/src/containers/Admin/Deposits/index.css +++ b/web/src/containers/Admin/Deposits/index.css @@ -59,7 +59,7 @@ margin-bottom: 8px; } .blue-admin-table .ant-table-row-expand-icon { - background-color: #0000ff; + background-color: var(--admin_panel_row_expand_icon); border-color: #c4c4c4; } .admin-deposit-wrapper .ant-select .ant-select-selection-placeholder { diff --git a/web/src/containers/Admin/SetupWizard/TradingInterface.js b/web/src/containers/Admin/SetupWizard/TradingInterface.js index dac316b85c..8b187bbc08 100644 --- a/web/src/containers/Admin/SetupWizard/TradingInterface.js +++ b/web/src/containers/Admin/SetupWizard/TradingInterface.js @@ -18,6 +18,7 @@ const Features = ({ initialValues = {}, handleNext, updateConstants, kit }) => { chat: isUpgrade ? false : !!values.chat, quick_trade: !!values.quick_trade, pro_trade: !!values.pro_trade, + home_page: !!values.home_page, }, }; updateConstants(formValues, () => handleNext(4)); @@ -98,6 +99,26 @@ const Features = ({ initialValues = {}, handleNext, updateConstants, kit }) => {
+ + +
+
+ +
+
+ Homepage +
+
+ (This will be the first page seen on your domain) +
+
+
+
+
+
{isUpgrade ? ( diff --git a/web/src/containers/Admin/UserBalance/index.js b/web/src/containers/Admin/UserBalance/index.js index 63de7ef046..3f01208647 100644 --- a/web/src/containers/Admin/UserBalance/index.js +++ b/web/src/containers/Admin/UserBalance/index.js @@ -213,6 +213,7 @@ class UserBalance extends Component { }} expandedRowRender={this.renderAddress} dataSource={tableData} + className="blue-admin-table" />
Percentage balance breakdown
diff --git a/web/src/containers/Admin/Verification/DataDisplay.js b/web/src/containers/Admin/Verification/DataDisplay.js index 7bc1f1b272..111b5989c6 100644 --- a/web/src/containers/Admin/Verification/DataDisplay.js +++ b/web/src/containers/Admin/Verification/DataDisplay.js @@ -51,7 +51,7 @@ export const renderJSONKey = (key, value) => {
) : (
- {key} : {val} + {key} : {typeof val === 'object' ? JSON.stringify(val) : val}
); }); From 6879e6e0e044e295e2454d4058e0a4f985689028 Mon Sep 17 00:00:00 2001 From: Yechan Kim Date: Fri, 16 Jul 2021 19:09:08 +0900 Subject: [PATCH 20/21] Update dockerfile for web to support a better multi-arch build --- web/docker/Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/docker/Dockerfile b/web/docker/Dockerfile index 253d929709..d9dc40558c 100644 --- a/web/docker/Dockerfile +++ b/web/docker/Dockerfile @@ -1,9 +1,11 @@ # build environment -FROM node:12.18.3-alpine as build +FROM node:12.18.3 as build ENV NODE_OPTIONS=--max_old_space_size=3072 WORKDIR /app COPY package.json /app/package.json -RUN npm install --loglevel=error +RUN npm config set unsafe-perm true && \ + npm install -g node-gyp && \ + npm install --loglevel=error COPY . /app RUN npm run build From cd69edf648a0071cc47333ffe736aad3b10e4251 Mon Sep 17 00:00:00 2001 From: Yechan Kim Date: Tue, 20 Jul 2021 19:00:29 +0900 Subject: [PATCH 21/21] Switched the web base image to 12.18.3 buster from plain 12.18.3 (stretch). --- web/docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/docker/Dockerfile b/web/docker/Dockerfile index d9dc40558c..6102e650de 100644 --- a/web/docker/Dockerfile +++ b/web/docker/Dockerfile @@ -1,5 +1,5 @@ # build environment -FROM node:12.18.3 as build +FROM node:12.18.3-buster as build ENV NODE_OPTIONS=--max_old_space_size=3072 WORKDIR /app COPY package.json /app/package.json