From c5baadba2aa3dea574daa894f2a740eb0ccfccad Mon Sep 17 00:00:00 2001 From: Farabi <102643568+farabi-deriv@users.noreply.github.com> Date: Mon, 19 Jun 2023 18:22:59 +0800 Subject: [PATCH] farabi/bot-315/dbot-to-deriv-bot (#8955) * fix: rebrand dbot to deriv bot * chore: added test case for tour trigger dialog --- .../dashboard/bot-builder/toolbar/toolbar.tsx | 4 +-- .../dashboard/bot-builder/toolbox/toolbox.tsx | 2 +- .../__tests__/dashboard-component.spec.tsx | 1 + .../dashboard-component/constants.ts | 6 ++-- .../components/dashboard/joyride-config.tsx | 2 +- .../dashboard/tour-trigger-dialog.spec.tsx | 31 ++++++++++++++++ .../dashboard/tour-trigger-dialog.tsx | 4 +-- .../dashboard/tutorial-tab/guide-content.tsx | 2 +- .../tutorial-tab/tutorial-content.tsx | 36 +++++++++---------- packages/bot-web-ui/src/stores/app-store.js | 6 ++-- .../bot-web-ui/src/stores/run-panel-store.js | 6 ++-- .../bot-web-ui/src/utils/bot-notifications.js | 2 +- .../help-strings/before_purchase.js | 2 +- .../help-strings/notify_telegram.js | 2 +- 14 files changed, 69 insertions(+), 37 deletions(-) create mode 100644 packages/bot-web-ui/src/components/dashboard/tour-trigger-dialog.spec.tsx diff --git a/packages/bot-web-ui/src/components/dashboard/bot-builder/toolbar/toolbar.tsx b/packages/bot-web-ui/src/components/dashboard/bot-builder/toolbar/toolbar.tsx index 6dd97fc2ae26..baeeb6daf0fb 100644 --- a/packages/bot-web-ui/src/components/dashboard/bot-builder/toolbar/toolbar.tsx +++ b/packages/bot-web-ui/src/components/dashboard/bot-builder/toolbar/toolbar.tsx @@ -41,7 +41,7 @@ const Toolbar = (props: TToolbar) => {
{isMobile() && ( { > {is_running ? ( ({ export const mocked_props = { active_tab: '3', + is_tour_dialog_visible: true, dialog_options: { title: 'string', message: 'string', diff --git a/packages/bot-web-ui/src/components/dashboard/dashboard-component/constants.ts b/packages/bot-web-ui/src/components/dashboard/dashboard-component/constants.ts index 6c6b426ae3ab..ecb4204b7d12 100644 --- a/packages/bot-web-ui/src/components/dashboard/dashboard-component/constants.ts +++ b/packages/bot-web-ui/src/components/dashboard/dashboard-component/constants.ts @@ -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.' @@ -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?'), ], diff --git a/packages/bot-web-ui/src/components/dashboard/joyride-config.tsx b/packages/bot-web-ui/src/components/dashboard/joyride-config.tsx index b80b88567d94..96cad2a8f764 100644 --- a/packages/bot-web-ui/src/components/dashboard/joyride-config.tsx +++ b/packages/bot-web-ui/src/components/dashboard/joyride-config.tsx @@ -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: [ ({ + __esModule: true, + default: 'mockedDefaultExport', + connect: + () => + (Component: T) => + props => + Component({ ...props, ...mock_connect_props }), +})); + +describe('', () => { + it('renders tour trigger dialog', () => { + render(); + expect(screen.getByText(/Get started on Deriv Bot/i)).toBeInTheDocument(); + }); +}); diff --git a/packages/bot-web-ui/src/components/dashboard/tour-trigger-dialog.tsx b/packages/bot-web-ui/src/components/dashboard/tour-trigger-dialog.tsx index 67184401340d..e7959c304a5a 100644 --- a/packages/bot-web-ui/src/components/dashboard/tour-trigger-dialog.tsx +++ b/packages/bot-web-ui/src/components/dashboard/tour-trigger-dialog.tsx @@ -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; @@ -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.' } /> diff --git a/packages/bot-web-ui/src/components/dashboard/tutorial-tab/guide-content.tsx b/packages/bot-web-ui/src/components/dashboard/tutorial-tab/guide-content.tsx index 9bf684962a59..38f29d357a81 100644 --- a/packages/bot-web-ui/src/components/dashboard/tutorial-tab/guide-content.tsx +++ b/packages/bot-web-ui/src/components/dashboard/tutorial-tab/guide-content.tsx @@ -108,7 +108,7 @@ const GuideContent = ({
{guide_list?.length > 0 && ( - Videos on DBot + Videos on Deriv Bot )}
diff --git a/packages/bot-web-ui/src/components/dashboard/tutorial-tab/tutorial-content.tsx b/packages/bot-web-ui/src/components/dashboard/tutorial-tab/tutorial-content.tsx index e9953d60c3af..b142d944977f 100644 --- a/packages/bot-web-ui/src/components/dashboard/tutorial-tab/tutorial-content.tsx +++ b/packages/bot-web-ui/src/components/dashboard/tutorial-tab/tutorial-content.tsx @@ -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'), }, { @@ -40,7 +40,7 @@ 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'), }, @@ -48,12 +48,12 @@ export const guide_content: TGuideContent[] = [ 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'." ), }, ], @@ -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', @@ -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." ), }, { @@ -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', @@ -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:' ), }, { @@ -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', @@ -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."), }, ], }, @@ -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', @@ -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.'), }, ], }, @@ -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." ), }, ], @@ -404,7 +404,7 @@ export const faq_content: TFaqContent[] = [ { type: 'text', content: localize( - 'Watch this video to learn how to build a trading bot on DBot. Also, check out this blog post on building a trading bot.' + 'Watch this video to learn how to build a trading bot on Deriv Bot. Also, check out this blog post on building a trading bot.' ), }, ], diff --git a/packages/bot-web-ui/src/stores/app-store.js b/packages/bot-web-ui/src/stores/app-store.js index a81c3a963972..80f03c5e6e91 100644 --- a/packages/bot-web-ui/src/stores/app-store.js +++ b/packages/bot-web-ui/src/stores/app-store.js @@ -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'), }); } @@ -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'), }); } @@ -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) { diff --git a/packages/bot-web-ui/src/stores/run-panel-store.js b/packages/bot-web-ui/src/stores/run-panel-store.js index b94142c736ab..7f2902308324 100644 --- a/packages/bot-web-ui/src/stores/run-panel-store.js +++ b/packages/bot-web-ui/src/stores/run-panel-store.js @@ -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; } @@ -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; } diff --git a/packages/bot-web-ui/src/utils/bot-notifications.js b/packages/bot-web-ui/src/utils/bot-notifications.js index 405814f15db9..51cfd9571758 100644 --- a/packages/bot-web-ui/src/utils/bot-notifications.js +++ b/packages/bot-web-ui/src/utils/bot-notifications.js @@ -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, diff --git a/packages/bot-web-ui/src/utils/help-content/help-strings/before_purchase.js b/packages/bot-web-ui/src/utils/help-content/help-strings/before_purchase.js index fdb282fddfbf..ea58194631fd 100644 --- a/packages/bot-web-ui/src/utils/help-content/help-strings/before_purchase.js +++ b/packages/bot-web-ui/src/utils/help-content/help-strings/before_purchase.js @@ -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.' diff --git a/packages/bot-web-ui/src/utils/help-content/help-strings/notify_telegram.js b/packages/bot-web-ui/src/utils/help-content/help-strings/notify_telegram.js index 9279be0d10ba..cfa529529cbe 100644 --- a/packages/bot-web-ui/src/utils/help-content/help-strings/notify_telegram.js +++ b/packages/bot-web-ui/src/utils/help-content/help-strings/notify_telegram.js @@ -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.' ), ], };