Skip to content

Commit

Permalink
Hirad/ cTrader demo accounts flow (deriv-com#8486)
Browse files Browse the repository at this point in the history
* feat: finishing cTrader flow

* fix: finished cTrader flow

* fix: success modal message changed

* feat: added reusable trade modal to the flow

* feat: added token to CTrader flow

* fix: added ctrader token to the remaining parts of the project

* fix: fixed the typo of cTrader in the token setter part

* fix: fixed the google play icon issue

* fix: removed the redundant condition

* fix: made improvements to trade modal and fixed the jurisdiction modal text issue

* feat: add demo/real transfers

* fix: made changes according to suggestions

* perf: minor fixes

* chore: minor fix

* chore: minor refactor

* chore: minor refactor

* chore: minor fixes

* fix: apply comments

* refactor: return side note to origin untild real ctrader release

* fix: add sub title for demo ctrader account

* refactor: improve naming

* fix: added top up for cTrader

* fix: fixed code smell issues

* fix: fixed the type of CTraderAndDerivEZDescription component

* fix: added cTrader to the onboarding page

* fix: fixed the issue with the user redirections

* fix: added support for qa1000 as well

* fix: changed the server maintenance text

* fix: changed the server maintenance text

* fix: added the onelink for QRCodes

* fix: added download center description and separated loadToken of ctrader from deriv x

* fix: unhide the real account flow

* fix: add ctrader account list

* fix: updated the content of you need a deriv account pop up

* fix: added ctrader to email and password part

* fix: fixed the css issues of cTrader platform in password and email

* fix: fixing cTrader issues

* fix: fixing the issues that were raised after resolving the conflicts

* fix: fixed the issue where all accounts were shown as Swap Free

* fix: finished cTrader fixes

* fix: changed web terminal icon and fixed windows download link and text

* fix: fixed some issues of cTrader

* fix: fixed the visibility of cTrader

* fix: fixing the test cases

* fix: fixed all of the test cases

* fix: added return to fix the issue of sonar cloud

* fix: removed real account from the flow

* fix: removed the real account from the flow

* fix: removing the redundant files from the PR

* Update bot-notification.tsx

* fix: removing the redundant files

* fix: removing the redundant files

* Update recent-footer.tsx

* Update contract-details.jsx

* Update recent-footer.tsx

* Update download.tsx

* Update faq-content.tsx

* fix: made changes based on the comments in the PR

* chore: small changes based on the comments

* fix: making changes based on the comments

* fix: fixed some small issues of cfds-listing

* chore: making small changes based on the content changes

* fix: made some small changes based on the new design

* fix: fixing the server maintenance icon

* fix: fixing issues raised for cTrader

* fix: fixed the design changes

* fix: added the tag for demo accounts

* chore: made changes to trade modal text

* fix: fixed the app description of cTrader

* fix: fixed the issue where cTrader was shown for AU and Norway

* fix: adding cTrader demo to top up modal

* fix: disabled cTrader redirection link

* fix: removed the issue where the blue part was shown in dxtrade

* fix: fixed the issue of the tag for demo accounts

* fix: hid the download part in the cTrader platform

* chore: added cTrader to compare account

* fix: fixing unit tests

* chore: updated the terminal link

* chore: updated the windows app link

* fix: fixed the jurisdiction modal pop up issue

* fix: fixing the unit tests

* fix: build does not fail anymore

* fix: removed cTrader from compare account

* fix: fixing the sonar cloud issue

---------

Co-authored-by: george-usynin-binary <heorhi@binary.com>
Co-authored-by: George Usynin <103181646+heorhi-deriv@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 15, 2023
1 parent 1a96216 commit d99ad25
Show file tree
Hide file tree
Showing 70 changed files with 1,154 additions and 324 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ describe('<DerivPassword />', () => {
})
).toBeInTheDocument();
expect(
screen.getByText(/use the to log in to deriv\.com, deriv go, deriv trader, smarttrader, and deriv bot\./i)
screen.getByText(
/use the to log in to deriv\.com, deriv go, deriv trader, smarttrader, deriv bot and deriv ctrader\./i
)
).toBeInTheDocument();
// expect BrandDerivRed not to be in the document
expect(screen.queryByText(/BrandDerivRed/i)).toBeInTheDocument();
Expand All @@ -50,7 +52,7 @@ describe('<DerivPassword />', () => {
expect(screen.queryByText(/unlink from/i)).not.toBeInTheDocument();

const popover_wrapper = screen.getAllByTestId('dt_popover_wrapper');
expect(popover_wrapper).toHaveLength(5);
expect(popover_wrapper).toHaveLength(6);
});

it('displays the correct platform information for non-MF clients & restricted countries', () => {
Expand All @@ -59,8 +61,8 @@ describe('<DerivPassword />', () => {
expect(screen.getByText(/use the to log in to deriv\.com, deriv trader and deriv go\./i));

const popover_wrapper = screen.getAllByTestId('dt_popover_wrapper');
// expect popover to have length of 2
expect(popover_wrapper).toHaveLength(3);
// expect popover to have length of 4
expect(popover_wrapper).toHaveLength(4);
// expect button with text change password to be in the document
expect(screen.getByRole('button', { name: /change password/i })).toBeInTheDocument();
});
Expand Down
75 changes: 53 additions & 22 deletions packages/account/src/Sections/Security/Passwords/deriv-password.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,34 +32,54 @@ const DerivPassword = ({
const platform_name_smarttrader = getPlatformSettings('smarttrader').name;
const platform_name_trader = getPlatformSettings('trader').name;
const platform_name_derivez = getPlatformSettings('derivez').name;
const platform_name_ctrader = getPlatformSettings('ctrader').name;

const PlatformDescription = () => {
let text =
'Use the <0>Deriv password</0> to log in to {{brand_website_name}}, {{platform_name_go}}, {{platform_name_trader}}, {{platform_name_smarttrader}}, and {{platform_name_dbot}}.';
let values = {
brand_website_name,
platform_name_trader,
platform_name_dbot,
platform_name_smarttrader,
platform_name_go,
};
if (is_eu_user) {
text = 'Use the <0>Deriv password</0> to log in to {{brand_website_name}} and {{platform_name_trader}}.';
values = {
brand_website_name,
platform_name_trader,
};
return (
<Localize
i18n_default_text={
'Use the <0>Deriv password</0> to log in to {{brand_website_name}} and {{platform_name_trader}}.'
}
components={[<strong key={0} />]}
values={{
brand_website_name,
platform_name_trader,
}}
/>
);
} else if (financial_restricted_countries) {
text =
'Use the <0>Deriv password</0> to log in to {{brand_website_name}}, {{platform_name_trader}} and {{platform_name_go}}.';
values = {
brand_website_name,
platform_name_trader,
platform_name_go,
};
return (
<Localize
i18n_default_text={
'Use the <0>Deriv password</0> to log in to {{brand_website_name}}, {{platform_name_trader}} and {{platform_name_go}}.'
}
components={[<strong key={0} />]}
values={{
brand_website_name,
platform_name_trader,
platform_name_go,
}}
/>
);
}

return <Localize i18n_default_text={text} components={[<strong key={0} />]} values={values} />;
return (
<Localize
i18n_default_text={
'Use the <0>Deriv password</0> to log in to {{brand_website_name}}, {{platform_name_go}}, {{platform_name_trader}}, {{platform_name_smarttrader}}, {{platform_name_dbot}} and {{platform_name_ctrader}}.'
}
components={[<strong key={0} />]}
values={{
brand_website_name,
platform_name_trader,
platform_name_dbot,
platform_name_smarttrader,
platform_name_go,
platform_name_ctrader,
}}
/>
);
};

return (
Expand All @@ -82,6 +102,10 @@ const DerivPassword = ({
{brand_website_name}
</Text>
</div>

{
//TODO reuse this piece of code in future by mapping through the platforms.
}
<div className='passwords-platform__icons'>
<Popover alignment='bottom' message={platform_name_trader}>
<Icon
Expand Down Expand Up @@ -124,6 +148,13 @@ const DerivPassword = ({
description='derivez'
/>
</Popover>
<Popover alignment='bottom' message={platform_name_ctrader}>
<Icon
icon={`${getPlatformSettings('ctrader').icon}-dashboard`}
size={32}
description='ctrader'
/>
</Popover>
</React.Fragment>
)}
</div>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions packages/appstore/src/assets/svgs/trading-platform/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import BinaryBot from 'Assets/svgs/trading-platform/branding/ic-branding-binarybot-dashboard.svg';
import BinaryBotBlue from 'Assets/svgs/trading-platform/ic-appstore-binarybot-blue.svg';
import CFDs from 'Assets/svgs/trading-platform/branding/ic-branding-mt5-cfds.svg';
import CTrader from 'Assets/svgs/trading-platform/branding/ic-branding-ctrader.svg';
import DBot from 'Assets/svgs/trading-platform/branding/ic-branding-dbot-dashboard.svg';
import Demo from 'Assets/svgs/trading-platform/ic-brand-demo.svg';
import Derived from 'Assets/svgs/trading-platform/branding/ic-branding-mt5-derived-dashboard.svg';
Expand All @@ -24,6 +25,7 @@ export const PlatformIcons = {
BinaryBot,
BinaryBotBlue,
CFDs,
CTrader,
DBot,
Demo,
Derived,
Expand Down
44 changes: 39 additions & 5 deletions packages/appstore/src/components/cfds-listing/cfds-listing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,15 @@
color: var(--text-less-prominent);
line-height: 1.45;
}
&--tag {
background-color: $color-blue;
color: var(--text-colored-background);
border-radius: 0.2rem;
padding: 0 0.4rem;
font-weight: bold;
font-size: 1.3rem;
}

&__mobile {
&-title {
text-align: left;
Expand Down Expand Up @@ -428,7 +437,6 @@
&__maintenance {
display: flex;
padding-top: 1rem;
align-items: center;

&-icon {
padding-right: 0.5rem;
Expand All @@ -439,13 +447,18 @@
}
}

&__dxtrade-button {
&__dxtrade-button,
&__platform-button {
display: flex;
background: var(--brand-dark-grey);
align-items: center;
text-decoration: none;
border-radius: $BORDER_RADIUS;

&-icon {
margin-left: 0.6rem;
}

&-text {
padding: 0.5rem;

Expand All @@ -454,9 +467,6 @@
white-space: nowrap;
}
}
&-icon {
margin-left: 0.6rem;
}
}
&__specs {
padding: 1.6rem;
Expand Down Expand Up @@ -543,6 +553,30 @@
border: 1px solid var(--border-normal-2);
color: var(--text-less-prominent);

&:hover {
background-color: var(--button-secondary-hover);
}
}
}
&--windows {
display: flex;
gap: 1.6rem;
align-items: center;
padding: 1.6rem 2.4rem;
border-bottom: 1px solid var(--border-disabled);
&-item {
flex-grow: 1;
}
&-link {
align-items: center;
display: flex;
justify-content: center;
text-decoration: none;
@include typeface(--paragraph-center-bold-black, none);
background-color: transparent;
border: 1px solid var(--border-normal-2);
color: var(--text-less-prominent);

&:hover {
background-color: var(--button-secondary-hover);
}
Expand Down
Loading

0 comments on commit d99ad25

Please sign in to comment.