Skip to content

Commit

Permalink
Merge pull request #2162 from hollaex/beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
abeikverdi committed May 16, 2023
2 parents 215ef40 + 6887a86 commit cbc395b
Show file tree
Hide file tree
Showing 21 changed files with 154 additions and 71 deletions.
8 changes: 4 additions & 4 deletions server/api/controllers/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ const getUsersAdmin = (req, res) => {
}
})
.then((data) => {
if (format.value) {
if (format.value === 'csv') {
res.setHeader('Content-disposition', `attachment; filename=${toolsLib.getKitConfig().api_name}-users.csv`);
res.set('Content-Type', 'text/csv');
return res.status(202).send(data);
Expand Down Expand Up @@ -481,7 +481,7 @@ const getAdminUserLogins = (req, res) => {
format: format.value
})
.then((data) => {
if (format.value) {
if (format.value === 'csv') {
res.setHeader('Content-disposition', `attachment; filename=${toolsLib.getKitConfig().api_name}-users-logins.csv`);
res.set('Content-Type', 'text/csv');
return res.status(202).send(data);
Expand Down Expand Up @@ -546,7 +546,7 @@ const getUserAudits = (req, res) => {
format: format.value
})
.then((data) => {
if (format.value) {
if (format.value === 'csv') {
res.setHeader('Content-disposition', `attachment; filename=${toolsLib.getKitConfig().api_name}-audits.csv`);
res.set('Content-Type', 'text/csv');
return res.status(202).send(data);
Expand Down Expand Up @@ -2247,7 +2247,7 @@ const getWalletsByAdmin = (req, res) => {
}
)
.then((data) => {
if (format.value) {
if (format.value === 'csv') {
res.setHeader('Content-disposition', `attachment; filename=${toolsLib.getKitConfig().api_name}-users.csv`);
res.set('Content-Type', 'text/csv');
return res.status(202).send(data);
Expand Down
2 changes: 1 addition & 1 deletion server/api/controllers/deposit.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const getAdminDeposits = (req, res) => {
}
)
.then((data) => {
if (format.value) {
if (format.value === 'csv') {
res.setHeader('Content-disposition', `attachment; filename=${toolsLib.getKitConfig().api_name}-users-deposits.csv`);
res.set('Content-Type', 'text/csv');
return res.status(202).send(data);
Expand Down
2 changes: 1 addition & 1 deletion server/api/controllers/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ const getUserLogins = (req, res) => {
format: format.value
})
.then((data) => {
if (format.value) {
if (format.value === 'csv') {
res.setHeader('Content-disposition', `attachment; filename=${toolsLib.getKitConfig().api_name}-logins.csv`);
res.set('Content-Type', 'text/csv');
return res.status(202).send(data);
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 @@ -295,7 +295,7 @@ const getAdminWithdrawals = (req, res) => {
}
)
.then((data) => {
if (format.value) {
if (format.value === 'csv') {
res.setHeader('Content-disposition', `attachment; filename=${toolsLib.getKitConfig().api_name}-users-deposits.csv`);
res.set('Content-Type', 'text/csv');
return res.status(202).send(data);
Expand Down
10 changes: 5 additions & 5 deletions server/api/swagger/admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ paths:
name: format
description: Specify data format
required: false
enum: ['csv']
enum: ['csv', 'all']
type: string
responses:
200:
Expand Down Expand Up @@ -1652,7 +1652,7 @@ paths:
name: format
description: Specify data format
required: false
enum: ['csv']
enum: ['csv', 'all']
type: string
tags:
- Admin
Expand Down Expand Up @@ -1733,7 +1733,7 @@ paths:
name: format
description: Specify data format
required: false
enum: ['csv']
enum: ['csv', 'all']
type: string
tags:
- Admin
Expand Down Expand Up @@ -2276,7 +2276,7 @@ paths:
name: format
description: Specify data format
required: false
enum: ['csv']
enum: ['csv', 'all']
type: string
responses:
200:
Expand Down Expand Up @@ -2402,7 +2402,7 @@ paths:
name: format
description: Specify data format
required: false
enum: ['csv']
enum: ['csv', 'all']
type: string
responses:
200:
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.2'
version: '2.6.3'
},
host: 'api.hollaex.com',
basePath: '/v2',
Expand Down
6 changes: 3 additions & 3 deletions server/api/swagger/user.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ paths:
name: format
description: Specify data format
required: false
enum: ['csv']
enum: ['csv', 'all']
type: string
responses:
200:
Expand Down Expand Up @@ -893,7 +893,7 @@ paths:
name: format
description: Specify data format
required: false
enum: ['csv']
enum: ['csv', 'all']
type: string
- in: query
name: transaction_id
Expand Down Expand Up @@ -1008,7 +1008,7 @@ paths:
name: format
description: Specify data format
required: false
enum: ['csv']
enum: ['csv', 'all']
type: string
- in: query
name: transaction_id
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.2",
"version": "2.6.3",
"private": false,
"description": "HollaEx Kit",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion settings/configmap
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ ENVIRONMENT_DOCKER_IMAGE_INFLUXDB_REGISTRY=influxdb
ENVIRONMENT_DOCKER_IMAGE_INFLUXDB_VERSION=1.8.3

ENVIRONMENT_DOCKER_IMAGE_LOCAL_NGINX_REGISTRY=bitholla/nginx-with-certbot
ENVIRONMENT_DOCKER_IMAGE_LOCAL_NGINX_VERSION=1.15.8
ENVIRONMENT_DOCKER_IMAGE_LOCAL_NGINX_VERSION=1.24.0

ENVIRONMENT_LOCAL_NGINX_HTTP_PORT=80
ENVIRONMENT_LOCAL_NGINX_HTTPS_PORT=443
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.6.2
2.6.3
2 changes: 1 addition & 1 deletion web/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN npm config set unsafe-perm true && \
COPY . /app
RUN npm run build

FROM nginx:1.16.0-alpine
FROM nginx:1.24.0-alpine
RUN apk add --update \
curl \
&& rm -rf /var/cache/apk/*
Expand Down
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.2",
"version": "2.6.3",
"private": true,
"dependencies": {
"@ant-design/compatible": "1.0.5",
Expand Down
40 changes: 31 additions & 9 deletions web/src/components/Form/FormFields/FieldWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,36 @@ import classnames from 'classnames';
import { ReactSVG } from 'react-svg';

import { STATIC_ICONS } from 'config/icons';
import { ActionNotification } from '../../';
import { getErrorLocalized } from '../../../utils/errors';
import { EditWrapper } from 'components';
import { ActionNotification, EditWrapper } from 'components';
import { getErrorLocalized } from 'utils/errors';

const Warning = ({ text, className = '' }) => (
<div className={classnames('d-flex', 'align-items-baseline', className)}>
<ExclamationCircleFilled className="field_warning_icon" />
<div className="field_warning_text">{text}</div>
</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" />;
}
} else {
return null;
}
};

export const FieldContent = ({
stringId,
Expand Down Expand Up @@ -41,12 +68,7 @@ export const FieldContent = ({
) : (
label
)}
{warning && (
<div className="d-flex align-items-baseline field_warning_wrapper">
<ExclamationCircleFilled className="field_warning_icon" />
<div className="field_warning_text">{warning}</div>
</div>
)}
{renderWarning(warning)}
</div>
)}
<EditWrapper stringId={stringId} />
Expand Down
43 changes: 23 additions & 20 deletions web/src/components/Views/NotLoggedIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const NotLoggedIn = ({
placeholderKey = 'NOT_LOGGEDIN.TEXT_GENERAL',
children,
hasBackground = true,
wrapperClassName = '',
}) => {
const SignUpLink = (
<Link
Expand All @@ -33,26 +34,28 @@ const NotLoggedIn = ({
return isLoggedIn() ? (
<Fragment>{children}</Fragment>
) : (
<div
className={classnames('not-logged-in_view', {
'show-background': hasBackground,
})}
>
<IconTitle
iconId="DEMO_LOGIN_ICON"
iconPath={ICONS['DEMO_LOGIN_ICON']}
textType="title"
className="w-100 d-flex justify-content-center"
/>
<div className="text-center my-3">
<div className="xht-order-heading">{STRINGS[placeholderKey]}</div>
<div className="xht-order-content">
<div className="my-2">
{STRINGS.formatString(
STRINGS['NOT_LOGGEDIN.TXT_2'],
SignUpLink,
LoginLink
)}
<div className={wrapperClassName}>
<div
className={classnames('not-logged-in_view', {
'show-background': hasBackground,
})}
>
<IconTitle
iconId="DEMO_LOGIN_ICON"
iconPath={ICONS['DEMO_LOGIN_ICON']}
textType="title"
className="w-100 d-flex justify-content-center"
/>
<div className="text-center my-3">
<div className="xht-order-heading">{STRINGS[placeholderKey]}</div>
<div className="xht-order-content">
<div className="my-2">
{STRINGS.formatString(
STRINGS['NOT_LOGGEDIN.TXT_2'],
SignUpLink,
LoginLink
)}
</div>
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions web/src/config/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,7 @@
"WITHDRAWALS_BUTTON_TEXT": "review withdrawal",
"WITHDRAWALS_FORM_NETWORK_LABEL": "Network",
"DEPOSIT_FORM_NETWORK_WARNING": "Make sure the network selected is compatible with the senders wallets network",
"DEPOSIT_FORM_MIN_WARNING": "Only deposits of {0} {1} or more will be accepted. Any deposits below this minimum threshold will result in a permanent loss of funds.",
"DEPOSIT_FORM_TITLE_WARNING_DESTINATION_TAG": "Enter both Address and Tag, which are required to deposit into your account successfully.",
"WITHDRAW_PAGE_DESTINATION_TAG_NONE": "None",
"WITHDRAW_PAGE_DESTINATION_TAG_MESSAGE": "Destination tag: {0}",
Expand Down
11 changes: 10 additions & 1 deletion web/src/containers/Admin/AdminFinancials/TableFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,14 @@ const FieldComponent = ({
);
};

const MultiFilter = ({ fields, filterOptions, onHandle, coins }) => {
const MultiFilter = ({
fields,
filterOptions,
onHandle,
coins,
setIsLoading,
isLoading,
}) => {
const [options, setOptions] = useState(filterOptions);
const [fieldsData, setFieldsData] = useState([]);
const [filterData, setFilterData] = useState({});
Expand Down Expand Up @@ -219,6 +226,7 @@ const MultiFilter = ({ fields, filterOptions, onHandle, coins }) => {

const onHandleSearch = () => {
let obj = {};
setIsLoading(true);
Object.keys(filterData).forEach((name) => {
if (filterData[name] !== '') {
obj = { ...obj, [name]: filterData[name] };
Expand Down Expand Up @@ -262,6 +270,7 @@ const MultiFilter = ({ fields, filterOptions, onHandle, coins }) => {
: 'filter-button green-btn'
}
disabled={
isLoading ||
Object.keys(filterData).length === 0 ||
!Object.values(filterData)
.map((field) => field === '')
Expand Down
12 changes: 10 additions & 2 deletions web/src/containers/Admin/AdminFinancials/Wallet.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react';
import { message, Table, Button } from 'antd';
import { message, Table, Button, Spin } from 'antd';
import { requestUsersDownload } from '../User/actions';
import MultiFilter from './TableFilter';
import { getExchangeWallet } from './action';
Expand Down Expand Up @@ -105,8 +105,10 @@ const filterOptions = [

const Wallet = () => {
const [userData, setUserData] = useState([]);
const [isLoading, setIsLoading] = useState(false);

useEffect(() => {
setIsLoading(true);
getWallet();
}, []);

Expand All @@ -115,9 +117,11 @@ const Wallet = () => {
const res = await getExchangeWallet(values);
if (res && res.data) {
setUserData(res.data);
setIsLoading(false);
}
} catch (error) {
message.error(error.data.message);
setIsLoading(false);
}
};

Expand All @@ -133,6 +137,8 @@ const Wallet = () => {
fields={filterFields}
filterOptions={filterOptions}
onHandle={getWallet}
setIsLoading={setIsLoading}
isLoading={isLoading}
/>
</div>
<div className="mt-5">
Expand All @@ -143,7 +149,9 @@ const Wallet = () => {
Download below CSV table
</span>
<div className="mt-4">
<Table columns={columns} dataSource={userData} />
<Spin spinning={isLoading}>
<Table columns={columns} dataSource={userData} />
</Spin>
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit cbc395b

Please sign in to comment.