Skip to content

Commit

Permalink
Merge branch 'master' into Jim/81652/system-did-not-redirect-to-trade…
Browse files Browse the repository at this point in the history
…rs-hub-home-page-from-dbot-new
  • Loading branch information
jim-deriv committed May 12, 2023
2 parents b7f5754 + 9466612 commit 84afb84
Show file tree
Hide file tree
Showing 27 changed files with 100 additions and 32 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ permissions:

name: 'Close stale issues and PRs'
on:
workflow_dispatch:
schedule:
- cron: '30 1 * * *'
- cron: '0 0 * * *'

jobs:
stale:
Expand All @@ -14,5 +15,11 @@ jobs:
- uses: actions/stale@v8
with:
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
stale-pr-message: 'This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity. Please reopen it if needed.'
close-pr-message: 'This PR was closed because it has been stalled for 5 days with no activity. Please reopen it if needed.'
days-before-stale: 60
days-before-close: 5
ascending: true
operations-per-run: 200

Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ describe('<Real />', () => {
clearIframe: jest.fn(),
iframe_height: 100,
iframe_url: 'https://www.test_url.com',
changeTheme: jest.fn(),
},
deposit: {
onMountDeposit: jest.fn(),
Expand Down
13 changes: 9 additions & 4 deletions packages/cashier/src/components/cashier-container/real/real.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import React from 'react';
import { Loading } from '@deriv/components';
import { useStore } from '@deriv/stores';
import { useStore, observer } from '@deriv/stores';
import CashierBreadcrumb from '../../cashier-breadcrumb';
import { useCashierStore } from '../../../stores/useCashierStores';
import './real.scss';

const Real = ({ is_deposit = false }: { is_deposit?: boolean }) => {
const Real = observer(({ is_deposit = false }: { is_deposit?: boolean }) => {
const {
traders_hub: { is_low_risk_cr_eu_real },
ui: { is_dark_mode_on },
} = useStore();

const { iframe, deposit, general_store } = useCashierStore();

const { clearIframe, iframe_height, iframe_url } = iframe;
const { clearIframe, iframe_height, iframe_url, changeTheme } = iframe;

const { is_loading } = general_store;

Expand All @@ -28,6 +29,10 @@ const Real = ({ is_deposit = false }: { is_deposit?: boolean }) => {
};
}, [clearIframe, onMountDeposit]);

React.useEffect(() => {
changeTheme();
}, [changeTheme, is_dark_mode_on]);

return (
<div className='cashier__wrapper real'>
{should_show_loader && <Loading className='real__loader' />}
Expand All @@ -44,6 +49,6 @@ const Real = ({ is_deposit = false }: { is_deposit?: boolean }) => {
)}
</div>
);
};
});

export default Real;
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ describe('<Withdraw />', () => {
client: {
verification_code: { payment_withdraw: 'code' },
},
ui: {
is_dark_mode_on: false,
},
modules: {
cashier: {
general_store: {
Expand Down
9 changes: 3 additions & 6 deletions packages/cashier/src/pages/withdrawal/withdraw/withdraw.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ const Withdraw = observer(() => {
const {
verification_code: { payment_withdraw: verification_code },
} = client;
const { iframe, general_store, withdraw } = useCashierStore();
const { is_loading, setActiveTab } = general_store;
const { iframe_height, iframe_url, clearIframe } = iframe;
const { general_store, withdraw } = useCashierStore();
const { setActiveTab } = general_store;
const { container, onMountWithdraw: onMount } = withdraw;

React.useEffect(() => {
Expand All @@ -19,9 +18,7 @@ const Withdraw = observer(() => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

return (
<Real iframe_height={iframe_height} iframe_url={iframe_url} clearIframe={clearIframe} is_loading={is_loading} />
);
return <Real />;
});

export default Withdraw;
4 changes: 2 additions & 2 deletions packages/cashier/src/stores/__tests__/iframe-store.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import IframeStore from '../iframe-store';
import { configure } from 'mobx';
import { TRootStore, TWebSocket } from 'Types';
import { TRootStore } from 'Types';

configure({ safeDescriptors: false });

Expand Down Expand Up @@ -90,7 +90,7 @@ describe('IframeStore', () => {
it('should set the proper iframe url', () => {
iframe_store.setIframeUrl('iframe_url/');

expect(iframe_store.iframe_url).toBe('iframe_url/&theme=dark');
expect(iframe_store.iframe_url).toBe('iframe_url/&DarkMode=on');
expect(iframe_store.root_store.client.setVerificationCode).toHaveBeenCalledWith('', 'payment_agent_withdraw');
});

Expand Down
18 changes: 17 additions & 1 deletion packages/cashier/src/stores/iframe-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,26 @@ export default class IframeStore {
makeObservable(this, {
iframe_height: observable,
iframe_url: observable,
base_url: observable,
is_session_timeout: observable,
timeout_session: observable,
setSessionTimeout: action.bound,
checkIframeLoaded: action.bound,
clearTimeoutCashierUrl: action.bound,
setBaseUrl: action.bound,
setTimeoutCashierUrl: action.bound,
setIframeUrl: action.bound,
setContainerHeight: action.bound,
clearIframe: action.bound,
changeTheme: action.bound,
});

this.root_store = root_store;
}

iframe_height = 0;
iframe_url = '';
base_url = '';
is_session_timeout = true;
onIframeLoaded: TOnIframeLoadedCallback | null = null;
timeout_session: NodeJS.Timeout | null = null;
Expand Down Expand Up @@ -83,7 +87,8 @@ export default class IframeStore {
const { client, ui } = this.root_store;

if (url) {
this.iframe_url = `${url}&theme=${ui.is_dark_mode_on ? 'dark' : 'light'}`;
this.setBaseUrl(url);
this.iframe_url = `${url}&DarkMode=${ui.is_dark_mode_on ? 'on' : 'off'}`;

const container = this.root_store.modules.cashier.general_store.active_container;

Expand All @@ -98,6 +103,17 @@ export default class IframeStore {
}
}

setBaseUrl(url?: string): void {
if (url) {
this.base_url = url;
}
}

changeTheme(): void {
const { ui } = this.root_store;
this.iframe_url = `${this.base_url}&DarkMode=${ui.is_dark_mode_on ? 'on' : 'off'}`;
}

setContainerHeight(height: number): void {
this.iframe_height = height;
}
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/Utils/Datadog/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,29 @@ const isStaging = process.env.CIRCLE_JOB === 'release_staging';
let dataDogSessionSampleRate = 0;
let dataDogSessionReplaySampleRate = 0;
let dataDogVersion = '';
let dataDogEnv = '';
let serviceName = '';

if (isProduction) {
serviceName = 'app.deriv.com';
dataDogVersion = `deriv-app-${process.env.CIRCLE_TAG}`;
dataDogSessionReplaySampleRate = +process.env.DATADOG_SESSION_REPLAY_SAMPLE_RATE! ?? 1;
dataDogSessionSampleRate = +process.env.DATADOG_SESSION_SAMPLE_RATE! ?? 10;
dataDogEnv = 'production';
} else if (isStaging) {
serviceName = 'staging-app.deriv.com';
dataDogVersion = `deriv-app-staging-v${formatDate(new Date(), 'YYYYMMDD')}-${formatTime(Date.now(), 'HH:mm')}`;
dataDogSessionReplaySampleRate = 100;
dataDogSessionSampleRate = 100;
dataDogEnv = 'staging';
}

datadogRum.init({
applicationId: isStaging || isProduction ? DATADOG_APP_ID : '',
clientToken: isStaging || isProduction ? DATADOG_CLIENT_TOKEN : '',
site: 'datadoghq.com',
service: serviceName,
env: 'production',
env: dataDogEnv,
sessionSampleRate: dataDogSessionSampleRate,
sessionReplaySampleRate: dataDogSessionReplaySampleRate,
trackUserInteractions: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/translations/crowdin/messages.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions packages/translations/src/translations/ach.json
Original file line number Diff line number Diff line change
Expand Up @@ -1598,6 +1598,7 @@
"1877832150": "crwdns1261841:0crwdne1261841:0",
"1879042430": "crwdns1261843:0crwdne1261843:0",
"1879412976": "crwdns1261845:0{{profit}}crwdne1261845:0",
"1879463662": "crwdns1990059:0{{minimum_deposit}}crwdnd1990059:0{{currency}}crwdne1990059:0",
"1879651964": "crwdns1787771:0crwdne1787771:0",
"1880029566": "crwdns1261847:0crwdne1261847:0",
"1880097605": "crwdns1261849:0{{ string_or_number }}crwdnd1261849:0{{ input_text }}crwdne1261849:0",
Expand Down Expand Up @@ -2462,6 +2463,7 @@
"-1559994981": "crwdns164879:0crwdne164879:0",
"-190084602": "crwdns81005:0crwdne81005:0",
"-811190405": "crwdns125116:0crwdne125116:0",
"-1984478597": "crwdns1990061:0crwdne1990061:0",
"-1272778997": "crwdns160430:0crwdne160430:0",
"-89973258": "crwdns117886:0{{seconds}}crwdne117886:0",
"-1332236294": "crwdns160466:0crwdne160466:0",
Expand Down
30 changes: 16 additions & 14 deletions packages/translations/src/translations/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@
"1178942276": "يرجى المحاولة مرة أخرى في غضون دقيقة.",
"1179704370": "يرجى إدخال مبلغ جني الأرباح أعلى من الربح المحتمل الحالي.",
"1180619731": "كل يوم، يمكنك إجراء ما يصل إلى {{ allowed_internal }} تحويلات بين حسابات المشتقات الخاصة بك، وما يصل إلى {{ allowed_mt5 }} التحويلات بين حسابات ديريف و {{platform_name_mt5}}، وما يصل إلى {{ allowed_dxtrade }} التحويلات بين حسابات ديريف و {{platform_name_dxtrade}}.",
"1181396316": "تمنحك هذه الكتلة رقمًا عشوائيًا من داخل نطاق محدد",
"1181396316": "تمنحك هذه المجموعة رقمًا عشوائيًا من داخل نطاق محدد",
"1181770592": "الربح/الخسارة من البيع",
"1183007646": "- نوع العقد: اسم نوع العقد مثل Rise، Fall، Touch، No Touch، إلخ.",
"1188316409": "لتلقي أموالك، اتصل بوكيل الدفع بالتفاصيل أدناه",
Expand All @@ -995,7 +995,7 @@
"1208729868": "القراد",
"1208903663": "عملة غير صالحة",
"1211912982": "يتم بدء تشغيل البوت",
"1214893428": "إنشاء الحساب غير متاح حاليًا للجوال. يرجى تسجيل الدخول باستخدام جهاز الكمبيوتر الخاص بك لإنشاء حساب جديد.",
"1214893428": "إنشاء الحساب غير متاح حاليًا على الهاتف المحمول. يرجى تسجيل الدخول باستخدام جهاز الكمبيوتر الخاص بك لإنشاء حساب جديد.",
"1216408337": "العاملون لحسابهم الخاص",
"1217159705": "رقم الحساب البنكي",
"1217481729": "التيثر كرمز ERC20 (eUSDT) هو إصدار من التيثر يتم استضافته على إيثريوم.",
Expand All @@ -1007,7 +1007,7 @@
"1222544232": "لقد أرسلنا لك بريدًا إلكترونيًا",
"1225150022": "عدد الأصول",
"1227074958": "كسر عشوائي",
"1227240509": "تقليم المساحات",
"1227240509": "تقليل المساحات",
"1228534821": "قد لا يتم دعم بعض العملات من قبل وكلاء الدفع في بلدك.",
"1229883366": "رقم التعريف الضريبي",
"1230884443": "الولاية/المقاطعة (اختياري)",
Expand Down Expand Up @@ -1093,27 +1093,27 @@
"1323996051": "الملف الشخصي",
"1324110809": "معلومات العنوان",
"1324922837": "2. سيظهر المتغير الجديد ككتلة ضمن متغير Set.",
"1327181172": "فانواتو المالية",
"1327181172": "فانواتو/Vanuatu المالية",
"1327494533": "{{sell_value}} (بيع)",
"1329136554": "مؤشر جامب 200",
"1329325646": "يتم استدعاء محتوى هذه الكتلة في كل علامة",
"1329136554": "مؤشر القفز (Jump) 200",
"1329325646": "يتم استدعاء محتوى هذه المجموعة في كل علامة",
"1331199417": "يرجى إدخال التنسيق الصحيح. ",
"1331367811": "رقم حساب العميل",
"1332168410": "تعرف على المزيد",
"1332168769": "قطع الاتصال",
"1333576137": "الرجاء تحديث.{{details}}. الخاص بك للمتابعة",
"1333839457": "إرسال بطاقة الهوية (الأمامية)",
"1334326985": "قد يستغرق الوصول بضع دقائق",
"1335967988": "ملاحظة",
"1336052175": "حسابات سويتش",
"1335967988": "لاحظ",
"1336052175": "التبديل بين الحسابات",
"1337846406": "تمنحك هذه المجموعة قيمة الشمعة المحددة من قائمة الشموع ضمن الفاصل الزمني المحدد.",
"1337864666": "صورة للوثيقة الخاص بك",
"1338496204": "المرجع. هوية شخصية",
"1339613797": "الجهة المنظمة/تسوية المنازعات الخارجية",
"1338496204": "الرقم المرجعي",
"1339613797": "الجهة التنظيمية/حل النزاعات الخارجية",
"1341840346": "عرض في المجلة",
"1346204508": "جني الأرباح",
"1346339408": "المدراء",
"1347071802": "قبل {{minutePast}}متر",
"1347071802": "قبل {{minutePast}}دقيقة",
"1348009461": "يرجى إغلاق مراكزك في حساب (حسابات) Deriv X التالي:",
"1349133669": "حاول تغيير معايير البحث الخاصة بك.",
"1349289354": "رائع، هذا كل ما نحتاجه",
Expand All @@ -1123,11 +1123,11 @@
"1354288636": "استنادًا إلى إجاباتك، يبدو أنك لا تملك المعرفة والخبرة الكافية في تداول العقود مقابل الفروقات. يعد تداول CFD محفوفًا بالمخاطر وقد تفقد كل رأس مالك.<0/><0/>",
"1355250245": "{{ calculation }} من القائمة {{ input_list }}",
"1356574493": "تقوم بإرجاع جزء محدد من سلسلة نصية معينة.",
"1356607862": "اشتقاق كلمة المرور",
"1356607862": " كلمة المرو ل ديريف",
"1357129681": "{{num_day}} يوم {{num_hour}} ساعة {{num_minute}} دقيقة",
"1357213116": "بطاقة هوية",
"1358543466": "غير متاح",
"1358543748": "مكن",
"1358543748": "تفعيل",
"1359424217": "لقد قمت ببيع هذا العقد في<0 />",
"1360929368": "إضافة حساب Deriv",
"1362578283": "مرتفع",
Expand Down Expand Up @@ -1172,7 +1172,7 @@
"1402208292": "تغيير حالة النص",
"1403376207": "تحديث التفاصيل الخاصة بي",
"1405584799": "مع الفاصل الزمني: {{ candle_interval_type }}",
"1407191858": "دي تريدر",
"1407191858": "دي تريدر/ DTrader",
"1408844944": "انقر فوق رمز علامة الجمع لتوسيع وظائف هذه الكتلة.",
"1410320737": "انتقل إلى لوحة معلومات Deriv MT5",
"1412535872": "يمكنك التحقق من نتيجة آخر صفقة باستخدام هذه المجموعة. يمكن وضعها فقط ضمن الكتلة الجذرية «إعادة تشغيل شروط التداول».",
Expand Down Expand Up @@ -1598,6 +1598,7 @@
"1877832150": "# من النهاية",
"1879042430": "اختبار الملاءمة، تحذير:",
"1879412976": "مبلغ الربح: <0>{{profit}}</0>",
"1879463662": "الحد الأدنى لقيمة الإيداع هو {{minimum_deposit}} {{currency}} . وإلا، ستفقد الأموال ولا يمكن استردادها.",
"1879651964": "<0>التحقق المعلق</0>",
"1880029566": "الدولار الأسترالي",
"1880097605": "المطالبة بـ {{ string_or_number }} مع الرسالة {{ input_text }}",
Expand Down Expand Up @@ -2462,6 +2463,7 @@
"-1559994981": "القيمة التقريبية",
"-190084602": "المعاملة",
"-811190405": "الوقت",
"-1984478597": "تفاصيل هذه المعاملة متاحة على CoinSpaid.",
"-1272778997": "لقد أرسلنا لك بريدًا إلكترونيًا.",
"-89973258": "جولة مركز المتداولإعادة إرسال البريد الإلكتروني في {{seconds}}",
"-1332236294": "يرجى التحقق من هويتك",
Expand Down
2 changes: 2 additions & 0 deletions packages/translations/src/translations/bn.json
Original file line number Diff line number Diff line change
Expand Up @@ -1598,6 +1598,7 @@
"1877832150": "# শেষ থেকে",
"1879042430": "উপযুক্ততা পরীক্ষা, সতর্কতা:",
"1879412976": "মুনাফার পরিমাণ: <0>{{profit}}</0>",
"1879463662": "একটি সর্বনিম্ন আমানত মান {{minimum_deposit}} {{currency}} প্রয়োজন বোধ করা হয়। অন্যথায়, তহবিল হারিয়ে যাবে এবং উদ্ধার করা যাবে না।",
"1879651964": "<0>মুলতুবি যাচাইকরণ</0>",
"1880029566": "অস্ট্রেলিয়ান ডলার",
"1880097605": "{{ string_or_number }} এর জন্য বার্তা {{ input_text }} এর জন্য অনুরোধ",
Expand Down Expand Up @@ -2462,6 +2463,7 @@
"-1559994981": "আনুমানিক মান",
"-190084602": "লেনদেন",
"-811190405": "সময়",
"-1984478597": "এই লেনদেনের বিবরণ CoinSpoid এ উপলব্ধ।",
"-1272778997": "আমরা আপনাকে একটি ইমেল পাঠিয়েছি।",
"-89973258": "{{seconds}}সেকেন্ডের মধ্যে ইমেল পুনরায় পাঠান",
"-1332236294": "অনুগ্রহ করে আপনার পরিচয় যাচাই করুন",
Expand Down
2 changes: 2 additions & 0 deletions packages/translations/src/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -1598,6 +1598,7 @@
"1877832150": "# vom Ende",
"1879042430": "Angemessenheitstest, WARNUNG:",
"1879412976": "Höhe des Gewinns: <0>{{profit}}</0>",
"1879463662": "Ein Mindesteinzahlungswert von {{minimum_deposit}} {{currency}} ist erforderlich. Andernfalls gehen die Gelder verloren und können nicht zurückgewonnen werden.",
"1879651964": "<0>Überprüfung steht noch aus</0>",
"1880029566": "Australischer Dollar",
"1880097605": "mit Nachricht {{ input_text }}nach {{ string_or_number }} fragen",
Expand Down Expand Up @@ -2462,6 +2463,7 @@
"-1559994981": "Ungefährer Wert",
"-190084602": "Transaktion",
"-811190405": "Zeit",
"-1984478597": "Die Details dieser Transaktion sind auf CoinsPaid verfügbar.",
"-1272778997": "Wir haben dir eine E-Mail geschickt.",
"-89973258": "E-Mail in {{seconds}}s erneut senden",
"-1332236294": "Bitte verifizieren Sie Ihre Identität",
Expand Down
2 changes: 2 additions & 0 deletions packages/translations/src/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -1598,6 +1598,7 @@
"1877832150": "# desde final",
"1879042430": "Prueba de Idoneidad, ADVERTENCIA:",
"1879412976": "Cantidad de ganancia: <0>{{profit}}</0>",
"1879463662": "Se requiere un depósito mínimo de {{minimum_deposit}} {{currency}} . De lo contrario, los fondos se perderán y no se podrán recuperar.",
"1879651964": "<0>Verificación pendiente</0>",
"1880029566": "Dólar australiano",
"1880097605": "solicitar {{ string_or_number }} con el mensaje {{ input_text }}",
Expand Down Expand Up @@ -2462,6 +2463,7 @@
"-1559994981": "Valor aproximado",
"-190084602": "Transacción",
"-811190405": "Hora",
"-1984478597": "Los detalles de esta transacción están disponibles en CoinsPaid.",
"-1272778997": "Le hemos enviado un correo electrónico.",
"-89973258": "Reenviar correo electrónico en {{seconds}}s",
"-1332236294": "Por favor, verifique su identidad",
Expand Down
Loading

0 comments on commit 84afb84

Please sign in to comment.