From e455ca118f5d65655a2e5f338b6ed65c7fb019b9 Mon Sep 17 00:00:00 2001 From: thibault-deriv <104425314+thibault-deriv@users.noreply.github.com> Date: Thu, 12 Jan 2023 15:37:05 +0100 Subject: [PATCH 01/25] release_staging also deploys to AWS and needs context --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2e44c43a7..1659eed75 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -228,6 +228,7 @@ workflows: filters: branches: only: /^master$/ + context: binary-frontend-artifact-upload - publish_cloudflare_staging: requires: - release_staging From d1ff4177491ef7a1bf8f4f391d96b3c622b5a946 Mon Sep 17 00:00:00 2001 From: maryia-matskevich-deriv <103181650+maryia-matskevich-deriv@users.noreply.github.com> Date: Mon, 30 Jan 2023 07:39:29 +0300 Subject: [PATCH 02/25] MaryiaF/feat: redirect to deriv help-centre by clicking on need help button (#3767) --- templates/partials/elevio.mustache | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/templates/partials/elevio.mustache b/templates/partials/elevio.mustache index d315585c5..b0d1d399d 100644 --- a/templates/partials/elevio.mustache +++ b/templates/partials/elevio.mustache @@ -1,13 +1,15 @@ - + \ No newline at end of file From df795d171ff92f32e4f3b78f5d7c6a2ed1841223 Mon Sep 17 00:00:00 2001 From: NikitK-deriv <103182473+NikitK-deriv@users.noreply.github.com> Date: Mon, 30 Jan 2023 07:40:05 +0300 Subject: [PATCH 03/25] NikitK/ Amending the Github page for Binary Bot (#3805) * feat: branding removal for other domains * feat: add behaviour for test links as well * chore: remove useless script and move logic outside the component * fix: make gulp setup as was before * chore: move script logic outside, in .js file * chore: replace camelCase on sneake_case * chore: return camelCase back * chore: move banner back * fix: aligning text * chore: remove banner for mobile * fix: resolve flashing icon issue * chore: trigger vercel * fix: bot page inst show * fix: bot page not shows * fix: bot page not shows * fix: bot page not shows --- .gitignore | 3 ++- gulpfile.babel.js | 5 +++- src/botPage/view/View.js | 6 ++--- src/botPage/view/index.js | 9 ++++++- src/common/utils/tools.js | 5 ++++ src/indexPage/index.js | 13 ++++++++-- src/indexPage/react-components/logo.jsx | 8 +++---- static/css/index.scss | 6 ++--- templates/bot.mustache | 32 ++++++++++++------------- templates/index.mustache | 2 +- 10 files changed, 57 insertions(+), 32 deletions(-) diff --git a/.gitignore b/.gitignore index ce7a9fb20..d0b8c4509 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ lib/ old/ CNAME *.env -.DS_Store \ No newline at end of file +.DS_Store +.idea \ No newline at end of file diff --git a/gulpfile.babel.js b/gulpfile.babel.js index 12c597d1c..eb280c1c7 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -75,7 +75,10 @@ gulp.task( }) ); -gulp.task('test-deploy', gulp.series('build-min', 'serve', () => {})); +gulp.task( + 'test-deploy', + gulp.series('build-min', 'serve', () => {}) +); gulp.task( 'watch-static', diff --git a/src/botPage/view/View.js b/src/botPage/view/View.js index 21382e1e0..461a5b913 100644 --- a/src/botPage/view/View.js +++ b/src/botPage/view/View.js @@ -41,7 +41,7 @@ import { getToken, remove, } from '../../common/utils/storageManager'; -import { isProduction, parseQueryString, serialize } from '../../common/utils/tools'; +import { isBinaryDomain, isProduction, parseQueryString, serialize } from '../../common/utils/tools'; import GTM from '../../common/gtm'; import { getMissingBlocksTypes, @@ -196,9 +196,9 @@ const updateLogo = token => { $('.binary-logo-text > img').attr('src', ''); const currentLandingCompany = getLandingCompanyForToken(token); if (currentLandingCompany === 'maltainvest') { - $('.binary-logo-text > img').attr('src', './image/binary-type-logo.svg'); + $('.binary-logo-text > img').attr('src', `${isBinaryDomain && './image/binary-type-logo.svg'}`); } else { - $('.binary-logo-text > img').attr('src', './image/binary-style/logo/type.svg'); + $('.binary-logo-text > img').attr('src', `${isBinaryDomain && './image/binary-style/logo/type.svg'}`); } setTimeout(() => window.dispatchEvent(new Event('resize'))); }; diff --git a/src/botPage/view/index.js b/src/botPage/view/index.js index 0717a740b..13e81def5 100644 --- a/src/botPage/view/index.js +++ b/src/botPage/view/index.js @@ -5,7 +5,7 @@ import View from './View'; import '../../common/binary-ui/dropdown'; import Elevio from '../../common/elevio'; import GTM from '../../common/gtm'; -import { isProduction } from '../../common/utils/tools'; +import { isBinaryDomain, isProduction } from '../../common/utils/tools'; $.ajaxSetup({ cache: false, @@ -40,3 +40,10 @@ view.initPromise.then(() => { }); } }); + +if (!isBinaryDomain) { + // eslint-disable-next-line no-unused-expressions + document.getElementsByClassName('dbot-banner__separator')[0]?.remove(); + // eslint-disable-next-line no-unused-expressions + document.getElementById('logo')?.remove(); +} diff --git a/src/common/utils/tools.js b/src/common/utils/tools.js index 3c2566d88..f41f0d369 100644 --- a/src/common/utils/tools.js +++ b/src/common/utils/tools.js @@ -147,3 +147,8 @@ export const errLogger = (err, msg) => { const errMsg = `${msg} - Error: ${errStr}`; console.warn(errMsg); }; + +export const isBinaryDomain = + document.location.hostname === 'localhost' || + document.location.hostname === 'bot.binary.com' || + document.location.hostname.includes('binary-bot-git-fork'); diff --git a/src/indexPage/index.js b/src/indexPage/index.js index 5fda3f8f0..da432a490 100644 --- a/src/indexPage/index.js +++ b/src/indexPage/index.js @@ -9,7 +9,7 @@ import GTM from '../common/gtm'; import { load as loadLang, showBanner } from '../common/lang'; import { moveToDeriv } from '../common/utils/utility'; import { get as getStorage, set as setStorage, remove, getTokenList } from '../common/utils/storageManager'; -import { createUrl, parseQueryString, serialize } from '../common/utils/tools'; +import { createUrl, isBinaryDomain, parseQueryString, serialize } from '../common/utils/tools'; import '../common/binary-ui/dropdown'; import BotLanding from './react-components/bot-landing'; import BinaryLanding from './react-components/binary-landing'; @@ -111,7 +111,7 @@ const renderElements = () => { return false; } if (window.location.pathname.indexOf('/bot') === -1) { - render(, document.getElementById('binary-logo')); + render(isBinaryDomain && , document.getElementById('binary-logo')); render(