Skip to content

Commit

Permalink
farabi/bot-315/dbot-to-deriv-bot (#8955)
Browse files Browse the repository at this point in the history
* fix: rebrand dbot to deriv bot

* chore: added test case for tour trigger dialog
  • Loading branch information
farabi-deriv committed Jun 19, 2023
1 parent e96af69 commit c5baadb
Show file tree
Hide file tree
Showing 14 changed files with 69 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const Toolbar = (props: TToolbar) => {
<div className='toolbar__section'>
{isMobile() && (
<ToolbarButton
popover_message={localize('Click here to start building your DBot.')}
popover_message={localize('Click here to start building your Deriv Bot.')}
button_id='db-toolbar__get-started-button'
button_classname='toolbar__btn toolbar__btn--icon toolbar__btn--start'
buttonOnClick={props.loadDataStrategy}
Expand All @@ -65,7 +65,7 @@ const Toolbar = (props: TToolbar) => {
>
{is_running ? (
<Localize
i18n_default_text='DBot will not proceed with any new trades. Any ongoing trades will be completed by our system. Any unsaved changes will be lost.<0>Note: Please check your statement to view completed transactions.</0>'
i18n_default_text='Deriv Bot will not proceed with any new trades. Any ongoing trades will be completed by our system. Any unsaved changes will be lost.<0>Note: Please check your statement to view completed transactions.</0>'
components={[
<div
key={0}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const Toolbox = ({
return (
<div className='dashboard__toolbox' data-testid='dashboard__toolbox'>
<ToolbarButton
popover_message={localize('Click here to start building your DBot.')}
popover_message={localize('Click here to start building your Deriv Bot.')}
button_id='db-toolbar__get-started-button'
button_classname='toolbar__btn toolbar__btn--icon toolbar__btn--start'
buttonOnClick={loadDataStrategy}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jest.mock('@deriv/components', () => ({

export const mocked_props = {
active_tab: '3',
is_tour_dialog_visible: true,
dialog_options: {
title: 'string',
message: 'string',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export type TSidebarItem = {

export const SIDEBAR_INTRO: TSidebarItem[] = [
{
label: localize('Welcome to DBot!'),
label: localize('Welcome to Deriv Bot!'),
content: [
localize(
'Ready to automate your trading strategy without writing any code? You’ve come to the right place.'
Expand All @@ -19,13 +19,13 @@ export const SIDEBAR_INTRO: TSidebarItem[] = [
},
{
label: localize('Guide'),
content: [localize('DBot - your automated trading partner')],
content: [localize('Deriv Bot - your automated trading partner')],
link: true,
},
{
label: localize('FAQs'),
content: [
localize('What is DBot?'),
localize('What is Deriv Bot?'),
localize('Where do I find the blocks I need?'),
localize('How do I remove blocks from the workspace?'),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ export const BOT_BUILDER_MOBILE: TStepMobile[] = [

export const DBOT_ONBOARDING_MOBILE = [
{
header: localize('Get started on DBot'),
header: localize('Get started on Deriv Bot'),
content: [
<Localize
key='get-started=mobile'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import { mocked_props } from './dashboard-component/__tests__/dashboard-component.spec';
import TourTriggrerDialog from './tour-trigger-dialog';

const mock_connect_props = {
dialog_options: {
title: 'string',
message: 'string',
ok_button_text: 'string',
cancel_button_text: 'string',
},
setStrategySaveType: jest.fn(),
};

jest.mock('Stores/connect.js', () => ({
__esModule: true,
default: 'mockedDefaultExport',
connect:
() =>
<T,>(Component: T) =>
props =>
Component({ ...props, ...mock_connect_props }),
}));

describe('<TourTriggrerDialog />', () => {
it('renders tour trigger dialog', () => {
render(<TourTriggrerDialog {...mocked_props} />);
expect(screen.getByText(/Get started on Deriv Bot/i)).toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const TourTriggrerDialog = ({
let text;
if (!tour_check) {
if (tab_id === 1) text = localize(is_mobile ? 'Bot Builder guide' : "Let's build a Bot!");
else text = localize('Get started on DBot');
else text = localize('Get started on Deriv Bot');
} else if (tab_id === 1) text = localize('Congratulations');
else text = localize('Want to retake the tour?');
return text;
Expand All @@ -82,7 +82,7 @@ const TourTriggrerDialog = ({
key={0}
i18n_default_text={
is_mobile
? 'Here’s a quick guide on how to use DBot on the go.'
? 'Here’s a quick guide on how to use Deriv Bot on the go.'
: 'Learn how to build your bot from scratch using a simple strategy.'
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const GuideContent = ({
</div>
{guide_list?.length > 0 && (
<Text align='center' weight='bold' color='prominent' line_height='s' size={is_mobile ? 'xxs' : 's'}>
Videos on DBot
Videos on Deriv Bot
</Text>
)}
<div className='tutorials-wrap__group'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const user_guide_content: TUserGuideContent[] = [
id: 1,
type: 'Tour',
subtype: 'OnBoard',
content: localize('Get started on DBot'),
content: localize('Get started on Deriv Bot'),
src: getImageLocation('onboard-tour.png'),
},
{
Expand All @@ -40,20 +40,20 @@ export const guide_content: TGuideContent[] = [
{
id: 1,
type: 'DBotVideo',
content: localize('DBot - your automated trading partner'),
content: localize('Deriv Bot - your automated trading partner'),
url: 'https://www.youtube.com/embed/QdI5zCkO4Gk',
src: getImageLocation('video_dbot.webp'),
},
];

export const faq_content: TFaqContent[] = [
{
title: localize('What is DBot?'),
title: localize('What is Deriv Bot?'),
description: [
{
type: 'text',
content: localize(
"DBot is a web-based strategy builder for trading digital options. It’s a platform where you can build your own automated trading bot using drag-and-drop 'blocks'."
"Deriv Bot is a web-based strategy builder for trading digital options. It’s a platform where you can build your own automated trading bot using drag-and-drop 'blocks'."
),
},
],
Expand Down Expand Up @@ -130,7 +130,7 @@ export const faq_content: TFaqContent[] = [
],
},
{
title: localize('Do you offer pre-built trading bots on DBot?'),
title: localize('Do you offer pre-built trading bots on Deriv Bot?'),
description: [
{
type: 'text',
Expand All @@ -146,7 +146,7 @@ export const faq_content: TFaqContent[] = [
{
type: 'text',
content: localize(
"A quick strategy is a ready-made strategy that you can use in DBot. There are 3 quick strategies you can choose from: Martingale, D'Alembert, and Oscar's Grind."
"A quick strategy is a ready-made strategy that you can use in Deriv Bot. There are 3 quick strategies you can choose from: Martingale, D'Alembert, and Oscar's Grind."
),
},
{
Expand Down Expand Up @@ -191,7 +191,7 @@ export const faq_content: TFaqContent[] = [
],
},
{
title: localize('How do I import my own trading bot into DBot?'),
title: localize('How do I import my own trading bot into Deriv Bot?'),
description: [
{
type: 'text',
Expand Down Expand Up @@ -270,12 +270,12 @@ export const faq_content: TFaqContent[] = [
],
},
{
title: localize('How do I control my losses with DBot?'),
title: localize('How do I control my losses with Deriv Bot?'),
description: [
{
type: 'text',
content: localize(
'There are several ways to control your losses with DBot. Here’s a simple example of how you can implement loss control in your strategy:'
'There are several ways to control your losses with Deriv Bot. Here’s a simple example of how you can implement loss control in your strategy:'
),
},
{
Expand Down Expand Up @@ -337,7 +337,7 @@ export const faq_content: TFaqContent[] = [
],
},
{
title: localize('Can I run DBot on multiple tabs in my web browser?'),
title: localize('Can I run Deriv Bot on multiple tabs in my web browser?'),
description: [
{
type: 'text',
Expand All @@ -348,11 +348,11 @@ export const faq_content: TFaqContent[] = [
],
},
{
title: localize('Can I trade cryptocurrencies on DBot?'),
title: localize('Can I trade cryptocurrencies on Deriv Bot?'),
description: [
{
type: 'text',
content: localize("No, we don't offer cryptocurrencies on DBot."),
content: localize("No, we don't offer cryptocurrencies on Deriv Bot."),
},
],
},
Expand All @@ -362,13 +362,13 @@ export const faq_content: TFaqContent[] = [
{
type: 'text',
content: localize(
"No, we don't. However, you'll find quick strategies on DBot that'll help you build your own trading bot for free."
"No, we don't. However, you'll find quick strategies on Deriv Bot that'll help you build your own trading bot for free."
),
},
],
},
{
title: localize('In which countries is DBot available?'),
title: localize('In which countries is Deriv Bot available?'),
description: [
{
type: 'text',
Expand All @@ -379,11 +379,11 @@ export const faq_content: TFaqContent[] = [
],
},
{
title: localize('If I close my web browser, will DBot continue to run?'),
title: localize('If I close my web browser, will Deriv Bot continue to run?'),
description: [
{
type: 'text',
content: localize('No, DBot will stop running when your web browser is closed.'),
content: localize('No, Deriv Bot will stop running when your web browser is closed.'),
},
],
},
Expand All @@ -393,7 +393,7 @@ export const faq_content: TFaqContent[] = [
{
type: 'text',
content: localize(
"Three of the most commonly used strategies in automated trading are Martingale, D'Alembert, and Oscar's Grind — you can find them all ready-made and waiting for you in DBot."
"Three of the most commonly used strategies in automated trading are Martingale, D'Alembert, and Oscar's Grind — you can find them all ready-made and waiting for you in Deriv Bot."
),
},
],
Expand All @@ -404,7 +404,7 @@ export const faq_content: TFaqContent[] = [
{
type: 'text',
content: localize(
'<a href="https://www.youtube.com/watch?v=QdI5zCkO4Gk&t=203s" target="_blank">Watch this video</a> to learn how to build a trading bot on DBot. Also, <a href="https://deriv.com/academy/blog/posts/how-to-build-a-basic-trading-bot-with-dbot/" target="_blank">check out this blog post</a> on building a trading bot.'
'<a href="https://www.youtube.com/watch?v=QdI5zCkO4Gk&t=203s" target="_blank">Watch this video</a> to learn how to build a trading bot on Deriv Bot. Also, <a href="https://deriv.com/academy/blog/posts/how-to-build-a-basic-trading-bot-with-dbot/" target="_blank">check out this blog post</a> on building a trading bot.'
),
},
],
Expand Down
6 changes: 3 additions & 3 deletions packages/bot-web-ui/src/stores/app-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export default class AppStore {
text: localize(
'We’re working to have this available for you soon. If you have another account, switch to that account to continue trading. You may add a Deriv MT5 Financial.'
),
title: localize('DBot is not available for this account'),
title: localize('Deriv Bot is not available for this account'),
link: localize('Go to Deriv MT5 dashboard'),
});
}
Expand All @@ -190,7 +190,7 @@ export default class AppStore {
text: localize(
'We’re working to have this available for you soon. If you have another account, switch to that account to continue trading. You may add a Deriv MT5 Financial.'
),
title: localize('DBot is not available for this account'),
title: localize('Deriv Bot is not available for this account'),
link: localize('Go to Deriv MT5 dashboard'),
});
}
Expand Down Expand Up @@ -249,7 +249,7 @@ export default class AppStore {
text: localize(
'We’re working to have this available for you soon. If you have another account, switch to that account to continue trading. You may add a Deriv MT5 Financial.'
),
title: localize('DBot is not available for this account'),
title: localize('Deriv Bot is not available for this account'),
link: localize('Go to Deriv MT5 dashboard'),
});
} else if (common.has_error) {
Expand Down
6 changes: 3 additions & 3 deletions packages/bot-web-ui/src/stores/run-panel-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,8 @@ export default class RunPanelStore {
this.onOkButtonClick = this.onCloseDialog;
this.onCancelButtonClick = undefined;
this.dialog_options = {
title: localize("DBot isn't quite ready for real accounts"),
message: localize('Please switch to your demo account to run your DBot.'),
title: localize("Deriv Bot isn't quite ready for real accounts"),
message: localize('Please switch to your demo account to run your Deriv Bot.'),
};
this.is_dialog_open = true;
}
Expand All @@ -367,7 +367,7 @@ export default class RunPanelStore {
this.onCancelButtonClick = undefined;
this.dialog_options = {
title: localize('Import error'),
message: localize('This strategy is currently not compatible with DBot.'),
message: localize('This strategy is currently not compatible with Deriv Bot.'),
};
this.is_dialog_open = true;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/bot-web-ui/src/utils/bot-notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const switch_account_notification = {
key: 'bot_switch_account',
header: localize('You have switched accounts.'),
message: localize(
'Our system will finish any DBot trades that are running, and DBot will not place any new trades.'
'Our system will finish any Deriv Bot trades that are running, and Deriv Bot will not place any new trades.'
),
type: 'warning',
is_persistent: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { localize } from '@deriv/translations';
export default {
text: [
localize(
'This block is mandatory. Only one copy of this block is allowed. It is added to the canvas by default when you open DBot.'
'This block is mandatory. Only one copy of this block is allowed. It is added to the canvas by default when you open Deriv Bot.'
),
localize(
'After defining trade parameters and trade options, you may want to instruct your bot to purchase contracts when specific conditions are met. To do that you can use conditional blocks and indicators blocks to help your bot to make decisions.'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default {
),
localize('- Find the chat ID property in the response, and copy the value of the id property'),
localize(
'4. Come back to DBot and add the Notify Telegram block to the workspace. Paste the Telegram API token and chat ID into the block fields accordingly.'
'4. Come back to Deriv Bot and add the Notify Telegram block to the workspace. Paste the Telegram API token and chat ID into the block fields accordingly.'
),
],
};

1 comment on commit c5baadb

@vercel
Copy link

@vercel vercel bot commented on c5baadb Jun 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

deriv-app – ./

deriv-app.vercel.app
binary.sx
deriv-app-git-master.binary.sx
deriv-app.binary.sx

Please sign in to comment.