Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
chore: resolved issues from master
Browse files Browse the repository at this point in the history
  • Loading branch information
prince-deriv committed Jan 8, 2024
2 parents 07c99e9 + 6d6638a commit 1db6d78
Show file tree
Hide file tree
Showing 56 changed files with 5,330 additions and 5,445 deletions.
131 changes: 31 additions & 100 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Deriv.com - An online trading platform that offers a wide selection of derivativ
- [Pre-installation](#pre-installation)
- [Quick start](#quick-start)
- [How to contribute](#how-to-contribute)
- [Base master](#base-master)
- [Base Crowdin](#base-crowdin)
- [Manage translations](#manage-translations)
- [PR Formating guideline](#pr-formating-guideline)
- [PR without translations](#pr-without-translation)
- [PR with translations](#pr-with-translation)
- [Manage releases](#manage-releases)
- [Test link deployment](#test-link-deployment)
- [FAQ](#faq)
Expand Down Expand Up @@ -94,9 +94,16 @@ Moreover, having these extensions will help you to speed up the development proc

## How to contribute

We have two types of PR (Pull request):
To contribute in the project, we need to create PRs to master. We have two types of PRs (Pull request):

### Base **Master**
### PR Formating guideline

1. Use the `{Developer}/{Clickup Card ID}/{Description}` format for PR titles. (e.g.: `[Dev's Name]/COJ-247/Align next-button on mt5 modal`).
2. Start the description with a verb in an imperative declaration for clarity and conciseness. For example, "Fix issue with..." or "Implement feature to...".
3. Add screenshots of change for easier reviewing (whenever applicable) and brief description
4. Use Draft PRs if you don't mean to request for reviews yet. [Read more here.](https://github.blog/2019-02-14-introducing-draft-pull-requests/)
### PR without translation
PR will be based on the master branch if the commits are not having text changes
Expand All @@ -110,7 +117,7 @@ PR will be based on the master branch if the commits are not having text changes
2. Make your changes
3. Make pull request
3. Make pull request following PR formatting guidelines.
- Push your changes to your origin , add `-u` flag for the first time push
Expand All @@ -122,45 +129,8 @@ PR will be based on the master branch if the commits are not having text changes
- Make sure to change the PR base to `master` branch
### Base Crowdin

PR will be based on crowdin branch if the commits are having text changes

1. Create branch from latest crowdin branch

- if you don't have crowdin branch
```sh
git fetch upstream crowdin:crowdin
git checkout crowdin
git checkout -b [_your_branch_name]
```
- if you have crowdin branch
```sh
git checkout crowdin
git pull upstream crowdin
git checkout -b [_your_branch_name]
```
2. Make your changes
- Commit your changes
3. Make pull request
- Push your changes to your origin, add `-u` flag for the first time push
```sh
git push -u origin [_your_branch_name]
```
- Click on the autogenerated link from terminal to open the PR
- Make sure to change the PR base to `crowdin` branch
## Manage translations
### PR with translation
- Pre-requisite:
Expand All @@ -173,37 +143,34 @@ PR will be based on crowdin branch if the commits are having text changes
- Set up your Crowdin API KEY in your .bash_profile or .zshrc
1. Extract translation
- Make sure you have the latest Crowdin changes, resolve conflicts if any
- Creating Branch
```sh
git pull upstream crowdin
```
npm run branch:create
```
Proceed by choosing Normal Translation
- Extract translation text to update `messages.json`
- Download Translations
```sh
npm run translate:extract
npm run translation:pull
```
This command will trigger the workflow to pull latest translation from the specific branch and automatically add the commit to that PR.
2. Upload translation
- Push the changes in the PR
- To upload source text to Crowdin (When task merge to crowdin branch)
- Conflicts on message.json file
```sh
npm run translate:upload
```
Don't worry it's easy to resolve, you can either resolve it using your changes or their changes doesn't matter because after you commit, it will again generate an updated messages.json file based on your current code, as long as you have all the changes from the master you are good to go.
3. Download translation
Pulled the translations but strings are still not translated
First you need to check if you have all the translations in your codebase.
Search for the string and copy the corresponding hashed value for the string, can be found on messages.json
- To download/get the latest Crowdin translations
```sh
npm run translate:download
```
Now search the whole codebase using the hash, if json files for each languages appeared on your search results then you check if the values are not in English.
Once the translations are proven to be there, you need to check where the strings are used
Usually if your are using localize function when not in the react component it is failing to translate strings properly, you can convert them to <Localize translate_text="" /> instead
**Note**: Don't forget to create a pull request to update crowdin branch
## Manage releases
Expand All @@ -213,7 +180,6 @@ There are 2 types of releases:
Merging to master (squash and merge) will automatically release the last commit to the staging server https://staging.deriv.com
⚠️ If you want to release Crowdin changes, please make a PR from crowdin to master branch
2. Release to production:
Expand All @@ -237,39 +203,4 @@ Example of release steps
## Test link deployment
There are two types of test link deployment preview:
1. Automatic deployment
Upon creating PR, [Vercel](https://vercel.com/) will auto-generate a test link inside the PR. you can use that to preview the test link for the changes you have made.
2. Manual deployment
If preferable to use manual deployment, you can use [gh-pages](https://pages.github.com/) functionality to create a test link. here are ways to do it:
- **Basic name.github.io/deriv-com/**
```sh
npm run deploy-dev
```
⚠️ This will remove your branch deployments
- **To a specific branch:**
```sh
branch_name=fix_all_the_bugs npm run deploy-branch
```
This will be deployed to name.github.io/deriv-com/br/fix_all_the_bugs
⚠️ You have to enable pathPrefix in gatsby-config for manual deployment, otherwise, the resources will not be uploaded to the site
## FAQ
- [how to create a new page?](documents/implementation-guide.md#create-new-page)
- [how to insert an image?](documents/implementation-guide.md#image-component)
- [how to style my element?](documents/implementation-guide.md#styled-component)
- [Where to put my new component?](documents/file-structures.md)
⚠️ If you have more questions to add, please open a PR to add your question in FAQ section. The Answer will be on the PR reviews
Upon creating PR, [Vercel](https://vercel.com/) and Cloudflare will auto-generate two test links inside the PR. you can use that to preview the test link for the changes you have made.
2 changes: 1 addition & 1 deletion crowdin/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -3438,7 +3438,7 @@
"-2048678807": "DBot Trading | Auto Trading Robot | Deriv",
"-490244393": "pre-built strategies included",
"-410563285": "Start with a popular strategy",
"-1612626587": "Martingale, D'Alembert, and Oscar's Grind — load and customise proven strategies or create your own from scratch.",
"-2090265979": "Martingale, D'Alembert, Oscar's Grind, and more — load and customise proven strategies or create your own from scratch.",
"-1171659940": "Build your strategy visually",
"-1855708032": "Simply drag, drop, and configure pre-built blocks and indicators onto a canvas to build your bot. No coding needed.",
"-1502830211": "Increase your profits",
Expand Down
2 changes: 1 addition & 1 deletion gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const onClientEntry = () => {
}
const dd_script = document.createElement('script')
dd_script.type = 'text/javascript'
dd_script.text = `!function(e,a,t,n,s){e=e[s]=e[s]||{q:[],onReady:function(a){e.q.push(a)}},(s=a.createElement(t)).async=1,s.src=n,(n=a.getElementsByTagName(t)[0]).parentNode.insertBefore(s,n)}(window,document,"script","https://www.datadoghq-browser-agent.com/us1/v4/datadog-rum.js","DD_RUM"),window.DD_RUM.onReady(function(){window.DD_RUM.init(${JSON.stringify(
dd_script.text = `!function(e,a,t,n,s){e=e[s]=e[s]||{q:[],onReady:function(a){e.q.push(a)}},(s=a.createElement(t)).async=1,s.src=n,(n=a.getElementsByTagName(t)[0]).parentNode.insertBefore(s,n)}(window,document,"script","https://www.datadoghq-browser-agent.com/us1/v5/datadog-rum.js","DD_RUM"),window.DD_RUM.onReady(function(){window.DD_RUM.init(${JSON.stringify(
dd_options,
)})});`
document.head.appendChild(dd_script)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import { TString } from 'types/generics'
import useSignupForm from 'features/hooks/use-signup-form'

const SignupPublicForm = () => {
const { onSignup, signUpForm } = useSignupForm()
const { onSignup, signUpForm } = useSignupForm({
form_name: 'virtual_signup_homepage_embedded',
})

const {
register,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react'
import { Analytics } from '@deriv/analytics'
import { public_signup_social_links } from './social.module.scss'
import Flex from 'features/components/atoms/flex-box'
import Button from 'features/components/atoms/button'
Expand Down Expand Up @@ -51,6 +52,12 @@ const social_button_content: SocialButtonContent[] = [

const PublicSignupSocial = () => {
const handleSocialSignup = (data_provider: TSocialProvider) => {
Analytics?.trackEvent('ce_virtual_signup_form', {
signup_provider: data_provider,
action: 'started',
form_source: document.referrer,
form_name: 'virtual_signup_homepage_embedded',
})
Login.initOneAll(data_provider)
}

Expand Down
8 changes: 6 additions & 2 deletions src/features/hooks/use-signup-form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,14 @@ const schema = yup.object({

type FormData = yup.InferType<typeof schema>

const useSignupForm = () => {
type TSignupFormOptions = {
form_name?: 'default_diel_deriv' | 'virtual_signup_homepage_embedded'
}

const useSignupForm = (options?: TSignupFormOptions) => {
const analyticsData: Parameters<typeof Analytics.trackEvent>[1] = {
form_source: isBrowser() && window.location.hostname,
form_name: 'default_diel_deriv',
form_name: options?.form_name || 'default_diel_deriv',
}
const signUpForm = useForm<FormData>({
mode: 'onChange',
Expand Down
Binary file modified src/images/common/dbot/dbot-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/common/dbot/dbot-build-strategy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/common/dbot/dbot-get-integrated-help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/common/dbot/dbot-maximise-profits.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/common/dbot/dbot-save-your-strategies.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/common/dbot/dbot-strategy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/common/dbot/dbot-track-your-performance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/common/dbot/step_image_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/common/dbot/step_image_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/common/dbot/step_image_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/common/dbot/step_image_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/common/dbot/step_image_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/pages/dbot/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ const items: TDNumbersItem[] = [
title: '_t_FREE_t_',
subtitle: '_t_zero cost to build_t_',
},
{ title: '3', subtitle: '_t_pre-built strategies included_t_' },
{ title: '6', subtitle: '_t_pre-built strategies included_t_' },
]

const trading: TradingType[] = [
{
title: '_t_Start with a popular strategy_t_',
subtitle:
"_t_Martingale, D'Alembert, and Oscar's Grind — load and customise proven strategies or create your own from scratch._t_",
"_t_Martingale, D'Alembert, Oscar's Grind, and more — load and customise proven strategies or create your own from scratch._t_",
image_name: 'dbot_strategy',
image_alt: '_t_Customise your DBot strategy_t_',
},
Expand Down
4 changes: 4 additions & 0 deletions src/pages/terms-and-conditions/_clients-grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ const columns: ColProps[] = [
url: '/tnc/deriv-(bvi)-ltd.pdf',
title: '_t_Deriv (BVI) Ltd_t_',
},
{
url: '/tnc/deriv-(v)-ltd.pdf',
title: '_t_Deriv (V) Ltd_t_',
},
],
},
]
Expand Down
Loading

0 comments on commit 1db6d78

Please sign in to comment.