-
Notifications
You must be signed in to change notification settings - Fork 298
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
Kate / DTRA-175 / Enable 'Only ups/downs' in reports and contract details page #8883
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov Report
@@ Coverage Diff @@
## master #8883 +/- ##
======================================
Coverage 0.05% 0.05%
======================================
Files 117 117
Lines 3425 3425
Branches 893 893
======================================
Hits 2 2
Misses 3423 3423 |
A production App ID was automatically generated for this PR. (log)
Click here to copy & paste above information.
|
🚨 Lighthouse report for the changes in this PR:
Lighthouse ran with https://deriv-app-git-fork-kate-deriv-kate-dtra-175onlyups.binary.sx/ |
@@ -7,6 +7,7 @@ import { | |||
getGrowthRatePercentage, | |||
isBot, | |||
isAccumulatorContract, | |||
isOnlyUpsDownsContract, |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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), |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
⏳ Generating Lighthouse report... |
👌 Pull request has been updated with the base branch by Paimon the Release Bot |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
* 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>
…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>
…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>
…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>
…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>
…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>
Changes:
Screenshots:
Please provide some screenshots of the change.