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

Henry/how to earn payout component #45

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
377905d
translations: 📚 sync translations with crowdin (#15158)
github-actions[bot] May 15, 2024
9e59b16
translations: 📚 sync translations with crowdin (#15160)
github-actions[bot] May 15, 2024
0f3d2ba
translations: 📚 sync translations with crowdin (#15161)
github-actions[bot] May 15, 2024
7ccea47
[WALL] george / WALL-3866 / Add API error handling for withdrawal ser…
heorhi-deriv May 15, 2024
0d87485
fix: remove disclaimer modal (#15076)
farrah-deriv May 15, 2024
e30aec7
translations: 📚 sync translations with crowdin (#15168)
github-actions[bot] May 15, 2024
be99e05
refactor: revert temp workaround (#14797)
rostislav-deriv May 15, 2024
c0783d7
[WALL] Rostislav / WALL-3931 / Wrap wallet migration logic behind fea…
rostislav-deriv May 15, 2024
078c7f2
[WALL]Jim/WALL-4041/hide close icon and set ctrader account as defaul…
jim-deriv May 15, 2024
fc97f7d
translations: 📚 sync translations with crowdin (#15175)
github-actions[bot] May 15, 2024
7dac1a4
chore: TransferFormAccountCard unit test (#15140)
lubega-deriv May 15, 2024
4352b11
chore: select dxtrade account by default (#15132)
jim-deriv May 15, 2024
8e00976
chore: remove description and buttons (#15063)
jim-deriv May 15, 2024
39b53da
[coj]/likhith/coj-775/added dependencies of accounts to externals to …
likhith-deriv May 15, 2024
da03b12
[WALL] aum / WALL-3808 / show-latest-balance-wallet-cashier-overlay-a…
aum-deriv May 15, 2024
87e9f29
[DTRA] Farhan/WEBREL-2/Test coverage: error-component & Page404 in Re…
farhan-nurzi-deriv May 16, 2024
3635eaf
fix: add tests (#15136)
henry-deriv May 16, 2024
16af5ec
DTRA/ Kate / WEBREL-5 / Add tests for loader component (#15104)
kate-deriv May 16, 2024
061755f
fix: do not ignore locales when switching between languages (#15043)
maryia-deriv May 16, 2024
ef9d55e
chore: disclaimer update (#15150)
shahzaib-deriv May 16, 2024
bb1b2e8
translations: 📚 sync translations with crowdin (#15191)
github-actions[bot] May 16, 2024
e6ec1ae
chore: :fire: fix the active_symbols refetching issue on bot (#15151)
sandeep-deriv May 16, 2024
8fd223e
translations: 📚 sync translations with crowdin (#15192)
github-actions[bot] May 16, 2024
ce809bb
chore: TransferFormAccountSelection unit test (#15124)
lubega-deriv May 16, 2024
8dc26ac
[WALL] Jim/WALL-4001/ Send email when forgot password is clicked (#15…
jim-deriv May 16, 2024
2019b6a
[WALL] aum / WALL-2990/ unit-test-transfer-form (#15162)
aum-deriv May 16, 2024
fcc172b
chore: transfer api error (#15203)
lubega-deriv May 16, 2024
b63e0f3
[WALL] Lubega / WALL-3274 / Crypto connection and cryptocurrency susp…
lubega-deriv May 16, 2024
2dcbde5
[WALL] Aizad/wall 3964/wallet onboarding (#15099)
aizad-deriv May 16, 2024
92c487e
[CFDS] Hasan/CFDS-3424/mt5 deeplink redirect issue (#14547)
hasan-deriv May 17, 2024
81c9be6
feat: add test coverage for empty trade history message and indicativ…
akmal-deriv May 17, 2024
8a70548
[DTRA] henry/dtra-1237/fix: dtrader-v2 setup (#14991)
henry-deriv May 17, 2024
941906c
[DTRA] Maryia/DTRA-1265/fix: improve alignment in open positions for …
maryia-deriv May 17, 2024
3f7b602
translations: 📚 sync translations with crowdin (#15215)
github-actions[bot] May 17, 2024
5f9f869
translations: 📚 sync translations with crowdin (#15219)
github-actions[bot] May 17, 2024
2718ef9
refactor(deriv_go): updated Deriv Go's app links paths for dev and st…
bassam-deriv May 17, 2024
0bddd7b
chore: update copy for onboarding (#15218)
aizad-deriv May 17, 2024
b01628e
chore: removed get more button and modal (#15115)
shahzaib-deriv May 17, 2024
261fb21
[coj]/likhith/wall-4066/locked onfido version to prevent unintended c…
likhith-deriv May 17, 2024
e2c0041
[WALL]Hasan/WALL-3823/Incorrect field highlighting (#15049)
hasan-deriv May 17, 2024
550acf2
[coj]/likhith/coj-795/install deriv sharable libs to account package …
likhith-deriv May 17, 2024
e877ce1
[WALL] Test case for TransferReceipt (#15010)
adrienne-deriv May 17, 2024
2f11105
[DTRA] Maryia/build: update quill-ui library version to 1.9.27 + util…
maryia-deriv May 20, 2024
14d82b2
feat: contract details v2 initial setup
akmal-deriv May 20, 2024
e07bbcf
Merge branch 'master' into contract-details-v2
akmal-deriv May 20, 2024
bc80c9d
translations: 📚 sync translations with crowdin (#15240)
github-actions[bot] May 20, 2024
4421cb0
chore: placeholder
ahmadtaimoor-deriv May 20, 2024
cd58cd0
fix: min height
ahmadtaimoor-deriv May 20, 2024
bdf57f0
chore: placeholder
ahmadtaimoor-deriv May 20, 2024
c1a7862
fix: min height
ahmadtaimoor-deriv May 20, 2024
5c56436
fix: earn payout bottom modal
henry-deriv May 20, 2024
d06e58c
fix: merge with branch
henry-deriv May 20, 2024
7b03dc2
[TRAH-3259]: chore: add comment to pull requests with bundle size inf…
markw-deriv May 20, 2024
ee0c735
Merge pull request #40 from henry-deriv/henry/how-to-earn-payout-comp…
akmal-deriv May 20, 2024
52ba11e
fix: make it single responsibility component
henry-deriv May 20, 2024
0d0b274
Merge branch 'contract-details-v2' of github.com:akmal-deriv/deriv-ap…
henry-deriv May 20, 2024
b86dc09
fix: remove unnecessary brackets
henry-deriv May 20, 2024
0917f77
[WALL] Aizad/WALL-4096/Skip Step Add More Wallets (#15249)
aizad-deriv May 20, 2024
4fcb3b8
fix: make body content reusable
henry-deriv May 20, 2024
dd4c2d7
feat: add entry-exit-details component skeleton
akmal-deriv May 20, 2024
d5ff269
feat: resolve conflicts
akmal-deriv May 20, 2024
eea953b
chore: pulled changes
ahmadtaimoor-deriv May 20, 2024
46196d5
chore: transactions unit test (#15250)
lubega-deriv May 20, 2024
d17c974
[CFDS] shontzu/CFDS-3502/unexpected-behaviour-upon-clicking-dynamic-l…
shontzu-deriv May 20, 2024
ffcafe9
fix(wallets): :ambulance: fix demo cfd balance (#15230)
heorhi-deriv May 20, 2024
2b4ecab
fix(wallets): :ambulance: fix deposit iframe loading (#15252)
heorhi-deriv May 20, 2024
b31bfde
fix: fix routing to wallet transfer on clicking manage funds button i…
aum-deriv May 20, 2024
5fdf2bd
chore: get the last successful master artifact (#15253)
markw-deriv May 20, 2024
b88f5c4
Jim/wall 4000/too many attempts modal doesnt appear new (#15220)
jim-deriv May 20, 2024
4da6b8a
[WALL] Jim/WALL-4121/Split modals and move modal titles to the header…
jim-deriv May 20, 2024
cc7f6d0
chore: transfer message unit test (#15222)
lubega-deriv May 20, 2024
5725ddf
build: add quill-tokens lib + update quill-ui lib (#15266)
maryia-deriv May 21, 2024
b11a33e
fix: update branch
henry-deriv May 21, 2024
77a3a52
[DTRA] Maryia/DTRA-1206/fix: request contract history in Contract det…
maryia-deriv May 21, 2024
bf39e6d
[DTRA]Ahmad WEBREL-21/Reports.tsx Coverage (#15164)
ahmadtaimoor-deriv May 21, 2024
20c1155
Merge branch 'master' into contract-details-v2
akmal-deriv May 21, 2024
c33cc0f
translations: 📚 sync translations with crowdin (#15271)
github-actions[bot] May 21, 2024
92ef310
feat: update quill-ui version
akmal-deriv May 21, 2024
c0c7c95
Merge branch 'contract-details-v2' of github.com:akmal-deriv/deriv-ap…
henry-deriv May 21, 2024
f025aa2
feat: update quill-ui version in core
akmal-deriv May 21, 2024
7713658
chore: update @deriv/deriv-charts to 2.1.17 (#15273)
DerivFE May 21, 2024
3604f17
fix: market closed (#15157)
balakrishna-deriv May 21, 2024
98b38b4
feat: add scroll
akmal-deriv May 21, 2024
c3ecc88
[TRAH-3380] shahzaib / remove authorization and loader from options &…
shahzaib-deriv May 21, 2024
7e49062
[TRAH-3250] thisyahlen / shahzaib - remove disclaimers from real acco…
thisyahlen-deriv May 21, 2024
48ba2f1
[TRAH]/MITRA/TRAH-3395/ Update descriptions on Wallets (#15121)
mitra-deriv May 21, 2024
bfdadf6
fix: :bug: change options & mulitpliers to options (#15244)
mitra-deriv May 21, 2024
0ee6ce6
chore: fix bottom nav scroll (#15279)
balakrishna-deriv May 21, 2024
29d8f63
Aizad/WALL-4039/Resize Logo in Transfer Summary Details on Transactio…
aizad-deriv May 21, 2024
294411e
[TRAH]/Mitra/TRAH-3230/Show real sign up modal once demo creation is …
mitra-deriv May 21, 2024
cf20505
Hirad/wall-4006/ Terminal button will call the token and redirect use…
hirad-deriv May 21, 2024
7efac63
chore: card wrapper
ahmadtaimoor-deriv May 21, 2024
43c7ba0
Merge branch 'contract-details-v2' of github.com:akmal-deriv/deriv-ap…
henry-deriv May 21, 2024
e1c29b6
chore: card wrapper
ahmadtaimoor-deriv May 21, 2024
0d02466
chore: card wrapper
ahmadtaimoor-deriv May 21, 2024
5587368
Merge pull request #43 from ahmadtaimoor-deriv/f_contract_details
akmal-deriv May 21, 2024
3ea2da0
Merge branch 'master' into contract-details-v2
akmal-deriv May 21, 2024
7568de9
Merge branch 'contract-details-v2' of github.com:akmal-deriv/deriv-ap…
henry-deriv May 21, 2024
d3811f7
fix: create risk management tool
henry-deriv May 22, 2024
f44c5a9
fix: clean up contract details page
henry-deriv May 22, 2024
b2496c9
fix: add contract details footer and add deal cancellation to risk ma…
henry-deriv May 22, 2024
0908a38
fix: add a case for when take profit is disabled for ongoing contract
henry-deriv May 22, 2024
a560f57
fix: remove unncessary code
henry-deriv May 22, 2024
82e21c9
chore: bump quill-ui version
henry-deriv May 22, 2024
f0eefa5
fix: add tag component to deal cancellation widget
henry-deriv May 22, 2024
b06205a
Merge pull request #42 from henry-deriv/henry/how-to-earn-payout-comp…
akmal-deriv May 23, 2024
d64fe86
chore: useContractDetail hook
ahmadtaimoor-deriv May 23, 2024
47e463a
chore: useContractDetail hook
ahmadtaimoor-deriv May 23, 2024
7e113c5
Merge pull request #44 from ahmadtaimoor-deriv/f_contract_details
akmal-deriv May 23, 2024
1b34634
fix: connect deal cancellation widget to store
henry-deriv May 28, 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
  •  
  •  
  •  
74 changes: 67 additions & 7 deletions .github/actions/analyze/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ inputs:
DATADOG_SESSION_SAMPLE_RATE:
description: 'Datadog session sample rate'
required: false
GITHUB_TOKEN:
description: 'Github token for downloading artifacts'
required: true
GD_API_KEY:
description: 'Google drive api key'
required: false
Expand Down Expand Up @@ -54,10 +57,40 @@ inputs:
IS_GROWTHBOOK_ENABLED:
description: 'Is growthbook enabled'
required: true
ISSUE_NUMBER:
description: 'Issue to post a comment to'
required: false

runs:
using: composite
steps:

- name: Get artifact URL
id: get_artifact_url
env:
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
shell: bash
run: |
ARTIFACT_URL=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
"https://api.github.com/repos/${{ github.repository }}/actions/artifacts" | \
jq -r '.artifacts | map(select(.workflow_run.head_branch == "master" and (.name | startswith("reports-")))) | .[0] | .archive_download_url')
echo "artifact_url=$ARTIFACT_URL" >> $GITHUB_OUTPUT
echo "artifact_url=$ARTIFACT_URL"

- name: Download artifact
if: steps.get_artifact_url.outputs.artifact_url != 'null'
env:
ARTIFACT_URL: ${{ steps.get_artifact_url.outputs.artifact_url }}
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
shell: bash
run: |
curl -L -H "Authorization: Bearer $GITHUB_TOKEN" \
"$ARTIFACT_URL" \
-o artifact.zip
unzip artifact.zip -d old
cd old
unzip reports.zip

- name: Analyze all packages
env:
NODE_ENV: ${{ inputs.NODE_ENV }}
Expand All @@ -78,17 +111,44 @@ runs:
REF_NAME: ${{ inputs.REF_NAME }}
REMOTE_CONFIG_URL: ${{ inputs.REMOTE_CONFIG_URL }}
NODE_OPTIONS: "--max_old_space_size=4096"
run: npm run build:prod && npm run analyze:stats
shell: bash
run: npm run build:prod && npm run analyze:stats && npm run analyze:build

- name: Zip all stats.json files
- name: Compare report to master
id: diff
if: steps.get_artifact_url.outputs.artifact_url != 'null'
shell: bash
run: |
zip -r stats.zip packages/*/stats.json
DIFF_OUTPUT=$(node .github/actions/analyze/compareReports.js)
echo "diff_output<<EOF" >> $GITHUB_OUTPUT
echo "$DIFF_OUTPUT" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

- name: Comment on PR with Diff Output
if: steps.get_artifact_url.outputs.artifact_url != 'null' && inputs.ISSUE_NUMBER
uses: actions/github-script@v5
env:
DIFF_OUTPUT: ${{ steps.diff.outputs.diff_output }}
ISSUE_NUMBER: ${{ inputs.ISSUE_NUMBER }}
with:
script: |
const diffOutput = process.env.DIFF_OUTPUT;
const issueNumber = process.env.ISSUE_NUMBER;
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
body: `${diffOutput}`
});

- name: Zip all report.json files
shell: bash
run: |
zip -r reports.zip packages/*/report.json

- name: Upload stats.zip
- name: Upload reports.zip
uses: actions/upload-artifact@v4
with:
name: stats-${{ github.sha }}
path: stats.zip
retention-days: 1
name: reports-${{ github.sha }}
path: reports.zip
retention-days: 5
122 changes: 122 additions & 0 deletions .github/actions/analyze/compareReports.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
const fs = require('fs');
const path = require('path');

function roundUpToDecimals(num, decimals) {
const factor = Math.pow(10, decimals);
return Math.ceil(num * factor) / factor;
}

function readJsonFile(filePath) {
if (fs.existsSync(filePath)) {
const data = fs.readFileSync(filePath, 'utf-8');
return JSON.parse(data);
}
return null;
}

function calculateDiff(oldSize, newSize) {
return newSize - oldSize;
}

function calculatePercentage(oldSize, newSize) {
if (oldSize === 0) {
return newSize === 0 ? 0 : 100;
}
return ((newSize - oldSize) / oldSize) * 100;
}

function formatSize(size, roundUp) {
if (size === null) {
return '-';
}

const formattedSize = roundUp ? roundUpToDecimals(size / 1024, 2) + 'kb' : (size / 1024).toFixed(2) + 'kb';
return formattedSize;
}

const packagesDir = './packages';
const oldPackagesDir = './old/packages';
const packages = [...new Set([...fs.readdirSync(packagesDir), ...fs.readdirSync(oldPackagesDir)])];

let tableRows = '';

for (const pkg of packages) {
const oldReport = readJsonFile(path.join(oldPackagesDir, pkg, 'report.json'));
const newReport = readJsonFile(path.join(packagesDir, pkg, 'report.json'));

const oldSize = oldReport ? oldReport[0].gzipSize : null;
const newSize = newReport ? newReport[0].gzipSize : null;
let diff = oldSize && newSize ? calculateDiff(oldSize, newSize) : null;

if (oldSize === null) {
diff = newSize;
}

if (newSize === null) {
diff = oldSize;
}

let diffText = '-';

if (diff !== 0) {
diffText = diff < 0 ? '-' : '+' + formatSize(diff, true);
} else {
diffText = '+0kb';
}

let percentage = oldSize && newSize ? calculatePercentage(oldSize, newSize) : null;

if (oldSize === null) {
percentage = 100;
}

if (newSize === null) {
percentage = -100;
}

let percentageText = '-';
let percentageEmoji;

if (percentage === 0) {
percentageEmoji = '';
} else if (percentage < 0) {
percentageEmoji = '🟢'; // green for decrease
} else if (percentage >= 0 && percentage <= 5) {
percentageEmoji = '🟡'; // yellow for small increase
} else {
percentageEmoji = '🔴'; // red for larger increase
}

if (percentage !== 0) {
percentageText = percentage.toFixed(2) + '%';
} else {
percentageText = '0%';
}

tableRows += `
<tr>
<td>${pkg}</td>
<td>${formatSize(oldSize)}</td>
<td>${formatSize(newSize)}</td>
<td>${diffText}</td>
<td>${percentageText} ${percentageEmoji}</td>
</tr>
`.trim();
}

console.log(
`
<table>
<thead>
<th>package</th>
<th>old</th>
<th>new</th>
<th>diff</th>
<th>percentage</th>
</thead>
<tbody>
${tableRows}
</tbody>
</table>
`.trim()
);
7 changes: 7 additions & 0 deletions .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@ on:
branches:
- master


jobs:
build_and_test:
name: Analyze Bundle
runs-on: Runner_16cores_Deriv-app
environment: Preview
permissions:
contents: read
pull-requests: write
actions: read
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
Expand All @@ -31,6 +36,7 @@ jobs:
DATADOG_SESSION_REPLAY_SAMPLE_RATE: ${{ vars.DATADOG_SESSION_REPLAY_SAMPLE_RATE }}
DATADOG_SESSION_SAMPLE_RATE: ${{ vars.DATADOG_SESSION_SAMPLE_RATE }}
DATADOG_SESSION_SAMPLE_RATE_LOGS: ${{ vars.DATADOG_SESSION_SAMPLE_RATE_LOGS }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GD_API_KEY: ${{ secrets.GD_API_KEY }}
GD_APP_ID: ${{ secrets.GD_APP_ID }}
GD_CLIENT_ID: ${{ secrets.GD_CLIENT_ID }}
Expand All @@ -39,3 +45,4 @@ jobs:
GROWTHBOOK_DECRYPTION_KEY: ${{ vars.GROWTHBOOK_DECRYPTION_KEY }}
REF_NAME: ${{ github.ref_name }}
REMOTE_CONFIG_URL: ${{ vars.REMOTE_CONFIG_URL }}
ISSUE_NUMBER: ${{ github.event.pull_request.number }}
Loading
Loading