Skip to content

Commit

Permalink
Amina/86159/vanuatu on derived (binary-com#7523)
Browse files Browse the repository at this point in the history
* fix: mt5 dashboard fix

* fix: test cases

* fix: test case

* fix: fixed the alignment issue of password-selection-modal

* fix: switching on exit traders modal

* chore: show appropriate information on the account switcher in the old UI

* fix: next button disabled in eu signup

* fix: test case fix

* fix: account switcher

* fix: manage account in account switcher

* fix: dxtrade error

* fix: redirecting for traders_hub

* fix: header traders hub cursor pointer

* fix: acc switcher

* fix: fixing issues of the tour guide

* fix: change regulations to regulation

* fix: regulations v2

* fix: icon and message

* fix: cursor pointer for status badge

* fix: mf real account signup width

* fix: real account signup modal

* fix: place of birth for eu

* fix: tests

* fix: fixed the scroll issue and added a new condition to tour guide

* fix: removed the redundant line of trading-hub-header

* fix: made a small change for the handle scroll function

* fix: replaced interval with timeout

* feat: vanuatu on derived

* fix: hide idv for EU

* fix: some capital characters

* fix: signup modal title

* fix: regulation compare table scroll smooth

* fix: compare account modal

* fix: responsive alignment

* fix: fix popup content

* fix: malta description fix and styles

* fix: regulation responsive scroll

* fix: compare account modal

* fix: update jurisdiction content

* fix: jurisdiction content

* fix: get_more_btn

* fix: regulators

* fix: css for account type dropdown

* fix: add options account for eu

* fix: onboarding content desc

* fix: onboarding content at stage 5

* fix: onboarding platform names

* chore: hide region for new accounts

* fix: add options account

* fix: design-difference-in-transfer-popup

* fix: regulator table scroll

* fix: success modal meesage

* fix: responsive scroll dashboard

* fix: regulation switcher appearing for high risk

* fix: 86699_stock_to_stocks

* fix: fix add new account

* fix: traders hub header dark theme icon

* fix: tooltip description for non-eu

* fix: dropdown icon for onboarding currency switcher

* fix: add short code text for derived and financial accounts

* fix: eu currency switcher showing in non-eu

* fix: change dmt5 to deriv mt5 in total assets

* fix: cfd learn more link

* test: fix tests

* fix: dark_mode_status_badge

* fix: add icon for deriv and financial accounts in receipt

* refactor: code refactoring

* fix: transfer now to top-up now

* fix: total assets to be shown based on selected region

* fix: total assets to be shown based on selected region

* fix: loginid error on logout

* fix: show popover in mobile

* fix: disable click on tourguide overlay and remove setting accountType on tour guide

* fix: onboarding footer

* fix: test failure

* fix: fixed the background color issue of onboarding in dark theme

* fix: region seitcher in mobile view

* fix: fixed the glitch issue with onboarding

* fix: fixed the issue of tour guide

* fix: dont show loader if user has no account when switching

* fix: deposit now style in cashier transfer modal

* fix: dashboard title size

* fix: decreased the delays

* fix: redirect to static pages

* fix: fixed the localization issue of tour guide

* fix: remove balance when account has mt5 status

* fix: regulation switcher glitch in high risk

* fix: onboarding labels

* fix: pointer display

* fix: status badge icon overflow and total assets currency in dark theme

* fix: success_message

* fix: minor issues in contents

* fix: account from field should be tha same as trading account

* trigger codecov

* fix: top-up to transfer

* fix: switch account to real for demo_low_risk

* fix: can create deriv x account if user has no cr account and status badge icon css

* fix: status badge color inconsistency and size

* fix: deriv x trade modal huawei css

* fix: jurisdiction modal content

* Account fix selected to (#27)

* fix: default selected to account

* fix: account transfer switch to default client acc

* fix: onboarding footer text padding

* fix: real account needed modal for mt5 if user has no cr account

* fix: eu onboarding footer

* fix: redirect_to_traders_hub_on_entering_mt5_url

* fix: redirect derivx url

* fix: icon design mismatch (#26)

* fix: simplified the conditions

* test: fix test

* fix: fixed all conflicts

* refactor: code refactoring

* fix: salutation

* fix: short code visibility

* fix: fix short code visibility

* refactor: code refactoring

* fix: remove icon for derivx trade modal

* fix: fixed the issue where is_pre_appstore was retrived from another place

* fix: add Assets alias to webpack/tsconfig, refactor imports

* test: fix jest config

* fix: default page should be demo in onboarding

* fix: freeze_mg_acc_on_cooling_perios

* fix: onboarding buttons

* fix: transfer_form_from_account_style

* fix: mt5 trade modal css alignment

* chore: hide disclaimer for low-risk clients

* fix: notification console error

* chore: add volatility in regulator modal

* fix: account_transfer_title

* chore: add disclamer to low risk eu

* fix: asterik_on_required_fields

* fix: adding loader to total asset balance on switching

* fix: loader

* fix: loader console error

* fix: regulation switcher glitch when switching

* fix: add back react content loader

* fix: safari styling shiii

* fix: close button on on boarding

* fix: Trader's hub title

* fix: disclaimer text change

* fix: all dem loaders

* fix: up/dpwn icon

* fix: dmt5 paswrd

* fix: low_risk flag in dbot

* fix: fix layout shift on safari

* fix: servererror component fix

* fix: circleci  and typo

* fix: header loader

* fix: investor password

* fix: merge conflicts

* test: vanuatu

* fix: account switcher name and stylings

* fix: test case

* fix: code cleanup

* chore: merge master

* fix: content in modals

* fix: remove code smell

* feat: restrict vanuatu

* fix: allow resubmission

* fix: code smell

* fix: refactor: modal

* fix: remove additional space in compare modal content

* fix: astericks in personal details form

* fix: width alignemnt in form

* fix: typo

* fix: tin label

* fix: tin

* fix: remove code smell

* fix: circleci fix after master update

---------

Co-authored-by: Hirad <hirad@re-work.dev>
Co-authored-by: Jim Daniels Wasswa <jim@deriv.com>
Co-authored-by: Matin shafiei <matin@binary.com>
Co-authored-by: Thisyahlen <thisyahlen@regentmarkets.com>
Co-authored-by: mahdiyeh-deriv <82078941+mahdiyeh-deriv@users.noreply.github.com>
Co-authored-by: Thisyahlen Nair <thisyahlennair@Thisyahlens-MacBook-Pro.local>
Co-authored-by: “Matin-deriv” <matin@deriv.com>
Co-authored-by: Bahar <bahar@regentmarkets.com>
Co-authored-by: george-usynin-binary <heorhi@binary.com>
Co-authored-by: mahdiyeh-fs <mahdiyeh@firstsource.tech>
Co-authored-by: GeorgeUsynin <70709786+GeorgeUsynin@users.noreply.github.com>
  • Loading branch information
12 people committed Mar 17, 2023
1 parent b7df92e commit dc59a0c
Show file tree
Hide file tree
Showing 21 changed files with 260 additions and 126 deletions.
1 change: 1 addition & 0 deletions packages/account/src/Styles/account.scss
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ $MIN_HEIGHT_FLOATING: calc(

.cfd-personal-details-modal__form & {
margin: unset;
max-width: unset;
}

&--2-cols {
Expand Down
44 changes: 31 additions & 13 deletions packages/appstore/src/components/cfds-listing/cfds-listing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
display: flex;
justify-content: space-between;
flex-direction: column;
min-height: 38rem;
min-height: 36rem;
width: 27.6em;
position: relative;
padding: 1.6rem;
Expand Down Expand Up @@ -81,6 +81,24 @@
border-radius: 0.5rem;
}
}
&__footer-wrapper {
@include mobile {
background-color: var(--general-main-1);
width: 100%;
height: 100%;
position: sticky;
bottom: 0;
max-height: 20rem;
z-index: 12;
}
.dc-modal-footer {
@include desktop {
position: fixed;
bottom: 0;
width: 100%;
}
}
}
&__h2-header {
margin: 1.4rem 0 2.4rem;
}
Expand Down Expand Up @@ -1141,7 +1159,7 @@
&__table-header {
grid-template-columns: 0.9fr 1.39fr 2.74fr;
&__pre-appstore {
grid-template-columns: 1fr 1.45fr 2.8fr 0.9fr;
grid-template-columns: 11rem 36rem 46rem 13.5rem;
}
}
@for $financial_accounts_count from 0 through 6 {
Expand Down Expand Up @@ -1178,27 +1196,27 @@
}

&__table-row {
grid-template-columns: 0.9fr 0.72fr 0.67fr 0.72fr 0.67fr 0.65fr 0.7fr;
grid-template-columns: 11rem 13.4rem 12.6rem 12rem 13.4rem 12.6rem 10rem 10rem;
&__pre-appstore {
grid-template-columns: 1fr 0.78fr 0.67fr 0.78fr 0.67fr 0.65fr 0.7fr 0.9fr;
grid-template-columns: 11rem 13.4rem 12.6rem 10rem 13.4rem 12.6rem 10rem 10rem 13.5rem;
}
&--leverage {
grid-template-columns: 0.9fr 0.72fr 0.67fr 2.04fr 0.7fr;
grid-template-columns: 11rem 38rem 36rem 10rem;
&__pre-appstore {
grid-template-columns: 1fr 0.78fr 0.67fr 2.1fr 0.7fr 0.9fr;
grid-template-columns: 11rem 36rem 36rem 10rem 13.5rem;
}
}

&--platform {
&__pre-appstore {
grid-template-columns: 1fr 4.25fr 0.9fr;
grid-template-columns: 11rem 82rem 13.5rem;
}
}

&--instruments {
grid-template-columns: 0.9fr 1.39fr 1.39fr 0.65fr 0.7fr;
grid-template-columns: 11rem 38rem 26rem 10rem 10rem;
&__pre-appstore {
grid-template-columns: 1fr 1.45fr 1.45fr 0.65fr 0.7fr 0.9fr;
grid-template-columns: 11rem 36rem 26rem 10rem 10rem 13.5rem;
}
}
}
Expand All @@ -1211,13 +1229,13 @@
}
}
&__table-footer {
grid-template-columns: 0.9fr 0.72fr 0.67fr 0.72fr 0.67fr 0.65fr 0.7fr;
grid-template-columns: 11rem 13.4rem 12.6rem 12rem 13.4rem 12.6rem 10rem 10rem;
height: 4.8rem;
&__pre-appstore {
grid-template-columns: 1fr 0.78fr 0.67fr 0.78fr 0.67fr 0.65fr 0.7fr 0.9fr;
height: 5.8rem;
grid-template-columns: 11rem 13.4rem 12.6rem 10rem 13.4rem 12.6rem 10rem 10rem 13.5rem;
}
&__item {
height: 5.8rem;
height: 4.8rem;
justify-content: center;
&--eu-pre-appstore {
height: 4.8rem;
Expand Down
12 changes: 8 additions & 4 deletions packages/cfd/src/Components/cfd-personal-details-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@ const CFDPersonalDetailsForm = ({
const item_value = item.value ? item.text : '';
setFieldValue(_field, item_value, true);
};
const tin_field_label = residence_list.find(res => res.text === values.tax_residence && res.tin_format)
?.tin_format
? localize('Tax identification number*')
: localize('Tax identification number');

return (
<AutoHeightWrapper default_height={200} height_offset={isDesktop() ? 148 : null}>
Expand Down Expand Up @@ -318,7 +322,7 @@ const CFDPersonalDetailsForm = ({
data-lpignore='true'
autoComplete='off'
type='text'
label={localize('Citizenship')}
label={localize('Citizenship*')}
error={citizenship_error}
disabled={is_citizenship_disabled}
list_items={residence_list}
Expand All @@ -334,7 +338,7 @@ const CFDPersonalDetailsForm = ({
<MobileWrapper>
<SelectNative
placeholder={localize('Please select')}
label={localize('Citizenship')}
label={localize('Citizenship*')}
value={values.citizen}
list_items={residence_list}
error={citizenship_error}
Expand Down Expand Up @@ -430,8 +434,8 @@ const CFDPersonalDetailsForm = ({
<InputField
id='real_mt5_tax_identification_number'
name='tax_identification_number'
label={localize('Tax identification number')}
placeholder={localize('Tax identification number')}
label={tin_field_label}
placeholder={tin_field_label}
value={values.tax_identification_number}
onBlur={handleBlur}
disabled={
Expand Down
9 changes: 7 additions & 2 deletions packages/cfd/src/Constants/cfd_compare_account_content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export const cr_real_content: TCompareAccountContentProps[] = [
values: {
synthetic_svg: { text: localize('St. Vincent & Grenadines'), options: { weight: 'bold' } },
synthetic_bvi: { text: localize('British Virgin Islands'), options: { weight: 'bold' } },
synthetic_vanuatu: { text: localize('Vanuatu'), options: { weight: 'bold' } },
financial_svg: { text: localize('St. Vincent & Grenadines'), options: { weight: 'bold' } },
financial_bvi: { text: localize('British Virgin Islands'), options: { weight: 'bold' } },
financial_vanuatu: { text: localize('Vanuatu'), options: { weight: 'bold' } },
Expand All @@ -93,6 +94,7 @@ export const cr_real_content: TCompareAccountContentProps[] = [
values: {
synthetic_svg: { text: localize('Deriv (SVG) LLC') },
synthetic_bvi: { text: localize('Deriv (BVI) Ltd') },
synthetic_vanuatu: { text: localize('Deriv (V) Ltd') },
financial_svg: { text: localize('Deriv (SVG) LLC') },
financial_bvi: { text: localize('Deriv (BVI) Ltd') },
financial_vanuatu: { text: localize('Deriv (V) Ltd') },
Expand All @@ -102,12 +104,15 @@ export const cr_real_content: TCompareAccountContentProps[] = [
},
{
id: 'regulator',
attribute: localize('Regulators/External dispute resolution'),
attribute: localize('Regulator/External dispute resolution'),
values: {
synthetic_svg: { text: localize('Financial Commission') },
synthetic_bvi: {
text: localize('British Virgin Islands Financial Services Commission (licence no. SIBA/L/18/1114)'),
},
synthetic_vanuatu: {
text: localize('Vanuatu Financial Services Commission'),
},
financial_svg: { text: localize('Financial Commission') },
financial_bvi: {
text: localize('British Virgin Islands Financial Services Commission (licence no. SIBA/L/18/1114)'),
Expand All @@ -124,7 +129,6 @@ export const cr_real_content: TCompareAccountContentProps[] = [
attribute: localize('Maximum leverage'),
values: {
synthetic_svg: { text: localize('Up to 1:1000') },
synthetic_bvi: { text: localize('Up to 1:1000') },
financial_vanuatu: { text: localize('Up to 1:1000') },
financial_labuan: { text: localize('Up to 1:100') },
derivx: { text: localize('Up to 1:1000') },
Expand Down Expand Up @@ -170,6 +174,7 @@ export const cr_real_content: TCompareAccountContentProps[] = [
export const cr_real_footer_buttons: TCompareAccountFooterButtonData[] = [
{ label: localize('Add'), action: 'synthetic_svg' },
{ label: localize('Add'), action: 'synthetic_bvi' },
{ label: localize('Add'), action: 'synthetic_vanuatu' },
{ label: localize('Add'), action: 'financial_svg' },
{ label: localize('Add'), action: 'financial_bvi' },
{ label: localize('Add'), action: 'financial_vanuatu' },
Expand Down
3 changes: 1 addition & 2 deletions packages/cfd/src/Constants/jurisdiction-contents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ export const jurisdiction_contents: TJurisdictionContent = {
header: localize('Vanuatu'),
synthetic_contents: [
`${localize('Regulated by the Vanuatu Financial Services Commission')}`,
`${localize('Registered with the Financial Commission')}`,
`${localize('90+ assets: forex, stock indices, commodities and cryptocurrencies')}`,
`${localize('30+ assets: synthetics, basket indices and derived FX')}`,
`${localize('Leverage up to 1:1000')}`,
],
financial_contents: [
Expand Down
21 changes: 19 additions & 2 deletions packages/cfd/src/Containers/__tests__/cfd-password-modal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ describe('<CFDPasswordModal/>', () => {
is_cfd_password_modal_enabled: true,
is_cfd_success_dialog_enabled: false,
is_dxtrade_allowed: false,
is_pre_appstore: false,
jurisdiction_selected_shortcode: 'svg',
platform: 'mt5',
has_cfd_error: false,
Expand Down Expand Up @@ -267,6 +268,22 @@ describe('<CFDPasswordModal/>', () => {
</Router>
);

expect(await screen.findByText('IcMt5SyntheticPlatform')).toBeInTheDocument();
});

it('should display icon in Success Dialog in tradershub', async () => {
const props = {
account_status: { status: ['mt5_password_not_set', 'dxtrade_password_not_set'] },
error_type: 'PasswordError',
account_type: { category: 'real', type: 'synthetic' },
is_pre_appstore: true,
};
render(
<Router history={history}>
<CFDPasswordModal {...mock_props} {...props} is_cfd_success_dialog_enabled is_eu />
</Router>
);

expect(await screen.findByText('MockedMT5Icon')).toBeInTheDocument();
});

Expand All @@ -282,7 +299,7 @@ describe('<CFDPasswordModal/>', () => {
</Router>
);

expect(await screen.findByText('MockedMT5Icon')).toBeInTheDocument();
expect(await screen.findByText('IcMt5FinancialPlatform')).toBeInTheDocument();
});

it('should display IcDxtradeSyntheticPlatform icon in Success Dialog', async () => {
Expand Down Expand Up @@ -328,7 +345,7 @@ describe('<CFDPasswordModal/>', () => {
<CFDPasswordModal {...mock_props} {...props} show_eu_related_content is_cfd_success_dialog_enabled />
</Router>
);
expect(await screen.findByText('MockedMT5Icon')).toBeInTheDocument();
expect(await screen.findByText('IcMt5CfdPlatform')).toBeInTheDocument();
});

it('should invoke verifyEmail for DerivX when Forgot password is clicked', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/cfd/src/Containers/cfd-dbvi-onboarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const CFDDbviOnboarding = ({
updateAccountStatus,
updateMT5Status,
}: TCFDDbviOnboardingProps) => {
const [showSubmittedModal, setShowSubmittedModal] = React.useState(false);
const [showSubmittedModal, setShowSubmittedModal] = React.useState(true);
const [is_loading, setIsLoading] = React.useState(false);

const getAccountStatusFromAPI = () => {
Expand Down
42 changes: 28 additions & 14 deletions packages/cfd/src/Containers/cfd-password-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ type TIconTypeProps = {
platform: string;
type?: string;
show_eu_related_content: boolean;
is_pre_appstore: boolean;
};

type TCFDPasswordFormReusedProps = {
Expand Down Expand Up @@ -197,7 +198,7 @@ const ReviewMessageForMT5 = ({
return null;
};

const IconType = React.memo(({ platform, type, show_eu_related_content }: TIconTypeProps) => {
const IconType = React.memo(({ is_pre_appstore, platform, type, show_eu_related_content }: TIconTypeProps) => {
if (platform === CFD_PLATFORMS.DXTRADE) {
switch (type) {
case 'all':
Expand All @@ -209,19 +210,30 @@ const IconType = React.memo(({ platform, type, show_eu_related_content }: TIconT
default:
return <Icon icon='IcDxtradeDerivxPlatform' size={128} />;
}
}

switch (type) {
case 'synthetic':
return <TradingPlatformIcon icon='Derived' size={128} />;
case 'financial':
if (show_eu_related_content) {
return <TradingPlatformIcon icon='CFDs' size={128} />;
}
return <TradingPlatformIcon icon='Financial' size={128} />;
default:
return <TradingPlatformIcon icon='Financial' size={128} />;
}
} else if (is_pre_appstore) {
switch (type) {
case 'synthetic':
return <TradingPlatformIcon icon='Derived' size={128} />;
case 'financial':
if (show_eu_related_content) {
return <TradingPlatformIcon icon='CFDs' size={128} />;
}
return <TradingPlatformIcon icon='Financial' size={128} />;
default:
return <TradingPlatformIcon icon='Financial' size={128} />;
}
} else
switch (type) {
case 'synthetic':
return <Icon icon='IcMt5SyntheticPlatform' size={128} />;
case 'financial':
if (show_eu_related_content) {
return <Icon icon='IcMt5CfdPlatform' size={128} />;
}
return <Icon icon='IcMt5FinancialPlatform' size={128} />;
default:
return <Icon icon='IcMt5FinancialStpPlatform' size={128} />;
}
});
IconType.displayName = 'IconType';

Expand Down Expand Up @@ -615,6 +627,7 @@ const CFDPasswordModal = ({
getAccountStatus,
history,
is_logged_in,
is_pre_appstore,
context,
is_cfd_password_modal_enabled,
is_cfd_success_dialog_enabled,
Expand Down Expand Up @@ -924,6 +937,7 @@ const CFDPasswordModal = ({
message={getSubmitText()}
icon={
<IconType
is_pre_appstore={is_pre_appstore}
platform={platform}
type={account_type.type}
show_eu_related_content={show_eu_related_content}
Expand Down
2 changes: 1 addition & 1 deletion packages/cfd/src/Containers/compare-accounts-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ const CompareAccountsModal = ({
} else if (is_pre_appstore_setting && should_show_derivx) {
return {
height: '574px',
width: '1131px',
width: '1115px',
};
}
return {
Expand Down
Loading

0 comments on commit dc59a0c

Please sign in to comment.