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

Commit

Permalink
Merge branch 'deriv-com:master' into performance-mark-on-binary
Browse files Browse the repository at this point in the history
  • Loading branch information
vinu-deriv authored Jul 30, 2024
2 parents 5e06120 + 7282427 commit bc0e38b
Show file tree
Hide file tree
Showing 20 changed files with 320 additions and 280 deletions.
26 changes: 16 additions & 10 deletions .github/workflows/release_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,23 @@ jobs:
with:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
- name: Build Docker image and push to Docker hub and K8S
uses: "./.github/actions/build_and_push_docker_image"

- name: Upload to vercel
uses: 'deriv-com/shared-actions/.github/actions/vercel_DR_publish@master'
id: dr_action
with:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
DOCKERHUB_ORGANISATION: ${{ secrets.DOCKERHUB_ORGANISATION }}
K8S_NAMESPACE: bot-deriv-com-production
KUBE_SERVER: ${{ secrets.KUBE_SERVER }}
SERVICEACCOUNT_TOKEN: ${{ secrets.SERVICEACCOUNT_TOKEN }}
CA_CRT: ${{ secrets.CA_CRT }}
APP_VERSION: latest
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_API_TOKEN }}
ENVIRONMENT: Production
VERCEL_SCOPE: deriv
ALIAS_DOMAIN_URL: 'bot-dr.binary.sx'
- name: Send Slack Notification on Vercel Publish failure
uses: "deriv-com/shared-actions/.github/actions/send_slack_notification@master"
if: steps.dr_action.conclusion == 'failure'
with:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
MESSAGE: "Vercel Publish failed for bot.deriv.com with version ${{ needs.release_production.outputs.RELEASE_VERSION }}"
send_slack_notification:
if: always()
needs: [release_production]
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/release_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,15 @@ jobs:
with:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
- name: Build Docker image and push to Docker hub and K8S
uses: "./.github/actions/build_and_push_docker_image"
- name: Upload to vercel
uses: 'deriv-com/shared-actions/.github/actions/vercel_DR_publish@master'
with:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
DOCKERHUB_ORGANISATION: ${{ secrets.DOCKERHUB_ORGANISATION }}
K8S_NAMESPACE: bot-deriv-com-staging
KUBE_SERVER: ${{ secrets.KUBE_SERVER }}
SERVICEACCOUNT_TOKEN: ${{ secrets.SERVICEACCOUNT_TOKEN }}
CA_CRT: ${{ secrets.CA_CRT }}
APP_VERSION: latest-staging
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_API_TOKEN }}
ENVIRONMENT: Preview
VERCEL_SCOPE: deriv
ALIAS_DOMAIN_URL: 'staging-bot-dr.binary.sx'
send_slack_notification:
if: always()
needs: [release_staging]
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ CNAME
*.env
.env
blockly-translations
temp
temp
.vercel
3 changes: 3 additions & 0 deletions public/images/ic-megaphone.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
153 changes: 0 additions & 153 deletions public/images/move-to-deriv.svg

This file was deleted.

31 changes: 31 additions & 0 deletions public/images/upgrade-to-deriv-bot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 12 additions & 6 deletions src/components/Banner/fixed-dbot-banner.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@ import './fixed-dbot-banner.scss';
const FixedDbotBanner = () => (
<div className='fixed-banner__container'>
<div className='fixed-banner__content'>
<div className='fixed-banner__icon-info icon-info'></div>
<img className='fixed-banner__icon' alt='move to deriv' src='/public/images/ic-megaphone.svg' />
<div>
<span>{translate('For improved features and an overall better performance, ')}</span>
<a className='fixed-banner__visit-deriv-bot' href='#' onClick={visitDerivBot}>
{translate('switch to Deriv Bot')}
</a>
<span>{translate(' now.')}</span>
<span>
<strong>{translate('Important: ')}</strong>
</span>
<span>{translate('Binary Bot will be discontinued on')} </span>
<strong>
<span>{translate('31 August 2024.')} </span>
<a className='fixed-banner__visit-deriv-bot' href='#' onClick={visitDerivBot}>
{translate('Upgrade to Deriv Bot')}
</a>
</strong>
<span>{translate(' to continue trading.')}</span>
</div>
</div>
</div>
Expand Down
7 changes: 3 additions & 4 deletions src/components/Banner/fixed-dbot-banner.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
justify-content: center;
background-color: #ffeabf;
height: 56px;

font-size: var(--font-size-s);
@include mobile {
height: unset;
}
Expand All @@ -28,6 +28,7 @@
&__visit-deriv-bot {
color: var(--text-prominent);
text-decoration: underline;
font-weight: bold;
&:hover {
text-decoration: underline;
}
Expand All @@ -37,10 +38,8 @@
}
}

&__icon-info {
&__icon {
margin-right: 0.5rem;
font-size: 1.4rem;
transform: rotate(180deg);
}
}

Expand Down
55 changes: 22 additions & 33 deletions src/components/Banner/move-to-dbot-banner.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { visitDerivBot } from './redirect-to-dbot';
import './move-to-dbot-banner.scss';

const updateLastPopupTime = () => {
localStorage.setItem('last_deriv_redirect_popup_time', new Date().toString());
localStorage.setItem('migration_popup_timer', new Date().toString());
};

const daysBetween = (date1, date2) => {
Expand All @@ -18,15 +18,15 @@ const daysBetween = (date1, date2) => {
};

const shouldShowPopup = () => {
const last_deriv_redirect_popup_time = localStorage.getItem('last_deriv_redirect_popup_time');
const migration_popup_timer = localStorage.getItem('migration_popup_timer');

if (!last_deriv_redirect_popup_time) {
if (!migration_popup_timer) {
updateLastPopupTime();
return true;
}

const allowed_delay = 7; // One week in days
const last_popup_date = new Date(last_deriv_redirect_popup_time);
const allowed_delay = 1; // One week in days
const last_popup_date = new Date(migration_popup_timer);
const current_date = new Date();

if (daysBetween(last_popup_date, current_date) >= allowed_delay) {
Expand All @@ -39,7 +39,7 @@ const shouldShowPopup = () => {

const MoveToDbotBanner = () => {
const container_class = 'mv-dbot-banner';
const [open_modal, setOpenModal] = useState(false);
const [open_modal, setOpenModal] = useState(true);

useEffect(() => {
try {
Expand All @@ -60,45 +60,34 @@ const MoveToDbotBanner = () => {
<div>
{open_modal && (
<DerivAppModal
title={translate('Discover Deriv Bot')}
title={translate('Important notice')}
close_on_outside_click={false}
primary_button={{
title: translate('Explore Deriv Bot'),
title: translate('Upgrade to Deriv Bot'),
onClick: visitDerivBot,
}}
secondary_button={{
title: translate('No, thanks'),
onClick: closeModal,
}}
onClose={closeModal}
>
<div className={container_class}>
<div className={`${container_class}__icon-container`}>
<img alt='move to deriv' src='/public/images/move-to-deriv.svg' />
<img alt='move to deriv' src='/public/images/upgrade-to-deriv-bot.svg' />
</div>
<div className={`${container_class}__title`}>
{translate('Take your bot trading to the next level')}
{translate('Binary bot is retiring on 31 August 2024')}
</div>
<div className={`${container_class}__content`}>
<div>{translate('On Deriv Bot, you\'ll enjoy:')}</div>
<ul>
<li>
{translate('New features and tools with faster execution and enhanced stability')}
</li>
<li>{translate('The ability to use your existing XML files from Binary Bot')}</li>
<li>
{translate(
'A familiar drag-and-drop interface; create and customise your trading bot easily'
)}
</li>
</ul>
<div>
<span>{translate('What are you waiting for?')}</span>{' '}
<span>
<strong>{translate('Explore Deriv Bot')}</strong>
</span>{' '}
<span>{translate('today and unlock new trading possibilities!')}</span>
</div>
<p>
{translate(
'Follow these steps to keep trading with your favourite strategies on Deriv Bot:'
)}
</p>
<ol className={`${container_class}__orderd-list`}>
<li>{translate('Download your Binary Bot strategy in XML format.')}</li>
<li>{translate('Switch to Deriv Bot and import your strategy.')}</li>
<li>{translate('Run your updated strategy to check its performance.')}</li>
<li>{translate('Save the updated strategy for quicker re-imports.')}</li>
</ol>
<p>{translate('Upgrade today and experience seamless trading on Deriv Bot.')}</p>
</div>
</div>
</DerivAppModal>
Expand Down
24 changes: 16 additions & 8 deletions src/components/Banner/move-to-dbot-banner.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,41 @@

.mv-dbot-banner {
text-align: center;
padding: 32px 108px;
padding: 16px 24px;
width: 440px;
@include mobile {
padding: 28px;
padding: 16px;
width: 100%;
}

&__title {
font-size: var(--font-size-l);
font-size: 20px;
font-weight: bold;
margin-bottom: 16px;

@include mobile {
font-size: var(--font-size-n);
}
}

&__content {
margin-top: 8px;
font-size: var(--font-size-s);
line-height: 20px;
text-align: left;
ol,
ul {
list-style: disc;
p {
line-height: 20px;
padding: 0px 32px;
}
}
&__icon-container {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 24px;
margin-bottom: 16px;
}

&__orderd-list {
margin: 0;
padding: 0 16px;
}
}
27 changes: 18 additions & 9 deletions src/components/common/deriv-app-modal/deriv-app-modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,16 @@
justify-content: center;
align-items: center;
color: var(--text-prominent);
padding: 24px;
padding: 20px 24px;
font-size: 1rem;
@include mobile {
padding: 16px 24px;
}

&:after {
content: '\00d7';
font-weight: 200;
font-size: 24px;
margin-top: -2px;
}
&:hover {
background: transparent;
Expand All @@ -72,10 +74,14 @@
}

&-title {
font-size: var(--font-size-l);
font-size: var(--font-size-n);
font-weight: bold;
margin: 0;
padding: 16px;
padding: 0 24px;
@include mobile {
padding: 0 16px;
font-size: var(--font-size-s);
}
}
}

Expand All @@ -96,9 +102,12 @@
display: flex;
justify-content: flex-end;
align-items: center;
padding: 8px 16px;
padding: 16px 24px;
border: none;
border-top: 1px solid var(--border-normal);
@include mobile {
padding: 16px;
}
&__btn-container {
@include mobile {
display: flex;
Expand All @@ -108,15 +117,15 @@
}
&__btn-container,
* {
margin: 4px;
font-weight: 600;
font-size: medium;
font-weight: 700;
font-size: var(--font-size-s);
text-transform: none;
line-height: 20px;
}
&-primary-btn {
background: var(--button-primary-default);
border: 2px solid var(--button-primary-default);
padding-inline: 18px;
padding: 8px 18px;
&:hover {
background: var(--button-primary-hover);
}
Expand Down
35 changes: 27 additions & 8 deletions src/translations/ach_UG/i10n.json
Original file line number Diff line number Diff line change
Expand Up @@ -509,12 +509,31 @@
"c5308e66942e2f7d7df852c970b3a057e00c1ecf": "crwdns3537814:0crwdne3537814:0",
"63c78e309e7a876e6f1c5fe3e636c9422c40459d": "crwdns3537816:0crwdne3537816:0",
"753634ab7e1b03cda76e1781b45652aaefaac751": "crwdns3537818:0crwdne3537818:0",
"7ae31c80e03a681e2552ac2125a0dfbba0302b0d": "crwdns4247750:0crwdne4247750:0",
"e1498f9eaee71b604ad0496b5aa54d39be0f37fd": "crwdns4247752:0crwdne4247752:0",
"30d45bf479993bcb72665e0632c245b8e6839a50": "crwdns4247754:0crwdne4247754:0",
"1a591a3e91fcb7a47f2c08e9e2e117f39af22078": "crwdns4247756:0crwdne4247756:0",
"a72310cea1dcce7466887418f51e962733bf9f57": "crwdns4247758:0crwdne4247758:0",
"070f0f8bdc34d7a78d1ff0e3617efc2cb111a655": "crwdns4247760:0crwdne4247760:0",
"923bd614d34029ade982ad020004aef1e4aed445": "crwdns4247762:0crwdne4247762:0",
"b60862f4855a392f00cc9f27e0862c0b979075a6": "crwdns4247764:0crwdne4247764:0"
"e733c45da6dd80cc92ea52d9533afc7abe6ed465": "crwdns4952754:0crwdne4952754:0",
"cdbe0cace9f8a90cfc06a182fa7743e23589ec7b": "crwdns4952756:0crwdne4952756:0",
"7becab7941ae5ec9e0f55de768be17b450f2858c": "crwdns4952758:0crwdne4952758:0",
"5eef41e07d5227234d18fe8d3d2099b8f6675d3c": "crwdns4952760:0crwdne4952760:0",
"1a591a3e91fcb7a47f2c08e9e2e117f39af22078": "crwdns4952762:0crwdne4952762:0",
"a72310cea1dcce7466887418f51e962733bf9f57": "crwdns4952764:0crwdne4952764:0",
"070f0f8bdc34d7a78d1ff0e3617efc2cb111a655": "crwdns4952766:0crwdne4952766:0",
"923bd614d34029ade982ad020004aef1e4aed445": "crwdns4952768:0crwdne4952768:0",
"b60862f4855a392f00cc9f27e0862c0b979075a6": "crwdns4952770:0crwdne4952770:0",
"1f5045ef7c9382c16e2fb9bca1fa9214e0d2a5a9": "crwdns4952772:0crwdne4952772:0",
"8011ae74b802850a7c80c526d29decd11c52481a": "crwdns5785804:0crwdne5785804:0",
"592e16590d2b69447e1c9ce940caadab56d9f0ca": "crwdns5785806:0crwdne5785806:0",
"ba0edac93dc72abb06dcfa0b3ca4c58ffe9c2cfb": "crwdns5785808:0crwdne5785808:0",
"a4289e25a051d47ecc43075f75174ed9e7d4e132": "crwdns5785810:0crwdne5785810:0",
"06c09b3c157bda3d91348c4d5c51e812753893bc": "crwdns5785812:0crwdne5785812:0",
"0debaf0bbe3a0d19c703d66efc3508365ab050dd": "crwdns5785814:0crwdne5785814:0",
"1ea2edd48de2b740276b065eb2b2c84d48d8c6e3": "crwdns5785816:0crwdne5785816:0",
"b8fbf18fb9fe9b8b44001edf74b8b24fe2931612": "crwdns5785818:0crwdne5785818:0",
"c4246cbcf8d2a674debd888f7b2b1e24922173d7": "crwdns5957544:0crwdne5957544:0",
"142ec93a3efa9ad0fccf5c1b13822ca5e034937b": "crwdns5957546:0crwdne5957546:0",
"e87cea2cf43e62ec5202bd61acc9ad0d6c83030a": "crwdns5957548:0crwdne5957548:0",
"fc3cd15fae43c29cf5c4fdcd79b3ac65a38ef68f": "crwdns5957550:0crwdne5957550:0",
"fe967dc39c4a8250a9217a1e494b86339c320cc7": "crwdns5957552:0crwdne5957552:0",
"2b267a435bc361e6575de4d9a2087d1aa16b30c3": "crwdns5957554:0crwdne5957554:0",
"ce4138db56a0476b057160916eb8c72ccc00cbd0": "crwdns5957556:0crwdne5957556:0",
"ec519f37ac566b94f6720e9be97da2fb35a21567": "crwdns5957558:0crwdne5957558:0",
"33831c793b9746fb03bb9be5c0e3178106c0f5a7": "crwdns5957560:0crwdne5957560:0"
}
Loading

0 comments on commit bc0e38b

Please sign in to comment.