Skip to content

Commit

Permalink
Merge pull request #2178 from hollaex/beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
abeikverdi authored Jun 7, 2023
2 parents 835a5c6 + f68c35e commit 7d0127c
Show file tree
Hide file tree
Showing 15 changed files with 63 additions and 45 deletions.
4 changes: 4 additions & 0 deletions server/api/controllers/deposit.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ const getAdminDeposits = (req, res) => {
format
} = req.swagger.params;

if (format.value && req.auth.scopes.indexOf(ROLES.ADMIN) === -1 && !user_id.value) {
return res.status(403).json({ message: API_KEY_NOT_PERMITTED });
}

toolsLib.wallet.getUserDepositsByKitId(
user_id.value,
currency.value,
Expand Down
2 changes: 1 addition & 1 deletion server/api/controllers/withdrawal.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ const getAdminWithdrawals = (req, res) => {
address
} = req.swagger.params;

if (format.value && req.auth.scopes.indexOf(ROLES.ADMIN) === -1) {
if (format.value && req.auth.scopes.indexOf(ROLES.ADMIN) === -1 && !user_id.value) {
return res.status(403).json({ message: API_KEY_NOT_PERMITTED });
}

Expand Down
5 changes: 5 additions & 0 deletions server/api/swagger/admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2669,6 +2669,8 @@ paths:
x-security-scopes:
- admin
- supervisor
- kyc
- support
x-token-permissions:
- can_read
/admin/user/referer:
Expand Down Expand Up @@ -2699,6 +2701,9 @@ paths:
- hmac
x-security-scopes:
- admin
- supervisor
- kyc
- support
x-token-permissions:
- can_read
/admin/user/wallet:
Expand Down
2 changes: 1 addition & 1 deletion server/api/swagger/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ paths:
in: query
required: false
type: string
maxLength: 1024
maxLength: 5000
responses:
200:
description: Success
Expand Down
2 changes: 1 addition & 1 deletion server/api/swagger/definitions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ definitions:
maxLength: 256
captcha:
type: string
maxLength: 1024
maxLength: 5000
referral:
type: string
maxLength: 256
Expand Down
2 changes: 1 addition & 1 deletion server/api/swagger/swagger.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const definition = {
swagger: '2.0',
info: {
title: 'HollaEx Kit',
version: '2.6.4'
version: '2.6.5'
},
host: 'api.hollaex.com',
basePath: '/v2',
Expand Down
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.6.4",
"version": "2.6.5",
"private": false,
"description": "HollaEx Kit",
"keywords": [
Expand Down
8 changes: 8 additions & 0 deletions templates/local/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ events {
}

http {
gzip on;
gzip_comp_level 6;
gzip_min_length 500;
gzip_buffers 16 8k;
gzip_proxied any;
gzip_vary on;
gzip_types text/plain text/css application/json application/x-javascript application/javascript text/xml application/xml application/rss+xml text/javascript image/svg+xml application/vnd.ms-fo

include /etc/nginx/mime.types;
include /etc/nginx/proxy.conf;
include /etc/nginx/conf.d/upstream*.conf;
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.6.4
2.6.5
2 changes: 1 addition & 1 deletion web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hollaex-kit",
"version": "2.6.4",
"version": "2.6.5",
"private": true,
"dependencies": {
"@ant-design/compatible": "1.0.5",
Expand Down
42 changes: 24 additions & 18 deletions web/src/components/Form/FormFields/FieldWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,21 @@ const Warning = ({ text, className = '' }) => (
</div>
);

const renderWarning = (warning) => {
if (warning) {
if (Array.isArray(warning)) {
return (
<div className="field_warning_wrapper">
{warning.map((msg, index) => (
<Warning
text={msg}
className={classnames({ 'mt-2': index !== 0 })}
/>
))}
</div>
);
} else {
return <Warning text={warning} className="field_warning_wrapper" />;
}
const WarningContainer = ({ warning, warnings }) => {
if (warnings && Array.isArray(warnings)) {
return (
<div className="field_warning_wrapper">
{warnings.map((msg, index) => (
<Warning
key={index}
text={msg}
className={classnames({ 'mt-2': index !== 0 })}
/>
))}
</div>
);
} else if (warning) {
return <Warning text={warning} className="field_warning_wrapper" />;
} else {
return null;
}
Expand All @@ -53,6 +52,7 @@ export const FieldContent = ({
ishorizontalfield = false,
dateFieldClassName,
warning,
warnings,
preview,
isEmail,
emailMsg,
Expand All @@ -68,10 +68,14 @@ export const FieldContent = ({
) : (
label
)}
{renderWarning(warning)}
<WarningContainer warning={warning} warnings={warnings} />
</div>
)}
<EditWrapper stringId={stringId} />
<EditWrapper
stringId={stringId}
warning={warning}
warnings={warnings}
/>
</div>
<div className={classnames('field-content')}>
<div
Expand Down Expand Up @@ -180,6 +184,7 @@ class FieldWrapper extends Component {
children,
label,
warning,
warnings,
stringId,
input: { value },
meta: { active = false, error = '', touched = false, invalid = false },
Expand Down Expand Up @@ -220,6 +225,7 @@ class FieldWrapper extends Component {
stringId={stringId}
label={label}
warning={warning}
warnings={warnings}
valid={!invalid}
hasValue={hasValue}
focused={active || focused}
Expand Down
12 changes: 9 additions & 3 deletions web/src/containers/Admin/AdminFinancials/Assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -523,17 +523,23 @@ class Assets extends Component {
handleDelete = async (symbol) => {
const { coins, exchange } = this.state;
this.setState({ submitting: true });
const pairedCoins = exchange.pairs.filter((data) => {
let pairData = data.split('-');
return pairData[0] === symbol || pairData[1] === symbol;
});
try {
let formProps = {
id: exchange.id,
coins: coins
.filter((data) => data.symbol !== symbol)
.map((data) => data.symbol),
pairs: exchange.pairs.filter((data) => {
};
if (pairedCoins.length) {
formProps.pairs = exchange.pairs.filter((data) => {
let pairData = data.split('-');
return pairData[0] !== symbol && pairData[1] !== symbol;
}),
};
});
}
await updateExchange(formProps);
await this.getMyExchange();
await this.getCoins();
Expand Down
15 changes: 2 additions & 13 deletions web/src/containers/Admin/Deposits/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
import { Button, Tooltip } from 'antd';
import { Link } from 'react-router';
import { isSupport } from 'utils/token';
import { formatCurrencyByIncrementalUnit } from 'utils/currency';
import { formatDate } from 'utils';

/*export const renderBoolean = (value) => (
Expand Down Expand Up @@ -234,20 +233,10 @@ export const renderRowContent = ({
return (
<div>
<div>
Amount:{' '}
{formatCurrencyByIncrementalUnit(
amount,
coins?.[currency?.toLocaleLowerCase()]?.increment_unit
)}{' '}
{currency}
Amount: {amount} {currency}
</div>
<div>
Fee:{' '}
{formatCurrencyByIncrementalUnit(
fee,
coins?.[fee_coin?.toLocaleLowerCase()]?.increment_unit
)}{' '}
{fee_coin}
Fee: {fee} {fee_coin}
</div>
{address && <div>Address: {address}</div>}
<div>Timestamp: {formatDate(created_at)}</div>
Expand Down
6 changes: 3 additions & 3 deletions web/src/containers/Deposit/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ export const generateFormFields = ({
}));

const { min } = coins[currency];
const warning = [STRINGS['DEPOSIT_FORM_NETWORK_WARNING']];
const warnings = [STRINGS['DEPOSIT_FORM_NETWORK_WARNING']];
if (min) {
warning.push(
warnings.push(
STRINGS.formatString(
STRINGS['DEPOSIT_FORM_MIN_WARNING'],
min,
Expand All @@ -64,7 +64,7 @@ export const generateFormFields = ({
'WITHDRAWALS_FORM_NETWORK_LABEL,WITHDRAWALS_FORM_NETWORK_PLACEHOLDER,DEPOSIT_FORM_NETWORK_WARNING,DEPOSIT_FORM_MIN_WARNING',
label: STRINGS['WITHDRAWALS_FORM_NETWORK_LABEL'],
placeholder: STRINGS['WITHDRAWALS_FORM_NETWORK_PLACEHOLDER'],
warning,
warnings,
validate: [required],
fullWidth: true,
options: networkOptions,
Expand Down

0 comments on commit 7d0127c

Please sign in to comment.