From 7ec2d6fe3a4da8e4674da972e38dc95d6c37d649 Mon Sep 17 00:00:00 2001 From: hirad-deriv Date: Wed, 28 Jun 2023 19:44:54 +0800 Subject: [PATCH 1/3] Hirad/derivez issue of token (#9174) * fix: changed the naming of the token * fix: added return to the service token * fix: commented derivx reaction --------- Co-authored-by: Matin shafiei --- packages/cfd/src/Stores/Modules/CFD/cfd-store.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cfd/src/Stores/Modules/CFD/cfd-store.js b/packages/cfd/src/Stores/Modules/CFD/cfd-store.js index ef91c114b33d..b27032ab31ff 100644 --- a/packages/cfd/src/Stores/Modules/CFD/cfd-store.js +++ b/packages/cfd/src/Stores/Modules/CFD/cfd-store.js @@ -701,8 +701,8 @@ export default class CFDStore extends BaseStore { setDerivezToken(response, server) { if (!response.error) { - const { derivez } = response.service_token; - this.derivez_tokens[server] = derivez.token; + const { pandats } = response.service_token; + this.derivez_tokens[server] = pandats.token; } } From 48bf63f1acf946e6a52f1c24a1cf46054ae0f5a8 Mon Sep 17 00:00:00 2001 From: hirad-deriv Date: Wed, 28 Jun 2023 20:47:23 +0800 Subject: [PATCH 2/3] Hirad/ hidding deriv ez (#9175) * fix: hidding deriv ez * fix: removed deriv ez from onboarindg * fix: removed deriv ez from onboarding and tests * fix: hid the deriv ez and fixed the tests --- .../src/components/cfds-listing/index.tsx | 4 +- .../__tests__/static-dashboard.spec.tsx | 56 ------------------- .../onboarding-new/static-dashboard.tsx | 4 +- packages/stores/types.ts | 1 + 4 files changed, 5 insertions(+), 60 deletions(-) delete mode 100644 packages/appstore/src/components/onboarding-new/__tests__/static-dashboard.spec.tsx diff --git a/packages/appstore/src/components/cfds-listing/index.tsx b/packages/appstore/src/components/cfds-listing/index.tsx index 3cf7d4b3ef8e..f70705787c46 100644 --- a/packages/appstore/src/components/cfds-listing/index.tsx +++ b/packages/appstore/src/components/cfds-listing/index.tsx @@ -283,7 +283,7 @@ const CFDsListing = () => { )} {/* TODO: remove is_real flag to unblock the flow for derivez real account creation */} - {is_landing_company_loaded && !is_real + {/* {is_landing_company_loaded && !is_real ? available_derivez_accounts?.map((account: AvailableAccount) => { const existing_accounts = getExistingAccounts(account.platform, account.market_type); const has_existing_accounts = existing_accounts.length > 0; @@ -342,7 +342,7 @@ const CFDsListing = () => { /> ); }) - : !is_real && } + : !is_real && } */} ); }; diff --git a/packages/appstore/src/components/onboarding-new/__tests__/static-dashboard.spec.tsx b/packages/appstore/src/components/onboarding-new/__tests__/static-dashboard.spec.tsx deleted file mode 100644 index d096c0b2abec..000000000000 --- a/packages/appstore/src/components/onboarding-new/__tests__/static-dashboard.spec.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import React from 'react'; -import { render, screen } from '@testing-library/react'; -import StaticDashboard from '../static-dashboard'; -import { StoreProvider, mockStore } from '@deriv/stores'; - -describe('', () => { - const is_blurry = { - icon: true, - item: false, - text: false, - get: false, - topup: false, - trade: false, - cfd_item: false, - cfd_text: false, - options_item: false, - options_text: false, - cfd_description: false, - options_description: false, - platformlauncher: false, - }; - - const is_onboarding_animated = { - text: false, - trade: false, - topup: false, - button: false, - get: false, - }; - - test('should render derivez in page if !CFDs_restricted_countries (non-eu countries)', () => { - const mock = mockStore({}); - - render( - - - - ); - expect(screen.queryByText('Deriv EZ')).toBeInTheDocument(); - }); - - test('should not render derivez if CFDs_restricted_countries: true (eu countries)', () => { - const mock = mockStore({ - traders_hub: { - CFDs_restricted_countries: true, - }, - }); - - render( - - - - ); - expect(screen.queryByText('Deriv Ez')).not.toBeInTheDocument(); - }); -}); diff --git a/packages/appstore/src/components/onboarding-new/static-dashboard.tsx b/packages/appstore/src/components/onboarding-new/static-dashboard.tsx index d9fcd14b295a..c3dd2b438671 100644 --- a/packages/appstore/src/components/onboarding-new/static-dashboard.tsx +++ b/packages/appstore/src/components/onboarding-new/static-dashboard.tsx @@ -564,7 +564,7 @@ const StaticDashboard = ({ is_financial_last_step={is_financial_last_step} is_eu_user={is_eu_user} /> - + /> */} )} diff --git a/packages/stores/types.ts b/packages/stores/types.ts index 0b33c95fd546..d4b881635b3e 100644 --- a/packages/stores/types.ts +++ b/packages/stores/types.ts @@ -129,6 +129,7 @@ type TNotification = type TClientStore = { accounts: { [k: string]: TActiveAccount }; + is_eu_country: boolean; active_accounts: TActiveAccount[]; active_account_landing_company: string; trading_platform_available_accounts: TTradingPlatformAvailableAccount[]; From f88bb22ba88efaf3b0f671fc0737152647a4460d Mon Sep 17 00:00:00 2001 From: hirad-deriv Date: Wed, 28 Jun 2023 21:02:41 +0800 Subject: [PATCH 3/3] Hirad/fixed tests (#9178) * fix: hidding deriv ez * fix: fixed test cases --- packages/stores/src/mockStore.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/stores/src/mockStore.ts b/packages/stores/src/mockStore.ts index e837c5439a6a..b6298c3557cb 100644 --- a/packages/stores/src/mockStore.ts +++ b/packages/stores/src/mockStore.ts @@ -123,6 +123,7 @@ const mock = (): TStores & { is_mock: boolean } => { is_deposit_lock: false, is_dxtrade_allowed: false, is_eu: false, + is_eu_country: false, is_financial_account: false, is_financial_information_incomplete: false, is_low_risk: false,