Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Utkarsha/update with master #51

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
0c5d8b3
[WALL] Jim/WALL-4588/update expectations and conditional (#16183)
jim-deriv Jul 25, 2024
fedf163
chore: fixed console error by adding useeffect (#16109)
fasihali-deriv Jul 25, 2024
632e990
[WALL] Aizad/WALL-4353/ Replace Tooltip with Tooltip from deriv-com/u…
aizad-deriv Jul 25, 2024
2b5a801
Fasih/TRAH-3827/ Enable tooltip again (#16175)
fasihali-deriv Jul 25, 2024
bdebbf3
[WALL] Jim/WALL-4349/replace walletbutton with button (#16146)
jim-deriv Jul 25, 2024
563e0b7
[DTRA] henry/dtra-1448/enable-landscape-blocker-dtrader (#16119)
henry-deriv Jul 26, 2024
3470ab4
[DTRA] Kate/Maryia/DTRA-1354/feat: Redesigned Trade params & Purchase…
maryia-deriv Jul 26, 2024
692fcd7
chore: update @deriv/deriv-charts to 2.2.0 (#16204)
DerivFE Jul 26, 2024
e25862b
[DTRA] Maryia/OPT-862/feat: update Step Indices config and icons (#15…
maryia-deriv Jul 26, 2024
63a0efd
Niloofar/[TRAH-3826]/Bottom disclaimer on Traders Hub for EU (#16193)
niloofar-deriv Jul 26, 2024
3fe82cf
[CFDS]/Hasan/CFDS-4165/Update STN abbreviation to STD on Trader's Hub…
hasan-deriv Jul 26, 2024
456b4a1
translations: 📚 sync translations with crowdin (#16209)
github-actions[bot] Jul 26, 2024
a1b3680
Hirad/CFDs-4392/Fixed the tablet view CFD modal issues (#16145)
hirad-deriv Jul 26, 2024
210a5bb
Likhith-Ako / FEQ-2485 / implement dr solution for deriv app (#16213)
ali-hosseini-deriv Jul 26, 2024
65ee6ec
[P2PS] - Nada/P2PS-2639/fix: order completion list to be taken from B…
nada-deriv Jul 26, 2024
a10f85c
[WALL] george / WALL-4522 / Add ce_cashier_deposit_onboarding_form an…
heorhi-deriv Jul 26, 2024
f4237d1
[P2PS] - Nada/2570/fix payment method checkbox issue, condition issue…
nada-deriv Jul 26, 2024
d96fc3d
translations: 📚 sync translations with crowdin (#16221)
github-actions[bot] Jul 26, 2024
d3b11bd
translations: 📚 sync translations with crowdin (#16223)
github-actions[bot] Jul 26, 2024
d84a0d6
[DTRA] henry/webrel-3029/hotfix: hide recent positions modal and show…
henry-deriv Jul 26, 2024
bce1cc1
DTRA / Kate / DTRA-1542 / [DTreader-V2]: Guide and Allow equal change…
kate-deriv Jul 29, 2024
9b2220e
fix: fixed the issue of digit contract tick count value getting trunc…
vinu-deriv Jul 29, 2024
1f8e870
DTRA / Kate / DTRA-1432 / Account switcher DTrader-V2 fixes (#16165)
kate-deriv Jul 29, 2024
8fe51d3
fix: run button color on run and stop status (#16106)
farabi-deriv Jul 29, 2024
e60c35a
chore: added yml file to ease deployment for passkey (#16216)
suisin-deriv Jul 29, 2024
c9011d4
ci: get the tag name from inputs (#16233)
ali-hosseini-deriv Jul 29, 2024
46d6b6d
Ako/update docker image creator (#16236)
ali-hosseini-deriv Jul 29, 2024
9e86851
feat: real account signup new flow (#16172)
niloofar-deriv Jul 29, 2024
0290b58
translations: 📚 sync translations with crowdin (#16238)
github-actions[bot] Jul 29, 2024
622cf26
fix: removed clean urls from vercel dr json (#16249)
nada-deriv Jul 30, 2024
fd346e1
Revert "[WALL] george / WALL-4522 / Add ce_cashier_deposit_onboarding…
nada-deriv Jul 29, 2024
bd32ef2
[DTRA] Maryia/DTRA-1546/fix: [V2] style & animation for Digits Curren…
maryia-deriv Jul 30, 2024
1486143
chore: replace localize import with new library (#16140)
likhith-deriv Jul 30, 2024
46faae9
[WALL] Lubega / WALL-4549 / Wallets initial translations setup (#16158)
lubega-deriv Jul 30, 2024
b2908af
translations: 📚 sync translations with crowdin (#16262)
github-actions[bot] Jul 30, 2024
e5f76cc
ci: change env usage (#16264)
ali-hosseini-deriv Jul 30, 2024
dfedd88
Ako/ override installCommand of vercel (#16257)
ali-hosseini-deriv Jul 30, 2024
de3dfc4
fix: remove localize loader (#16268)
lubega-deriv Jul 30, 2024
39032b6
Rupato/BOT-1935/Handle-invalid-access-token (#16190)
rupato-deriv Jul 30, 2024
51d4b18
[BOT] maryia/BOT-1479/[Test Coverage] Folder: bot-web-ui/src/componen…
maryia-matskevich-deriv Jul 30, 2024
64426df
fix: resolve conflicts
utkarsha-deriv Jul 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 0 additions & 4 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ inputs:
description: 'Node environment'
required: false
default: 'test'
CROWDIN_WALLETS_API_KEY:
description: 'Crowdin wallets api key'
required: false
DATADOG_CLIENT_TOKEN:
description: 'Datadog client token'
required: false
Expand Down Expand Up @@ -64,7 +61,6 @@ runs:
- name: Build all packages
env:
NODE_ENV: ${{ inputs.NODE_ENV }}
CROWDIN_WALLETS_API_KEY: ${{ inputs.CROWDIN_WALLETS_API_KEY }}
DATADOG_APPLICATION_ID: ${{ inputs.DATADOG_APPLICATION_ID }}
DATADOG_CLIENT_TOKEN: ${{ inputs.DATADOG_CLIENT_TOKEN }}
DATADOG_CLIENT_TOKEN_LOGS: ${{ inputs.DATADOG_CLIENT_TOKEN_LOGS }}
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/build_docker_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build Docker image and push to dockerhub
on:
workflow_dispatch:
inputs:
docker_image_tag_name:
type: string
description: Docker image tag name
required: true
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
tag_name: ${{ github.event.inputs.docker_image_tag_name }}
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.WEB_ACCESS_DOCKERHUB_USERNAME }}
password: ${{ secrets.WEB_ACCESS_DOCKERHUB_PASSWORD }}

- name: Run Bootstrap
run: npm run bootstrap

- name: Run Build:prod
run: npm run build:prod

- name: Run Build Docker
run: docker build -t ${{ secrets.WEB_ACCESS_DOCKERHUB_USERNAME }}/$tag_name . --platform=linux/amd64

- name: Run Tag Docker
run: docker tag ${{ secrets.WEB_ACCESS_DOCKERHUB_USERNAME }}/$tag_name ${{ secrets.WEB_ACCESS_DOCKERHUB_USERNAME }}/$tag_name

- name: Run Push Docker
run: docker push ${{ secrets.WEB_ACCESS_DOCKERHUB_USERNAME }}/$tag_name
21 changes: 19 additions & 2 deletions .github/workflows/release_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Versioning
uses: "./.github/actions/versioning"
with:
RELEASE_TYPE: $RELEASE_TYPE
RELEASE_TYPE: ${{ env.RELEASE_TYPE }}
- name: Extract version
id: extract_version
run: echo "RELEASE_VERSION=${version}" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
MESSAGE: "${{ env.RELEASE_TYPE }} Release succeeded for app.deriv.com with version ${{ needs.build_test_and_publish.outputs.RELEASE_VERSION }}"

build_and_publish_to_docker_k8s:
build_and_publish_to_DR_solution:
name: Build Docker image and push to Docker hub and K8S
runs-on: Runner_8cores_Deriv-app
environment: Production
Expand Down Expand Up @@ -121,3 +121,20 @@ jobs:
with:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
MESSAGE: "${{ env.RELEASE_TYPE }} Docker Publish and Kubernetes Deployment for app.deriv.com with version ${{ needs.build_test_and_publish.outputs.RELEASE_VERSION }} has Failed"
- name: Upload to vercel
id: vercel-upload
uses: 'deriv-com/shared-actions/.github/actions/vercel_DR_publish@master'
with:
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: 'app-dr.binary.sx'

- name: Send DR Slack Notification
uses: "deriv-com/shared-actions/.github/actions/send_slack_notification@master"
if: ${{ steps.vercel-upload.outcome != 'success' }}
with:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
MESSAGE: Disaster Recovery Release to vercel failed for app.deriv.com with version ${{ needs.build_test_and_publish.outputs.RELEASE_VERSION }}
20 changes: 9 additions & 11 deletions .github/workflows/release_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
uses: "./.github/actions/build"
with:
NODE_ENV: production
CROWDIN_WALLETS_API_KEY: ${{ secrets.CROWDIN_WALLETS_API_KEY }}
IS_GROWTHBOOK_ENABLED: ${{ vars.IS_GROWTHBOOK_ENABLED }}
DATADOG_APPLICATION_ID: ${{ vars.DATADOG_APPLICATION_ID }}
DATADOG_CLIENT_TOKEN: ${{ vars.DATADOG_CLIENT_TOKEN }}
Expand Down Expand Up @@ -53,14 +52,13 @@ jobs:
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
id: vercel-upload
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: ${{ secrets.K8S_NAMESPACE }}
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-app-dr.binary.sx'
1 change: 0 additions & 1 deletion .github/workflows/release_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
uses: "./.github/actions/build"
with:
NODE_ENV: production
CROWDIN_WALLETS_API_KEY: ${{ secrets.CROWDIN_WALLETS_API_KEY }}
DATADOG_APPLICATION_ID: ${{ vars.DATADOG_APPLICATION_ID }}
IS_GROWTHBOOK_ENABLED: ${{ vars.IS_GROWTHBOOK_ENABLED }}
DATADOG_CLIENT_TOKEN: ${{ vars.DATADOG_CLIENT_TOKEN }}
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/sync-translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ on:
- master
schedule:
- cron: '0 */12 * * *'

jobs:
sync_translations:
permissions:
contents: write
runs-on: ubuntu-latest
environment: Staging
steps:
- name: Sync translations
- name: Sync accounts translations
uses: deriv-com/translations/.github/actions/extract_and_sync_translations@main
with:
PROJECT_NAME: ${{ vars.ACC_R2_PROJECT_NAME }}
Expand All @@ -26,3 +26,15 @@ jobs:
R2_SECRET_ACCESS_KEY: ${{ secrets.ACC_R2_SECRET_ACCESS_KEY }}
R2_BUCKET_NAME: ${{ secrets.ACC_R2_BUCKET_NAME }}
PROJECT_SOURCE_DIRECTORY: "packages/account/src"
- name: Sync wallets translations
uses: deriv-com/translations/.github/actions/extract_and_sync_translations@main
with:
PROJECT_NAME: ${{ vars.WALLETS_PROJECT_NAME }}
CROWDIN_BRANCH_NAME: staging
CROWDIN_PROJECT_ID: ${{ secrets.WALLETS_CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.ACC_CROWDIN_PERSONAL_TOKEN }}
R2_ACCOUNT_ID: ${{ secrets.ACC_R2_ACCOUNT_ID }}
R2_ACCESS_KEY_ID: ${{ secrets.ACC_R2_ACCESS_KEY_ID }}
R2_SECRET_ACCESS_KEY: ${{ secrets.ACC_R2_SECRET_ACCESS_KEY }}
R2_BUCKET_NAME: ${{ secrets.ACC_R2_BUCKET_NAME }}
PROJECT_SOURCE_DIRECTORY: "packages/wallets/src"
2 changes: 1 addition & 1 deletion .stylelintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = {
'shorthand-property-no-redundant-values': true,
'string-no-newline': true,
'time-min-milliseconds': 100,
'unit-allowed-list': ['fr', 'px', 'em', 'rem', '%', 'svh', 'svw', 'vw', 'vh', 'deg', 'ms', 's', 'dpcm'],
'unit-allowed-list': ['fr', 'px', 'em', 'rem', '%', 'svh', 'svw', 'vw', 'vh', 'dvh', 'deg', 'ms', 's', 'dpcm'],
'value-keyword-case': 'lower',
},
extends: [
Expand Down
48 changes: 40 additions & 8 deletions __mocks__/translation.mock.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,51 @@
const Localize = ({ i18n_default_text, values }) => {
// Replace placeholders in the default text with actual values
const localizedText = i18n_default_text.replace(/\{\{(\w+)\}\}/g, (match, key) => values[key] || match);
import React from 'react';

return localizedText || null;
const Localize = ({ i18n_default_text, components = [], values = {} }) => {
// Split text into parts, extracting placeholders for components and values
const parts = i18n_default_text.split(/(<\d+>.*?<\/\d+>|{{\w+}})/g);

const replaceValues = text => {
return text.replace(/{{(\w+)}}/g, (match, key) => values[key] || match);
};

return (
<>
{parts.map((part, index) => {
// Replace component placeholders with actual components
const componentMatch = part.match(/<(\d+)>(.*?)<\/\1>/);

if (componentMatch) {
const componentIndex = parseInt(componentMatch[1]);

// Replace values wrapped in components with actual values
const content = replaceValues(componentMatch[2]);
const Component = components[componentIndex];
return Component ? React.cloneElement(Component, { key: index, children: content }) : content;
}

// Replace value placeholders with actual values
const valueMatch = part.match(/{{(\w+)}}/);
if (valueMatch) {
const valueKey = valueMatch[1];
return values[valueKey] || part;
}
return part;
})}
</>
);
};

const mockFn = jest.fn((text, args) => {
return text.replace(/{{(.*?)}}/g, (_, match) => args[match.trim()]);
});

// Mock for useTranslations hook
const useTranslations = () => ({
localize: jest.fn((text, args) => {
return text.replace(/{{(.*?)}}/g, (_, match) => args[match.trim()]);
}),
localize: mockFn,
currentLang: 'EN',
});

const localize = jest.fn(text => text);
const localize = mockFn;

const getAllowedLanguages = jest.fn(() => ({ EN: 'English', VI: 'Tiếng Việt' }));

Expand Down
Loading
Loading