From 5aacb0d69fe520aa535f8d72977da379120a415a Mon Sep 17 00:00:00 2001 From: Henry Hein Date: Wed, 3 Jan 2024 11:30:44 +0800 Subject: [PATCH] fix: remove remainder of the files --- src/images/common/logos/xxhdpi.png | Bin 0 -> 9230 bytes .../_common/__tests__/tests_common.js | 2 +- .../_common/__tests__/third_party_links.js | 41 - src/javascript/_common/image_slider.js | 64 - src/javascript/_common/image_utility.js | 53 - .../app/common/__tests__/account_opening.js | 23 - .../app/common/content_visibility.js | 56 +- .../app/common/verification_code.js | 24 - src/javascript/app/common/verify_email.js | 26 - .../user/account/__tests__/iphistory.data.js | 105 -- .../user/account/__tests__/profit_table.js | 40 - .../pages/user/account/__tests__/statement.js | 42 - .../app/pages/user/account/change_password.js | 53 - .../user/account/onfido_phrases/index.js | 347 ------ .../payment_agent_transfer.js | 155 --- .../payment_agent_transfer.ui.js | 86 -- .../account/profit_table/profit_table.init.js | 146 --- .../user/account/profit_table/profit_table.js | 33 - .../account/profit_table/profit_table.ui.js | 129 -- .../app/pages/user/account/settings.js | 59 - .../user/account/settings/account_closure.js | 487 -------- .../pages/user/account/settings/api_token.js | 165 --- .../user/account/settings/authorised_apps.js | 153 --- .../settings/iphistory/iphistory.data.js | 46 - .../settings/iphistory/iphistory.init.js | 34 - .../account/settings/iphistory/iphistory.js | 18 - .../settings/iphistory/iphistory.ui.js | 62 - .../account/settings/limits/limits.init.js | 108 -- .../user/account/settings/limits/limits.js | 29 - .../user/account/settings/limits/limits.ui.js | 92 -- .../account/settings/professional_client.js | 140 +++ .../user/account/statement/statement.init.js | 271 ---- .../pages/user/account/statement/statement.js | 58 - .../user/account/statement/statement.ui.js | 121 -- src/javascript/app/pages/user/accounts.js | 283 ----- .../user/metatrader/metatrader.config.js | 624 ---------- .../app/pages/user/metatrader/metatrader.js | 481 -------- .../pages/user/metatrader/metatrader.ui.js | 1093 ----------------- .../user/metatrader/types_of_accounts.js | 32 - src/javascript/app/pages/user/tnc_approval.js | 71 -- src/sass/_common/base/language_base.scss | 9 - src/sass/_common/base/mixin.scss | 23 - src/sass/_common/components.scss | 124 -- src/sass/_common/table.scss | 49 - src/sass/app/websocket_pages.scss | 125 -- src/sass/static/pages.scss | 869 ------------- .../_common/components/forms_common_rows.jsx | 290 ----- .../_common/components/image_slider.jsx | 30 - .../_common/components/mt5_banner.jsx | 14 - .../_common/components/payment_logo.jsx | 37 - .../_common/includes/form_verify_email.jsx | 34 - .../app/_includes/authenticate_message.jsx | 231 ---- .../app/_includes/financial_form.jsx | 155 --- .../app/_includes/form_verification_code.jsx | 17 - .../app/_includes/pep_declaration.jsx | 23 - src/templates/app/user/accounts.jsx | 71 -- src/templates/app/user/metatrader.jsx | 530 -------- src/templates/app/user/profit_table.jsx | 20 - src/templates/app/user/settings.jsx | 39 - src/templates/app/user/statement.jsx | 78 -- src/templates/app/user/tnc_approval.jsx | 30 - .../app/user/top_up_virtual/pop_up.jsx | 28 - .../user/top_up_virtual/top_up_virtual.jsx | 25 - 63 files changed, 157 insertions(+), 8546 deletions(-) create mode 100644 src/images/common/logos/xxhdpi.png delete mode 100644 src/javascript/_common/__tests__/third_party_links.js delete mode 100644 src/javascript/_common/image_slider.js delete mode 100644 src/javascript/_common/image_utility.js delete mode 100644 src/javascript/app/common/__tests__/account_opening.js delete mode 100644 src/javascript/app/common/verification_code.js delete mode 100644 src/javascript/app/common/verify_email.js delete mode 100644 src/javascript/app/pages/user/account/__tests__/iphistory.data.js delete mode 100644 src/javascript/app/pages/user/account/__tests__/profit_table.js delete mode 100644 src/javascript/app/pages/user/account/__tests__/statement.js delete mode 100644 src/javascript/app/pages/user/account/change_password.js delete mode 100644 src/javascript/app/pages/user/account/onfido_phrases/index.js delete mode 100644 src/javascript/app/pages/user/account/payment_agent_transfer/payment_agent_transfer.js delete mode 100644 src/javascript/app/pages/user/account/payment_agent_transfer/payment_agent_transfer.ui.js delete mode 100644 src/javascript/app/pages/user/account/profit_table/profit_table.init.js delete mode 100644 src/javascript/app/pages/user/account/profit_table/profit_table.js delete mode 100644 src/javascript/app/pages/user/account/profit_table/profit_table.ui.js delete mode 100644 src/javascript/app/pages/user/account/settings.js delete mode 100644 src/javascript/app/pages/user/account/settings/account_closure.js delete mode 100644 src/javascript/app/pages/user/account/settings/api_token.js delete mode 100644 src/javascript/app/pages/user/account/settings/authorised_apps.js delete mode 100644 src/javascript/app/pages/user/account/settings/iphistory/iphistory.data.js delete mode 100644 src/javascript/app/pages/user/account/settings/iphistory/iphistory.init.js delete mode 100644 src/javascript/app/pages/user/account/settings/iphistory/iphistory.js delete mode 100644 src/javascript/app/pages/user/account/settings/iphistory/iphistory.ui.js delete mode 100644 src/javascript/app/pages/user/account/settings/limits/limits.init.js delete mode 100644 src/javascript/app/pages/user/account/settings/limits/limits.js delete mode 100644 src/javascript/app/pages/user/account/settings/limits/limits.ui.js create mode 100644 src/javascript/app/pages/user/account/settings/professional_client.js delete mode 100644 src/javascript/app/pages/user/account/statement/statement.init.js delete mode 100644 src/javascript/app/pages/user/account/statement/statement.js delete mode 100644 src/javascript/app/pages/user/account/statement/statement.ui.js delete mode 100644 src/javascript/app/pages/user/accounts.js delete mode 100644 src/javascript/app/pages/user/metatrader/metatrader.config.js delete mode 100644 src/javascript/app/pages/user/metatrader/metatrader.js delete mode 100644 src/javascript/app/pages/user/metatrader/metatrader.ui.js delete mode 100644 src/javascript/app/pages/user/metatrader/types_of_accounts.js delete mode 100644 src/javascript/app/pages/user/tnc_approval.js delete mode 100644 src/templates/_common/components/forms_common_rows.jsx delete mode 100644 src/templates/_common/components/image_slider.jsx delete mode 100644 src/templates/_common/components/mt5_banner.jsx delete mode 100644 src/templates/_common/components/payment_logo.jsx delete mode 100644 src/templates/_common/includes/form_verify_email.jsx delete mode 100644 src/templates/app/_includes/authenticate_message.jsx delete mode 100644 src/templates/app/_includes/financial_form.jsx delete mode 100644 src/templates/app/_includes/form_verification_code.jsx delete mode 100644 src/templates/app/_includes/pep_declaration.jsx delete mode 100644 src/templates/app/user/accounts.jsx delete mode 100644 src/templates/app/user/metatrader.jsx delete mode 100644 src/templates/app/user/profit_table.jsx delete mode 100644 src/templates/app/user/settings.jsx delete mode 100644 src/templates/app/user/statement.jsx delete mode 100644 src/templates/app/user/tnc_approval.jsx delete mode 100644 src/templates/app/user/top_up_virtual/pop_up.jsx delete mode 100644 src/templates/app/user/top_up_virtual/top_up_virtual.jsx diff --git a/src/images/common/logos/xxhdpi.png b/src/images/common/logos/xxhdpi.png new file mode 100644 index 0000000000000000000000000000000000000000..3f7d1786a5d800e3abf949b3d2a34fd72582e405 GIT binary patch literal 9230 zcmV+pB=OscP)PyD$Vo&&RCodHT?d@iL=&HTcl07)0i_pFs!|2%3IftQ2na~;y$c9P7mz9-C`vB^ z()mzOnn)8HO79k=9&ofP-~MxK*yJU7NiKQ!4&MBJciU$t^Cp`uGqWMYpibjn{X;`M zV-dFl_aZ4rNUa9l2OK|sevBOiVw=#=#2I&r8Fu3yUk$5QEki%;TT1!z<}|FTi|F^C zzLFZQ-?Wno6>m(xA2}(ddA=HJm^uS#RL)nZ9<^vzgZlMusi=Z{UM?1dDSNOq@4vIVlB9w@| zU%GTvQJE+3gVe86kte0l>*q(V`lm(Sj41c*`g;qjMimV{ubv-x2FFm54=h_HE(58NqK8p9v3Z9UVkcbtF zC!`2K9{GBV)ypT*!p}$fsz#c>T7~k(XwUawNR8_>>_yF5#lC~0)T=QoURo6H+r5yA zmuf~`dyZ4QE-0(?cI^9=KVMGz?f2NB7x@57%mziLPG6+qqh`~AgTKdOc=%uOXhx*- zvK-knN=SH`V^bjFnZClt4Xb!nQ6L&Je5Rs;*sC~}4;kn^PAL$L9M(yJ2nitLf4s0& z+hIH^hYCb;?!(B;*|9^dI)C4R-{{`G`-*G@B9NavSyH*ej9JU%IFD4S){!=SJ)H`d zXu`9kP=N?J;$Vg}kmD~ZDq0F-qNAy5tu821fES`Ydw-THh>S)?!J-W$Uj6;gWd#DB zuq2SYkyhwMkya%$d5$28iHRY3ggo-cDKj0rT8B;MqC<+8Z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_pY+ZCzWc4J;Qd6?z>AduCoar`*C82Wwqt2a( zt90*9IC(_OSFl4aBnt?dO|#*Opwx2;v^}9!j#Z|^*GWGp}BwW z789In>?AiD-S{5MQk0eNu_op(oI;CDIuMiBMOb&#E+zAa!+>Hwk zXM&di@dAVybCk|aF_F!g=6B^7iq6P{DjkzZcbxl(9S7s_#sQ|1a+iH}u7;53B0GKF kLLp%bE}q(TOpl=d1La&xj!FQqUH||907*qoM6N<$f?JX4>Hq)$ literal 0 HcmV?d00001 diff --git a/src/javascript/_common/__tests__/tests_common.js b/src/javascript/_common/__tests__/tests_common.js index cdc1aa6dc77..1688ba78f4e 100644 --- a/src/javascript/_common/__tests__/tests_common.js +++ b/src/javascript/_common/__tests__/tests_common.js @@ -18,4 +18,4 @@ module.exports = { setURL, getApiToken: () => 'hhh9bfrbq0G3dRf', api : new LiveApi({ websocket, appId: 1 }), -}; +}; diff --git a/src/javascript/_common/__tests__/third_party_links.js b/src/javascript/_common/__tests__/third_party_links.js deleted file mode 100644 index 19ca544ef50..00000000000 --- a/src/javascript/_common/__tests__/third_party_links.js +++ /dev/null @@ -1,41 +0,0 @@ -const { expect, setURL } = require('./tests_common'); -const AccountOpening = require('../third_party_links'); - -describe('ThirdPartyLinks', () => { - [ - 'https://www.binary.com', - 'https://www.binary.me', - 'https://www.deriv.com', - ].forEach(url => { - describe(url, () => { - runTests(url); - }); - }); -}); - -function runTests(url) { - describe('.isThirdPartyLink()', () => { - let domain; - before(() => { - setURL(url); - domain = url.replace(/^https:\/\/www\./, ''); - }); - - it(`works for ${domain}`, () => { - expect(AccountOpening.isThirdPartyLink(url)).to.equal(false); - }); - it(`works for ${domain} subdomains`, () => { - expect(AccountOpening.isThirdPartyLink(`https://www.style.${domain}`)).to.equal(false); - expect(AccountOpening.isThirdPartyLink(`https://login.${domain}/signup.php?lang=0`)).to.equal(false); - }); - it('works for special values', () => { - expect(AccountOpening.isThirdPartyLink('javascript:;')).to.equal(false); - expect(AccountOpening.isThirdPartyLink('#')).to.equal(false); - expect(AccountOpening.isThirdPartyLink(`mailto:affiliates@${domain}`)).to.equal(false); - }); - it('works for third party domains', () => { - expect(AccountOpening.isThirdPartyLink('https://www.authorisation.mga.org.mt/verification.aspx?lang=EN&company=a5fd1edc-d072-4c26-b0cd-ab3fa0f0cc40&details=1')).to.equal(true); - expect(AccountOpening.isThirdPartyLink('https://twitter.com/Binarydotcom')).to.equal(true); - }); - }); -} diff --git a/src/javascript/_common/image_slider.js b/src/javascript/_common/image_slider.js deleted file mode 100644 index b3e568fd751..00000000000 --- a/src/javascript/_common/image_slider.js +++ /dev/null @@ -1,64 +0,0 @@ -const getElementById = require('./common_functions').getElementById; -const applyToAllElements = require('./utility').applyToAllElements; - -const ImageSlider = (() => { - let slider, - slider_els, - go_back, - go_next, - curr_slide; - - const init = () => { - slider = getElementById('image_slider'); - - if (slider) { - go_back = getElementById('go_back'); - go_next = getElementById('go_next'); - slider_els = document.querySelectorAll('#slider_wrapper .slider-image'); - curr_slide = 0; - - if (slider_els && slider_els.length) { - slider_els[curr_slide].classList.remove('invisible'); - slider.classList.remove('invisible'); - } - - if (go_back && go_next) { - go_back.addEventListener('click', goLeft); - go_next.addEventListener('click', goRight); - } - } - }; - - const hideAll = (el) => { - applyToAllElements(el, (element) => { - element.classList.add('invisible'); - }); - }; - - const goLeft = () => { - curr_slide = curr_slide === 0 ? slider_els.length - 1 : curr_slide - 1; - hideAll(slider_els); - slider_els[curr_slide].classList.remove('invisible'); - - }; - - const goRight = () => { - curr_slide = curr_slide === slider_els.length - 1 ? 0 : curr_slide + 1; - hideAll(slider_els); - slider_els[curr_slide].classList.remove('invisible'); - }; - - const onUnMount = () => { - if (go_back && go_next) { - go_back.removeEventListener('click', goLeft); - go_back.removeEventListener('click', goRight); - } - }; - - return { - init, - onUnMount, - }; -})(); - -module.exports = ImageSlider; diff --git a/src/javascript/_common/image_utility.js b/src/javascript/_common/image_utility.js deleted file mode 100644 index a55d226d177..00000000000 --- a/src/javascript/_common/image_utility.js +++ /dev/null @@ -1,53 +0,0 @@ -require('canvas-toBlob'); - -const compressImg = (image) => new Promise((resolve) => { - const img = new Image(); - img.src = image.src; - img.onload = () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('2d'); - if (img.naturalWidth > 2560) { - const width = 2560; - const scaleFactor = width / img.naturalWidth; - canvas.width = width; - canvas.height = img.naturalHeight * scaleFactor; - } else { - canvas.height = img.naturalHeight; - canvas.width = img.naturalWidth; - } - - context.fillStyle = 'transparent'; - context.fillRect(0, 0, canvas.width, canvas.height); - - context.save(); - context.drawImage(img, 0, 0, canvas.width, canvas.height); - - canvas.toBlob((blob) => { - const filename = image.filename.replace(/\.[^/.]+$/, '.jpg'); - const file = new Blob([blob], { - type: 'image/jpeg', - }); - file.lastModifiedDate = Date.now(); - file.name = filename; - resolve(file); - }, 'image/jpeg', 0.9); // <----- set quality here - - }; -}); - -const convertToBase64 = (file) => new Promise((resolve) => { - const reader = new FileReader(); - reader.readAsDataURL(file); - reader.onloadend = () => { - const result = { src: reader.result, filename: file.name }; - resolve(result); - }; -}); - -const isImageType = filename => (/\.(gif|jpg|jpeg|tiff|png)$/i).test(filename); - -module.exports = { - compressImg, - convertToBase64, - isImageType, -}; diff --git a/src/javascript/app/common/__tests__/account_opening.js b/src/javascript/app/common/__tests__/account_opening.js deleted file mode 100644 index cfe4cf506b7..00000000000 --- a/src/javascript/app/common/__tests__/account_opening.js +++ /dev/null @@ -1,23 +0,0 @@ -const AccountOpening = require('../account_opening'); -const { expect, setURL } = require('../../../_common/__tests__/tests_common'); -const State = require('../../../_common/storage').State; -const Url = require('../../../_common/url'); -global.$ = require('jquery'); - - -describe('AccountOpening', () => { - describe('.redirectAccount()', () => { - it('will redirect client who can upgrade to maltainvest to the corresponding account opening page', () => { - State.set(['response', 'authorize', 'authorize', 'upgradeable_landing_companies'], ['maltainvest']); - expect(AccountOpening.redirectAccount()).to.eq(1); - }); - it('will not redirect client who is already on maltainvest account opening page again', () => { - setURL(`${Url.websiteUrl()}en/maltainvestws.html`); - expect(AccountOpening.redirectAccount()).to.eq(0); - }); - it('will redirect client who cannot upgrade their account to the previous page', () => { - State.set(['response', 'authorize', 'authorize', 'upgradeable_landing_companies'], []); - expect(AccountOpening.redirectAccount()).to.eq(-1); - }); - }); -}); diff --git a/src/javascript/app/common/content_visibility.js b/src/javascript/app/common/content_visibility.js index 5bb5a43c973..c22a598d6f8 100644 --- a/src/javascript/app/common/content_visibility.js +++ b/src/javascript/app/common/content_visibility.js @@ -1,8 +1,6 @@ const Client = require('../base/client'); const BinarySocket = require('../base/socket'); -const MetaTrader = require('../pages/user/metatrader/metatrader'); const State = require('../../_common/storage').State; -const updateTabDisplay = require('../../_common/tab_selector').updateTabDisplay; /* data-show attribute controls element visibility based on @@ -44,7 +42,6 @@ const updateTabDisplay = require('../../_common/tab_selector').updateTabDisplay; data-show='SVG' -> throws error */ -const visible_classname = 'data-show-visible'; const mt_company_rule = 'mtcompany'; const eu_country_rule = 'eucountry'; const options_blocked_rule = 'optionsblocked'; @@ -52,33 +49,31 @@ const options_blocked_rule = 'optionsblocked'; const ContentVisibility = (() => { let $center_select_m; - const init = () => { - let arr_mt5fin_shortcodes; - - return new Promise(resolve => { + const init = () => + new Promise(resolve => { BinarySocket.wait('authorize', 'landing_company', 'website_status').then(() => { - const current_landing_company_shortcode = State.getResponse('authorize.landing_company_name') || 'default'; - const mt_financial_company = State.getResponse('landing_company.mt_financial_company'); - const mt_gaming_company = State.getResponse('landing_company.mt_gaming_company'); + // const current_landing_company_shortcode = State.getResponse('authorize.landing_company_name') || 'default'; + // const mt_financial_company = State.getResponse('landing_company.mt_financial_company'); + // const mt_gaming_company = State.getResponse('landing_company.mt_gaming_company'); // Check if mt_financial_company is offered, if not found, switch to mt_gaming_company - const mt_landing_company = mt_financial_company || mt_gaming_company; + // const mt_landing_company = mt_financial_company || mt_gaming_company; // Check mt_financial_company by account type, since we are offering different landing companies for financial and financial_stp - arr_mt5fin_shortcodes = mt_landing_company ? Object.keys(mt_landing_company) - .map((key) => mt_landing_company[key].shortcode) : []; + // arr_mt5fin_shortcodes = mt_landing_company ? Object.keys(mt_landing_company) + // .map((key) => mt_landing_company[key].shortcode) : []; - controlVisibility( - current_landing_company_shortcode, - MetaTrader.isEligible(), - // We then pass the list of found mt5fin company shortcodes as an array - arr_mt5fin_shortcodes - ); + // controlVisibility( + // current_landing_company_shortcode, + // MetaTrader.isEligible(), + // // We then pass the list of found mt5fin company shortcodes as an array + // arr_mt5fin_shortcodes + // ); resolve(); }); - }); - }; + }) + ; const generateParsingErrorMessage = (reason, attr_str) => ( `Invalid data-show attribute value! ${reason} Given value: '${attr_str}'.` @@ -173,25 +168,6 @@ const ContentVisibility = (() => { return show_element; }; - const controlVisibility = (current_landing_company_shortcode, client_has_mt_company, mt5_login_list) => { - document.querySelectorAll('[data-show]').forEach(el => { - const attr_str = el.dataset.show; - if (shouldShowElement(attr_str, current_landing_company_shortcode, client_has_mt_company, mt5_login_list)) { - el.classList.add(visible_classname); - } else { - const open_tab_url = new RegExp(`\\?.+_tabs=${el.id}`, 'i'); - // check if we hide a tab that's open - // then redirect to the url without query - if (el.classList.contains('tm-li') && open_tab_url.test(window.location.href)) { - const { origin, pathname } = window.location; - window.location.href = origin + pathname; - } - } - }); - - updateTabDisplay(); - }; - // if text is hidden, we need to append it to body to be able to get its width const getTextWidth = (text) => { const $el = $('', { text }); diff --git a/src/javascript/app/common/verification_code.js b/src/javascript/app/common/verification_code.js deleted file mode 100644 index f00a398f87b..00000000000 --- a/src/javascript/app/common/verification_code.js +++ /dev/null @@ -1,24 +0,0 @@ -const FormManager = require('./form_manager'); - -const handleVerifyCode = (onSubmit, hide_wrapper = true) => { - const $wrapper = $('#verification_code_wrapper'); - $wrapper.setVisibility(1); - const verify_form_id = '#frm_verify'; - const verification_code = '#txt_verification_code'; - FormManager.init(verify_form_id, [ - { selector: verification_code, validations: [['req', { hide_asterisk: true }], 'token'], exclude_request: 1 }, - ]); - FormManager.handleSubmit({ - form_selector : verify_form_id, - fnc_response_handler: () => { - $wrapper.setVisibility(!hide_wrapper); - if (typeof onSubmit === 'function') { - onSubmit($(verification_code).val()); - } - }, - }); -}; - -module.exports = { - handleVerifyCode, -}; diff --git a/src/javascript/app/common/verify_email.js b/src/javascript/app/common/verify_email.js deleted file mode 100644 index 2d084acf992..00000000000 --- a/src/javascript/app/common/verify_email.js +++ /dev/null @@ -1,26 +0,0 @@ -const Cookies = require('js-cookie'); -const TrafficSource = require('../../app/common/traffic_source'); - -/* Contains helper function related to the verify_email API call */ -const getFormRequest = () => { - const utm_data = TrafficSource.getData(); - const affiliate_token = Cookies.getJSON('affiliate_tracking'); - - return [ - { selector: '#email', validations: ['req', 'email'], request_field: 'verify_email' }, - { request_field: 'type', value: 'account_opening' }, - { - request_field: 'url_parameters', - value : { - utm_source: TrafficSource.getSource(utm_data), - ...(utm_data.utm_campaign && { - utm_medium : utm_data.utm_medium, - utm_campaign: utm_data.utm_campaign, - }), - ...(affiliate_token && { affiliate_token: affiliate_token.t }), - }, - }, - ]; -}; - -module.exports = getFormRequest; diff --git a/src/javascript/app/pages/user/account/__tests__/iphistory.data.js b/src/javascript/app/pages/user/account/__tests__/iphistory.data.js deleted file mode 100644 index c9a1fe56d5a..00000000000 --- a/src/javascript/app/pages/user/account/__tests__/iphistory.data.js +++ /dev/null @@ -1,105 +0,0 @@ -const expect = require('chai').expect; -const IPHistoryData = require('../settings/iphistory/iphistory.data'); - -describe('IPHistoryData', () => { - describe('.parseUserAgent()', () => { - // TODO: add more user agent test strings - const parse = IPHistoryData.parseUserAgent; - const common = [ - { - ua : 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:48.0) Gecko/20100101 Firefox/48.0', - name : 'Firefox', - version: '48.0', - }, - { - ua : 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/601.6.17 (KHTML, like Gecko) Version/9.1.1 Safari/601.6.17', - name : 'Safari', - version: '9.1.1', - }, - { - ua : 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36', - name : 'Chrome', - version: '51.0.2704.106', - }, - { - ua : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246', - name : 'Edge', - version: '12.246', - }, - { - // the new edge doesn't have e at the end - ua : 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36 Edg/80.0.361.69', - name : 'Edge', - version: '80.0.361.69', - }, - { - ua : 'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; AS; rv:11.0) like Gecko', - name : 'IE', - version: '11.0', - }, - { - ua : 'Mozilla/5.0 (compatible, MSIE 11, Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko', - name : 'IE', - version: '11', - }, - { - ua : 'Opera/9.80 (X11; Linux i686; Ubuntu/14.10) Presto/2.12.388 Version/12.16', - name : 'Opera', - version: '9.80', - }, - { - ua : 'Mozilla/5.0 (Windows NT 5.2; RW; rv:7.0a1) Gecko/20091211 SeaMonkey/9.23a1pre', - name : 'SeaMonkey', - version: '9.23a1pre', - }, - ]; - - common.forEach((entry) => { - it(`works for ${entry.name}`, () => { - const browser = IPHistoryData.parseUserAgent(entry.ua); - expect(browser.name).to.equal(entry.name); - expect(browser.version).to.equal(entry.version); - }); - }); - - it('returns null when userAgent is not parsable', () => { - const ua = '--unparsable--'; - expect(parse(ua)).to.equal(null); - }); - }); - - describe('.parse()', () => { - const parse = IPHistoryData.parse; - - it('parses activity objects correctly', () => { - const activity = { - environment: '12-Jul-16 06:38:09GMT IP=211.24.127.133 IP_COUNTRY=MY User_AGENT=Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:48.0) Gecko/20100101 Firefox/48.0 LANG=EN', - time : 1468305490, - status : 1, - action : 'login', - }; - const res = parse(activity); - expect(res).to.deep.equal({ - time : 1468305490, - success: true, - action : 'login', - ip_addr: '211.24.127.133', - browser: { - name : 'Firefox', - version: '48.0', - }, - }); - }); - - it('returns correct .success attribute', () => { - const activity = { - environment: '13-Jul-16 05:13:29GMT IP=211.24.127.133 IP_COUNTRY=MY User_AGENT=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/601.6.17 (KHTML, like Gecko) Version/9.1.1 Safari/601.6.17 LANG=EN', - time : 1468386810, - status : 0, - action : 'login', - }; - const res = parse(activity); - expect(res.success).to.equal(false); - }); - }); -}); diff --git a/src/javascript/app/pages/user/account/__tests__/profit_table.js b/src/javascript/app/pages/user/account/__tests__/profit_table.js deleted file mode 100644 index 76e6495ae82..00000000000 --- a/src/javascript/app/pages/user/account/__tests__/profit_table.js +++ /dev/null @@ -1,40 +0,0 @@ -const profitTable = require('../profit_table/profit_table'); -const { api, expect, getApiToken } = require('../../../../../_common/__tests__/tests_common'); - -describe('Profit Table', () => { - let profit_table; - before(function (done) { - this.timeout(10000); - // this is a read token, even if other people take it, won't be able to do any harm - api.authorize(getApiToken()).then(() => { - api.getProfitTable({ limit: 1, description: 1, offset: 0 }).then((response) => { - profit_table = response.profit_table; - done(); - }); - }); - }); - it('Should have all expected data', () => { - if (profit_table.transactions.length) { - const profit_table_data = profitTable.getProfitTabletData(profit_table.transactions[0]); - expect(profit_table_data).to.be.an('Object') - .and.to.have.property('buyDate') - .and.to.be.a('string'); - expect(profit_table_data).to.have.property('ref') - .and.to.be.a('number'); - expect(profit_table_data).to.have.property('payout') - .and.to.be.a('string'); - expect(profit_table_data).to.have.property('buyPrice') - .and.to.be.a('string'); - expect(profit_table_data).to.have.property('sellDate') - .and.to.be.a('string'); - expect(profit_table_data).to.have.property('sellPrice') - .and.to.be.a('string'); - expect(profit_table_data).to.have.property('pl') - .and.to.be.a('string'); - expect(profit_table_data).to.have.property('desc') - .and.to.be.a('string'); - expect(profit_table_data).to.have.property('id') - .and.to.be.a('number'); - } - }); -}); diff --git a/src/javascript/app/pages/user/account/__tests__/statement.js b/src/javascript/app/pages/user/account/__tests__/statement.js deleted file mode 100644 index 4fa2a6c10d0..00000000000 --- a/src/javascript/app/pages/user/account/__tests__/statement.js +++ /dev/null @@ -1,42 +0,0 @@ -const statement = require('../statement/statement'); -const { api, expect, getApiToken } = require('../../../../../_common/__tests__/tests_common'); - -describe('Statement', () => { - let statement_ws; - before(function (done) { - this.timeout(10000); - // this is a read token, even if other people take it, won't be able to do any harm - api.authorize(getApiToken()).then(() => { - api.getStatement({ limit: 1, description: 1, offset: 0 }).then((response) => { - statement_ws = response.statement; - done(); - }); - }); - }); - it('Should have all expected data', () => { - if (statement_ws.transactions.length) { - const statement_data = statement.getStatementData(statement_ws.transactions[0]); - expect(statement_data).to.be.an('Object') - .and.to.have.property('date') - .and.to.be.a('string'); - expect(statement_data).to.have.property('ref') - .and.to.be.a('number'); - expect(statement_data).to.have.property('payout') - .and.to.be.a('string'); - expect(statement_data).to.have.property('localized_action') - .and.to.be.a('string'); - expect(statement_data).to.have.property('action_type') - .and.to.be.a('string'); - expect(statement_data).to.have.property('amount') - .and.to.be.a('string'); - expect(statement_data).to.have.property('balance') - .and.to.be.a('string'); - expect(statement_data).to.have.property('desc') - .and.to.be.a('string'); - if (/buy|sell/.test(statement_data.action_type)) { - expect(statement_data).to.have.property('id') - .and.to.be.a('number'); - } - } - }); -}); diff --git a/src/javascript/app/pages/user/account/change_password.js b/src/javascript/app/pages/user/account/change_password.js deleted file mode 100644 index 54c7064e117..00000000000 --- a/src/javascript/app/pages/user/account/change_password.js +++ /dev/null @@ -1,53 +0,0 @@ -const BinaryPjax = require('../../../base/binary_pjax'); -const Client = require('../../../base/client'); -const BinarySocket = require('../../../base/socket'); -const FormManager = require('../../../common/form_manager'); -const localize = require('../../../../_common/localize').localize; -const State = require('../../../../_common/storage').State; - -const ChangePassword = (() => { - const form_id = '#frm_change_password'; - - const init = () => { - FormManager.init(form_id, [ - { selector: '#old_password', validations: ['req', ['length', { min: 6, max: 25 }]], clear_form_error_on_input: true }, - { selector: '#new_password', validations: ['req', 'password', ['not_equal', { to: '#old_password', name1: localize('Current password'), name2: localize('New password') }], 'compare_to_email'] }, - - { request_field: 'change_password', value: 1 }, - ]); - FormManager.handleSubmit({ - form_selector : form_id, - fnc_response_handler: handler, - }); - }; - - const handler = (response) => { - if ('error' in response) { - $(`${form_id}_error`).text(response.error.message).setVisibility(1); - } else { - $(form_id).setVisibility(0); - $('#msg_success').setVisibility(1); - setTimeout(() => { - Client.sendLogoutRequest(true); - }, 5000); - } - }; - - const onLoad = () => { - BinarySocket.wait('get_account_status').then(() => { - const status = State.getResponse('get_account_status.status'); - if (!/social_signup/.test(status)) { - init(); - } else { - BinaryPjax.loadPreviousUrl(); - } - }); - }; - - return { - onLoad, - }; -})(); - -module.exports = ChangePassword; - diff --git a/src/javascript/app/pages/user/account/onfido_phrases/index.js b/src/javascript/app/pages/user/account/onfido_phrases/index.js deleted file mode 100644 index 80e2ae2d92b..00000000000 --- a/src/javascript/app/pages/user/account/onfido_phrases/index.js +++ /dev/null @@ -1,347 +0,0 @@ -const localize = require('../../../../../_common/localize').localize; - -module.exports = { - country_select: { - alert_dropdown: { - country_not_found: localize('Country not found'), - }, - alert: { - another_doc: - localize('Documents from that country are not currently supported — try another document type'), - }, - button_primary: localize('Submit document'), - search : { - accessibility : localize('Select country'), - input_placeholder: localize('e.g. United States'), - label : localize('Search for country'), - }, - title: localize('Select issuing country'), - }, - cross_device_checklist: { - button_primary : localize('Submit verification'), - info : localize('Tips'), - list_item_doc_multiple: localize('Documents uploaded'), - list_item_doc_one : localize('Document uploaded'), - list_item_selfie : localize('Selfie uploaded'), - subtitle : localize('We\'re now ready to verify your identity'), - title : localize('Great, that\'s everything we need'), - }, - cross_device_error_desktop: { - subtitle: localize('The link only works on mobile devices'), - title : localize('Something\'s gone wrong'), - }, - cross_device_error_restart: { - subtitle: localize('You\'ll need to restart your verification on your computer'), - title : localize('Something\'s gone wrong'), - }, - cross_device_intro: { - button_primary : localize('Get secure link'), - list_accessibility: - localize('Steps required to continue verification on your mobile'), - list_item_finish : localize('Check back here to finish the submission'), - list_item_open_link : localize('Open the link and complete the tasks'), - list_item_send_phone: localize('Send a secure link to your phone'), - subtitle : localize('Here\'s how to do it:'), - title : localize('Continue on your phone'), - }, - cross_device_return: { - body : localize('Your computer may take a few seconds to update'), - subtitle: localize('You can now return to your computer to continue'), - title : localize('Uploads successful'), - }, - doc_confirmation: { - alert: { - blur_detail : localize('Make sure everything is clear'), - blur_title : localize('Blurry photo detected'), - crop_detail : localize('Make sure full document is visible'), - crop_title : localize('Cut-off image detected'), - glare_detail : localize('Move away from direct light'), - glare_title : localize('Glare detected'), - no_doc_detail: localize('Make sure all of the document is in the photo'), - no_doc_title : localize('No document detected'), - }, - body_id: - localize('Make sure your card details are clear to read, with no blur or glare'), - body_image_medium: - localize('It’ll take longer to verify you if we can’t read it'), - body_image_poor: localize('To smoothly verify you, we need a better photo'), - body_license : - localize('Make sure your license details are clear to read, with no blur or glare'), - body_passport: - localize('Make sure your passport details are clear to read, with no blur or glare'), - body_permit: - localize('Make sure your permit details are clear to read, with no blur or glare'), - body_tax_letter: - localize('Make sure details are clear to read, with no blur or glare'), - button_close : localize('Close'), - button_primary_redo : localize('Redo'), - button_primary_upload : localize('Confirm'), - button_primary_upload_anyway: localize('Upload anyway'), - button_secondary_redo : localize('Redo'), - button_zoom : localize('Enlarge image'), - image_accessibility : localize('Photo of your document'), - title : localize('Check your image'), - }, - doc_select: { - button_id : localize('Identity card'), - button_id_detail : localize('Front and back'), - button_license : localize('Driver\'s license'), - button_license_detail : localize('Front and back'), - button_passport : localize('Passport'), - button_passport_detail: localize('Face photo page'), - button_permit : localize('Residence permit'), - button_permit_detail : localize('Front and back'), - extra_no_mobile : localize('Sorry, no mobile phone bills'), - list_accessibility : localize('Documents you can use to verify your identity'), - subtitle : localize('It must be an official photo ID'), - subtitle_poa : - localize('These are the documents most likely to show your current home address'), - title : localize('Choose document'), - title_poa: localize('Select a %{country} document'), - }, - doc_submit: { - button_link_upload : localize('or upload photo – no scans or photocopies'), - button_primary : localize('Continue on phone'), - subtitle : localize('Take a photo with your phone'), - title_id_back : localize('Submit identity card (back)'), - title_id_front : localize('Submit identity card (front)'), - title_license_back : localize('Submit license (back)'), - title_license_front: localize('Submit license (front)'), - title_passport : localize('Submit passport photo page'), - title_permit_back : localize('Submit residence permit (back)'), - title_permit_front : localize('Submit residence permit (front)'), - }, - error_unsupported_browser: { - subtitle_android: - localize('Restart the process on the latest version of Google Chrome'), - subtitle_ios : localize('Restart the process on the latest version of Safari'), - title_android: localize('Unsupported browser'), - title_ios : localize('Unsupported browser'), - }, - generic: { - accessibility: { - close_sdk_screen: localize('Close identity verification screen'), - dismiss_alert : localize('Dismiss alert'), - }, - back : localize('back'), - close : localize('close'), - errors: { - interrupted_flow_error: { - instruction: localize('Restart process on a different device'), - message : localize('Camera not detected'), - }, - invalid_size: { - instruction: localize('Must be under 10MB.'), - message : localize('File size exceeded.'), - }, - invalid_type: { - instruction: localize('Try using another file type.'), - message : localize('File not uploaded.'), - }, - lazy_loading: { - message: localize('An error occurred while loading the component'), - }, - multiple_faces: { - instruction: localize('Only your face can be in the selfie'), - message : localize('Multiple faces found'), - }, - no_face: { - instruction: localize('Your face is needed in the selfie'), - message : localize('No face found'), - }, - request_error: { - instruction: localize('Please try again'), - message : localize('Connection lost'), - }, - sms_failed: { - instruction: localize('Copy the link to your phone'), - message : localize('Something\'s gone wrong'), - }, - sms_overuse: { - instruction: localize('Copy the link to your phone'), - message : localize('Too many failed attempts'), - }, - unsupported_file: { - instruction: localize('Try using a JPG or PNG file'), - message : localize('File type not supported'), - }, - }, - lazy_load_placeholder: localize('Loading...'), - loading : localize('Loading'), - }, - get_link: { - alert_wrong_number : localize('Check that your number is correct'), - button_copied : localize('Copied'), - button_copy : localize('Copy'), - button_submit : localize('Send link'), - info_qr_how : localize('How to scan a QR code'), - info_qr_how_list_item_camera: - localize('Point your phone’s camera at the QR code'), - info_qr_how_list_item_download: - localize('If it doesn’t work, download a QR code scanner from Google Play or the App Store'), - link_divider : localize('or'), - link_qr : localize('Scan QR code'), - link_sms : localize('Get link via SMS'), - link_url : localize('Copy link'), - loader_sending : localize('Sending'), - number_field_input_placeholder: localize('Enter mobile number'), - number_field_label : localize('Enter your mobile number:'), - subtitle_qr : localize('Scan the QR code with your phone'), - subtitle_sms : localize('Send this one-time link to your phone'), - subtitle_url : localize('Open the link on your mobile'), - title : localize('Get your secure link'), - url_field_label : localize('Copy the link to your mobile browser'), - }, - linked_computer: { - button_primary : localize('Continue'), - info : localize('Make sure§'), - list_item_desktop_open: localize('2. Your desktop window stays open'), - list_item_sent_by_you : localize('1. This link was sent by you'), - subtitle : localize('Continue with the verification'), - title : localize('Linked to your computer'), - }, - mobilePhrases: { - photo_upload: { - body_id_back : localize('Take a photo of the back of your card'), - body_id_front : localize('Take a photo of the front of your card'), - body_license_back : localize('Take a photo of the back of your license'), - body_license_front: localize('Take a photo of the front of your license'), - body_passport : localize('Take a photo of your passport photo page'), - body_selfie : localize('Take a selfie showing your face'), - }, - selfie_capture: { - alert: { - camera_inactive: { - detail: - localize('Take a photo using the basic camera mode instead'), - }, - camera_not_working: { - detail: - localize('Take a photo using the basic camera mode instead'), - }, - }, - }, - upload_guide: { - button_primary: localize('Take a photo'), - title : localize('Passport photo page'), - }, - }, - outro: { - body : localize('Thank you'), - title: localize('Verification complete'), - }, - permission_recovery: { - button_primary : localize('Refresh'), - info : localize('Recovery'), - list_header_cam : localize('Follow these steps to recover camera access:'), - list_item_action_cam: - localize('Refresh this page to restart the identity verification process'), - list_item_how_to_cam: - localize('Grant access to your camera from your browser settings'), - subtitle_cam: localize('Recover camera access to continue face verification'), - title_cam : localize('Camera access is denied'), - }, - permission: { - body_cam : localize('We cannot verify you without using your camera'), - button_primary_cam: localize('Enable camera'), - subtitle_cam : - localize('When prompted, you must enable camera access to continue'), - title_cam: localize('Allow camera access'), - }, - photo_upload: { - body_bank_statement : localize('Provide the whole document page for best results'), - body_benefits_letter: - localize('Provide the whole document page for best results'), - body_bill : localize('Provide the whole document page for best results'), - body_government_letter: - localize('Provide the whole document page for best results'), - body_id_back : localize('Upload back of card from your computer'), - body_id_front : localize('Upload front of card from your computer'), - body_license_back : localize('Upload back of license from your computer'), - body_license_front: localize('Upload front of license from your computer'), - body_passport : localize('Upload passport photo page from your computer'), - body_selfie : localize('Upload a selfie from your computer'), - body_tax_letter : localize('Provide the whole document page for best results'), - button_take_photo : localize('Take photo'), - button_upload : localize('Upload'), - title_selfie : localize('Selfie'), - }, - selfie_capture: { - alert: { - camera_inactive: { - detail: - localize('Check that it is connected and functional. You can also continue verification on your phone'), - detail_no_fallback: - localize('Make sure your device has a working camera'), - title: localize('Camera not working?'), - }, - camera_not_working: { - detail: - localize('It may be disconnected. Try using your phone instead.'), - detail_no_fallback: localize('Make sure your device\'s camera works'), - title : localize('Camera not working'), - }, - timeout: { - detail: - localize('Remember to press stop when you\'re done. Redo video actions'), - title: localize('Looks like you took too long'), - }, - }, - button_accessibility: localize('Take a photo'), - frame_accessibility : localize('View from camera'), - title : localize('Take a selfie'), - }, - selfie_confirmation: { - image_accessibility: localize('Photo of your face'), - subtitle : localize('Make sure your selfie clearly shows your face'), - title : localize('Check selfie'), - }, - selfie_intro: { - button_primary : localize('Continue'), - list_accessibility : localize('Tips to take a good selfie'), - list_item_face_forward: - localize('Face forward and make sure your eyes are clearly visible'), - list_item_no_glasses: localize('Remove your glasses, if necessary'), - subtitle : localize('We\'ll compare it with your document'), - title : localize('Take a selfie'), - }, - sms_sent: { - info : localize('Tips'), - info_link_expire: localize('Your link will expire in one hour'), - info_link_window: localize('Keep this window open while using your mobile'), - link : localize('Resend link'), - subtitle : localize('We\'ve sent a secure link to %{number}'), - subtitle_minutes: localize('It may take a few minutes to arrive'), - title : localize('Check your mobile'), - }, - switch_phone: { - info : localize('Tips'), - info_link_expire : localize('Your mobile link will expire in one hour'), - info_link_refresh: localize('Don\'t refresh this page'), - info_link_window : localize('Keep this window open while using your mobile'), - link : localize('Cancel'), - subtitle : localize('Once you\'ve finished we\'ll take you to the next step'), - title : localize('Connected to your mobile'), - }, - upload_guide: { - button_primary : localize('Upload photo'), - image_detail_blur_alt : localize('Example of a blurry document'), - image_detail_blur_label : localize('All details must be clear — nothing blurry'), - image_detail_cutoff_alt : localize('Example of a cut-off document'), - image_detail_cutoff_label: - localize('Show all details — including the bottom 2 lines'), - image_detail_glare_alt : localize('Example of a document with glare'), - image_detail_glare_label: localize('Move away from direct light — no glare'), - image_detail_good_alt : localize('Document example'), - image_detail_good_label : localize('The photo should clearly show your document'), - subtitle : localize('Scans and photocopies are not accepted'), - title : localize('Upload passport photo page'), - }, - welcome: { - description_p_1: - localize('To open a bank account, we will need to verify your identity.'), - description_p_2: localize('It will only take a couple of minutes.'), - next_button : localize('Verify Identity'), - title : localize('Open your new bank account'), - }, -}; diff --git a/src/javascript/app/pages/user/account/payment_agent_transfer/payment_agent_transfer.js b/src/javascript/app/pages/user/account/payment_agent_transfer/payment_agent_transfer.js deleted file mode 100644 index 1706c10750b..00000000000 --- a/src/javascript/app/pages/user/account/payment_agent_transfer/payment_agent_transfer.js +++ /dev/null @@ -1,155 +0,0 @@ -const PaymentAgentTransferUI = require('./payment_agent_transfer.ui'); -const Client = require('../../../../base/client'); -const BinarySocket = require('../../../../base/socket'); -const getDecimalPlaces = require('../../../../common/currency').getDecimalPlaces; -const getNumberFormat = require('../../../../common/currency').getNumberFormat; -const FormManager = require('../../../../common/form_manager'); -const localize = require('../../../../../_common/localize').localize; -const State = require('../../../../../_common/storage').State; - -const PaymentAgentTransfer = (() => { - let is_authenticated_payment_agent, - common_request_fields, - $form_error; - - const onLoad = () => { - PaymentAgentTransferUI.initValues(); - BinarySocket.wait('get_settings', 'balance').then(() => { - const currency = Client.get('currency'); - const balance = Client.get('balance'); - if (!currency || +balance === 0) { - $('#pa_transfer_loading').remove(); - $('#no_balance_error').setVisibility(1); - return; - } - is_authenticated_payment_agent = State.getResponse('get_settings.is_authenticated_payment_agent'); - if (is_authenticated_payment_agent) { - BinarySocket.send({ - paymentagent_list: Client.get('residence'), - currency, - }).then((response) => { - const pa_values = response.paymentagent_list.list.filter( - (a) => a.paymentagent_loginid === Client.get('loginid') - )[0]; - init(pa_values, currency, balance); - }); - } else { - setFormVisibility(false); - } - }); - }; - - // Remove multiline and excess whitespaces from description text. - const trimDescriptionContent = () => { - document.getElementById('description').addEventListener('change', e => { - e.srcElement.value = e.target.value.replace(/\s+/g, ' '); - }); - }; - - const init = (pa, currency, balance) => { - const form_id = '#frm_paymentagent_transfer'; - $form_error = $('#form_error'); - - setFormVisibility(true); - PaymentAgentTransferUI.updateFormView(currency); - trimDescriptionContent(); - - common_request_fields = [ - { request_field: 'paymentagent_transfer', value: 1 }, - { request_field: 'currency', value: currency }, - ]; - - FormManager.init(form_id, [ - { selector: '#client_id', validations: ['req', ['regular', { regex: /^\w+\d+$/, message: localize('Please enter a valid Login ID.') }]], request_field: 'transfer_to' }, - { selector: '#amount', validations: ['req', ['number', { type: 'float', decimals: getDecimalPlaces(currency), min: pa ? pa.min_withdrawal : 10, max: max_withdrawal(balance, pa, 2000) }], ['custom', { func: () => +Client.get('balance') >= +$('#amount').val(), message: localize('Insufficient balance.') }]] }, - { selector: '#description', validations: ['general'] }, - - { request_field: 'dry_run', value: 1 }, - ].concat(common_request_fields)); - - FormManager.handleSubmit({ - form_selector : form_id, - fnc_response_handler: responseHandler, - enable_button : 1, - }); - }; - - const max_withdrawal = (balance, pa, fixed_max_withdrawal) => { - const pa_max_withdrawal = pa ? pa.max_withdrawal : fixed_max_withdrawal; - - return balance < pa_max_withdrawal ? balance : pa_max_withdrawal; - }; - - const setFormVisibility = (is_visible) => { - if (is_visible) { - $('#pa_transfer_loading').remove(); - PaymentAgentTransferUI.showForm(); - PaymentAgentTransferUI.showNotes(); - } else { - PaymentAgentTransferUI.hideForm(); - PaymentAgentTransferUI.hideNotes(); - if (!is_authenticated_payment_agent) { - $('#pa_transfer_loading').remove(); - $('#not_pa_error').setVisibility(1); - } - } - }; - - const responseHandler = (response) => { - const req = response.echo_req; - const error = response.error; - - if (error) { - if (req.dry_run === 1) { - $form_error.text(error.message).setVisibility(1); - return; - } - PaymentAgentTransferUI.showTransferError(error.message); - return; - } - - if (response.paymentagent_transfer === 2) { - PaymentAgentTransferUI.hideFirstForm(); - PaymentAgentTransferUI.showConfirmation(); - PaymentAgentTransferUI.updateConfirmView(response.client_to_full_name, req.transfer_to.toUpperCase(), - getNumberFormat(req.amount, req.currency), req.currency); - initConfirm(req); - return; - } - - if (response.paymentagent_transfer === 1) { - PaymentAgentTransferUI.hideFirstForm(); - PaymentAgentTransferUI.showDone(); - PaymentAgentTransferUI.updateDoneView(Client.get('loginid'), req.transfer_to.toUpperCase(), getNumberFormat(req.amount, req.currency), req.currency); - } - }; - - const initConfirm = (req) => { - const confirm_form_id = '#frm_confirm_transfer'; - - FormManager.init(confirm_form_id, [ - { request_field: 'transfer_to', value: req.transfer_to }, - { request_field: 'amount', value: getNumberFormat(req.amount, req.currency) }, - { request_field: 'description', value: req.description }, - ].concat(common_request_fields)); - - FormManager.handleSubmit({ - form_selector : confirm_form_id, - fnc_response_handler: responseHandler, - }); - - $('#back_transfer').off('click').click(() => { - PaymentAgentTransferUI.showForm(); - PaymentAgentTransferUI.showNotes(); - PaymentAgentTransferUI.hideConfirmation(); - PaymentAgentTransferUI.hideDone(); - $form_error.setVisibility(0); - }); - }; - - return { - onLoad, - }; -})(); - -module.exports = PaymentAgentTransfer; diff --git a/src/javascript/app/pages/user/account/payment_agent_transfer/payment_agent_transfer.ui.js b/src/javascript/app/pages/user/account/payment_agent_transfer/payment_agent_transfer.ui.js deleted file mode 100644 index 11309377409..00000000000 --- a/src/javascript/app/pages/user/account/payment_agent_transfer/payment_agent_transfer.ui.js +++ /dev/null @@ -1,86 +0,0 @@ -const localize = require('../../../../../_common/localize').localize; -const getCurrencyDisplayCode = require('../../../../common/currency').getCurrencyDisplayCode; - -const PaymentAgentTransferUI = (() => { - let $paymentagent_transfer, - $confirm_transfer, - $done_transfer, - $notes_transfer; - - const initValues = () => { - $paymentagent_transfer = $('#frm_paymentagent_transfer'); - $confirm_transfer = $('#frm_confirm_transfer'); - $done_transfer = $('#pa_transfer_done'); - $notes_transfer = $('#paymentagent_transfer_notes'); - }; - - const hideForm = () => { $paymentagent_transfer.setVisibility(0); }; - - const showForm = () => { $paymentagent_transfer.setVisibility(1); }; - - const hideConfirmation = () => { $confirm_transfer.setVisibility(0); }; - - const showConfirmation = () => { $confirm_transfer.find('#msg_form').setVisibility(0).end().setVisibility(1); }; - - const hideDone = () => { $done_transfer.setVisibility(0); }; - - const showDone = () => { $done_transfer.setVisibility(1); }; - - const hideNotes = () => { $notes_transfer.setVisibility(0); }; - - const showNotes = () => { $notes_transfer.setVisibility(1); }; - - const showTransferError = (err) => { $confirm_transfer.find('#msg_form').text(err).setVisibility(1); }; - - const updateFormView = (currency) => { $paymentagent_transfer.find('label[for="amount"]').text(`${localize('Amount')} ${getCurrencyDisplayCode(currency)}`); }; - - const updateConfirmView = (username, loginid, amount, currency) => { - $confirm_transfer - .find('#user_name') - .empty() - .text(username) - .end() - .find('#loginid') - .empty() - .text(loginid) - .end() - .find('#confirm_amount') - .empty() - .text(`${amount} ${getCurrencyDisplayCode(currency)}`); - }; - - const updateDoneView = (from_id, to_id, amount, currency) => { - const confirm_msg = localize('Your request to transfer [_1] [_2] from [_3] to [_4] has been successfully processed.', [ - amount, - getCurrencyDisplayCode(currency), - from_id, - to_id, - ]); - $done_transfer.find(' > #confirm_msg').text(confirm_msg).setVisibility(1); - }; - - const hideFirstForm = () => { - hideForm(); - hideConfirmation(); - hideNotes(); - }; - - return { - initValues, - hideForm, - showForm, - hideConfirmation, - showConfirmation, - hideDone, - showDone, - hideNotes, - showNotes, - showTransferError, - updateFormView, - updateConfirmView, - updateDoneView, - hideFirstForm, - }; -})(); - -module.exports = PaymentAgentTransferUI; diff --git a/src/javascript/app/pages/user/account/profit_table/profit_table.init.js b/src/javascript/app/pages/user/account/profit_table/profit_table.init.js deleted file mode 100644 index 6bd33094afe..00000000000 --- a/src/javascript/app/pages/user/account/profit_table/profit_table.init.js +++ /dev/null @@ -1,146 +0,0 @@ -const ProfitTableUI = require('./profit_table.ui'); -const ViewPopup = require('../../view_popup/view_popup'); -const showLocalTimeOnHover = require('../../../../base/clock').showLocalTimeOnHover; -const BinarySocket = require('../../../../base/socket'); -const DateTo = require('../../../../common/attach_dom/date_to'); -const addTooltip = require('../../../../common/get_app_details').addTooltip; -const buildOauthApps = require('../../../../common/get_app_details').buildOauthApps; -const localize = require('../../../../../_common/localize').localize; - -const ProfitTableInit = (() => { - let batch_size, - chunk_size, - transactions_received, - transaction_consumed, - no_more_data, - pending, - current_batch; - - const tableExist = () => document.getElementById('profit-table'); - - const finishedConsumed = () => (transaction_consumed === transactions_received); - - const onUnload = () => { - current_batch = []; - transaction_consumed = 0; - transactions_received = 0; - pending = false; - - ProfitTableUI.errorMessage(null); - - if (tableExist()) { - ProfitTableUI.cleanTableContent(); - } - }; - - const getNextBatchTransactions = () => { - getProfitTable({ offset: transactions_received, limit: batch_size }); - pending = true; - }; - - const getNextChunk = () => { - const chunk = current_batch.splice(0, chunk_size); - transaction_consumed += chunk.length; - return chunk; - }; - - const profitTableHandler = (response) => { - if (response.error) { - ProfitTableUI.errorMessage(response.error.message); - return; - } - - pending = false; - const profit_table = response.profit_table; - current_batch = profit_table.transactions; - transactions_received += current_batch.length; - - if (current_batch.length < batch_size) { - no_more_data = true; - } - - if (!tableExist()) { - ProfitTableUI.createEmptyTable().appendTo('#profit-table-container'); - ProfitTableUI.updateProfitTable(getNextChunk()); - - // Show a message when the table is empty - if ((transactions_received === 0) && (current_batch.length === 0)) { - $('#profit-table').find('tbody') - .append($('', { class: 'flex-tr' }) - .append($('', { colspan: 8 }) - .append($('

', { class: 'notice-msg center-text', text: localize('You\'ve made no transactions of this type up to this date.') })))); - } else { - $('#util_row').setVisibility(1); - } - } - }; - - const onScrollLoad = () => { - $(document).scroll(() => { - const hidableHeight = (percentage) => { - const total_hidable = $(document).height() - $(window).height(); - return Math.floor((total_hidable * percentage) / 100); - }; - - const p_from_top = $(document).scrollTop(); - - if (!tableExist() || p_from_top < hidableHeight(50)) { - return; - } - - if (finishedConsumed() && !no_more_data && !pending) { - getNextBatchTransactions(); - return; - } - - if (!finishedConsumed()) { - ProfitTableUI.updateProfitTable(getNextChunk()); - } - }); - }; - - const getProfitTable = (opts) => { - const req = { profit_table: 1, description: 1 }; - - if (opts) $.extend(true, req, opts); - - const obj_date_to_from = DateTo.getDateToFrom(); - if (obj_date_to_from) $.extend(true, req, obj_date_to_from); - - BinarySocket.send(req).then((response) => { - profitTableHandler(response); - showLocalTimeOnHover('td.buy-date,td.sell-date'); - $('.barspinner').setVisibility(0); - }); - }; - - const onLoad = () => { - batch_size = 50; - chunk_size = batch_size / 2; - transactions_received = 0; - transaction_consumed = 0; - no_more_data = false; - pending = false; - current_batch = []; - - DateTo.attachDateToPicker(() => { - ProfitTableUI.cleanTableContent(); - $('.barspinner').setVisibility(1); - transactions_received = 0; - getNextBatchTransactions(); - }); - BinarySocket.send({ oauth_apps: 1 }).then((response) => { - addTooltip(ProfitTableUI.setOauthApps(buildOauthApps(response))); - }); - getNextBatchTransactions(); - onScrollLoad(); - ViewPopup.viewButtonOnClick('#profit-table-container'); - }; - - return { - onLoad, - onUnload, - }; -})(); - -module.exports = ProfitTableInit; diff --git a/src/javascript/app/pages/user/account/profit_table/profit_table.js b/src/javascript/app/pages/user/account/profit_table/profit_table.js deleted file mode 100644 index b4ae40f19e9..00000000000 --- a/src/javascript/app/pages/user/account/profit_table/profit_table.js +++ /dev/null @@ -1,33 +0,0 @@ -const moment = require('moment'); -const Client = require('../../../../base/client'); -const formatMoney = require('../../../../common/currency').formatMoney; - -const ProfitTable = (() => { - const getProfitTabletData = (transaction) => { - const currency = Client.get('currency'); - const buy_moment = moment.utc(transaction.purchase_time * 1000); - const sell_moment = moment.utc(transaction.sell_time * 1000); - const buy_price = parseFloat(transaction.buy_price); - const sell_price = parseFloat(transaction.sell_price); - - return { - buyDate : `${buy_moment.format('YYYY-MM-DD')}\n${buy_moment.format('HH:mm:ss')} GMT`, - ref : transaction.transaction_id, - payout : +transaction.payout ? formatMoney(currency, parseFloat(transaction.payout), true) : '-', - buyPrice : formatMoney(currency, buy_price, true), - sellDate : `${sell_moment.format('YYYY-MM-DD')}\n${sell_moment.format('HH:mm:ss')} GMT`, - sellPrice: formatMoney(currency, sell_price, true), - pl : formatMoney(currency, Number(sell_price - buy_price), true), - desc : transaction.longcode, - id : transaction.contract_id, - app_id : transaction.app_id, - shortcode: transaction.shortcode, - }; - }; - - return { - getProfitTabletData, - }; -})(); - -module.exports = ProfitTable; diff --git a/src/javascript/app/pages/user/account/profit_table/profit_table.ui.js b/src/javascript/app/pages/user/account/profit_table/profit_table.ui.js deleted file mode 100644 index d466baa177b..00000000000 --- a/src/javascript/app/pages/user/account/profit_table/profit_table.ui.js +++ /dev/null @@ -1,129 +0,0 @@ -const ProfitTable = require('./profit_table'); -const Client = require('../../../../base/client'); -const Table = require('../../../../common/attach_dom/table'); -const Currency = require('../../../../common/currency'); -const showTooltip = require('../../../../common/get_app_details').showTooltip; -const localize = require('../../../../../_common/localize').localize; - -const ProfitTableUI = (() => { - let oauth_apps = {}; - let total_profit = 0; - - let currency; - - const profit_table_id = 'profit-table'; - const cols = ['buy-date', 'ref', 'payout', 'contract', 'buy-price', 'sell-date', 'sell-price', 'pl', 'details']; - - const createEmptyTable = () => { - const header = [ - localize('Date'), - localize('Ref.'), - localize('Potential Payout'), - localize('Contract'), - localize('Purchase Price'), - localize('Sale Date'), - localize('Sale Price'), - localize('Profit/Loss'), - localize('Details'), - ]; - - currency = Client.get('currency'); - - header[7] += currency ? ` (${Currency.getCurrencyDisplayCode(currency)})` : ''; - - const footer = [localize('Total Profit/Loss'), '', '', '', '', '', '', '', '']; - - const data = []; - const metadata = { - cols, - id: profit_table_id, - }; - const $table_container = Table.createFlexTable(data, metadata, header, footer); - - $table_container - .children('table') - .children('tfoot') - .children('tr') - .attr('id', 'pl-day-total'); - - return $table_container; - }; - - const updateFooter = (transactions) => { - total_profit += transactions.reduce((previous, current) => { - const buy_price = Number(parseFloat(current.buy_price)); - const sell_price = Number(parseFloat(current.sell_price)); - const pl = sell_price - buy_price; - return previous + pl; - }, 0); - - const sub_total_type = (total_profit >= 0) ? 'profit' : 'loss'; - - $('#pl-day-total').find(' > .pl').html(Currency.formatMoney(currency, Number(total_profit), true)) - .removeClass('profit loss') - .addClass(sub_total_type); - }; - - const createProfitTableRow = (transaction) => { - const profit_table_data = ProfitTable.getProfitTabletData(transaction); - const pl_type = Number(transaction.sell_price - transaction.buy_price) >= 0 ? 'profit' : 'loss'; - - const data = [ - profit_table_data.buyDate, - `${profit_table_data.ref}`, - /binaryico/i.test(profit_table_data.shortcode) ? '-' : profit_table_data.payout, // TODO: remove ico exception when all ico contracts are removed - '', - profit_table_data.buyPrice, - profit_table_data.sellDate, - profit_table_data.sellPrice, - profit_table_data.pl, - '', - ]; - const $row = Table.createFlexTableRow(data, cols, 'data'); - - $row.children('.pl').addClass(pl_type); - $row.children('.contract').html(`${profit_table_data.desc}
`); - $row.children('.buy-date, .sell-date').each(function () { - $(this).wrapInner('

'); - }); - - // TODO: remove ico exception when all ico contracts are removed - if (!/binaryico/i.test(profit_table_data.shortcode)) { - // create view button and append - const $view_button = $(' - -); - -export const Jurisdiction = () => ( -
-
-

{it.L('Your account will be opened with [_1], and will be subject to the jurisdiction and laws of [_2].', '', '')}

-
-
-); - -export const RiskDisclaimer = () => ( -
-
-

{it.L('The financial trading services contained within this site are only suitable for customers who accept the possibility of losing all the money they invest and who understand and have experience of the risk involved in the acquisition of financial contracts. Transactions in financial contracts carry a high degree of risk. If purchased contracts expire worthless, you will suffer a total loss of your investment, which consists of the contract premium.')}

-
-
-); - -export const ClientMessage = () => ( -
-
-
-

-

-
-
-); - -export const TaxInformationForm = () => ( - -
- - -
-

{it.L('This requirement is mandated by the Common Reporting Standard (CRS) and the Foreign Account Tax Compliance Act (FATCA).')}

-

{it.L('Please enter your [_1]tax information[_2] below to continue.', '', '')}

-

{it.L('Rest assured that your information will only be used for CRS/FATCA reporting purposes and will be kept safe.')}

-

{it.L('If we have reason to believe that your tax information is incomplete, we may contact you for clarification.')}

-
-
- - - - - - - -

- {it.L('This Tax Identification Number (TIN) is invalid. You may continue, but to facilitate future payment processes, valid tax information will be required.')} -

- -
-
- - -
-
-
-); diff --git a/src/templates/_common/components/image_slider.jsx b/src/templates/_common/components/image_slider.jsx deleted file mode 100644 index 3e3ae35393f..00000000000 --- a/src/templates/_common/components/image_slider.jsx +++ /dev/null @@ -1,30 +0,0 @@ -import React from 'react'; - -const ImageSlider = ({ id, className, images }) => ( -
-
-
- -
-
-
    - {images.map((image, idx) => ( -
  • - - {!!image.caption && -
    -

    {image.caption}

    -
    - } -
  • - ))} -
-
-
- -
-
-
-); - -export default ImageSlider; diff --git a/src/templates/_common/components/mt5_banner.jsx b/src/templates/_common/components/mt5_banner.jsx deleted file mode 100644 index f66aaa3d2ce..00000000000 --- a/src/templates/_common/components/mt5_banner.jsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from 'react'; - -const mt5Banner = () => ( - - - -

{it.L('Binary.com MT5 is moving to Deriv')}

- - -
{it.L('Learn more')}
-
-); - -export default mt5Banner; diff --git a/src/templates/_common/components/payment_logo.jsx b/src/templates/_common/components/payment_logo.jsx deleted file mode 100644 index 7c15da21ab5..00000000000 --- a/src/templates/_common/components/payment_logo.jsx +++ /dev/null @@ -1,37 +0,0 @@ -import React from 'react'; - -const payment_methods_list = [ - { image: 'visa', param: '?anchor=visa' }, - { image: 'mastercard', param: '?anchor=mastercard' }, - { image: 'maestro', param: '?anchor=maestro' }, - { image: 'bank_transfer', param: '?anchor=bank-transfer' }, - { image: 'paytrust', param: '?anchor=paytrust', dataShow: '-eucountry' }, - { image: 'neteller', param: '?anchor=neteller' }, - { image: 'fasapay', param: '?anchor=fasapay', dataShow: '-eucountry' }, - { image: 'perfect_money', param: '?anchor=perfect-money', dataShow: '-eucountry' }, - { image: 'skrill', param: '?anchor=skrill' }, - { image: 'qiwi', param: '?anchor=qiwi', dataShow: '-eucountry' }, - { image: 'webmoney', param: '?anchor=webmoney' }, - { image: 'paysafe', param: '?anchor=paysafe' }, - { image: 'jeton', param: '?anchor=jeton' }, - { image: 'sticpay', param: '?anchor=sticpay' }, - { image: 'airtm', param: '?anchor=airtm' }, -]; - -const PaymentLogo = () => payment_methods_list.map((item, inx) => ( -
- {item.param ? - - - - : - - } -
-)); - -export default PaymentLogo; diff --git a/src/templates/_common/includes/form_verify_email.jsx b/src/templates/_common/includes/form_verify_email.jsx deleted file mode 100644 index b6d7cc8dc49..00000000000 --- a/src/templates/_common/includes/form_verify_email.jsx +++ /dev/null @@ -1,34 +0,0 @@ -import React from 'react'; - -const FormVerifyEmail = ({ - className = '', - padding = 8, - email_padding = 7, - button_padding = 5, - email_padding_mobile = 10, - button_padding_mobile = 8, - dark_button, - children, - text, -}) => ( -
-
-
-
-
- -
-
- -
- -
- {children} -
-
-
-); - -export default FormVerifyEmail; diff --git a/src/templates/app/_includes/authenticate_message.jsx b/src/templates/app/_includes/authenticate_message.jsx deleted file mode 100644 index f7346efea36..00000000000 --- a/src/templates/app/_includes/authenticate_message.jsx +++ /dev/null @@ -1,231 +0,0 @@ -import React from 'react'; -import { SeparatorLine } from '../../_common/components/separator_line.jsx'; -import { Table } from '../../_common/components/elements.jsx'; - -const FileSelector = ({ - heading, - data_show, - allowed_documents, - instructions, - accepted_documents, - type, -}) => ( -
-
-
-

{heading}

-
-
- {allowed_documents && - - {it.L('We accept')}: -
    - { allowed_documents.map((document, i) => ( -
  • {document}
  • - ))} -
-
- } - {it.L('Requirements')}: -
    - { instructions.map((instruction, i) => ( -
  • {instruction}
  • - ))} -
-
-
-

- {accepted_documents.length > 1 - ? `${it.L('Submit one of the documents below')}:` - : `${it.L('Submit the document below')}:` - } -

-
- { accepted_documents.map((document, i) => { - const j = i + 1; - return ( - -

{document.name}

-
- { type === 'poi' && ( - -
-
- -
-
- -
-
-
-
- -
-
- -
-
-
-
- - -
-
- - -
-
-
- )} - { type === 'poa' && ( -
-
- - -
-
- )} - { type === 'selfie' && ( -
-
- - -
-
- )} -
-
- ); - })} -
-
-
-
-
-
-); - -export const UnsupportedMessage = () => ( - -

{it.L('Learn more about submitting essential documents with our handy infographic:')}

-

- {it.L('View guide')} -

- - - - - - - -
-

{it.L('Document submission status')}

- - - -
-
{it.L('Please resolve all pending issues to continue')}
- - -); - -export const AuthenticateMessage = () => ( - -

{it.L('Learn more about submitting essential documents with our handy infographic:')}

-

- {it.L('View guide')} -

- - - -
-

{it.L('Document submission status')}

-
- - -
-
{it.L('Please resolve all pending issues to continue')}
- - -); diff --git a/src/templates/app/_includes/financial_form.jsx b/src/templates/app/_includes/financial_form.jsx deleted file mode 100644 index 641d1f51564..00000000000 --- a/src/templates/app/_includes/financial_form.jsx +++ /dev/null @@ -1,155 +0,0 @@ -import React from 'react'; -import { Fieldset, FormRow } from '../../_common/components/forms.jsx'; - -const Experience = () => ( - - - - - - -); - -const Frequency = () => ( - - - - - - - -); - -const SelectRow = ({ id, label, con }) => ( - {con()} -); - -const Values = () => ( - - - - - - - - -); - -const TradingExperienceForm = () => ( -
- - - - - - - - - - - -
-); - -const FinancialInformationForm = () => ( -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-); - -const FinancialForm = () => ( - - - - -); - -export default FinancialForm; diff --git a/src/templates/app/_includes/form_verification_code.jsx b/src/templates/app/_includes/form_verification_code.jsx deleted file mode 100644 index e0450f18ada..00000000000 --- a/src/templates/app/_includes/form_verification_code.jsx +++ /dev/null @@ -1,17 +0,0 @@ -import React from 'react'; -import { FormRow, SubmitButton, Fieldset } from '../../_common/components/forms.jsx'; - -const FormVerificationCode = () => ( -
-

{it.L('Please check your email for the verification code to complete the process.')}

-
-
- -
- - - -
-); - -export default FormVerificationCode; diff --git a/src/templates/app/_includes/pep_declaration.jsx b/src/templates/app/_includes/pep_declaration.jsx deleted file mode 100644 index ae6cba22dc7..00000000000 --- a/src/templates/app/_includes/pep_declaration.jsx +++ /dev/null @@ -1,23 +0,0 @@ -import React from 'react'; -import { Fieldset } from '../../_common/components/forms.jsx'; - -const PepDeclaration = () => ( -
-
- -
-

{it.L('A politically exposed person (PEP) is an individual who is or has been entrusted with a prominent public function. Family members and close associates of such individuals are also considered as PEPs. A PEP who has ceased to be entrusted with a prominent public function for at least 12 months no longer qualifies as a PEP.')}

-
-
-
- - -
-
-); - -export default PepDeclaration; diff --git a/src/templates/app/user/accounts.jsx b/src/templates/app/user/accounts.jsx deleted file mode 100644 index 4feb7e16ce9..00000000000 --- a/src/templates/app/user/accounts.jsx +++ /dev/null @@ -1,71 +0,0 @@ -import React from 'react'; -import Loading from '../../_common/components/loading.jsx'; -import { SeparatorLine } from '../../_common/components/separator_line.jsx'; -import { Table } from '../../_common/components/elements.jsx'; - -const Accounts = () => ( - -
- -
- -
-

{it.L('Create or Manage Accounts')}

- -
-
-
- -
-
- {it.L('Note: You can only have one fiat currency account and one of each cryptocurrency account.')} -
-
- -
-

{it.L('You have created all accounts available to you.')}

-
- - - -

{it.L('Your Existing Accounts')}

-
-
-
- {it.L('Note: For any enquiries regarding disabled or excluded accounts, please contact [_1]Customer Support[_2].', ``, '')} -
-
- - - - -); - -export default Accounts; diff --git a/src/templates/app/user/metatrader.jsx b/src/templates/app/user/metatrader.jsx deleted file mode 100644 index f3e0e11abac..00000000000 --- a/src/templates/app/user/metatrader.jsx +++ /dev/null @@ -1,530 +0,0 @@ -import React from 'react'; -import { Button } from '../../_common/components/elements.jsx'; -import { - FormRow, - SubmitButton, -} from '../../_common/components/forms.jsx'; -import Loading from '../../_common/components/loading.jsx'; -import MT5Banner from '../../_common/components/mt5_banner.jsx'; - -/* eslint-disable react/jsx-no-target-blank */ -const AccountDesc = ({ title, description, account_type, landing_company_short, items, id = undefined }) => { - let types = ''; - if (account_type) { - types = `demo_${account_type} real_${account_type} ${landing_company_short || ''}`; - } - - return ( -
-

{title}

-

{description}

-
    - {items && items.map((item, i) => ( -
  • {item}
  • - ))} -
-

- - {it.L('Compare MetaTrader 5 accounts')} - -

-
- ); -}; - -const TypeGroup = ({ title, children, types }) => ( -
-
-

{title}

- {children} -
- {types.map((box, i) => ( -
-
- {box.title ? -
{box.title}
- : - - } -
-

{box.desc}

-
- ))} -
-); - -const CashierDesc = ({ title, desc, arrow_direction }) => ( -
-

{title}

-

{desc}

-
- - - -
-
-); - -const Metatrader = () => ( - - -
-

{it.L('MetaTrader 5 dashboard')}

-
-

-

- {it.L('Please [_1]authenticate[_2] your account to continue trading.', ``, '')} -

-
-
-
-
-
-
-
-
-
-

-
-
-
-
-

- -
-
-
-
{it.L('MT5 Login:')}
-
-
-
-
-
{it.L('Balance:')}
-
-
-
-
{it.L('Broker:')}
-
-
-
-
{it.L('Server:')}
-
-
-
-
{it.L('Trade server:')}
-
-
-
-
- -
- -
-

- {it.L('Server maintenance starting 01:00 GMT every Sunday. This process may take up to 2 hours to complete. Service may be disrupted during this time.')} -

-
- -
- {it.L('Get started with MT5')} - - -
-
-
- -
-
 
- - - -
-
- - {/* first item should be the general description - if there are any landing company specific descriptions, - they should be below this with landing_company_short prop */} - - - - - - -
-
-
-
-
-
- -
- -
-
- -
- - {it.L('Back')} - - -
-
-
-
-
- {it.L('Due to an issue on our server, some MT5 accounts are unavailable at the moment. Please bear with us and thank you for your patience.')} -
-
-

{it.L('Choose a server for your MT5 [_1] account:', '')}

- -
-
- -
-
-
-
-
-
-
-

{it.L('Change password')}

-
- - - - - - -
-
-
-
-
-

{it.L('Reset password')}

-
-
-
-

{it.L('Verification code is wrong. Please use the link sent to your email.')}

-

{it.L('To reset your trading or investor password, please click the button below:')}

- -
- -
-
-

{it.L('Please check your email for the verification code to complete the process.')}

- - -
- -
- - - - -
-
-
-
-
-
- -

-

-
-
-
-
-

{it.L('How to manage your funds')}

-

{it.L('Deposits and withdrawals for your MetaTrader 5 account always pass through your binary options account.')}

-
-
- -
- -
- -
-
- -
-
-
{it.L('Deposit or withdraw below')}
-
-
-
-
-
-
- {it.L('Remaining MT5 fund transfers for today: [_1]', '')} -
-
-
-
-
- - -
- ', '')} /> - -
- -
-
-
-
-
- - -
- ', '')} /> - -
- -
-
-
-
-
-
-
{it.L('To perform this action, please set the [_1]currency[_2] of your account.', ``, '')}
-
- {it.L('To perform this action, please switch to your [_1] Real Account.', it.website_name)} -
- {it.L('If you do not have a [_1] Real Account yet, please [_2]create one[_3].', it.website_name, ``, '')} -
-
- {it.L('To create a MetaTrader 5 account:')} -
    -
  • {it.L('Upgrade to [_1] [_2]Gaming Account[_3].', it.website_name, ``, '')}
  • -
  • {it.L('Upgrade to [_1] [_2]Financial Account[_3].', it.website_name, ``, '')}
  • -
  • {it.L('Please [_1]complete the trading experience section[_2] in the financial assessment to open an MT5 account.', ``, '')}
  • -
  • {it.L('Please [_1]complete the financial assessment[_2] to open an MT5 account.', ``, '')}
  • -
  • {it.L('Complete your [_1]Tax Information[_2].', ``, '')}
  • -
  • {it.L('Select [_1]Citizenship[_2].', ``, '')}
  • -
  • {it.L('Select [_1]Account opening reason[_2].', ``, '')}
  • -
  • {it.L('Please [_1]authenticate your account[_2] before creating an MT5 account.', ``, '')}
  • -
-
-
{it.L('To withdraw from MetaTrader 5 Financial Account please [_1]Authenticate[_2] your Binary account.', ``, '')}
-
-
-
- -); -/* eslint-enable react/jsx-no-target-blank */ - -export default Metatrader; diff --git a/src/templates/app/user/profit_table.jsx b/src/templates/app/user/profit_table.jsx deleted file mode 100644 index b89a18c5dec..00000000000 --- a/src/templates/app/user/profit_table.jsx +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react'; -import { DatePicker } from '../../_common/components/elements.jsx'; -import Loading from '../../_common/components/loading.jsx'; - -const ProfitTable = () => ( - -
-
-

{it.L('Profit Table')}

-

-

-
- -
- -
-
-); - -export default ProfitTable; diff --git a/src/templates/app/user/settings.jsx b/src/templates/app/user/settings.jsx deleted file mode 100644 index 99d840633ab..00000000000 --- a/src/templates/app/user/settings.jsx +++ /dev/null @@ -1,39 +0,0 @@ -import React from 'react'; - -const Column = ({ - id, - header, - text, - url, - image, - className = '', -}) => ( -
-
- - - -
-
-

{header}

-

{text}

-
-
-); - -const Settings = () => ( - -
-

{it.L('Profile')}

- -
- - - - -
-
-
-); - -export default Settings; diff --git a/src/templates/app/user/statement.jsx b/src/templates/app/user/statement.jsx deleted file mode 100644 index 0512b614e0d..00000000000 --- a/src/templates/app/user/statement.jsx +++ /dev/null @@ -1,78 +0,0 @@ -import React from 'react'; -import { Button, DatePicker } from '../../_common/components/elements.jsx'; -import Loading from '../../_common/components/loading.jsx'; - -const AccountStatisticsBox = ({ id, title, heading, className }) => ( -
- { title ? -

{title}

- : - {heading} - } - { id &&

} -

-); - -const Statement = () => ( - -
-
-

{it.L('Statement')}

-

-

-
- - - - -
-
-
- -
-
-
{it.L('[_1] rows displayed:', '')} {it.L('Download CSV')}
-
-
- -
- -
-
-

{it.L('Download your statement')}

-
-

{it.L('Please select the date range of your statement:')}

-
- - -
-
- -
-

{it.L('Your statement has been sent to your email address.')}

-

-

-
-
-
-); - -export default Statement; diff --git a/src/templates/app/user/tnc_approval.jsx b/src/templates/app/user/tnc_approval.jsx deleted file mode 100644 index e7c4b2a32a2..00000000000 --- a/src/templates/app/user/tnc_approval.jsx +++ /dev/null @@ -1,30 +0,0 @@ -import React from 'react'; -import Loading from '../../_common/components/loading.jsx'; - -const TncApproval = () => ( - -
-
- -
-
-

-
-
-
-

{it.L('[_1] has updated its Terms & Conditions. By clicking OK, you confirm that you have read and accepted the updated Terms & Conditions.', '[_1]', '[_2]')}

-
- - - -
- -
-
- -

-

-
-); - -export default TncApproval; diff --git a/src/templates/app/user/top_up_virtual/pop_up.jsx b/src/templates/app/user/top_up_virtual/pop_up.jsx deleted file mode 100644 index 9e26b2bb42d..00000000000 --- a/src/templates/app/user/top_up_virtual/pop_up.jsx +++ /dev/null @@ -1,28 +0,0 @@ -import React from 'react'; - -const TopUpVirtualPopup = () => ( - -
-

{it.L('Top up Virtual Account')}

-

-

{it.L('Do you want to top up for another [_1]? If not, you can do this later on the [_2]Cashier page[_3], too.', '$10,000.00', ``, '')}

-
-
- -   - -
-
- -
- -
-
- -
-
-); - -export default TopUpVirtualPopup; diff --git a/src/templates/app/user/top_up_virtual/top_up_virtual.jsx b/src/templates/app/user/top_up_virtual/top_up_virtual.jsx deleted file mode 100644 index cfd5e3e22d3..00000000000 --- a/src/templates/app/user/top_up_virtual/top_up_virtual.jsx +++ /dev/null @@ -1,25 +0,0 @@ -import React from 'react'; -import Loading from '../../../_common/components/loading.jsx'; - -const TopUpVirtual = () => ( - -
-

{it.L('Top up virtual account')}

-
- -
-
-); - -export default TopUpVirtual;