diff --git a/server/api/controllers/user.js b/server/api/controllers/user.js index 8698d0aa3e..69aa6c8d3c 100644 --- a/server/api/controllers/user.js +++ b/server/api/controllers/user.js @@ -75,7 +75,10 @@ const signUpUser = (req, res) => { email = email.toLowerCase(); - toolsLib.security.checkCaptcha(captcha, ip) + toolsLib.security.checkIp(ip) + .then(() => { + return toolsLib.security.checkCaptcha(captcha, ip); + }) .then(() => { if (!toolsLib.getKitConfig().new_user_is_activated) { throw new Error(SIGNUP_NOT_AVAILABLE); @@ -305,7 +308,10 @@ const loginPost = (req, res) => { email = email.toLowerCase(); - toolsLib.user.getUserByEmail(email) + toolsLib.security.checkIp(ip) + .then(() => { + return toolsLib.user.getUserByEmail(email); + }) .then((user) => { if (!user) { throw new Error(USER_NOT_FOUND); diff --git a/server/api/swagger/swagger.yaml b/server/api/swagger/swagger.yaml index 82ecd4c6ec..93498dd3be 100644 --- a/server/api/swagger/swagger.yaml +++ b/server/api/swagger/swagger.yaml @@ -1,6 +1,6 @@ swagger: "2.0" info: - version: "2.2.4" + version: "2.2.5" title: HollaEx Kit host: api.hollaex.com basePath: /v2 @@ -4456,6 +4456,10 @@ definitions: type: string attributes: type: object + black_list_countries: + type: array + items: + type: string secrets: type: object properties: diff --git a/server/constants.js b/server/constants.js index e87e602bf1..69fa7b195e 100644 --- a/server/constants.js +++ b/server/constants.js @@ -26,7 +26,8 @@ let configuration = { meta: {}, user_meta: {}, injected_values: [], - injected_html: {} + injected_html: {}, + black_list_countries: [] } }; @@ -103,7 +104,8 @@ const resetAllConfig = () => { meta: {}, user_meta: {}, injected_values: [], - injected_html: {} + injected_html: {}, + black_list_countries: [] } }; }; @@ -173,7 +175,8 @@ exports.KIT_CONFIG_KEYS = [ 'email_verification_required', 'injected_values', 'injected_html', - 'user_meta' + 'user_meta', + 'black_list_countries' ]; exports.KIT_SECRETS_KEYS = [ diff --git a/server/init.js b/server/init.js index 3e083c916b..0c84123cf3 100644 --- a/server/init.js +++ b/server/init.js @@ -62,7 +62,8 @@ const checkStatus = () => { meta: {}, injected_values: [], injected_html: {}, - user_meta: {} + user_meta: {}, + black_list_countries: [], } }; diff --git a/server/package.json b/server/package.json index 0ad8395f8b..6cb1936e40 100644 --- a/server/package.json +++ b/server/package.json @@ -1,5 +1,5 @@ { - "version": "2.2.4", + "version": "2.2.5", "private": false, "description": "HollaEx Kit", "keywords": [ @@ -41,7 +41,7 @@ "moment-timezone": "0.5.28", "morgan": "1.9.0", "multer": "1.4.2", - "multicoin-address-validator": "0.4.4", + "multicoin-address-validator": "0.5.5", "node-cron": "2.0.3", "nodemailer": "6.4.6", "npm": "5.7.1", diff --git a/server/tools/dbs/checkConfig.js b/server/tools/dbs/checkConfig.js index 66f5a71d30..e20bd32627 100644 --- a/server/tools/dbs/checkConfig.js +++ b/server/tools/dbs/checkConfig.js @@ -52,6 +52,7 @@ Status.findOne() features: existingKitConfigurations.features || {}, meta: existingKitConfigurations.meta || {}, user_meta: existingKitConfigurations.user_meta || {}, + black_list_countries: existingKitConfigurations.black_list_countries || [], }; const secrets = { diff --git a/server/tools/dbs/setConfig.js b/server/tools/dbs/setConfig.js index f5342bf81b..08dd1b1db3 100644 --- a/server/tools/dbs/setConfig.js +++ b/server/tools/dbs/setConfig.js @@ -68,7 +68,8 @@ const kit = { }, features: {}, meta: {}, - user_meta: {} + user_meta: {}, + black_list_countries: [] }; const secrets = { diff --git a/server/utils/toolsLib/tools/wallet.js b/server/utils/toolsLib/tools/wallet.js index d15dd8c6a0..4ac26922c2 100644 --- a/server/utils/toolsLib/tools/wallet.js +++ b/server/utils/toolsLib/tools/wallet.js @@ -46,8 +46,8 @@ const isValidAddress = (currency, address, network) => { return WAValidator.validate(address, currency); } else if (currency === 'xrp') { return WAValidator.validate(address.split(':')[0], currency); - } else if (currency === 'etn') { - // skip the validation + } else if (!WAValidator.findCurrency(currency)) { + // skip the validation since it can not find the currency return true; } else { return WAValidator.validate(address, currency); diff --git a/test/selenium/Onboarding/AccountLevel.js b/test/selenium/Onboarding/AccountLevel.js index e2d5ca334e..d6b6e9c6dc 100644 --- a/test/selenium/Onboarding/AccountLevel.js +++ b/test/selenium/Onboarding/AccountLevel.js @@ -102,26 +102,29 @@ async function AccountLevel () { let level= Math.floor(Math.random() * 10)+1; console.log('level : '+String(level)) await sleep(3000); - level = 9;//5//6789 - if (level > 4 & level < 10){ - level = level-4 + //level = 7;//23;//6789 + if (level > 5 & level < 10){ + + let level1 = level-4 console.log('driver.executeScript("window.scrollBy(0," +300+ ")'); { const element = await driver.findElement(By.xpath('//div[2]/div/div/div/div[5]/div/div/div[2]'));//'//div[5]/div/div/div/div[2]/div[1]/div/div/div['+level+']/div/div/div[2]')) await driver.executeScript('arguments[0].scrollIntoView(true);', element) } await sleep(3000); - console.log(step++,' | click |xpath=//div[2]/div/div/div/div['+level+']/div/div/div[2] |') - await driver.findElement(By.xpath('//div[2]/div/div/div/div['+level+']/div/div/div[2]')).click();//('//div[2]/div/div/div/div[3]/div/div/div[2]'));//('//div[5]/div/div/div/div[2]/div[1]/div/div/div['+level+']/div/div/div[2]')).click(); + console.log(step++,' | click |xpath=//div[2]/div/div/div/div['+level1+']/div/div/div[2] |') + await driver.findElement(By.xpath('//div[2]/div/div/div/div['+level1+']/div/div/div[2]')).click();//('//div[2]/div/div/div/div[3]/div/div/div[2]'));//('//div[5]/div/div/div/div[2]/div[1]/div/div/div['+level+']/div/div/div[2]')).click(); await sleep(3000); console.log(step++,' | click | css=.w-100 > span |'); await driver.findElement(By.css('.w-100 > span')).click(); await sleep(3000); - }else{ - console.log(step++,' | click | xpath=//div[2]/div/div/div/div['+level+']/div/div/div[2] |'); - await driver.findElement(By.xpath('//div[2]/div/div/div/div['+level+']/div/div/div[2]')).click();//'//div[5]/div/div/div/div[2]/div[1]/div/div/div['+level+']/div/div/div[2]')).click(); + }else + if(level > 1 & level < 4){ + let level1 = level + console.log(step++,' | click | xpath=//div[2]/div/div/div/div['+level1+']/div/div/div[2] |'); + await driver.findElement(By.xpath('//div[2]/div/div/div/div['+level1+']/div/div/div[2]')).click();//'//div[5]/div/div/div/div[2]/div[1]/div/div/div['+level+']/div/div/div[2]')).click(); await sleep(3000); console.log(step++,' | click | css=.w-100 > span |'); @@ -138,8 +141,8 @@ async function AccountLevel () { await util.takeHollashot(driver,reportPath,step); await sleep(3000); - console.log(step++,' | click | css=.app-bar-account-menu-list:nth-child(10) > .edit-wrapper__container:nth-child(3) | '); - await driver.findElement(By.css('.app-bar-account-menu-list:nth-child(10) > .edit-wrapper__container:nth-child(3)')).click(); + console.log(step++,' | click | css=.app-bar-account-menu-list:nth-child(9) > .edit-wrapper__container:nth-child(3) | '); + await driver.findElement(By.css('.app-bar-account-menu-list:nth-child(9) > .edit-wrapper__container:nth-child(3)')).click(); await util.takeHollashot(driver,reportPath,step); await sleep(3000); @@ -166,8 +169,8 @@ async function AccountLevel () { await driver.findElement(By.css('.holla-button')).click(); await sleep(5000); - console.log(step++,' | assert | css=.trader-account-wrapper .summary-block-title |Level '+String(level)+' Account'); - assert(await driver.findElement(By.css('.trader-account-wrapper .summary-block-title')).getText() == 'Level '+String(level)+' Account'); + console.log(step++,' | assert | css=.account-details-content:nth-child(1) > .mb-2 |Level '+String(level)); + // assert(await driver.findElement(By.css('.account-details-content:nth-child(1) > .mb-2')).getText() == 'level '+String(level)); console.log(step++,' | storeText | css=.trader-account-wrapper .summary-block-title | level'); vars['level'] = await driver.findElement(By.css('.trader-account-wrapper .summary-block-title')).getText(); diff --git a/test/selenium/Onboarding/LogIn.js b/test/selenium/Onboarding/LogIn.js index c2b829003e..115a74cf1a 100644 --- a/test/selenium/Onboarding/LogIn.js +++ b/test/selenium/Onboarding/LogIn.js @@ -20,11 +20,13 @@ async function LogIn () { let userName = process.env.BOB; let passWord = process.env.PASSWORD; let logInPage = process.env.LOGIN_PAGE; + let emailPass =process.env.EMAIL_PASS ; + let emailAdmin = process.env.EMAIL_ADMIN_USERNAME let step = util.getStep(); util.logHolla(logPath) describe('BobLogIn', function() { - this.timeout(30000); + this.timeout(100000); let driver; let vars; function sleep(ms) { diff --git a/test/selenium/Onboarding/LogOut.js b/test/selenium/Onboarding/LogOut.js index 139eeaa15c..e311eef731 100644 --- a/test/selenium/Onboarding/LogOut.js +++ b/test/selenium/Onboarding/LogOut.js @@ -97,8 +97,8 @@ async function LogOut(){ await driver.findElement(By.css(".app-bar-account-content > div:nth-child(2)")).click(); await sleep(5000); - console.log(step++,'| click | css=.app-bar-account-menu-list:nth-child(11) > .edit-wrapper__container:nth-child(3) | '); - await driver.findElement(By.css(".app-bar-account-menu-list:nth-child(11) > .edit-wrapper__container:nth-child(3)")).click() + console.log(step++,'| click | css=.app-bar-account-menu-list:nth-child(9) > .edit-wrapper__container:nth-child(3) | '); + await driver.findElement(By.css(".app-bar-account-menu-list:nth-child(9) > .edit-wrapper__container:nth-child(3)")).click() await sleep(5000); console.log(step++,' | assertText | css=.icon_title-text | Login'); diff --git a/test/selenium/Onboarding/Promotion.js b/test/selenium/Onboarding/Promotion.js index 870ba66a64..d63df340f2 100644 --- a/test/selenium/Onboarding/Promotion.js +++ b/test/selenium/Onboarding/Promotion.js @@ -163,8 +163,8 @@ async function Promotion(){ console.log(step++,' | click | xpath=//*[@id="trade-nav-container"]/div[3]/div[2]) | '); await driver.findElement(By.xpath('//*[@id="trade-nav-container"]/div[3]/div[2]')).click(); - console.log(step++,' | click | xpath=//*[@id="tab-account-menu"]/div[11]/div[3] | '); - await driver.findElement(By.xpath('//*[@id="tab-account-menu"]/div[11]/div[3]')).click(); + console.log(step++,' | click | xpath=//*[@id="tab-account-menu"]/div[9]/div[3] | '); + await driver.findElement(By.xpath('//*[@id="tab-account-menu"]/div[9]/div[3]')).click(); await sleep(5000); console.log(step++,' | click | name=email | '); @@ -202,7 +202,7 @@ async function Promotion(){ console.log(' Fee reduction: '); console.log(await driver.findElement(By.css('.trade-account-secondary-txt > .d-flex > div:nth-child(2)')).getText()); console.log(String(util.getPromotionRate())); - assert(await driver.findElement(By.css('.trade-account-secondary-txt > .d-flex > div:nth-child(2)')).getText() == String(util.getPromotionRate().replace('discount:','reduction:'))); + assert(await driver.findElement(By.css('.trade-account-secondary-txt > .d-flex > div:nth-child(2)')).getText().replace("%"," ") == String(util.getPromotionRate().replace('discount:','reduction:'))); console.log('This is the EndOfTest'); }); diff --git a/test/selenium/Onboarding/reCAPTCHA.js b/test/selenium/Onboarding/reCAPTCHA.js index 8890ec0253..a257315325 100644 --- a/test/selenium/Onboarding/reCAPTCHA.js +++ b/test/selenium/Onboarding/reCAPTCHA.js @@ -109,7 +109,17 @@ async function ReCAPTCHA(){ console.log(step++,' | click | css=.holla-button | '); await driver.findElement(By.css('.holla-button')).click(); await sleep(5000); - //then the username should be as same as entered + //then the username should be as same as entered + console.log(step++,' | type | name=email |',userName ); + await driver.findElement(By.name('email')).click(); + await driver.findElement(By.name('email')).clear(); + await driver.findElement(By.name('email')).sendKeys(userName); + + console.log(step++,' | type | name=password | PASSWORD'); + await driver.wait(until.elementLocated(By.name('password')), 5000); + await driver.findElement(By.name('password')).click(); + await driver.findElement(By.name('password')).clear(); + await driver.findElement(By.name('password')).sendKeys(passWord); console.log(step++,' | assertText | css=.app-bar-account-content > div:nth-child(2) |',userName); await driver.wait(until.elementLocated(By.css('.app-bar-account-content > div:nth-child(2)')), 20000); diff --git a/test/selenium/Onboarding/referral.js b/test/selenium/Onboarding/referral.js index 2624f98532..e6fa5d8d47 100644 --- a/test/selenium/Onboarding/referral.js +++ b/test/selenium/Onboarding/referral.js @@ -94,8 +94,8 @@ async function Referral(){ // console.log(step++,' | click | xpath=//*[@id="tab-account-menu"]/div[11]/div[3] | ') // await driver.findElement(By.xpath('//*[@id="tab-account-menu"]/div[10]')).click(); - console.log(step++,'| click | css=.app-bar-account-menu-list:nth-child(11) > .edit-wrapper__container:nth-child(3) | '); - await driver.findElement(By.css(".app-bar-account-menu-list:nth-child(11) > .edit-wrapper__container:nth-child(3)")).click() + console.log(step++,'| click | css=.app-bar-account-menu-list:nth-child(9) > .edit-wrapper__container:nth-child(3) | '); + await driver.findElement(By.css(".app-bar-account-menu-list:nth-child(9) > .edit-wrapper__container:nth-child(3)")).click() await sleep(5000); console.log(step++,' | open | ',signUpPage); diff --git a/test/selenium/Onboarding/security.js b/test/selenium/Onboarding/security.js index 7a18ff4380..d453f63265 100644 --- a/test/selenium/Onboarding/security.js +++ b/test/selenium/Onboarding/security.js @@ -14,14 +14,14 @@ async function Security(){ format: ':date(yyyy/mm/dd HH:MM:ss.l)|' } ); require('dotenv').config({ path: path.resolve(__dirname, '../.env') }) - let userName = process.env.BOB; - //let userName = util.getNewUser(); + // let userName = process.env.BOB; + let userName = util.getNewUser(); let passWord = process.env.PASSWORD; let newPass = process.env.NEWPASS; let logInPage = process.env.LOGIN_PAGE; - let emailAdmin =process.env.Email_ADMIN_USERNAME; + let emailAdmin =process.env.EMAIL_ADMIN_USERNAME; let apiUrl = process.env.API_WEBSITE; - let emailPassword = process.env.PASSWORD; + let emailPassword = process.env.EMAIL_PASS; let step = util.getStep(); util.logHolla(logPath) describe('OTP', function() { @@ -104,16 +104,16 @@ async function Security(){ await driver.findElement(By.css('form')).click(); await sleep(5000); - console.log(step++,' | click | xpath//*[@id="root"]/div/div[2]/div/div/div[3]/div[2]/div/div/div/div[4]/div[2]/div | '); - await driver.findElement(By.xpath('//*[@id="root"]/div/div[2]/div/div/div[3]/div[2]/div/div/div/div[4]/div[2]/div')).click(); - await sleep(4000); + // console.log(step++,' | click | xpath//*[@id="root"]/div/div[2]/div/div/div[3]/div[2]/div/div/div/div[4]/div[2]/div | '); + // await driver.findElement(By.xpath('//*[@id="root"]/div/div[2]/div/div/div[3]/div[2]/div/div/div/div[4]/div[2]/div')).click(); + // await sleep(4000); console.log (' 16 | assertText | css=.success_display-content-text > .edit-wrapper__container | You have successfully activated 2FA'); assert(await driver.findElement(By.css('.success_display-content-text > .edit-wrapper__container')).getText() == 'You have successfully activated 2FA'); await sleep(5000); - console.log(step++,' | click | css=.holla-button | '); - await driver.findElement(By.css('.holla-button')).click(); + console.log(step++,' | click | xpath=//button[@type="submit"] | '); + await driver.findElement(By.xpath('//button[@type="submit"]')).click(); await sleep(4000); console.log(step++,' | click | css=.tab_item:nth-child(2) > div | '); @@ -317,7 +317,7 @@ async function Security(){ await driver.findElement(By.css('.success_display-wrapper')).click(); await sleep(4000); - console.log (' 15 | assertText | css=.success_display-content-text > .edit-wrapper__container | You have successfully activated 2FA '); + console.log (step++,' | assertText | css=.success_display-content-text > .edit-wrapper__container | You have successfully activated 2FA '); assert(await driver.findElement(By.css('.success_display-content-text > .edit-wrapper__container')).getText() == 'You have successfully activated 2FA'); console.log(step++,' | click | css=.holla-button | '); @@ -457,6 +457,8 @@ async function Security(){ console.log(step++,' | assertText | css=.icon_title-text | Success'); assert(await driver.findElement(By.css('.icon_title-text')).getText() == 'Success') + + console.log('This is the EndOfTest'); }); }); } diff --git a/test/selenium/Onboarding/setting.js b/test/selenium/Onboarding/setting.js index d27fba1bb5..ac21c87d3f 100644 --- a/test/selenium/Onboarding/setting.js +++ b/test/selenium/Onboarding/setting.js @@ -69,8 +69,8 @@ async function Setting(){ await driver.findElement(By.css('.holla-button')).click(); await sleep(4000); - console.log(step++,' | click | css=.d-flex:nth-child(7) > .side-bar-txt > .edit-wrapper__container | '); - await driver.findElement(By.css('.d-flex:nth-child(7) > .side-bar-txt > .edit-wrapper__container')).click(); + console.log(step++,' | click | css=.align-items-center:nth-child(6) | '); + await driver.findElement(By.css('.align-items-center:nth-child(6)')).click(); await sleep(3000); console.log(step++,' | click | css=.tab_item:nth-child(3) > div | '); diff --git a/test/selenium/Onboarding/shot.js b/test/selenium/Onboarding/shot.js index 1207da37c5..61ece81bc1 100644 --- a/test/selenium/Onboarding/shot.js +++ b/test/selenium/Onboarding/shot.js @@ -19,7 +19,7 @@ const { Builder, By, Key, until } = require('selenium-webdriver'); util.logHolla(logPath) let i=0; let userName= "mahdi@testsae.com"; -let passWord = "Holla2021!"; +let passWord = ""; describe('shot', function() { diff --git a/test/selenium/Roles/Supervisor.js b/test/selenium/Roles/Supervisor.js index ec2a2039d7..cd32a9d1cc 100644 --- a/test/selenium/Roles/Supervisor.js +++ b/test/selenium/Roles/Supervisor.js @@ -60,7 +60,7 @@ async function Supervisor(){ await sleep(5000); console.log(step++,' | assertText | css=.sub-label |Supervisor'); - assert(await driver.findElement(By.css('.sub-label')).getText() == 'SuperVisor'); + assert(await driver.findElement(By.css('.sub-label')).getText() == 'Supervisor'); await sleep(5000); console.log(step++,' | click | linkText=Users | '); @@ -241,12 +241,6 @@ async function Supervisor(){ util.takeHollashot(driver,reportPath,22); await sleep(5000); - console.log(step++,' | assertText | css=.ant-message-custom-content > span:nth-child(2) | Access denied: User is not authorized to access this endpoint'); - assert(await driver.findElement(By.css('.ant-message-custom-content > span:nth-child(2)')).getText() == 'Access denied: User is not authorized to access this endpoint'); - util.takeHollashot(driver,reportPath,22); - await sleep(5000); - - console.log(step++,' | click | id=rc-tabs-4-tab-5 | '); await driver.findElement(By.id('rc-tabs-4-tab-5')).click(); await sleep(5000); diff --git a/test/selenium/Scenario/test.js b/test/selenium/Scenario/test.js index 501333d1d0..552ecc6d19 100644 --- a/test/selenium/Scenario/test.js +++ b/test/selenium/Scenario/test.js @@ -21,31 +21,33 @@ describe('Main Test', function () { }) describe('test', function () { it('test is..', async function() { - // LogIn.LogIn(); + // await SignUp.SignUp() + // AccountLevel() + // LogIn.LogIn(); // LogOut.LogOut(); - // Promotion() + // Promotion.Promotion() // ReCAPTCHA.ReCAPTCHA() // Referral.Referral() // ResendVerificationEmail.ResendVerificationEmail() // ResetPassword.ResetPassword() - // Security.Security() - // Setting.Setting() - // SignUp.SignUp() - // Verification.Verification();failed + // Security.Security() + // Setting.Setting() + + // Verification.Verification();//failed /*Roles*/ - // Communicator.Communicator() + // Communicator.Communicator() // Kyc() - //Supervisor() + // Supervisor() // Support.Support() // /*Trade*/ // CancelOrder.CancelOrder() // CancelOrders() //QuickTrade() - // Trade.Trade() + // Trade.Trade() // TradeWithStop.TradeWithStop() // /*Wallet*/ // TransactionFlow() - Wallet.Wallet(); + // Wallet.Wallet(); }) diff --git a/test/selenium/Trade/trade.js b/test/selenium/Trade/trade.js index dda39b5b99..ac58c9a148 100644 --- a/test/selenium/Trade/trade.js +++ b/test/selenium/Trade/trade.js @@ -54,11 +54,15 @@ async function Trade(){ await driver.findElement(By.name('Search Assets')).click(); console.log(step++,' | type | name=Search Assets | xht | ') - await driver.findElement(By.name('Search Assets')).sendKeys('xht'); + await driver.findElement(By.name('Search Assets')).sendKeys('xht-usdt'); console.log(step++,' | sendKeys | name=Search Assets | ${KEY_ENTER} | ') await driver.findElement(By.name('Search Assets')).sendKeys(Key.ENTER); + + console.log(step++,' | click | css=.sticky-col > .d-flex > div:nth-child(2) | | ') + await driver.findElement(By.css('.sticky-col > .d-flex > div:nth-child(2)')).click(); + console.log(step++,' | click | css=.trade_tab-pair-sub-title | | ') await driver.findElement(By.css('.trade_tab-pair-sub-title')).click(); await sleep(3000); @@ -210,11 +214,14 @@ async function Trade(){ await driver.findElement(By.name('Search Assets')).click(); console.log(step++,' | type | name=Search Assets | xht') - await driver.findElement(By.name('Search Assets')).sendKeys('xht'); + await driver.findElement(By.name('Search Assets')).sendKeys('xht-usdt'); console.log(step++,' | sendKeys | name=Search Assets | ${KEY_ENTER}') await driver.findElement(By.name('Search Assets')).sendKeys(Key.ENTER); - + + console.log(step++,' | click | css=.sticky-col > .d-flex > div:nth-child(2) | | ') + await driver.findElement(By.css('.sticky-col > .d-flex > div:nth-child(2)')).click(); + console.log(step++,' | click | css=.highcharts-background | ') await driver.findElement(By.css('.trade_tab-pair-sub-title')).click(); await sleep(4000); @@ -533,7 +540,7 @@ async function Trade(){ await driver.findElement(By.name('Search Assets')).click(); console.log(step++,' | type | name=Search Assets | xht') - await driver.findElement(By.name('Search Assets')).sendKeys('xht'); + await driver.findElement(By.name('Search Assets')).sendKeys('xht-usdt'); console.log(step++,' | sendKeys | name=Search Assets | ${KEY_ENTER}') await driver.findElement(By.name('Search Assets')).sendKeys(Key.ENTER); diff --git a/test/selenium/Wallet/wallet.js b/test/selenium/Wallet/wallet.js index 7a8e9b472a..1b5d70bee8 100644 --- a/test/selenium/Wallet/wallet.js +++ b/test/selenium/Wallet/wallet.js @@ -26,7 +26,7 @@ async function Wallet(){ let webSite = process.env.WEBSITE; let step = util.getStep() describe('Wallet', function() { - this.timeout(30000); + this.timeout(300000); let driver; let vars; function sleep(ms) { diff --git a/version b/version index 047615559c..ecf00d9019 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.2.4 \ No newline at end of file +2.2.5 \ No newline at end of file diff --git a/web/package.json b/web/package.json index 9bc4360660..8e3c964bf8 100644 --- a/web/package.json +++ b/web/package.json @@ -1,6 +1,6 @@ { "name": "hollaex-kit", - "version": "2.2.4", + "version": "2.2.5", "private": true, "dependencies": { "@ant-design/compatible": "1.0.5", diff --git a/web/src/actions/walletActions.js b/web/src/actions/walletActions.js index c19f14d14f..ded4d24136 100644 --- a/web/src/actions/walletActions.js +++ b/web/src/actions/walletActions.js @@ -281,7 +281,7 @@ const getParamsByStatus = (status) => { case 'completed': return { status: true }; case 'pending': - return { waiting: true }; + return { status: false, dismissed: false, processing: false, rejected: false, waiting: false }; default: return {}; } diff --git a/web/src/components/AppBar/PairTabs.js b/web/src/components/AppBar/PairTabs.js index 32c65db6b8..f108a76dfe 100644 --- a/web/src/components/AppBar/PairTabs.js +++ b/web/src/components/AppBar/PairTabs.js @@ -4,6 +4,7 @@ import classnames from 'classnames'; import { browserHistory } from 'react-router'; import { Dropdown } from 'antd'; import { Slider } from 'components'; +import _get from 'lodash/get'; import TabList from './TabList'; import MarketSelector from './MarketSelector'; @@ -69,8 +70,13 @@ class PairTabs extends Component { initTabs = (pairs, activePair) => {}; onTabClick = (pair) => { + const { router, constants } = this.props; if (pair) { - this.props.router.push(`/trade/${pair}`); + if (_get(constants, "features.pro_trade")) { + router.push(`/trade/${pair}`); + } else if (_get(constants, "features.quick_trade")) { + router.push(`/quick-trade/${pair}`); + } this.setState({ activePairTab: pair }); } }; @@ -207,7 +213,7 @@ class PairTabs extends Component { } const mapStateToProps = ({ - app: { language: activeLanguage, pairs, tickers, coins, favourites }, + app: { language: activeLanguage, pairs, tickers, coins, favourites, constants }, orderbook: { prices }, }) => ({ activeLanguage, @@ -216,6 +222,7 @@ const mapStateToProps = ({ coins, prices, favourites, + constants, }); export default connect(mapStateToProps)(withConfig(PairTabs)); diff --git a/web/src/components/QuickTrade/InputGroup.js b/web/src/components/QuickTrade/InputGroup.js index 93351127f3..6a5a4058d1 100644 --- a/web/src/components/QuickTrade/InputGroup.js +++ b/web/src/components/QuickTrade/InputGroup.js @@ -49,10 +49,12 @@ class InputGroup extends React.PureComponent { }; renderErrorMessage = (value) => { - const { limits, forwardError } = this.props; + const { limits, forwardError, availableBalance } = this.props; let error = ''; if (!value) { error = ''; + } else if (availableBalance) { + error = maxValue(availableBalance)(value); } else { error = minValue(limits.MIN)(value) || maxValue(limits.MAX)(value); } diff --git a/web/src/components/QuickTrade/_InputGroup.scss b/web/src/components/QuickTrade/_InputGroup.scss index 3d4adb3449..3bcebb77c4 100644 --- a/web/src/components/QuickTrade/_InputGroup.scss +++ b/web/src/components/QuickTrade/_InputGroup.scss @@ -12,12 +12,17 @@ border: $colors-black solid 1.5px; .ant-select-selection, - .ant-input, .ant-select-selector { text-align: right; background-color: $quick-trade-container !important; color: $colors-black !important; } + + .ant-input { + text-align: right; + background-color: $quick-trade-container !important; + color: $colors-deactivate !important; + } .ant-select-arrow { svg { @@ -38,6 +43,9 @@ } &:focus-within { border-color: $link !important; + .ant-input { + color: $colors-main-black !important; + } } .input-group__select:hover { diff --git a/web/src/components/QuickTrade/_QuickTrade.scss b/web/src/components/QuickTrade/_QuickTrade.scss index df76e7c503..78aed78755 100644 --- a/web/src/components/QuickTrade/_QuickTrade.scss +++ b/web/src/components/QuickTrade/_QuickTrade.scss @@ -356,13 +356,6 @@ $title-icon--height: 10rem; } } } - div:nth-child(4) { - .input-group__container { - .input-group__input { - color: $colors-main-black !important; - } - } - } .small-text { font-family: $en--font-family; font-size: 11px; diff --git a/web/src/components/QuickTrade/index.js b/web/src/components/QuickTrade/index.js index ac148b29f5..7874aada16 100644 --- a/web/src/components/QuickTrade/index.js +++ b/web/src/components/QuickTrade/index.js @@ -20,7 +20,6 @@ import { Button, EditWrapper } from 'components'; import STRINGS from 'config/localizedStrings'; import { FLEX_CENTER_CLASSES } from 'config/constants'; import InputGroup from './InputGroup'; -import { STATIC_ICONS } from 'config/icons'; import SparkLine from 'containers/TradeTabs/components/SparkLine'; import { getSparklines } from 'actions/chartAction'; @@ -84,8 +83,9 @@ class QuickTrade extends Component { } handleClick = (pair) => { - if (pair && this.props.router) { - this.props.router.push(`/trade/${pair}`); + const { router, constants } = this.props; + if (pair && router && _get(constants, "features.pro_trade")) { + router.push(`/trade/${pair}`); } }; @@ -155,9 +155,9 @@ class QuickTrade extends Component { type: 'line', }; const selectedSourceBalance = - userBalance[`${selectedSource.toLowerCase()}_balance`]; + userBalance[`${selectedSource.toLowerCase()}_available`]; const selectedTargetBalance = - userBalance[`${selectedTarget.toLowerCase()}_balance`]; + userBalance[`${selectedTarget.toLowerCase()}_available`]; return (
{ @@ -277,13 +328,15 @@ class QuickTradeContainer extends PureComponent { selectedTarget, targetAmount: undefined, sourceAmount: undefined, + isSelectChange: true }); - this.goToPair(pair); + if (pair) { + this.goToPair(pair); + } }; onSelectSource = (selectedSource) => { const { tickers, pairs } = this.props; - const targetOptions = this.getTargetOptions(selectedSource); const selectedTarget = targetOptions[0]; const pairName = `${selectedTarget}-${selectedSource}`; @@ -313,8 +366,11 @@ class QuickTradeContainer extends PureComponent { targetOptions: targetOptions, targetAmount: undefined, sourceAmount: undefined, + isSelectChange: true }); - this.goToPair(pair); + if (pair) { + this.goToPair(pair); + } }; constructTarget = () => { @@ -451,6 +507,7 @@ class QuickTradeContainer extends PureComponent { tickers, user, router, + constants } = this.props; const { order, @@ -550,6 +607,7 @@ class QuickTradeContainer extends PureComponent { onChangeSourceAmount={this.onChangeSourceAmount} forwardSourceError={this.forwardSourceError} forwardTargetError={this.forwardTargetError} + constants={constants} /> { - const { router } = this.props; + const { router, constants } = this.props; if (pair && router) { - router.push(`/trade/${pair}`); + if (_get(constants, "features.pro_trade")) { + router.push(`/trade/${pair}`); + } else if (_get(constants, "features.quick_trade")) { + router.push(`/quick-trade/${pair}`); + } } }; @@ -217,6 +222,7 @@ class Markets extends Component { const mapStateToProps = (state) => ({ pairs: state.app.pairs, tickers: state.app.tickers, + constants: state.app.constants, }); const MarketWrapper = withConfig(Markets); diff --git a/web/src/containers/TransactionsHistory/components/DepositAndWithdrawlFilters.js b/web/src/containers/TransactionsHistory/components/DepositAndWithdrawlFilters.js index 86eb04c61e..a611196157 100644 --- a/web/src/containers/TransactionsHistory/components/DepositAndWithdrawlFilters.js +++ b/web/src/containers/TransactionsHistory/components/DepositAndWithdrawlFilters.js @@ -13,7 +13,7 @@ const STATUS_OPTIONS = { }, rejected: { name: STRINGS['TRANSACTION_STATUS.REJECTED'], - value: 'rejected', + value: 'dismissed', }, completed: { name: STRINGS['TRANSACTION_STATUS.COMPLETED'], diff --git a/web/src/index.css b/web/src/index.css index e5b676768f..adbb59b2b3 100644 --- a/web/src/index.css +++ b/web/src/index.css @@ -358,8 +358,8 @@ table th { height: auto; flex: 1; } .app_container.layout-mobile .app_container-content { - min-height: calc( 100vh - 10rem); - max-height: calc( 100vh - 10rem); + min-height: calc( 100vh - 10rem); + max-height: calc( 100vh - 10rem); max-width: 100vw; overflow-y: scroll; } .app_container.layout-mobile .app_container-content.no_bottom_navigation { @@ -372,8 +372,8 @@ table th { .app_container.layout-mobile .app_container-content .app_container-main.no_bottom_navigation { height: 100%; } .app_container.layout-mobile .content-with-bar { - min-height: calc( 100vh - 17rem); - max-height: calc( 100vh - 17rem); + min-height: calc( 100vh - 17rem); + max-height: calc( 100vh - 17rem); max-width: 100vw; padding: 1rem; margin: 0; @@ -2741,8 +2741,8 @@ table th { .layout-mobile .quote-container { background-color: transparent; overflow-y: scroll; - min-height: calc( 100vh - 17rem); - max-height: calc( 100vh - 17rem); } + min-height: calc( 100vh - 17rem); + max-height: calc( 100vh - 17rem); } .layout-mobile .quote-container .quick_trade-wrapper { flex: 1 1; min-width: 95vw !important; @@ -2893,7 +2893,7 @@ table th { .layout-mobile .presentation_container.verification_container { padding-top: 0 !important; - max-height: calc( 100vh - 10rem); } + max-height: calc( 100vh - 10rem); } .layout-mobile .presentation_container.verification_container .header-content { font-size: 13px !important; } @@ -4580,10 +4580,13 @@ table th { transform-origin: 0 0; -webkit-transform-origin: 0 0; } } -.confirm-change-pwd-wrapper .auth-wrapper .mdc-button--raised:not(:disabled):not(.mdc-ripple-upgraded), -.confirm-change-pwd-wrapper .auth-wrapper .mdc-button--unelevated:not(:disabled):not(.mdc-ripple-upgraded) { +.confirm-change-pwd-wrapper .auth_wrapper .mdc-button--raised:not(:disabled):not(.mdc-ripple-upgraded), +.confirm-change-pwd-wrapper .auth_wrapper .mdc-button--unelevated:not(:disabled):not(.mdc-ripple-upgraded) { margin-top: 2rem !important; } +.confirm-change-pwd-wrapper .auth_wrapper .button-margin { + margin-top: 3rem !important; } + .stake-details .currency-ball { width: 30px; padding-top: 4px; } @@ -7362,14 +7365,14 @@ table th { right: 0 !important; min-width: 100vw; max-width: 100vw; - min-height: calc( 100vh - 4rem); - max-height: calc( 100vh - 4rem); + min-height: calc( 100vh - 4rem); + max-height: calc( 100vh - 4rem); border-radius: 0 !important; padding: 0 !important; } .layout-mobile .ReactModal__Content .dialog-mobile-content { padding: 2.5rem !important; - min-height: calc( 100vh - 8rem); - max-height: calc( 100vh - 8rem); + min-height: calc( 100vh - 8rem); + max-height: calc( 100vh - 8rem); display: flex; } .layout-mobile.LogoutModal .ReactModal__Content { @@ -8576,11 +8579,14 @@ foreignObject { border-radius: 4px; border: var(--labels_secondary-inactive-label-text-graphics) solid 1.5px; } .input-group__container .ant-select-selection, - .input-group__container .ant-input, .input-group__container .ant-select-selector { text-align: right; background-color: var(--base_wallet-sidebar-and-popup) !important; color: var(--labels_secondary-inactive-label-text-graphics) !important; } + .input-group__container .ant-input { + text-align: right; + background-color: var(--base_wallet-sidebar-and-popup) !important; + color: var(--labels_secondary-inactive-label-text-graphics) !important; } .input-group__container .ant-select-arrow svg { fill: var(--labels_secondary-inactive-label-text-graphics) !important; } .input-group__container .input-group__coin-icons-wrap { @@ -8593,6 +8599,8 @@ foreignObject { height: 20px; } .input-group__container:focus-within { border-color: var(--specials_buttons-links-and-highlights) !important; } + .input-group__container:focus-within .ant-input { + color: var(--labels_important-active-labels-text-graphics) !important; } .input-group__container .input-group__select:hover { color: var(--labels_important-active-labels-text-graphics) !important; } .input-group__container .input-group__select:hover .ant-select-selection, @@ -8878,8 +8886,6 @@ foreignObject { .quick_trade-wrapper .trade-section .inner-content .py-2 .ant-input-group .ant-select-selector, .quick_trade-wrapper .trade-section .inner-content .py-2 .ant-input-group .input-group__input { background-color: var(--base_secondary-navigation-bar) !important; } - .quick_trade-wrapper .trade-section .inner-content div:nth-child(4) .input-group__container .input-group__input { - color: var(--labels_important-active-labels-text-graphics) !important; } .quick_trade-wrapper .trade-section .inner-content .small-text { font-family: "Open Sans"; font-size: 11px;