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

Kate / DTRA-175 / Enable 'Only ups/downs' in reports and contract details page #8883

Merged
merged 26 commits into from
Jul 21, 2023

Conversation

kate-deriv
Copy link
Contributor

@kate-deriv kate-deriv commented Jun 1, 2023

Changes:

  • Enable Only ups and downs in reports and contract details page
  • Change chart marker's styles accordinately

Screenshots:

Please provide some screenshots of the change.

@vercel
Copy link

vercel bot commented Jun 1, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
deriv-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 21, 2023 8:30am

@kate-deriv kate-deriv changed the title Kate / DTRA-175 / Enable 'Only ups/Downs' in reports and contract details page Kate / DTRA-175 / Enable 'Only ups/downs' in reports and contract details page Jun 1, 2023
@codecov
Copy link

codecov bot commented Jun 1, 2023

Codecov Report

Merging #8883 (1a43547) into master (d5c38a0) will not change coverage.
The diff coverage is n/a.

❗ Current head 1a43547 differs from pull request most recent head 2ac9198. Consider uploading reports for the commit 2ac9198 to get more accurate results

@@          Coverage Diff           @@
##           master   #8883   +/-   ##
======================================
  Coverage    0.05%   0.05%           
======================================
  Files         117     117           
  Lines        3425    3425           
  Branches      893     893           
======================================
  Hits            2       2           
  Misses       3423    3423           

@github-actions
Copy link
Contributor

github-actions bot commented Jun 2, 2023

A production App ID was automatically generated for this PR. (log)

Click here to copy & paste above information.
- **PR**: [https://github.com/binary-com/deriv-app/pull/8883](https://github.com/binary-com/deriv-app/pull/8883)
- **URLs**:
    - **w/ App ID + Server**: https://deriv-app-git-fork-kate-deriv-kate-dtra-175onlyups.binary.sx?qa_server=red.binaryws.com&app_id=32875
    - **Original**: https://deriv-app-git-fork-kate-deriv-kate-dtra-175onlyups.binary.sx
- **App ID**: `32875`

@github-actions
Copy link
Contributor

github-actions bot commented Jun 2, 2023

🚨 Lighthouse report for the changes in this PR:

Category Score
🔺 Performance 17
🟧 Accessibility 75
🟢 Best practices 92
🟧 SEO 85
🟢 PWA 90

Lighthouse ran with https://deriv-app-git-fork-kate-deriv-kate-dtra-175onlyups.binary.sx/

@@ -7,6 +7,7 @@ import {
getGrowthRatePercentage,
isBot,
isAccumulatorContract,
isOnlyUpsDownsContract,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently we are enabling only one contract type from SmartTrader (Only ups/ downs). When there will be more contracts and they will all have common style, then I need to rename variable, something like isOnlyUpsDownsContract ---> isSmartTraderContract + refactor function which check if it is a SmartTrader contract.

@@ -24,7 +25,8 @@ const createMarkerConfig = (marker_type, x, y, content_config) =>

export const getSpotCount = (contract_info, spot_count) => {
if (isDigitContract(contract_info.contract_type)) return spot_count + 1;
if (isAccumulatorContract(contract_info.contract_type)) return null;
if (isAccumulatorContract(contract_info.contract_type) || isOnlyUpsDownsContract(contract_info.contract_type))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to new requirements, we don't need to show spot number for contracts from SmartTrader

@@ -127,7 +129,7 @@ export const createMarkerSpotMiddle = (contract_info, tick, idx) => {
spot_value: `${spot}`,
spot_epoch,
align_label: tick.align_label,
is_value_hidden: is_accumulator,
is_value_hidden: is_accumulator || (isOnlyUpsDownsContract(contract_info.contract_type) && idx !== 1),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to new requirements we should hide information about tick (value, time) for all ticks, except the first and the last

@@ -32,13 +32,15 @@ export const isValidToSell = (contract_info: TContractInfo) =>

export const hasContractEntered = (contract_info: TContractInfo) => !!contract_info.entry_spot;

export const isAccumulatorContract = (contract_type: string) => /ACCU/i.test(contract_type);
export const isAccumulatorContract = (contract_type = '') => /ACCU/i.test(contract_type);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added empty string as a default param because contract_type could be possibly undefined as we passed it as contract_info.contract_type inside of function and TContractInfo has :
contract_type?: string; (node_modules/@deriv/api-types/index.d.ts, line 13467)
Moreover, this approach is being used in line 51 (this file) and 143.

@coveralls
Copy link

coveralls commented Jul 6, 2023

Coverage Status

coverage: 8.882% (+0.005%) from 8.877% when pulling 2ac9198 on kate-deriv:kate/DTRA-175_only_ups into 8623b8a on binary-com:master.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 6, 2023

Generating Lighthouse report...

@ali-hosseini-deriv
Copy link
Member

👌 Pull request has been updated with the base branch by Paimon the Release Bot

@sonarcloud
Copy link

sonarcloud bot commented Jul 21, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
1.8% 1.8% Duplication

@bahar-sadeghzadeh bahar-sadeghzadeh merged commit 0ee0f43 into binary-com:master Jul 21, 2023
3 checks passed
vinu-deriv pushed a commit that referenced this pull request Jul 24, 2023
* shontzu/WALL-865/Incorrect-total-asset-amount (#9217)

* fix: attemp #3

* chore: remove irrelevant check

* chore: unit test

* chore: unit test fail

* chore: fixes based on review

* chore: empty commit

* chore: code revie fixes

* chore: revert test case changes

* chore: rename type to TUseTotalAccountBalance

* chore: format doc and added test case for multiple accounts in different currencies

---------

Co-authored-by: Ali(Ako) Hosseini <ali.hosseini@deriv.com>

* Farabi/bot 317/translation fixes for dbot homepage (#9108)

* fix: translation issues

* redeploy: vercel retrigger

---------

Co-authored-by: Ali(Ako) Hosseini <ali.hosseini@deriv.com>

* shahzaib / KYC-270 / fix POI flow after IDV failure and retries (#9222)

* chore: fix POI flow after IDV failure and retries

* chore: fix onfido infinite trigger for nigeria clients

* chore: fix onfido trigger if submission left is zero or less

* style: fix manual upload card content alignment

* chore: rename prop to default_enabled

* fix: nimc slip document step check

* chore: add comment to define the use of added prop

* maryia/DTRA-297/fix: Crypto profit text & Hide barriers in case of trade params errors (#9347)

* chore: remove animation correction

* feat: clear barriers upon errors

* fix: profit text & hide it for crypto with more than 2 decimals

* test: AccumulatorsProfitLossText

* Revert "chore: remove animation correction"

This reverts commit f9bb5ec.

* fix: not hide barriers for ongoing contract in case of trade params error

---------

Co-authored-by: Ali(Ako) Hosseini <ali.hosseini@deriv.com>

* Kate / DTRA-175 / Enable 'Only ups/downs' in reports and contract details page (#8883)

* refactor: move trade type from un to supported

* feat: ad contract type check func and add to contract details

* feat: add chart markers settings for contract type

* chore: add style for mobile

* chore: remove gradient

* chore: empty commit

* chore: add gradient for contract details card for desktop

* feat: add chart markers setings and update style

* refactor: apply suggestions

* chore: empty commit

---------

Co-authored-by: Ali(Ako) Hosseini <ali.hosseini@deriv.com>

* fix: token leakage to third party api (#9000)

Co-authored-by: Ali(Ako) Hosseini <ali.hosseini@deriv.com>

---------

Co-authored-by: shontzu <108507236+shontzu-deriv@users.noreply.github.com>
Co-authored-by: Ali(Ako) Hosseini <ali.hosseini@deriv.com>
Co-authored-by: Farabi <102643568+farabi-deriv@users.noreply.github.com>
Co-authored-by: Shahzaib <shahzaib@deriv.com>
Co-authored-by: Maryia <103177211+maryia-deriv@users.noreply.github.com>
Co-authored-by: kate-deriv <121025168+kate-deriv@users.noreply.github.com>
Co-authored-by: Sui Sin <103026762+suisin-deriv@users.noreply.github.com>
mahdiyeh-deriv pushed a commit to mahdiyeh-deriv/deriv-app that referenced this pull request Jul 25, 2023
…ails page (binary-com#8883)

* refactor: move trade type from un to supported

* feat: ad contract type check func and add to contract details

* feat: add chart markers settings for contract type

* chore: add style for mobile

* chore: remove gradient

* chore: empty commit

* chore: add gradient for contract details card for desktop

* feat: add chart markers setings and update style

* refactor: apply suggestions

* chore: empty commit

---------

Co-authored-by: Ali(Ako) Hosseini <ali.hosseini@deriv.com>
mahdiyeh-deriv pushed a commit to mahdiyeh-deriv/deriv-app that referenced this pull request Jul 25, 2023
…ails page (binary-com#8883)

* refactor: move trade type from un to supported

* feat: ad contract type check func and add to contract details

* feat: add chart markers settings for contract type

* chore: add style for mobile

* chore: remove gradient

* chore: empty commit

* chore: add gradient for contract details card for desktop

* feat: add chart markers setings and update style

* refactor: apply suggestions

* chore: empty commit

---------

Co-authored-by: Ali(Ako) Hosseini <ali.hosseini@deriv.com>
mahdiyeh-deriv pushed a commit to mahdiyeh-deriv/deriv-app that referenced this pull request Jul 25, 2023
…ails page (binary-com#8883)

* refactor: move trade type from un to supported

* feat: ad contract type check func and add to contract details

* feat: add chart markers settings for contract type

* chore: add style for mobile

* chore: remove gradient

* chore: empty commit

* chore: add gradient for contract details card for desktop

* feat: add chart markers setings and update style

* refactor: apply suggestions

* chore: empty commit

---------

Co-authored-by: Ali(Ako) Hosseini <ali.hosseini@deriv.com>
mahdiyeh-deriv pushed a commit to mahdiyeh-deriv/deriv-app that referenced this pull request Jul 25, 2023
…ails page (binary-com#8883)

* refactor: move trade type from un to supported

* feat: ad contract type check func and add to contract details

* feat: add chart markers settings for contract type

* chore: add style for mobile

* chore: remove gradient

* chore: empty commit

* chore: add gradient for contract details card for desktop

* feat: add chart markers setings and update style

* refactor: apply suggestions

* chore: empty commit

---------

Co-authored-by: Ali(Ako) Hosseini <ali.hosseini@deriv.com>
matin-deriv pushed a commit to matin-deriv/deriv-app that referenced this pull request Aug 2, 2023
…ails page (binary-com#8883)

* refactor: move trade type from un to supported

* feat: ad contract type check func and add to contract details

* feat: add chart markers settings for contract type

* chore: add style for mobile

* chore: remove gradient

* chore: empty commit

* chore: add gradient for contract details card for desktop

* feat: add chart markers setings and update style

* refactor: apply suggestions

* chore: empty commit

---------

Co-authored-by: Ali(Ako) Hosseini <ali.hosseini@deriv.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants