Skip to content

Commit

Permalink
Merge pull request #1647 from hollaex/beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
abeikverdi authored Sep 6, 2022
2 parents 4d27137 + 009b2cd commit 4c97b7e
Show file tree
Hide file tree
Showing 53 changed files with 521 additions and 272 deletions.
2 changes: 1 addition & 1 deletion server/api/swagger/swagger.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
swagger: "2.0"
info:
version: "2.4.0"
version: "2.4.1"
title: HollaEx Kit
host: api.hollaex.com
basePath: /v2
Expand Down
4 changes: 2 additions & 2 deletions server/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.4.0",
"version": "2.4.1",
"private": false,
"description": "HollaEx Kit",
"keywords": [
Expand Down Expand Up @@ -48,7 +48,7 @@
"multicoin-address-validator": "0.5.5",
"node-cron": "2.0.3",
"nodemailer": "6.4.6",
"npm": "5.7.1",
"npm": "8.19.1",
"npm-programmatic": "0.0.12",
"otp": "0.1.3",
"pg": "6.4.2",
Expand Down
14 changes: 7 additions & 7 deletions server/utils/hollaex-tools-lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

### Prerequisites

This Tools Library will only work with the [HollaEx Kit](https://github.com/bitholla/hollaex-kit).
This Tools Library will only work with the [HollaEx Kit](https://github.com/hollaex/hollaex-kit).

### Installation

1. Clone the repo
```sh
git clone https://github.com/bitholla/hollaex-tools-lib.git
git clone https://github.com/hollaex/hollaex-tools-lib.git
```
2. Install NPM packages
```sh
Expand Down Expand Up @@ -649,7 +649,7 @@ const tools = require('hollaex-tools-lib');
#### User functions

- `signUpUser(email, password, [opts = { referral: null }])`
- Signup new user using bitHolla's signup flow
- Signup new user using hollaex's signup flow
- Will send email to user asking for verification
- Returns promise with sequelize object of user data
```javascript
Expand Down Expand Up @@ -1780,7 +1780,7 @@ const tools = require('hollaex-tools-lib');
- `order` = asc or desc
- `start_date` = get users created after this date
- `end_date` = get users created before this date
- `format` = pass `csv` to get csv file
- `format` = pass `csv` to get csv file or `all` to get all the data without pagination
- Returns promise with trades data
```javascript
tools.order.getAllTradesNetwork()
Expand All @@ -1805,7 +1805,7 @@ const tools = require('hollaex-tools-lib');
- `order` = asc or desc
- `start_date` = get users created after this date
- `end_date` = get users created before this date
- `format` = pass `csv` to get csv file
- `format` = pass `csv` to get csv file or `all` to get all the data without pagination
- Returns promise with trades data
```javascript
tools.order.getAllUserTradesByKitId(99)
Expand All @@ -1830,7 +1830,7 @@ const tools = require('hollaex-tools-lib');
- `order` = asc or desc
- `start_date` = get users created after this date
- `end_date` = get users created before this date
- `format` = pass `csv` to get csv file
- `format` = pass `csv` to get csv file or `all` to get all the data without pagination
- Returns promise with trades data
```javascript
tools.order.getAllUserTradesByEmail('[email protected]')
Expand All @@ -1855,7 +1855,7 @@ const tools = require('hollaex-tools-lib');
- `order` = asc or desc
- `start_date` = get users created after this date
- `end_date` = get users created before this date
- `format` = pass `csv` to get csv file
- `format` = pass `csv` to get csv file or `all` to get all the data without pagination
- Returns promise with trades data
```javascript
tools.order.getAllUserTradesByNetwork(1)
Expand Down
4 changes: 2 additions & 2 deletions server/utils/hollaex-tools-lib/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "hollaex-tools-lib",
"version": "2.4.0",
"version": "2.4.1",
"description": "HollaEx tools library for developers",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/bitholla/hollaex-kit/tree/master/server/utils/hollaex-tools-lib"
"url": "https://github.com/hollaex/hollaex-kit/tree/master/server/utils/hollaex-tools-lib"
},
"dependencies": {}
}
5 changes: 3 additions & 2 deletions server/utils/hollaex-tools-lib/tools/security.js
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,8 @@ const issueToken = (
isSupport = false,
isSupervisor = false,
isKYC = false,
isCommunicator = false
isCommunicator = false,
expiresIn = getKitSecrets().security.token_time // 24 hours by default
) => {
// Default scope is ['user']
let scopes = [].concat(BASE_SCOPES);
Expand Down Expand Up @@ -894,7 +895,7 @@ const issueToken = (
},
SECRET,
{
expiresIn: getKitSecrets().security.token_time
expiresIn
}
);
return token;
Expand Down
6 changes: 3 additions & 3 deletions server/utils/hollaex-tools-lib/tools/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ const getAllUsersAdmin = (opts = {
return { count, data };
})
.then(async (users) => {
if (opts.format) {
if (opts.format && opts.format === 'csv') {
if (users.data.length === 0) {
throw new Error(NO_DATA_FOR_CSV);
}
Expand Down Expand Up @@ -1110,7 +1110,7 @@ const getUserLogins = (opts = {

return dbQuery.findAndCountAllWithRows('login', options)
.then((logins) => {
if (opts.format) {
if (opts.format && opts.format === 'csv') {
if (logins.data.length === 0) {
throw new Error(NO_DATA_FOR_CSV);
}
Expand Down Expand Up @@ -1238,7 +1238,7 @@ const getUserAudits = (opts = {

return dbQuery.findAndCountAllWithRows('audit', options)
.then((audits) => {
if (opts.format) {
if (opts.format && opts.format === 'csv') {
if (audits.data.length === 0) {
throw new Error(NO_DATA_FOR_CSV);
}
Expand Down
6 changes: 3 additions & 3 deletions server/utils/hollaex-tools-lib/tools/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ const getUserTransactionsByKitId = (
endDate,
transactionId,
address,
format: (format && format === 'csv') ? 'all' : null, // for csv get all data
format: (format && (format === 'csv' || format === 'all')) ? 'all' : null, // for csv get all data
...opts
});
});
Expand All @@ -703,7 +703,7 @@ const getUserTransactionsByKitId = (
endDate,
transactionId,
address,
format: (format && format === 'csv') ? 'all' : null, // for csv get all data
format: (format && (format === 'csv' || format === 'all')) ? 'all' : null, // for csv get all data
...opts
});
});
Expand Down Expand Up @@ -749,7 +749,7 @@ const getUserTransactionsByKitId = (
}
return promiseQuery
.then((transactions) => {
if (format) {
if (format && format === 'csv') {
if (transactions.data.length === 0) {
throw new Error(NO_DATA_FOR_CSV);
}
Expand Down
3 changes: 2 additions & 1 deletion test/Cypress/cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"viewportWidth": 1400,
"viewportHeight": 800,
"chromeWebSecurity": false,
"defaultCommandTimeout": 10000 ,
"defaultCommandTimeout": 10000,
"projectId": "zx8ctg",
"env": {
"TAGS": "not @waiting",
"NODE_ENV": "",
Expand Down
8 changes: 5 additions & 3 deletions test/Cypress/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@
},
"dependencies": {
"cypress-cucumber-preprocessor": "^4.3.1",
"cypress-tags": "^1.0.0",
"totp-generator": "^0.0.13"
},
"cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": true
},
"scripts": {
"debug.javascript.codelens.npmScripts": "never",
"test": "npx cypress-tags run -e",
"test-ci": "npx cypress-tags run --browser chrome --record -e",
"test": "npx cypress-tags run --browser chrome -e",
"pre-ci": "npm run test-ci TAGS=@pre",
"pre": "npm test TAGS=@pre"

}
}
}
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.0
2.4.1
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.4.0",
"version": "2.4.1",
"private": true,
"dependencies": {
"@ant-design/compatible": "1.0.5",
Expand Down
2 changes: 1 addition & 1 deletion web/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<link rel="manifest" href="/manifest.json">
<link rel="manifest" id="manifest-placeholder">
<link rel="shortcut icon" href="/favicon.ico">
<link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="/css/bootstrap-grid.min.css">
Expand Down
15 changes: 0 additions & 15 deletions web/public/manifest.json

This file was deleted.

1 change: 1 addition & 0 deletions web/src/components/AppBar/MarketSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ class MarketSelector extends Component {
placeHolder={`${STRINGS['SEARCH_TXT']}...`}
className="app-bar-search-field"
handleSearch={handleSearch}
showCross
/>
</div>
<div className="scroll-view">
Expand Down
6 changes: 2 additions & 4 deletions web/src/components/AppBar/PairTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class PairTabs extends Component {
'px-2',
'market-trigger',
{
'active-tab-pair': location.pathname === '/trade/add/tabs',
'active-tab-pair': location.pathname === '/markets',
},
{
'active-market-trigger': activePairTab,
Expand All @@ -120,9 +120,7 @@ class PairTabs extends Component {
className="market-selector-dropdown"
overlay={
<MarketSelector
onViewMarketsClick={() =>
browserHistory.push('/trade/add/tabs')
}
onViewMarketsClick={() => browserHistory.push('/markets')}
addTradePairTab={this.onTabClick}
closeAddTabMenu={() =>
this.setState((prevState) =>
Expand Down
8 changes: 8 additions & 0 deletions web/src/components/AppBar/SearchBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ class SearchBox extends React.Component {
dispatch(reset(FORM_NAME));
}

handleOnClear = () => {};

render() {
const {
handleSearch,
placeHolder,
className = '',
outlineClassName = '',
name,
showCross = false,
} = this.props;
const searchField = {
search: {
Expand All @@ -33,6 +36,11 @@ class SearchBox extends React.Component {
: 'app-bar-search-field-outline',
placeholder: placeHolder,
onChange: handleSearch,
showCross: showCross,
onCrossClick: (e) => {
handleSearch('');
this.props.dispatch(reset(FORM_NAME));
},
},
};

Expand Down
1 change: 0 additions & 1 deletion web/src/components/AppBar/_AppBar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,6 @@ $app-menu-width: calc(100vw - 40rem);
}

.search-field {
// width: 100%;
color: $colors-black;
background-color: $app-background-color;

Expand Down
2 changes: 1 addition & 1 deletion web/src/components/AppBar/_MobileMarketSelector.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

.app-bar-search-field {
flex-direction: row;
padding-left: 0.5rem;
// padding-left: 0.5rem;
}

.app-bar-add-tab-search {
Expand Down
11 changes: 9 additions & 2 deletions web/src/components/AppBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,14 @@ class AppBar extends Component {
renderIcon = () => {
const { icons: ICONS, isEditMode } = this.props;
return (
<div className={classnames('app_bar-icon', 'text-uppercase', 'h-100')}>
<div
className={classnames(
'app_bar-icon',
'text-uppercase',
'h-100',
'ml-3'
)}
>
<div className="d-flex h-100">
<Link
to={DEFAULT_URL}
Expand Down Expand Up @@ -178,7 +185,7 @@ class AppBar extends Component {
return (
<div className={classnames('app_bar-icon', 'text-uppercase', 'h-100')}>
<div className="d-flex h-100">
<div className="'h-100'">
<div className="h-100">
<Image
iconId="EXCHANGE_LOGO"
icon={ICONS['EXCHANGE_LOGO']}
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/AppFooter/_AppFooter.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ $footer-logo-color: $trade-tabs-inactive-color;

.footer-txt {
width: 23rem;
margin-left: 1.5rem;
margin-left: 2rem !important;
margin-top: 0.5rem;
}
.footer-logo {
Expand Down
13 changes: 13 additions & 0 deletions web/src/components/Form/FormFields/FieldWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export const FieldContent = ({
hideUnderline = false,
contentClassName = '',
hideCheck = false,
showCross = false,
onCrossClick = () => {},
outlineClassName = '',
displayError,
error,
Expand Down Expand Up @@ -64,6 +66,13 @@ export const FieldContent = ({
className="field-valid"
/>
)}
{showCross && hasValue && (
<ReactSVG
onClick={onCrossClick}
src={STATIC_ICONS.CANCEL_CROSS_ACTIVE}
className="clear-field"
/>
)}
</div>
{!hideUnderline && (
<span
Expand Down Expand Up @@ -153,6 +162,8 @@ class FieldWrapper extends Component {
preview,
isEmail = false,
emailMsg = '',
showCross = showCross,
onCrossClick = () => {},
} = this.props;

const displayError = !(active || focused) && (visited || touched) && error;
Expand Down Expand Up @@ -184,6 +195,8 @@ class FieldWrapper extends Component {
preview={preview}
isEmail={isEmail}
emailMsg={emailMsg}
onCrossClick={onCrossClick}
showCross={showCross}
>
{children}
{notification && typeof notification === 'object' && (
Expand Down
1 change: 1 addition & 0 deletions web/src/components/Form/FormFields/InputField.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const InputField = (props) => {
type={type}
{...input}
{...rest}
onBlur={() => {}}
/>
</div>
</FieldWrapper>
Expand Down
Loading

0 comments on commit 4c97b7e

Please sign in to comment.