diff --git a/server/api/swagger/swagger.yaml b/server/api/swagger/swagger.yaml index 67513dbda9..5c388545f2 100644 --- a/server/api/swagger/swagger.yaml +++ b/server/api/swagger/swagger.yaml @@ -1,6 +1,6 @@ swagger: "2.0" info: - version: "2.4.4" + version: "2.4.5" title: HollaEx Kit host: api.hollaex.com basePath: /v2 diff --git a/server/package.json b/server/package.json index 66ca3f3647..cfb041e944 100644 --- a/server/package.json +++ b/server/package.json @@ -1,5 +1,5 @@ { - "version": "2.4.4", + "version": "2.4.5", "private": false, "description": "HollaEx Kit", "keywords": [ diff --git a/test/Cypress/cucumber-html-report.js b/test/Cypress/cucumber-html-report.js new file mode 100644 index 0000000000..44b148adab --- /dev/null +++ b/test/Cypress/cucumber-html-report.js @@ -0,0 +1,47 @@ +//*** Let name it cucumber-html-report.js ** +//the newst version +var os = require('os'); +const { detect } = require('detect-browser'); +const browser = detect(); +const report = require("multiple-cucumber-html-reporter"); +const cypress = require('cypress'); + +report.generate( + {jsonDir: "cypress/cucumber-json", // ** Path of .json file **// + reportPath: "./reports/cucumber-htmlreport.html", + pageTitle: "Hollaex Kit Tests Report", + reportName : "Test result", + pageFooter : "Hollaex QA team", + displayDuration: true, + displayReportTime : true, + metadata: { + + browser: { + + scenarioTimestamp : true, + name: "chrome", + version: browser.name+browser.version+browser.os + }, + device: "Local test machine", + platform: {name: os.platform()+os.version, + + version: "11",env:'HollaexKit'} + ,}, + customData: { + title: 'Run info', + data: [ + {label: 'Project', value: 'Hollaex Kit'}, + {label: 'Release', value: '2.4'}, + {label: 'Cycle', value: '1'}, + {label: 'Execution Time', value: Date()}, + + ] + } + + + ,} + + + ); + + \ No newline at end of file diff --git a/test/Cypress/cypress/integration/Gherkin/login/login.js b/test/Cypress/cypress/integration/Gherkin/login/login.js index 065e9b38bb..1e42ed4501 100644 --- a/test/Cypress/cypress/integration/Gherkin/login/login.js +++ b/test/Cypress/cypress/integration/Gherkin/login/login.js @@ -1,3 +1,5 @@ +import { commandTimings } from 'cypress-timings' +commandTimings() import {Given, When, Then} from "cypress-cucumber-preprocessor/steps" Given ('I am in the Hollaex login page',()=>{ @@ -6,16 +8,23 @@ Given ('I am in the Hollaex login page',()=>{ }) When ('I enter credentials Username,Password',()=>{ - + const t0 = performance.now(); + cy.get('.holla-button').should('be.visible').should('be.disabled') cy.get('[name="email"]').clear().type(Cypress.env("USER0")) cy.get('[name="password"]').clear().type(Cypress.env('PASSWORD')) + const t1 = performance.now(); + cy.log('time') + cy.log(t1-t0) }) Then ('I should be able to login successfully',()=>{ - + const t0 = performance.now(); cy.get('.holla-button').should('be.visible').should('be.enabled').click() cy.get('.warning_text').should('not.exist') + const t1 = performance.now(); + cy.log('time') + cy.log(t1-t0) }) When ('I enter credentials Wrong Username,Password',()=>{ @@ -76,14 +85,17 @@ And ('I enter Expired,long,short and then true 2FA code',()=>{ cy.wrap(token).as('token') cy.log(token); cy.log('second', text) - cy.get('.otp_form-wrapper > form.w-100 > .w-100 > :nth-child(1) > .field-wrapper > :nth-child(1) > :nth-child(1) > .field-content > .field-children > div > .input_field-input') - .clear().type('543065') - cy.get('.otp_form-wrapper > form.w-100 > .holla-button').should('not.be.disabled').click() + // cy.get('.otp_form-wrapper > form.w-100 > .w-100 > :nth-child(1) > .field-wrapper > :nth-child(1) > :nth-child(1) > .field-content > .field-children > div > .input_field-input') + cy.get('.masterInput') + .clear().type('108249') + // cy.get('.otp_form-wrapper > form.w-100 > .holla-button').should('not.be.disabled').click() cy.get('.warning_text').should('contain','Invalid OTP Code') - cy.get('.otp_form-wrapper > form.w-100 > .w-100 > :nth-child(1) > .field-wrapper > :nth-child(1) > :nth-child(1) > .field-content > .field-children > div > .input_field-input') - .clear().type('5430656') - cy.get('.otp_form-wrapper > form.w-100 > .holla-button').should('be.disabled') - cy.get('.otp_form-wrapper > form.w-100 > .w-100 > :nth-child(1) > .field-wrapper > :nth-child(1) > :nth-child(1) > .field-content > .field-children > div > .input_field-input') + //cy.get('.otp_form-wrapper > form.w-100 > .w-100 > :nth-child(1) > .field-wrapper > :nth-child(1) > :nth-child(1) > .field-content > .field-children > div > .input_field-input') + cy.get('.masterInput') + .clear().type('108294') + // cy.get('.otp_form-wrapper > form.w-100 > .holla-button').should('not.be.disabled') + //cy.get('.otp_form-wrapper > form.w-100 > .w-100 > :nth-child(1) > .field-wrapper > :nth-child(1) > :nth-child(1) > .field-content > .field-children > div > .input_field-input') + //the new changes .clear().type(token) - cy.get('.otp_form-wrapper > form.w-100 > .holla-button').click() + // cy.get('.otp_form-wrapper > form.w-100 > .holla-button').click() }) \ No newline at end of file diff --git a/test/Cypress/package.json b/test/Cypress/package.json index 028769e70b..85f2ba0e1d 100644 --- a/test/Cypress/package.json +++ b/test/Cypress/package.json @@ -1,25 +1,39 @@ { "devDependencies": { "@4tw/cypress-drag-drop": "^2.1.0", + "@cucumber/cucumber": "^8.5.3", + "@cucumber/pretty-formatter": "^1.0.0", + "@cypress-audit/lighthouse": "^1.3.1", "cypress": "^9.2.0", + "cypress-audit": "^1.1.0", "cypress-iframe": "^1.0.1", + "cypress-timings": "^1.0.0", "cypress-xpath": "^1.6.2", "eslint": "^8.11.0", + "multiple-cucumber-html-reporter": "^2.0.0", "prettier": "2.6.0" }, "dependencies": { + "@badeball/cypress-cucumber-preprocessor": "^13.0.0", + "cucumber-perf": "^2.0.1", "cypress-cucumber-preprocessor": "^4.3.1", - "cypress-tags": "^1.0.0", + "cypress-lighthouse": "^0.1.0", + "detect-browser": "^5.3.0", + "save-dev": "^0.0.1-security", "totp-generator": "^0.0.13" }, "cypress-cucumber-preprocessor": { + "cucumberJson": { + "generate": true, + "outputFolder": "cypress/cucumber-json", + "filePrefix": "", + "fileSuffix": ".cucumber" + }, "nonGlobalStepDefinitions": true }, "scripts": { "debug.javascript.codelens.npmScripts": "never", - "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", + "test": "npx cypress-tags run -e", "pre": "npm test TAGS=@pre" } -} +} \ No newline at end of file diff --git a/version b/version index ab6d27898c..26f8b8bcdf 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.4.4 \ No newline at end of file +2.4.5 \ No newline at end of file diff --git a/web/package.json b/web/package.json index 8ff54d7b66..ab0ebbc80a 100644 --- a/web/package.json +++ b/web/package.json @@ -1,6 +1,6 @@ { "name": "hollaex-kit", - "version": "2.4.4", + "version": "2.4.5", "private": true, "dependencies": { "@ant-design/compatible": "1.0.5", diff --git a/web/public/assets/flags/mn.png b/web/public/assets/flags/mn.png new file mode 100644 index 0000000000..334a47784b Binary files /dev/null and b/web/public/assets/flags/mn.png differ diff --git a/web/public/assets/images/check-sending-bitcoin.svg b/web/public/assets/images/check-sending-bitcoin.svg index 9282e4c812..8fd1984b4b 100644 --- a/web/public/assets/images/check-sending-bitcoin.svg +++ b/web/public/assets/images/check-sending-bitcoin.svg @@ -1,23 +1,4 @@ - - - - - - - - - - - - - - + + + + \ No newline at end of file diff --git a/web/public/assets/images/maxIcon.svg b/web/public/assets/images/maxIcon.svg new file mode 100644 index 0000000000..fc72131453 --- /dev/null +++ b/web/public/assets/images/maxIcon.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/web/src/components/CurrencyBall/withPrice.js b/web/src/components/CurrencyBall/withPrice.js index 33949a283d..e08be03a59 100644 --- a/web/src/components/CurrencyBall/withPrice.js +++ b/web/src/components/CurrencyBall/withPrice.js @@ -13,7 +13,7 @@ const CurrencyBallWithPrice = ({ isExistBroker = false, }) => { const { display_name, ...rest } = coins[symbol] || DEFAULT_COIN_DATA; - const minValue = min ? min : rest.min; + const minValue = rest.min ? rest.min : min; return (
diff --git a/web/src/components/Form/FormFields/PinInput.js b/web/src/components/Form/FormFields/PinInput.js index 782faa0553..d8853324b5 100644 --- a/web/src/components/Form/FormFields/PinInput.js +++ b/web/src/components/Form/FormFields/PinInput.js @@ -1,5 +1,6 @@ import React, { useEffect, useRef, useState } from 'react'; import classnames from 'classnames'; +import { LoadingOutlined } from '@ant-design/icons'; const PinInput = ({ input: { value = '', onChange }, @@ -58,29 +59,35 @@ const PinInput = ({ return (
- -
- - - -
-
-
- - - -
+ {!isSubmitting ? ( + + +
+ + + +
+
+
+ + + +
+
+ ) : ( + + )}
{isError && (
{isError}
diff --git a/web/src/components/Form/FormFields/_FormFields.scss b/web/src/components/Form/FormFields/_FormFields.scss index 1580c5c8b1..5ab6dc89dd 100644 --- a/web/src/components/Form/FormFields/_FormFields.scss +++ b/web/src/components/Form/FormFields/_FormFields.scss @@ -37,6 +37,7 @@ $placeholder--font-weight: bold; } &:disabled { cursor: not-allowed; + opacity: 0.5; } } diff --git a/web/src/components/OtpForm/index.js b/web/src/components/OtpForm/index.js index a1b316e327..02e1e19d4b 100644 --- a/web/src/components/OtpForm/index.js +++ b/web/src/components/OtpForm/index.js @@ -40,7 +40,8 @@ class Form extends Component { setFormRef = (el) => { if (el) { this.otpFormRef = el; - el.getElementsByTagName('input')[0].focus(); + if (el.getElementsByTagName('input')[0]) + el.getElementsByTagName('input')[0].focus(); } }; diff --git a/web/src/config/constants.js b/web/src/config/constants.js index 1adb1de0b5..3cf36ebb84 100644 --- a/web/src/config/constants.js +++ b/web/src/config/constants.js @@ -83,6 +83,7 @@ export const FLEX_CENTER_CLASSES = [ ]; export const TIMESTAMP_FORMAT = STRINGS['TIMESTAMP_FORMAT']; +export const DEFAULT_TIMESTAMP_FORMAT = STRINGS['DEFAULT_TIMESTAMP_FORMAT']; export const HOUR_FORMAT = STRINGS['HOUR_FORMAT']; export const TIMESTAMP_FORMAT_FA = STRINGS['TIMESTAMP_FORMAT'] .split('/') diff --git a/web/src/config/icons/static.js b/web/src/config/icons/static.js index e43376d6b9..2429dee2a7 100644 --- a/web/src/config/icons/static.js +++ b/web/src/config/icons/static.js @@ -13,6 +13,7 @@ const icons = { SET_ADMIN_NETWORK_KEYS: '/assets/images/set-admin-network-keys.svg', SET_ADMIN_EMAIL: '/assets/images/set-admin-email.svg', SET_ADMIN_PASSWORD: '/assets/images/set-admin-password.svg', + MAX_ICON: '/assets/images/maxIcon.svg', SET_ADMIN_RETYPE_PASSWORD: '/assets/images/set-admin-retype-password.svg', TIMEZONE_WORLD_MAP: '/assets/images/timezone-worldmap.svg', SETUP_SECTION_PRO_TRADING: '/assets/images/setup-section-pro-trading-01.svg', diff --git a/web/src/config/lang/ar.json b/web/src/config/lang/ar.json index 491673b07f..10ab12141e 100644 --- a/web/src/config/lang/ar.json +++ b/web/src/config/lang/ar.json @@ -7,6 +7,7 @@ "CANCEL_WITHDRAWAL": "إلغاء السحب", "CANCEL_WITHDRAWAL_POPUP_CONFIRM": "هل تريد إلغاء السحب الذي في قيد الانتظار لـ", "TIMESTAMP_FORMAT": "YYYY/MM/DD HH:mm:ss", + "DEFAULT_TIMESTAMP_FORMAT": "DD, MMMM, YYYY", "HOUR_FORMAT": "HH:mm:ss", "LOGIN_TEXT": "تسجیل الدخول", "SIGN_IN": "تسجیل الدخول", diff --git a/web/src/config/lang/de.json b/web/src/config/lang/de.json index e0e4adc0e9..496089e417 100644 --- a/web/src/config/lang/de.json +++ b/web/src/config/lang/de.json @@ -7,6 +7,7 @@ "CANCEL_WITHDRAWAL": "Auszahlung abbrechen", "CANCEL_WITHDRAWAL_POPUP_CONFIRM": "Möchten Sie Ihre ausstehende Auszahlung stornieren?:", "TIMESTAMP_FORMAT": "YYYY/MM/DD HH:mm:ss", + "DEFAULT_TIMESTAMP_FORMAT": "DD, MMMM, YYYY", "NO_ACTIVE_ORDERS": "No orders detected. Place your orders on the Pro or Quick trade page", "HOUR_FORMAT": "HH:mm:ss", "LOGIN_TEXT": "Login", diff --git a/web/src/config/lang/en.json b/web/src/config/lang/en.json index 2a84c369e9..d071832167 100644 --- a/web/src/config/lang/en.json +++ b/web/src/config/lang/en.json @@ -7,6 +7,7 @@ "CANCEL_WITHDRAWAL": "Cancel Withdrawal", "CANCEL_WITHDRAWAL_POPUP_CONFIRM": "Do you want to cancel your pending withdrawal of:", "TIMESTAMP_FORMAT": "YYYY/MM/DD HH:mm:ss", + "DEFAULT_TIMESTAMP_FORMAT": "DD, MMMM, YYYY", "NO_ACTIVE_ORDERS": "No orders detected. Place your orders on the Pro or Quick trade page", "NO_ACTIVE_TRADES": "Looks like there aren't any trades yet", "NO_ACTIVE_DEPOSITS": "Looks like there aren't any deposits yet.", @@ -811,6 +812,7 @@ "DEFAULT_TOGGLE_OPTIONS": { "ON": "on", "OFF": "off" }, "SIZE": "Size", "PRICE": "Price", + "AVERAGE": "Average", "FEE": "Fee", "FEES": "Fees", "TIME": "Time", @@ -904,7 +906,7 @@ }, "WALLET_BUTTON_BASE_DEPOSIT": "deposit", "WALLET_BUTTON_BASE_WITHDRAW": "withdraw", - "WALLET_BUTTON_CRYPTOCURRENCY_DEPOSIT": "receive", + "WALLET_BUTTON_CRYPTOCURRENCY_DEPOSIT": "deposit", "WALLET_BUTTON_CRYPTOCURRENCY_WITHDRAW": "send", "AVAILABLE_BALANCE_TEXT": "Available {0} Balance: {1} {2}", "BALANCE_TEXT": "Balance", @@ -1075,7 +1077,7 @@ "TRADE_TAB_POSTS": "Announcements", "WALLET_TAB_WALLET": "Wallet", "WALLET_TAB_TRANSACTIONS": "Transactions", - "RECEIVE_CURRENCY": "Receive {0}", + "RECEIVE_CURRENCY": "Deposit {0}", "SEND_CURRENCY": "Send {0}", "COPY_ADDRESS": "Copy Address", "SUCCESFUL_COPY": "Successfully Copied!", @@ -1296,5 +1298,5 @@ "WITHDRAWALS_FORM_METHOD": "Method", "WITHDRAWALS_FORM_ADDRESS_EXCHANGE": "Exchange user email", "WITHDRAWALS_FORM_EXCHANGE_PLACEHOLDER": "Input user's email on this exchange", - "WITHDRAWALS_FORM_MAIL_INFO": "Input a user's HollaEx account email that is on this exchange and transfers for free." + "WITHDRAWALS_FORM_MAIL_INFO": "Input a user's HollaEx account email that is on this exchange and transfer for free." } diff --git a/web/src/config/lang/es.json b/web/src/config/lang/es.json index 9f3a2db1aa..7d6fd0984c 100644 --- a/web/src/config/lang/es.json +++ b/web/src/config/lang/es.json @@ -8,6 +8,7 @@ "CANCEL_WITHDRAWAL_POPUP_CONFIRM": "Quiere cancelar su retiro pendiente de:", "NO_ACTIVE_ORDERS": "No orders detected. Place your orders on the Pro or Quick trade page", "TIMESTAMP_FORMAT": "YYYY/MM/DD HH:mm:ss", + "DEFAULT_TIMESTAMP_FORMAT": "DD, MMMM, YYYY", "HOUR_FORMAT": "HH:mm:ss", "LOGIN_TEXT": "Iniciar Sesión", "SIGN_IN": "Iniciar Sesión", diff --git a/web/src/config/lang/fa.json b/web/src/config/lang/fa.json index 980cf62fc3..916feb4df4 100644 --- a/web/src/config/lang/fa.json +++ b/web/src/config/lang/fa.json @@ -7,6 +7,7 @@ "CANCEL_WITHDRAWAL": "لغو برداشت", "CANCEL_WITHDRAWAL_POPUP_CONFIRM": "آیا از لغو برداشت در حال انتظار خود مطمئن هستید؟", "TIMESTAMP_FORMAT": "YYYY/MM/DD HH:mm:ss ", + "DEFAULT_TIMESTAMP_FORMAT": "DD, MMMM, YYYY", "HOUR_FORMAT": "HH:mm:ss ", "LOGIN_TEXT": "ورود", "SIGN_IN": "ورود", diff --git a/web/src/config/lang/fr.json b/web/src/config/lang/fr.json index 93d8d6e2f3..20d3ace290 100644 --- a/web/src/config/lang/fr.json +++ b/web/src/config/lang/fr.json @@ -7,6 +7,7 @@ "CANCEL_WITHDRAWAL": "Annuler le retrait", "CANCEL_WITHDRAWAL_POPUP_CONFIRM": "Voulez-vous annuler le retrait de :", "TIMESTAMP_FORMAT": "YYYY/MM/DD HH:mm:ss", + "DEFAULT_TIMESTAMP_FORMAT": "DD, MMMM, YYYY", "HOUR_FORMAT": "HH:mm:ss", "LOGIN_TEXT": "Connexion", "SIGN_IN": "S'identifier", diff --git a/web/src/config/lang/id.json b/web/src/config/lang/id.json index d4a93f4d2b..ea1056c996 100644 --- a/web/src/config/lang/id.json +++ b/web/src/config/lang/id.json @@ -7,6 +7,7 @@ "CANCEL_WITHDRAWAL": "Pembatalan Penarikan", "CANCEL_WITHDRAWAL_POPUP_CONFIRM": "Apakah Anda ingin membatalkan penarikan yang sedang dalam proses:", "TIMESTAMP_FORMAT": "YYYY/MM/DD HH:mm:ss", + "DEFAULT_TIMESTAMP_FORMAT": "DD, MMMM, YYYY", "HOUR_FORMAT": "HH:mm:ss", "LOGIN_TEXT": "Masuk", "SIGN_IN": "Masuk", diff --git a/web/src/config/lang/index.js b/web/src/config/lang/index.js index 3a5a2999da..d60057eac5 100644 --- a/web/src/config/lang/index.js +++ b/web/src/config/lang/index.js @@ -27,5 +27,5 @@ export default { zh, pt, tr, - mn + mn, }; diff --git a/web/src/config/lang/ja.json b/web/src/config/lang/ja.json index fe8fd88d67..0c63929c8a 100644 --- a/web/src/config/lang/ja.json +++ b/web/src/config/lang/ja.json @@ -7,6 +7,7 @@ "CANCEL_WITHDRAWAL": "出金キャンセル", "CANCEL_WITHDRAWAL_POPUP_CONFIRM": "保留中の出金をキャンセルしますか?", "TIMESTAMP_FORMAT": "YYYY/MM/DD HH:mm:ss", + "DEFAULT_TIMESTAMP_FORMAT": "DD, MMMM, YYYY", "HOUR_FORMAT": "HH:mm:ss", "LOGIN_TEXT": "ログイン", "SIGN_IN": "ログイン", diff --git a/web/src/config/lang/ko.json b/web/src/config/lang/ko.json index e111797276..cc2c2341fa 100644 --- a/web/src/config/lang/ko.json +++ b/web/src/config/lang/ko.json @@ -6,6 +6,7 @@ "CANCEL_WITHDRAWAL": "출금 취소", "CANCEL_WITHDRAWAL_POPUP_CONFIRM": "진행중인 출금 거래를 취소하시겠습니까?:", "TIMESTAMP_FORMAT": "YYYY/MM/DD HH:mm:ss", + "DEFAULT_TIMESTAMP_FORMAT": "DD, MMMM, YYYY", "HOUR_FORMAT": "HH:mm:ss", "LOGIN_TEXT": "로그인", "SIGN_IN": "로그인", diff --git a/web/src/config/lang/mn.json b/web/src/config/lang/mn.json index 52fa658bde..4fdc9c96e5 100644 --- a/web/src/config/lang/mn.json +++ b/web/src/config/lang/mn.json @@ -385,7 +385,7 @@ "VIOLATION_ERROR": "Таны байршуулсан бүх баримт бичгийн нийт хэмжээ {0}mb-ын байршуулах хязгаараас хэтэрсэн байна. Үргэлжлүүлэхийн тулд жижиг файлуудыг байршуулна уу." }, "POR": { - "SECTION_1_TEXT_1": "Бүртгэл баталгаажуулалтаа удаашруулахгүйн тулд дараах зүйлсийг анхаарна уу:", + "SECTION_1_TEXT_1": "Бүртгэл баталгаажуулалтаа удаашруулахгүйн тулд дараах зүйлсийг анхаарна уу:", "SECTION_1_TEXT_2": "НЭР, ХАЯГ, ОЛГОСОН ОГНОО, ДУУСАХ ОГНОО харагдахуйц байх.", "SECTION_1_TEXT_3": "Оршин суугаа хаягийн тодорхойлолт 3 САРЫН ДОТОР авсан байх.", "SECTION_1_TEXT_4": "ӨНДӨР ЧАНАРТАЙ байх (хамгийн багадаа 300 DPI)", @@ -692,7 +692,10 @@ "INSTALL_METAMASK": "Та өөрийн хөтөч дээрээ Metamask суулгах ёстой: https://metamask.io/download.html", "INSTALL_METAMASK_TITLE": "MetaMask илэрсэнгүй", "REWARDS": { - "0": { "CARD": "Шагнал авах (бонус байхгүй)", "TEXT": "тогтмол шагналууд." }, + "0": { + "CARD": "Шагнал авах (бонус байхгүй)", + "TEXT": "тогтмол шагналууд." + }, "1": { "CARD": "Шагнал + урамшуулал аваарай", "TEXT": "орлогоосоо урамшуулах урамшуулал" @@ -1297,4 +1300,4 @@ "WITHDRAWALS_FORM_ADDRESS_EXCHANGE": "Имэйл солилцох", "WITHDRAWALS_FORM_EXCHANGE_PLACEHOLDER": "Хэрэглэгчийн имэйлийг оруулна уу", "WITHDRAWALS_FORM_MAIL_INFO": "Бирж дээрх хэрэглэгчийн имэйлийг оруулаад үнэгүй шилжүүлээрэй." -} \ No newline at end of file +} diff --git a/web/src/config/lang/pt.json b/web/src/config/lang/pt.json index bb3b5d5c44..968d5139bf 100644 --- a/web/src/config/lang/pt.json +++ b/web/src/config/lang/pt.json @@ -7,6 +7,7 @@ "CANCEL_WITHDRAWAL": "Cancelar Saque", "CANCEL_WITHDRAWAL_POPUP_CONFIRM": "Você gostaria de cancelar seu saque em andamento de:", "TIMESTAMP_FORMAT": "DD/MM/YYYY HH:mm:ss", + "DEFAULT_TIMESTAMP_FORMAT": "DD, MMMM, YYYY", "HOUR_FORMAT": "HH:mm:ss", "LOGIN_TEXT": "Login", "SIGN_IN": "Acessar", diff --git a/web/src/config/lang/tr.json b/web/src/config/lang/tr.json index c802b69781..2c49c2e589 100644 --- a/web/src/config/lang/tr.json +++ b/web/src/config/lang/tr.json @@ -8,6 +8,7 @@ "CANCEL_WITHDRAWAL": "Çekimi İptal Et", "CANCEL_WITHDRAWAL_POPUP_CONFIRM": "Bekleyen çekiminizi iptal etmek istiyor musunuz:", "TIMESTAMP_FORMAT": "YYYY/AA/GG SS:dd:ss", + "DEFAULT_TIMESTAMP_FORMAT": "DD, MMMM, YYYY", "HOUR_FORMAT": "SS:dd:ss", "LOGIN_TEXT": "Giriş", "SIGN_IN": "Giriş", diff --git a/web/src/config/lang/vi.json b/web/src/config/lang/vi.json index c7745b3bbf..62c31ec219 100644 --- a/web/src/config/lang/vi.json +++ b/web/src/config/lang/vi.json @@ -7,6 +7,7 @@ "CANCEL_WITHDRAWAL": "Hủy yêu cầu rút tiền", "CANCEL_WITHDRAWAL_POPUP_CONFIRM": "Quý khách có chắc chắn muốn hủy yêu cầu rút tiền đang được thực hiện hay không?:", "TIMESTAMP_FORMAT": "YYYY/MM/DD HH:mm:ss", + "DEFAULT_TIMESTAMP_FORMAT": "DD, MMMM, YYYY", "HOUR_FORMAT": "HH:mm:ss", "LOGIN_TEXT": "Đăng nhập", "SIGN_IN": "Đăng nhập", diff --git a/web/src/config/lang/zh.json b/web/src/config/lang/zh.json index 7982631d8f..3cfd2c5bcf 100644 --- a/web/src/config/lang/zh.json +++ b/web/src/config/lang/zh.json @@ -6,6 +6,7 @@ "CANCEL_WITHDRAWAL": "取消提现", "CANCEL_WITHDRAWAL_POPUP_CONFIRM": "想要取消正在进行的交易吗?:", "TIMESTAMP_FORMAT": "YYYY/MM/DD HH:mm:ss", + "DEFAULT_TIMESTAMP_FORMAT": "DD, MMMM, YYYY", "HOUR_FORMAT": "HH:mm:ss", "LOGIN_TEXT": "登录", "SIGN_IN": "登录", diff --git a/web/src/containers/Admin/TradeHistory/index.js b/web/src/containers/Admin/TradeHistory/index.js index 75bd628437..1c7cc5b668 100644 --- a/web/src/containers/Admin/TradeHistory/index.js +++ b/web/src/containers/Admin/TradeHistory/index.js @@ -1,10 +1,7 @@ import React, { Component } from 'react'; import { Row, Col, Table, Spin } from 'antd'; import { requestTrades, requestTradesDownload } from './actions'; - import { SubmissionError } from 'redux-form'; - -import { formatCurrency } from '../../../utils/index'; import Moment from 'react-moment'; const INITIAL_STATE = { @@ -22,11 +19,11 @@ const formatDate = (value) => { return {value}; }; const formatNum = (value) => { - return
{formatCurrency(value)}
; + return
{value}
; }; const formatFee = (value, { fee_coin }) => { - return
{`${formatCurrency(value)} ${fee_coin}`}
; + return
{`${value} ${fee_coin}`}
; }; const COLUMNS = [ diff --git a/web/src/containers/Deposit/_Deposit.scss b/web/src/containers/Deposit/_Deposit.scss index a3148b0acc..baa0e0e7ba 100644 --- a/web/src/containers/Deposit/_Deposit.scss +++ b/web/src/containers/Deposit/_Deposit.scss @@ -14,6 +14,16 @@ $qr-code--size: 12rem; } } +.margin-aligner { + margin-bottom: 24px; + margin-right: 1rem; + + & svg { + width: 30px !important; + height: 30px !important; + } +} + .deposit_info-wrapper > div { flex: 1; } @@ -62,9 +72,6 @@ $qr-code--size: 12rem; margin-bottom: 0.5rem; } - .review-link { - } - .separator { margin: 1rem 0; height: 2px; diff --git a/web/src/containers/Deposit/utils.js b/web/src/containers/Deposit/utils.js index ba99f5f376..558f3660e8 100644 --- a/web/src/containers/Deposit/utils.js +++ b/web/src/containers/Deposit/utils.js @@ -148,13 +148,12 @@ const RenderContentForm = ({ targets, }) => { const coinObject = coins[currency]; - const { icon_id } = coinObject; - const GENERAL_ID = 'REMOTE_COMPONENT__FIAT_WALLET_DEPOSIT'; - const currencySpecificId = `${GENERAL_ID}__${currency.toUpperCase()}`; + const generalId = 'REMOTE_COMPONENT__FIAT_WALLET_DEPOSIT'; + const currencySpecificId = `${generalId}__${currency.toUpperCase()}`; const id = targets.includes(currencySpecificId) ? currencySpecificId - : GENERAL_ID; + : generalId; if (coinObject && coinObject.type !== 'fiat') { return ( @@ -165,12 +164,14 @@ const RenderContentForm = ({ >
- - {titleSection} +
+ + {titleSection} +
{(currency === 'xrp' || currency === 'xlm' || selectedNetwork === 'xlm') && ( diff --git a/web/src/containers/Summary/components/Markets.js b/web/src/containers/Summary/components/Markets.js index ee33beb6ad..39ef2a1735 100644 --- a/web/src/containers/Summary/components/Markets.js +++ b/web/src/containers/Summary/components/Markets.js @@ -142,6 +142,7 @@ class Markets extends Component {
)} { return (
@@ -74,11 +75,12 @@ const MarketList = ({ {markets.map((market, index) => ( ))} diff --git a/web/src/containers/TradeTabs/components/MarketRow.js b/web/src/containers/TradeTabs/components/MarketRow.js index 35c057aff7..6947d902c4 100644 --- a/web/src/containers/TradeTabs/components/MarketRow.js +++ b/web/src/containers/TradeTabs/components/MarketRow.js @@ -5,7 +5,14 @@ import { formatToCurrency } from 'utils/currency'; class MarketRow extends Component { render() { - const { icons: ICONS, market, chartData, handleClick } = this.props; + const { + icons: ICONS, + market, + chartData, + handleClick, + loading, + index, + } = this.props; const { key, @@ -24,30 +31,61 @@ class MarketRow extends Component { onClick={() => handleClick(key)} > -
- -
{display_name}
-
+ {!loading ? ( +
+ +
{display_name}
+
+ ) : ( +
+ )} - - {formatToCurrency(ticker.close, increment_price)} - - {pair_2_display} + {!loading ? ( +
+ + {formatToCurrency(ticker.close, increment_price)} + + {pair_2_display} +
+ ) : ( +
+ )} - {ticker.volume} - {pair_base_display} + {!loading ? ( +
+ {ticker.volume} + {pair_base_display} +
+ ) : ( +
+ )} {selected === options[0].value ? ( side, renderCell: ({ side = '' }, key, index) => { @@ -107,6 +107,21 @@ export const generateOrderHistoryHeaders = ( ); }, }, + { + stringId: 'TYPE', + label: STRINGS['TYPE'], + key: 'type', + exportToCsv: ({ type = '' }) => type, + renderCell: ({ type = '' }, key, index) => { + return ( + +
+ {type ? STRINGS[`TYPES.${type.toUpperCase()}`] : ''} +
+ + ); + }, + }, { stringId: 'SIZE', label: STRINGS['SIZE'], @@ -150,14 +165,16 @@ export const generateOrderHistoryHeaders = ( if (pairs[symbol]) { const { increment_price, pair_2_display } = pairs[symbol]; - return STRINGS.formatString( - CURRENCY_PRICE_FORMAT, - formatToCurrency( - calculatePrice(quick, price, size), - increment_price - ), - pair_2_display - ).join(''); + return price ? + STRINGS.formatString( + CURRENCY_PRICE_FORMAT, + formatToCurrency( + calculatePrice(quick, price, size), + increment_price + ), + pair_2_display + ).join('') : + '' } else { return calculatePrice(quick, price, size); } @@ -168,14 +185,16 @@ export const generateOrderHistoryHeaders = ( return ( - {STRINGS.formatString( + {price ? + STRINGS.formatString( CURRENCY_PRICE_FORMAT, formatToCurrency( calculatePrice(quick, price, size), increment_price ), pair_2_display - )} + ) + : ''} ); } else { @@ -183,6 +202,51 @@ export const generateOrderHistoryHeaders = ( } }, }, + { + stringId: 'AVERAGE', + label: STRINGS['AVERAGE'], + key: 'average', + exportToCsv: ({ average = 0, size = 0, quick, symbol }) => { + if (pairs[symbol]) { + const { increment_price, pair_2_display } = pairs[symbol]; + + return average ? + STRINGS.formatString( + CURRENCY_PRICE_FORMAT, + formatToCurrency( + calculatePrice(quick, average, size), + increment_price + ), + pair_2_display + ).join('') : + '' + } else { + return calculatePrice(quick, average, size); + } + }, + renderCell: ({ average = 0, size = 0, quick, symbol }, key, index) => { + if (pairs[symbol]) { + const { increment_price, pair_2_display } = pairs[symbol]; + + return ( + + {average ? + STRINGS.formatString( + CURRENCY_PRICE_FORMAT, + formatToCurrency( + calculatePrice(quick, average, size), + increment_price + ), + pair_2_display + ) + : ''} + + ); + } else { + return {calculatePrice(quick, average, size)}; + } + }, + }, { stringId: 'AMOUNT', label: STRINGS['AMOUNT'], @@ -275,7 +339,7 @@ export const generateOrderHistoryHeaders = ( ); }, }, - { + /*{ stringId: 'FEE,NO_FEE', label: STRINGS['FEE'], key: 'fee', @@ -285,22 +349,22 @@ export const generateOrderHistoryHeaders = ( {STRINGS.formatString( CURRENCY_PRICE_FORMAT, - formatToCurrency(fee, 0, true), + fee, fee_coin_display )} ), - }, + },*/ { stringId: 'TIME', label: STRINGS['TIME'], - key: 'updated_at', + key: 'created_at', className: isMobile ? 'text-center' : '', - exportToCsv: ({ updated_at = '' }) => updated_at, - renderCell: ({ updated_at = '' }, key, index) => { + exportToCsv: ({ created_at = '' }) => created_at, + renderCell: ({ created_at = '' }, key, index) => { return ( - {getFormatTimestamp(updated_at)} + {getFormatTimestamp(created_at)} ); }, diff --git a/web/src/containers/UserSecurity/ChangePasswordForm.js b/web/src/containers/UserSecurity/ChangePasswordForm.js index 6f77974961..f618ae4a7c 100644 --- a/web/src/containers/UserSecurity/ChangePasswordForm.js +++ b/web/src/containers/UserSecurity/ChangePasswordForm.js @@ -5,9 +5,13 @@ import { isMobile } from 'react-device-detect'; import renderFields from 'components/Form/factoryFields'; import { Button, EditWrapper } from 'components'; import STRINGS from 'config/localizedStrings'; +import { password, required } from 'components/Form/validations'; -const validate = () => { +const validate = (values) => { const errors = {}; + if (values.new_password !== values.new_password_confirm) { + errors.new_password_confirm = STRINGS['VALIDATIONS.PASSWORDS_DONT_MATCH']; + } return errors; }; @@ -22,6 +26,8 @@ export const generateFormValues = () => ({ STRINGS[ 'ACCOUNT_SECURITY.CHANGE_PASSWORD.FORM.CURRENT_PASSWORD.placeholder' ], + validate: [required, password], + fullWidth: isMobile, ishorizontalfield: true, }, @@ -33,6 +39,7 @@ export const generateFormValues = () => ({ placeholder: STRINGS['ACCOUNT_SECURITY.CHANGE_PASSWORD.FORM.NEW_PASSWORD.placeholder'], fullWidth: isMobile, + validate: [required, password], ishorizontalfield: true, }, new_password_confirm: { @@ -47,6 +54,7 @@ export const generateFormValues = () => ({ STRINGS[ 'ACCOUNT_SECURITY.CHANGE_PASSWORD.FORM.NEW_PASSWORD_REPEAT.placeholder' ], + validate: [password], fullWidth: isMobile, ishorizontalfield: true, }, diff --git a/web/src/containers/Verification/index.js b/web/src/containers/Verification/index.js index 208fc86d19..4a938c612c 100644 --- a/web/src/containers/Verification/index.js +++ b/web/src/containers/Verification/index.js @@ -39,7 +39,7 @@ import { verifyBankData } from 'actions/verificationActions'; import { getErrorLocalized } from 'utils/errors'; import { required, maxLength } from 'components/Form/validations'; import { getCountry } from 'containers/Verification/utils'; -import { getFormatTimestamp } from 'utils/utils'; +import { getFormattedBOD } from 'utils/utils'; import { COUNTRIES_OPTIONS } from 'utils/countries'; import { verificationTabsSelector } from './selector'; // const CONTENT_CLASS = @@ -449,7 +449,7 @@ class Verification extends Component { id="REMOTE_COMPONENT__KYC_VERIFICATION_HOME" handleBack={this.handleBack} setActivePageContent={this.setActivePageContent} - getFormatTimestamp={getFormatTimestamp} + getFormatTimestamp={getFormattedBOD} getCountry={getCountry} /> ), diff --git a/web/src/containers/Wallet/AssetsBlock.js b/web/src/containers/Wallet/AssetsBlock.js index f34667e8aa..fe60522ea4 100644 --- a/web/src/containers/Wallet/AssetsBlock.js +++ b/web/src/containers/Wallet/AssetsBlock.js @@ -137,7 +137,7 @@ const AssetsBlock = ({ return (
- {totalAssets.length && loading ? ( + {totalAssets.length && !loading ? (
{BASE_CURRENCY ? ( @@ -252,7 +252,7 @@ const AssetsBlock = ({ */} - {sortedSearchResults && loading ? ( + {sortedSearchResults && !loading ? (
{sortedSearchResults && baseCoin && - loading && + !loading && increment_unit ? (
diff --git a/web/src/containers/Wallet/MainWallet.js b/web/src/containers/Wallet/MainWallet.js index f03a6e752e..98dc758670 100644 --- a/web/src/containers/Wallet/MainWallet.js +++ b/web/src/containers/Wallet/MainWallet.js @@ -44,7 +44,8 @@ class Wallet extends Component { this.props.totalAsset, this.props.oraclePrices, this.props.constants, - this.props.contracts + this.props.contracts, + this.props.isFetching ); } @@ -60,7 +61,8 @@ class Wallet extends Component { nextProps.totalAsset, nextProps.oraclePrices, nextProps.constants, - nextProps.contracts + nextProps.contracts, + nextProps.isFetching ); } @@ -81,7 +83,8 @@ class Wallet extends Component { this.props.totalAsset, this.props.oraclePrices, this.props.constants, - this.props.contracts + this.props.contracts, + this.props.isFetching ); } } @@ -137,14 +140,14 @@ class Wallet extends Component { total, oraclePrices, { features: { stake_page = false } = {} } = {}, - contracts = {} + contracts = {}, + isFetching ) => { - const { increment_unit, display_name } = - coins[BASE_CURRENCY] || DEFAULT_COIN_DATA; + const { min, display_name } = coins[BASE_CURRENCY] || DEFAULT_COIN_DATA; const totalAssets = STRINGS.formatString( CURRENCY_PRICE_FORMAT, display_name, - formatToCurrency(total, increment_unit) + formatToCurrency(total, min) ); const searchResult = this.getSearchResult(coins, balance, oraclePrices); @@ -171,7 +174,7 @@ class Wallet extends Component { stake_page && !isMobile } - loading={this.props.dataFetched} + loading={isFetching} contracts={contracts} broker={this.props.broker} /> @@ -278,7 +281,7 @@ const mapStateToProps = (store) => ({ bankaccount: store.user.userData.bank_account, totalAsset: store.asset.totalAsset, oraclePrices: store.asset.oraclePrices, - dataFetched: store.asset.dataFetched, + isFetching: store.asset.isFetching, contracts: store.app.contracts, broker: store.app.broker, }); diff --git a/web/src/containers/Wallet/components/index.js b/web/src/containers/Wallet/components/index.js index 835a3359c2..3af9f8addd 100644 --- a/web/src/containers/Wallet/components/index.js +++ b/web/src/containers/Wallet/components/index.js @@ -150,7 +150,7 @@ export const renderTitleSection = (symbol, type, icon, coins, iconId) => { diff --git a/web/src/containers/Withdraw/form.js b/web/src/containers/Withdraw/form.js index a1ead20e32..469e8354bf 100644 --- a/web/src/containers/Withdraw/form.js +++ b/web/src/containers/Withdraw/form.js @@ -318,12 +318,16 @@ class Form extends Component { >
- - {titleSection} +
+ + {titleSection} +
{renderFields(formValues)} {error &&
{error}
}
diff --git a/web/src/containers/Withdraw/index.js b/web/src/containers/Withdraw/index.js index 30f1ef494d..0eba2a1929 100644 --- a/web/src/containers/Withdraw/index.js +++ b/web/src/containers/Withdraw/index.js @@ -31,6 +31,7 @@ import { import { FORM_NAME } from './form'; import { limitNumberWithinRange } from 'utils/math'; +import { STATIC_ICONS } from 'config/icons'; class Withdraw extends Component { state = { @@ -159,8 +160,8 @@ class Withdraw extends Component { coins, verification_level, this.props.activeTheme, - ICONS['BLUE_PLUS'], - 'BLUE_PLUS', + STATIC_ICONS['MAX_ICON'], + 'MAX_ICON', networks, network, ICONS, diff --git a/web/src/index.css b/web/src/index.css index 50b31ea47a..712ec61112 100644 --- a/web/src/index.css +++ b/web/src/index.css @@ -1955,6 +1955,13 @@ table th { color: var(--specials_buttons-links-and-highlights); padding: 0 0.25rem; } +.margin-aligner { + margin-bottom: 24px; + margin-right: 1rem; } + .margin-aligner svg { + width: 30px !important; + height: 30px !important; } + .deposit_info-wrapper > div { flex: 1; } @@ -8020,7 +8027,8 @@ table th { .input_field-input::placeholder { color: var(--labels_secondary-inactive-label-text-graphics) !important; } .input_field-input:disabled { - cursor: not-allowed; } + cursor: not-allowed; + opacity: 0.5; } .dropdown-triangle:after { content: ''; diff --git a/web/src/index.js b/web/src/index.js index fcabd49b29..460deed74b 100644 --- a/web/src/index.js +++ b/web/src/index.js @@ -64,7 +64,7 @@ import { setContracts, setBroker, } from 'actions/appActions'; -import { setPricesAndAsset } from 'actions/assetActions'; +// import { setPricesAndAsset } from 'actions/assetActions'; import { hasTheme } from 'utils/theme'; import { generateRCStrings } from 'utils/string'; import { LANGUAGE_KEY } from './config/constants'; @@ -168,7 +168,7 @@ const getConfigs = async () => { store.dispatch(setPairsData(constants.pairs)); store.dispatch(setContracts(getContracts(constants.coins))); store.dispatch(setBroker(constants.broker)); - store.dispatch(setPricesAndAsset({}, constants.coins)); + // store.dispatch(setPricesAndAsset({}, constants.coins)); const orderLimits = {}; Object.keys(constants.pairs).forEach((pair) => { diff --git a/web/src/reducers/assetReducer.js b/web/src/reducers/assetReducer.js index bc4ed52d6c..bbf192ff12 100644 --- a/web/src/reducers/assetReducer.js +++ b/web/src/reducers/assetReducer.js @@ -14,17 +14,17 @@ const INITIAL_STATE = { allCoins: [], allPairs: [], exchange: {}, - dataFetched: false, + isFetching: true, }; export default (state = INITIAL_STATE, { type, payload }) => { switch (type) { case SET_PRICES_AND_ASSET_PENDING: - return { ...state, dataFetched: true }; + return { ...state, isFetching: true }; case SET_PRICES_AND_ASSET_SUCCESS: - return { ...state, ...payload, dataFetched: true }; + return { ...state, ...payload, isFetching: false }; case SET_PRICES_AND_ASSET_FAILURE: - return { ...state, dataFetched: false }; + return { ...state, isFetching: false }; case SET_ALL_COINS: return { ...state, ...payload }; diff --git a/web/src/utils/utils.js b/web/src/utils/utils.js index 8fe84658f2..609fbec8a3 100644 --- a/web/src/utils/utils.js +++ b/web/src/utils/utils.js @@ -6,6 +6,7 @@ import { TOKEN_TIME, TIMESTAMP_FORMAT, TIMESTAMP_FORMAT_FA, + DEFAULT_TIMESTAMP_FORMAT, AUDIOS, } from '../config/constants'; import { getLanguage } from './string'; @@ -48,6 +49,13 @@ export const checkUserSessionExpired = (loginTime) => { return currentTime - loginTime > TOKEN_TIME; }; +export const getFormattedBOD = (date, format = DEFAULT_TIMESTAMP_FORMAT) => { + if (getLanguage() === 'fa') { + return formatTimestampFarsi(date, format); + } + return formatTimestampGregorian(date, format); +}; + export const getFormatTimestamp = (date, format) => { if (getLanguage() === 'fa') { return formatTimestampFarsi(date, format);