-
Notifications
You must be signed in to change notification settings - Fork 396
[DTRA] / Kate / DTRA-934 / Enable forward starting contract from Smartrader #14181
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
[DTRA] / Kate / DTRA-934 / Enable forward starting contract from Smartrader #14181
Conversation
…tion in recen positions
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
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-934forwardstarti-07af52.binary.sx/ |
packages/components/src/components/positions-drawer-card/positions-drawer-card.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/components/positions-drawer-card/positions-drawer-card.tsx
Outdated
Show resolved
Hide resolved
92cb821
| isForwardStartingBuyTransaction( | ||
| row.action_type, | ||
| row.shortcode, | ||
| row.purchase_time || row.transaction_time |
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.
Can we pass a single row param and destructure/use the properties we need inside isForwardStartingBuyTransaction? :)
same in data-table.tsx
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.
But row object has a lot of fields, a we need only 3. What are the benefits of passing all object? Moreover, in that case it won't be obvious which exactly information do we need
| const contract_type = extractInfoFromShortcode(row_obj.shortcode)?.category?.toUpperCase(); | ||
| const unsupportedContractConfig = getUnsupportedContracts()[contract_type as TUnsupportedContractType]; | ||
| const shouldShowForwardStartingNotification = | ||
| isForwardStarting(row_obj.shortcode, row_obj.purchase_time || row_obj.transaction_time) && |
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.
Can we pass a single row_obj param to isForwardStarting and take all necessary properties from it inside isForwardStarting? :)
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.
Please, refer to answer #14181 (comment)
|
|
⏳ Generating Lighthouse report... |
…trader (deriv-com#14181) * feat: enable forward starting contracts on descktop and modify filtration in recen positions * feat: add filtration for mobiile recent positions and refactor failing tests * refactor: comments * refactor: modify checking function * refactor: rename function * refactor: improve type of function arguments * refactor: add tests and remove codesmells * refactor: add timer for hidding notification * refactor: remove code smells * refactor: remove unused code * refactor: fix failing test * refactor: extract logic into the hook * chore: rename and remove extra spaces * refactor: extract duplictaed filtration logic * fix: allow display of manually sold forward contract before starting * refactor: add tests for new function * refactor: apply suggestions regarding destructurization * refactor: apply suggestions




Changes:
CALLSPREAD/Spread UpandPUTSPREAD/Spread Downwhich are not available at all our platforms) and forward starting contracts, which haven't started yet. Forward starting contracts, which already HAVE started, are shown.hasContractStartedis based oncontract_infofields (it's comparingcurrent_spot_timeanddate_start) and used in such places as position-drawer-card, position-drawer, open-positions. Second one,hasForwardContractStartedfunction acceptsshortcode, extractingstart_timefrom shortcode and compare withDate.now(). Is used in statement, because there we have no access tocontract_info.Screenshots: