diff --git a/server/utils/hollaex-network-lib/index.js b/server/utils/hollaex-network-lib/index.js
index 627b879b28..ff91d3f01d 100644
--- a/server/utils/hollaex-network-lib/index.js
+++ b/server/utils/hollaex-network-lib/index.js
@@ -1754,7 +1754,7 @@ class HollaExNetwork {
data.email = true;
}
- if (opts.category && ['stake', 'referral', 'internal'].includes(opts.category)) {
+ if (opts.category) {
data.category = opts.category;
}
diff --git a/server/utils/hollaex-tools-lib/tools/p2p.js b/server/utils/hollaex-tools-lib/tools/p2p.js
index 6aff25db5d..5074cda368 100644
--- a/server/utils/hollaex-tools-lib/tools/p2p.js
+++ b/server/utils/hollaex-tools-lib/tools/p2p.js
@@ -117,7 +117,7 @@ const fetchP2PDeals = async (opts = {
}
});
} else {
- const p2pDeals = await client.getAsync(`p2p-deals${opts.user_id}`);
+ const p2pDeals = await client.getAsync(`p2p-deals${opts.user_id || 'all'}`);
if (p2pDeals) return JSON.parse(p2pDeals);
else {
@@ -138,7 +138,7 @@ const fetchP2PDeals = async (opts = {
}
}
- await client.setexAsync(`p2p-deals${opts.user_id}`, 30, JSON.stringify(deals));
+ await client.setexAsync(`p2p-deals${opts.user_id || 'all'}`, 30, JSON.stringify(deals));
return deals;
}
@@ -352,6 +352,7 @@ const updateP2PDeal = async (data) => {
}
});
await client.delAsync(`p2p-deals${merchant_id}`);
+ await client.delAsync(`p2p-dealsall`);
await getModel('p2pDeal').update({ status }, { where : { id : edited_ids }});
return { message : 'success' };
}
@@ -410,7 +411,7 @@ const updateP2PDeal = async (data) => {
};
await client.delAsync(`p2p-deals${merchant_id}`);
-
+ await client.delAsync(`p2p-dealsall`);
return p2pDeal.update(data, {
fields: [
'merchant_id',
@@ -446,6 +447,8 @@ const deleteP2PDeal = async (removed_ids, user_id) => {
};
await client.delAsync(`p2p-deals${user_id}`);
+ await client.delAsync(`p2p-dealsall`);
+
const promises = deals.map(async (deal) => {
return await deal.destroy();
});
diff --git a/server/utils/hollaex-tools-lib/tools/user.js b/server/utils/hollaex-tools-lib/tools/user.js
index 0bc5a20917..a2c9650b8b 100644
--- a/server/utils/hollaex-tools-lib/tools/user.js
+++ b/server/utils/hollaex-tools-lib/tools/user.js
@@ -3403,7 +3403,7 @@ const getPaymentDetails = async (user_id, opts = {
const query = {
where: {
created_at: timeframe,
- user_id,
+ ...(user_id && { user_id }),
...(opts.is_p2p && { is_p2p: opts.is_p2p }),
...(opts.is_fiat_control && { is_fiat_control: opts.is_fiat_control }),
...(opts.status && { status: opts.status })
diff --git a/web/src/components/AppBar/PairTabs.js b/web/src/components/AppBar/PairTabs.js
index ab898047ef..b12ea5ecbb 100644
--- a/web/src/components/AppBar/PairTabs.js
+++ b/web/src/components/AppBar/PairTabs.js
@@ -1,5 +1,6 @@
import React, { Component } from 'react';
import { connect } from 'react-redux';
+import { bindActionCreators } from 'redux';
import classnames from 'classnames';
import { browserHistory } from 'react-router';
import { Dropdown } from 'antd';
@@ -14,7 +15,10 @@ import withConfig from 'components/ConfigProvider/withConfig';
import { formatToCurrency } from 'utils/currency';
import { MarketsSelector } from 'containers/Trade/utils';
import SparkLine from 'containers/TradeTabs/components/SparkLine';
+import { getSparklines } from 'actions/chartAction';
+import { changeSparkLineChartData } from 'actions/appActions';
+let isMounted = false;
class PairTabs extends Component {
state = {
activePairTab: '',
@@ -29,9 +33,6 @@ class PairTabs extends Component {
}
this.setState({ activePairTab: active });
this.initTabs(pairs, active);
- // getSparklines(Object.keys(pairs)).then((chartData) =>
- // this.props.changeSparkLineChartData(chartData)
- // );
}
UNSAFE_componentWillReceiveProps(nextProps) {
@@ -98,6 +99,7 @@ class PairTabs extends Component {
markets,
quicktrade,
sparkLineChartData,
+ pairs,
} = this.props;
const market = markets.find(({ key }) => key === activePairTab) || {};
const {
@@ -107,6 +109,13 @@ class PairTabs extends Component {
display_name,
} = market;
+ if (activePairTab && !isMounted) {
+ isMounted = true;
+ getSparklines(Object.keys(pairs)).then((chartData) =>
+ this.props.changeSparkLineChartData(chartData)
+ );
+ }
+
const filterQuickTrade = quicktrade.filter(({ type }) => type !== 'pro');
return (
@@ -278,4 +287,14 @@ const mapStateToProps = (state) => {
};
};
-export default connect(mapStateToProps)(withConfig(PairTabs));
+const mapDispatchToProps = (dispatch) => ({
+ changeSparkLineChartData: bindActionCreators(
+ changeSparkLineChartData,
+ dispatch
+ ),
+});
+
+export default connect(
+ mapStateToProps,
+ mapDispatchToProps
+)(withConfig(PairTabs));
diff --git a/web/src/containers/Admin/User/AboutData.js b/web/src/containers/Admin/User/AboutData.js
index d462b95268..8c51428e1e 100644
--- a/web/src/containers/Admin/User/AboutData.js
+++ b/web/src/containers/Admin/User/AboutData.js
@@ -461,6 +461,7 @@ const AboutData = ({
freezeAccount,
verifyEmail,
recoverUser,
+ deleteUser,
onChangeSuccess,
allIcons = {},
userTiers,
@@ -639,6 +640,14 @@ const AboutData = ({
Account is active
+
{
+ deleteUser();
+ }}
+ >
+ Delete user
+
(
+
+
+
+
+
+
+
+ User Delete
+
+
+
+
+ Email:
+ {userData.email}
+
+
Are you sure you want to delete this user?
+
+
+
+
+
+
+);
+
+export default DeletionConfirmation;
diff --git a/web/src/containers/Admin/User/UserContent.js b/web/src/containers/Admin/User/UserContent.js
index 3db46b0b4b..93b305922f 100644
--- a/web/src/containers/Admin/User/UserContent.js
+++ b/web/src/containers/Admin/User/UserContent.js
@@ -30,10 +30,12 @@ import {
activateUser,
verifyUser,
recoverUser,
+ deleteUser,
requestTiers,
} from './actions';
import UserMetaForm from './UserMetaForm';
import PaymentMethods from './PaymentMethods';
+import DeletionConfirmation from './DeleteConfirmation';
// import Flagger from '../Flaguser';
// import Notes from './Notes';
@@ -45,6 +47,7 @@ class UserContent extends Component {
state = {
showVerifyEmailModal: false,
showRecoverModal: false,
+ showDeleteModal: false,
userTiers: {},
};
@@ -218,6 +221,24 @@ class UserContent extends Component {
});
};
+ handleDeleteUser = () => {
+ const { userInformation = {}, refreshData } = this.props;
+ const postValues = {
+ user_id: parseInt(userInformation.id, 10),
+ };
+
+ deleteUser(postValues)
+ .then((res) => {
+ refreshData({ ...postValues, activated: false });
+ this.setState({ showDeleteModal: false });
+ })
+ .catch((err) => {
+ const _error =
+ err.data && err.data.message ? err.data.message : err.message;
+ message.error(_error);
+ });
+ };
+
openVerifyEmailModal = () => {
this.setState({
showVerifyEmailModal: true,
@@ -230,6 +251,12 @@ class UserContent extends Component {
});
};
+ openDeleteUserModel = () => {
+ this.setState({
+ showDeleteModal: true,
+ });
+ };
+
renderTabBar = (props, DefaultTabBar) => {
if (this.props.isConfigure) return ;
return ;
@@ -252,7 +279,12 @@ class UserContent extends Component {
referral_history_config,
} = this.props;
- const { showVerifyEmailModal, showRecoverModal, userTiers } = this.state;
+ const {
+ showVerifyEmailModal,
+ showRecoverModal,
+ showDeleteModal,
+ userTiers,
+ } = this.state;
const {
id,
@@ -354,6 +386,7 @@ class UserContent extends Component {
freezeAccount={this.freezeAccount}
verifyEmail={this.openVerifyEmailModal}
recoverUser={this.openRecoverUserModel}
+ deleteUser={this.openDeleteUserModel}
kycPluginName={kycPluginName}
requestUserData={requestUserData}
refreshAllData={refreshAllData}
@@ -470,6 +503,12 @@ class UserContent extends Component {
onConfirm={this.handleRecoverUser}
userData={userInformation}
/>
+ this.setState({ showRecoverModal: false })}
+ onConfirm={this.handleDeleteUser}
+ userData={userInformation}
+ />
);
}
diff --git a/web/src/containers/Admin/User/actions.js b/web/src/containers/Admin/User/actions.js
index 3dee3d6e04..764ed70048 100644
--- a/web/src/containers/Admin/User/actions.js
+++ b/web/src/containers/Admin/User/actions.js
@@ -214,6 +214,15 @@ export const recoverUser = (values) => {
return requestAuthenticated('/admin/user/restore', options);
};
+export const deleteUser = (values) => {
+ const options = {
+ method: 'DELETE',
+ body: JSON.stringify(values),
+ };
+
+ return requestAuthenticated('/admin/user', options);
+};
+
export const performVerificationLevelUpdate = (values) => {
const options = {
method: 'POST',
diff --git a/web/src/containers/App/App.js b/web/src/containers/App/App.js
index e2f5f73687..d0ee8c3f4e 100644
--- a/web/src/containers/App/App.js
+++ b/web/src/containers/App/App.js
@@ -799,7 +799,7 @@ class App extends Component {
onClick={this.resetTimer}
onKeyPress={this.resetTimer}
/>
-
+
{!isChartEmbed && (
{
}
};
-const renderCards = (data, coins, type, loading, features, quicktradePairs) =>
- data.map(
- (
- {
- symbol,
- lastPrice,
- oneDayPriceDifferencePercent,
- oneDayPriceDifferencePercenVal,
- },
- index
- ) =>
- loading ? (
-
- ) : (
- goToCoinInfo(symbol, features, quicktradePairs)}
- >
-
-
-
-
- {coins[symbol].fullname}
-
- {symbol.toUpperCase()}
-
-
-
-
-
- {lastPrice ? `$${lastPrice}` : '-'}
-
- {renderPercentage(
- type === 'newAssets'
- ? oneDayPriceDifferencePercenVal
- : oneDayPriceDifferencePercent,
- type
- )}
+const renderCards = (data, coins, type, loading, features, quicktradePairs) => {
+ return data?.length >= 1 ? (
+ data?.map(
+ (
+ {
+ symbol,
+ lastPrice,
+ oneDayPriceDifferencePercent,
+ oneDayPriceDifferencePercenVal,
+ increment_unit,
+ },
+ index
+ ) => {
+ const roundPrice = lastPrice?.split(',')?.join('');
+
+ return loading ? (
+
+ ) : (
+
goToCoinInfo(symbol, features, quicktradePairs)}
+ >
+
+
+
+
+ {coins[symbol]?.fullname}
+
+ {symbol?.toUpperCase()}
+
-
-
+
+
+
+ {lastPrice
+ ? `$${formatCurrencyByIncrementalUnit(
+ roundPrice,
+ increment_unit
+ )}`
+ : '-'}
+
+ {renderPercentage(
+ type === 'newAssets'
+ ? oneDayPriceDifferencePercenVal
+ : oneDayPriceDifferencePercent,
+ type
+ )}
+
+
+
+
-
- )
+ );
+ }
+ )
+ ) : (
+
+
+
);
+};
const AssetsCards = ({
coins,
@@ -258,6 +275,10 @@ const AssetsCards = ({
: cardTypes[currentIndex] === 'losers'
? 'losers-asset-card'
: 'new-asset-card'
+ } ${
+ sortedCoinsData[cardTypes[currentIndex]]?.length === 0
+ ? 'text-center'
+ : ''
}`}
>
{renderCards(
@@ -327,7 +348,7 @@ const AssetsCards = ({
: type === 'losers'
? 'losers-asset-card'
: 'new-asset-card'
- }`}
+ } ${sortedCoinsData[type]?.length === 0 ? 'text-center' : ''}`}
>
{renderCards(
sortedCoinsData[type],
diff --git a/web/src/containers/DigitalAssets/components/AssetsList.js b/web/src/containers/DigitalAssets/components/AssetsList.js
index a8de876ef9..1df97480e1 100644
--- a/web/src/containers/DigitalAssets/components/AssetsList.js
+++ b/web/src/containers/DigitalAssets/components/AssetsList.js
@@ -15,6 +15,7 @@ import { EditWrapper } from 'components';
import STRINGS from 'config/localizedStrings';
import withConfig from 'components/ConfigProvider/withConfig';
import AssetsRow from './AssetsRow';
+import { Spin } from 'antd';
const AssetsList = ({
coinsListData,
@@ -246,18 +247,26 @@ const AssetsList = ({
- {getSortedList().map((coinData, index) => (
-
- ))}
+ {getSortedList()?.length >= 1 ? (
+ getSortedList()?.map((coinData, index) => (
+
+ ))
+ ) : (
+
+
+
+ |
+
+ )}
diff --git a/web/src/containers/DigitalAssets/components/AssetsRow.js b/web/src/containers/DigitalAssets/components/AssetsRow.js
index 09add0c719..a777e2c9da 100644
--- a/web/src/containers/DigitalAssets/components/AssetsRow.js
+++ b/web/src/containers/DigitalAssets/components/AssetsRow.js
@@ -10,6 +10,7 @@ import { MiniSparkLine } from 'containers/TradeTabs/components/MiniSparkLine';
import { getLastValuesFromParts } from 'utils/array';
import { unique } from 'utils/data';
import { Loading } from './utils';
+import { formatCurrencyByIncrementalUnit } from 'utils/currency';
const AssetsRow = ({
coinData,
@@ -32,6 +33,7 @@ const AssetsRow = ({
oneDayPriceDifferencePercent,
lastPrice,
key,
+ increment_unit,
} = coinData;
const getAllAvailableMarkets = (key) => {
@@ -94,6 +96,7 @@ const AssetsRow = ({
};
const markets = getAllAvailableMarkets(symbol);
+ const roundPrice = lastPrice?.split(',')?.join('');
return (
@@ -137,7 +140,12 @@ const AssetsRow = ({
{lastPrice && '$'}
- {lastPrice ? lastPrice : '-'}
+ {lastPrice
+ ? formatCurrencyByIncrementalUnit(
+ roundPrice,
+ increment_unit
+ )
+ : '-'}
{(oneDayPriceDifferencePercent && oneDayPriceDifference) ||
@@ -200,6 +208,8 @@ const AssetsRow = ({
coins[symbol].market_cap.toLocaleString('en-US', {
style: 'currency',
currency: 'USD',
+ minimumFractionDigits: 0,
+ maximumFractionDigits: 0,
})
) : (
0
@@ -218,7 +228,9 @@ const AssetsRow = ({
{lastPrice && '$'}
- {lastPrice ? lastPrice : '-'}
+ {lastPrice
+ ? formatCurrencyByIncrementalUnit(roundPrice, increment_unit)
+ : '-'}
) : (
@@ -291,6 +303,8 @@ const AssetsRow = ({
coins[symbol].market_cap.toLocaleString('en-US', {
style: 'currency',
currency: 'USD',
+ minimumFractionDigits: 0,
+ maximumFractionDigits: 0,
})
) : (
0
diff --git a/web/src/containers/DigitalAssets/components/AssetsWrapper.js b/web/src/containers/DigitalAssets/components/AssetsWrapper.js
index ef4d74dc05..179d8442b7 100644
--- a/web/src/containers/DigitalAssets/components/AssetsWrapper.js
+++ b/web/src/containers/DigitalAssets/components/AssetsWrapper.js
@@ -31,7 +31,7 @@ class AssetsWrapper extends Component {
data: [],
chartData: {},
coinsData: [],
- pageSize: 100,
+ pageSize: 50,
page: 0,
count: 0,
searchValue: '',