Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Commit 67f9cef

Browse files
authored
Maryia/task_push_labuan_bvi_vanuatu (#7164)
* Maryia/feat: removed Add region button * feat: initialized Mt5GoToDerivBanner * finilized Mt5GoToDerivBanner styling (desktop+responsive) * made only button clickable not the whole banner * Finalized popup for new clients (desktop + responsive) * feat: filtering mt5 accounts to show only svg and labuan (stp) * finalized existing clients flow * fix: centered the go to deriv banner * Maryia/fix: show existing STP even if missing from landing_company
1 parent 023a5f9 commit 67f9cef

File tree

11 files changed

+377
-123
lines changed

11 files changed

+377
-123
lines changed
Lines changed: 1 addition & 0 deletions
Loading

src/javascript/app/common/attach_dom/dialog.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ const Dialog = (() => {
8585
}
8686

8787
el_btn_ok.addEventListener('click', () => {
88-
el_dialog.remove();
88+
if (!options.keep_open_on_confirm) {
89+
el_dialog.remove();
90+
}
8991
if (typeof options.onConfirm === 'function') {
9092
options.onConfirm();
9193
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const getElementById = require('../../_common/common_functions').getElementById;
2+
const getLanguage = require('../../_common/language').get;
3+
4+
const Mt5GoToDerivBanner = (() => {
5+
const classname = 'mt5_go_to_deriv_banner';
6+
7+
const onLoad = () => {
8+
getElementById(`${classname}-link`).href = `https://app.deriv.com/mt5?lang=${getLanguage()}`;
9+
getElementById(`${classname}_container`).setVisibility(1);
10+
};
11+
12+
return { onLoad };
13+
})();
14+
15+
module.exports = Mt5GoToDerivBanner;

src/javascript/app/pages/user/account/settings/account_closure.js

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
const Metatrader = require('../../metatrader/metatrader');
2-
const BinarySocket = require('../../../../base/socket');
3-
const Client = require('../../../../base/client');
4-
const Currency = require('../../../../common/currency');
5-
const Url = require('../../../../../_common/url');
6-
const hasAccountType = require('../../../../../_common/base/client_base').hasAccountType;
7-
const getElementById = require('../../../../../_common/common_functions').getElementById;
8-
const localize = require('../../../../../_common/localize').localize;
1+
const Metatrader = require('../../metatrader/metatrader');
2+
const MetaTraderConfig = require('../../metatrader/metatrader.config');
3+
const BinarySocket = require('../../../../base/socket');
4+
const Client = require('../../../../base/client');
5+
const Currency = require('../../../../common/currency');
6+
const Url = require('../../../../../_common/url');
7+
const hasAccountType = require('../../../../../_common/base/client_base').hasAccountType;
8+
const getElementById = require('../../../../../_common/common_functions').getElementById;
9+
const localize = require('../../../../../_common/localize').localize;
910
const applyToAllElements = require('../../../../../_common/utility').applyToAllElements;
10-
const State = require('../../../../../_common/storage').State;
11+
const State = require('../../../../../_common/storage').State;
1112

1213
const AccountClosure = (() => {
1314
let reason_checkbox_list,
@@ -211,7 +212,7 @@ const AccountClosure = (() => {
211212
const getMT5MarketType = (mt5_account) => mt5_account.market_type === 'synthetic' ? 'gaming' : mt5_account.market_type;
212213

213214
const showErrorPopUp = async (response) => {
214-
const mt5_login_list = (await BinarySocket.wait('mt5_login_list')).mt5_login_list;
215+
const filtered_mt5_login_list = MetaTraderConfig.getFilteredMt5LoginList((await BinarySocket.wait('mt5_login_list')).mt5_login_list);
215216
const dxtrade_accounts_list = (await BinarySocket.send({ trading_platform_accounts: 1, platform: 'dxtrade' })).trading_platform_accounts;
216217

217218
// clear all previously added details first
@@ -240,7 +241,7 @@ const AccountClosure = (() => {
240241
el_section.setVisibility(1).appendChild(el_section_parent);
241242
};
242243
const getMTDisplay = (account) => {
243-
const mt5_account = (mt5_login_list.find(acc => acc.login === account) || {});
244+
const mt5_account = (filtered_mt5_login_list.find(acc => acc.login === account) || {});
244245
const market_type = getMT5MarketType(mt5_account);
245246
return Client.getMT5AccountDisplays(market_type, mt5_account.sub_account_type).short;
246247
};

src/javascript/app/pages/user/metatrader/metatrader.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,10 @@ const MetaTraderConfig = (() => {
562562
return /\d$/.test(acc_type) ? acc_type.substr(0, acc_type.lastIndexOf('_')) : acc_type;
563563
};
564564

565+
// hide bvi and vanuatu (fx) mt5 accounts, display svg and stp (labuan) only:
566+
const getFilteredMt5LoginList = (mt5_login_list) => mt5_login_list
567+
.filter(mt5_account => mt5_account.landing_company_short === 'svg' || mt5_account.landing_company_short === 'labuan');
568+
565569
// if no server exists yet, e.g. during new account creation
566570
// we want to get information like landing company etc which is shared
567571
// between all the servers, so we can disregard the server and return the first
@@ -606,6 +610,7 @@ const MetaTraderConfig = (() => {
606610
getCleanAccType,
607611
getCurrency,
608612
getDisplayLogin,
613+
getFilteredMt5LoginList,
609614
getSampleAccount,
610615
isAuthenticated,
611616
isAuthenticationPromptNeeded,

0 commit comments

Comments
 (0)