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

maryia/DTRA-260/TS migration of /Constants files & SmartChart/Helpers files in Trader #6

Conversation

maryia-deriv
Copy link
Collaborator

@maryia-deriv maryia-deriv commented Jun 22, 2023

Changes:

  • migrate validation-rules to ts
  • remove 2 unused ui.js files
  • migrate index.js to ts
  • remove unused markers.js
  • migrate Constants/barriers.js file to ts
  • migrate Helpers/barriers.js file and its test to ts
  • migrate chart-barrier-store.js to ts
  • remove unused chart-marker-store.js

Screenshots:

Please provide some screenshots of the change.

@maryia-deriv maryia-deriv changed the title maryia/WEBREL-320/TS migration of files from Constants/ & SmartChart/Helpers/ dirs in Trader [WIP] maryia/DTRA-260/TS migration of files from Constants/ & SmartChart/Helpers/ dirs in Trader [WIP] Jun 28, 2023
@maryia-deriv maryia-deriv changed the title maryia/DTRA-260/TS migration of files from Constants/ & SmartChart/Helpers/ dirs in Trader [WIP] maryia/DTRA-260/TS migration of files from Constants & SmartChart/Helpers directory in Trader Jun 28, 2023
@maryia-deriv maryia-deriv changed the title maryia/DTRA-260/TS migration of files from Constants & SmartChart/Helpers directory in Trader maryia/DTRA-260/TS migration of /Constants files & SmartChart/Helpers files in Trader Jun 28, 2023
@@ -0,0 +1,18 @@
import type { ChartBarrierStore } from '../chart-barrier-store';

export type TBarrier = ChartBarrierStore & { key?: string };

Choose a reason for hiding this comment

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

for me i ended up adding key as a prop in chartbarrierstore in my PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@henry-deriv the thing is that ChartBarrierStore has nothing to do with the key, the key is assigned afterwards to a resulting object which is returned as a result of new ChartBarrierStore(...) call.

Choose a reason for hiding this comment

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

I made the same change in my PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thank you🙏🏻

import { TTradeStore } from 'Types';

type TOptions = {
min?: number;

Choose a reason for hiding this comment

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

why not number | string as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good point👍🏻 reused existing TRuleOptions type from validator.ts :)

Copy link

@henry-deriv henry-deriv left a comment

Choose a reason for hiding this comment

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

Left comments

@coveralls
Copy link

coveralls commented Jul 4, 2023

Pull Request Test Coverage Report for Build 5456508300

  • 8 of 48 (16.67%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.004%) to 8.879%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/trader/src/Stores/Modules/SmartChart/chart-barrier-store.ts 0 7 0.0%
packages/trader/src/Stores/Modules/Trading/Constants/validation-rules.ts 0 33 0.0%
Totals Coverage Status
Change from base Build 5456153184: -0.004%
Covered Lines: 8341
Relevant Lines: 77199

💛 - Coveralls

@github-actions
Copy link

github-actions bot commented Jul 4, 2023

Generating Lighthouse report...

@kate-deriv kate-deriv merged commit 4269754 into kate-deriv:kate/ts_migration_trader_package Jul 5, 2023
1 check passed
kate-deriv added a commit that referenced this pull request Aug 10, 2023
#6)

* refactor: migrate trade params and started mobile version

* refactor: ts migration of trade params mobile

* chore: add nessasary prop

* refactor: apply suggestions

* chore: change todo text

* refactor: add import
kate-deriv added a commit that referenced this pull request Sep 7, 2023
* refactor: ts migration of chart loader

* refactor: ts migration of screen large form and started purchase

* refactor: add types in store and refcator contract

* refactor: ts migaration of purchase field

* refactor: ts migration of cancel deal info

* refactor: ts migration of the purchase btn

* refactor: cancel deal info

* refactor: remove simular types

* refactor: create file for types

* chore: cover return value with react fragment

* refactor: apply suggestions

* refactor: update imports

* refactor: type returned value

* refactor: left an explanation of expecting ts error

* Akmal / feat: migrate EmptyPortfolioMessage, ErrorComponent and Page404 in Trader package (#5)

* feat: migrate Page404 to Typescript

* feat: migrate EmptyPortfolioMessage to Typescript

* feat: migrate ErrorComponent to Typescript

* fix: dialog prop

* fix: dialog type

* chore: remove React.FC

* maryia/WEBREL-321/feat: migrate Actions files to TS (#4)

* feat: migrate /contract-type.js to ts & remove barrier.js

* feat: migrate duration to ts + remove unused currency.js

* feat: migrate actions/purchase to ts

* feat: migrate actions/symbol to ts

* feat: migrate start-date.js to ts

* feat: migrate actions/test.js to ts

* chore: improve types in start-date and duration

* fix: address review comments

* revert: unnecessary line deletion

* fix: address reviews

* refactor: remove some code smells

* refactor: remove code smells

* refactor: update types in stores

* Akmal / feat: migrate utils in Trader package  (#9)

* feat: migrate MarketUnderlying to Typescript

* feat: migrate errors to Typescript

* feat: migrate error spec to Typescript

* feat: migrate index to Typescript

* feat: migrate validator to Typescript

* feat: trigger vercel

* chore: sort options alphabetically

* fix: TValidationResult type

* chore: prettier formatting

* refactor: reduce code smells

* chore: validator type improvements (#12)

* Kate / DTRA-249 / Code refactoring and removing duplicated files (#13)

* refactor: remove duplicated file

* refactor: test improvements

* fix: removed forgotten import

* chore: empty commit to retrigger checks

* refactor: apply suggestion

* maryia/DTRA-260/TS migration of /Constants files & SmartChart/Helpers files in Trader (#6)

* feat: validation-rules and ui.js to ts

* chore: squash merge maryia/WEBREL-321/actions-to-TS changes

* chore: added types to validation-rules.ts

* chore: remove unused ui.js, migrate used ui.js and index.js to ts

* chore: remove unused ui.js

* chore: remove unused markers.js, and migrate barriers.js to ts

* chore: added types to barriers.js and its test

* test: add missing test for removeBarrier to barriers

* Revert "chore: squash merge maryia/WEBREL-321/actions-to-TS changes"

* feat: migrated chart-barrier-store.js to ts

* feat: remove unused ChartMarkerStore

* build: trigger build

* fix: address review comments

* henry/webrel-319/ts-migration-modules-trading-helpers-folder (#11)

* fix: merge conflicts

* fix: resolve comments

* fix: remove comment

* fix: add loadash types dependency

* refactor: move error type to common props file

* fix: circle CI

* fix: resolve comment

* fix: bug

* fix: convert returntype to use ttradestore

* empty commit

* fix: type change

* fix: resolve comments

* fix: comments

* maryia/861n17c54/fix: sonarcloud warnings (#14)

* fix: sonarcloud warnings

* fix: types

* fix: resolve conflicts

* refactor: apply suggestions

* refactor: add last suggestion

* refactor: tests

* refactor: update function

* refactor: add ts migration of exist tests

* fix: tests

* fix: test case

---------

Co-authored-by: Akmal Djumakhodjaev <akmal@binary.com>
Co-authored-by: Maryia <103177211+maryia-deriv@users.noreply.github.com>
Co-authored-by: henry-deriv <118344354+henry-deriv@users.noreply.github.com>
Co-authored-by: Matin shafiei <matin@deriv.com>
kate-deriv pushed a commit that referenced this pull request Sep 13, 2023
* feat: 🍱 added visual assets

* Kyc/wall 1325/revamp poa section (#6)

* feat: ✨ added new component

* feat: ✅ added testcases

* feat: account page revamp, cfd poa remove, account poa reuse

* refactor: simplified && condition

* chore: modal alignment styles

* fix: failing tests

* refactor: some ts issues resolve

* refactor: poa container TS migration

* chore: styles clarifications

* refactor: poa form ts migration, code refactor

* fix: ts ignore for cfd build

* fix: commented code

* fix: failing test

* chore: code refactoring

* chore: recreating PR for kyc-WALL-1322-revamp-poa-section

* chore: incorporated review comments

* chore: review comments

* chore: review comments2

* chore: remove unused variable

* chore: cfd-poa testcases

* refactor: review comments

* chore: review comments

* ref: Incorporated review somments

* chore: review coment

* chore: review comments

* chore: review comments addressing

* fix: failing test

* chore: styles code refactor

* chore: spaces fix

* refactor: file descriptions map array

* chore: review comments

* chore: review comments

* chore: review comments

* chore: compare account flow fix

* chore: review comments

* chore: review comments

* chore: review comments

* chore: review comments incorporating

* fix: styling discrepancies

* fix: back button condition

* chore: remove back button

* fix: failing test cfd-poa

* refactor: localize change to component

* refactor: 🎨 incorporated Localize component

* chore: remove unused css and types

* chore: wrong description on examples

* fix: styles for resubmit message

* fix: submitting error poa page

* chore: mobing submit error to the top

* fix: wrong message after submitting documents

* refactor: boolean instead !!

* chore: added gif as supported file

* fix: failing test

* fix: resolve path

---------

Co-authored-by: Likhith Kolayari <likhith@regentmarkets.com>
Co-authored-by: Likhith Kolayari <98398322+likhith-deriv@users.noreply.github.com>
Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”>
kate-deriv added a commit that referenced this pull request Oct 4, 2023
* fix: ts-migrate trade-params

* fix: sonarcloud

* fix: pull in changes from tech debt 2 package

* fix: resolve comments

* fix: move type to common prop types

* fix: move type to common prop types

* fix: move type to common prop types file

* fix: resolve comments

* Kate / DTRA-321 / TS migration of trade-params and trade-params-mobile (#6)

* refactor: migrate trade params and started mobile version

* refactor: ts migration of trade params mobile

* chore: add nessasary prop

* refactor: apply suggestions

* chore: change todo text

* refactor: add import

* fix: circleCI error

* fix: ts migrate trade-footer-extensions.jsx

* fix: fix import

* fix: remove progress-slider-stream since its not used

* fix: resolve comments

* fix: reset with master

* fix: reset with master

* fix: reset with master

* fix: reset with master

* fix: circleCI

* fix: togglePositions folder

* fix: dtra-346 marketisclosed and marketcountdowntimer migration

* fix: bug

* Maryia/dtra-270/TS migration: trade-store (#5)

* chore: prepare for migration

* chore: add more types to trade-store

* chore: add more types to trade-store

* chore: add more types to trade-store

* chore: add more types to trade-store

* chore: migrated trade-store to ts

* chore: improve types in trade-store

* fix: type

* revert: hooks package installation

* refactor: address review

* fix: resolve comments

* feat: add ts migartion of store

* refactor: add prev changes

* chore: empty commit

* fix: add lost mocked

* fix: resolve comments

* Kate / DTRA-354 / Components/Form/Purchase files in Trader package (#21)

* refactor: ts migartion of purchase files

* refactor: remove duplicated types

* refactor: apply suggestions

* maryia/fix: sonarcloud warnings (#7)

* fix: sonarcloud warnings

* fix: Unexpected end of JSON input

* fix: bug

* fix: sonarcloud

* fix: reorder props

* fix: test cases

* fix: coveralls

* fix: coveralls

* fix: this component doesnt exist anymore, hence test was also removed

* henry/dtra-356/fix: ts-migration-digitsJSX (#24)

* fix: initial commit

* fix: ts migrate digits JSX

* fix: small type change

* fix: comment

* chore: removed unused state

* Maryia/dtra-355/Migrate ContractDrawer files to TS (#22)

* feat: migrated swipeable-components to TS

* feat: migrated market-closed-contract-overlay & index to TS

* chore: migrated contract-drawer-card.tsx to ts

* build: fix type

* chore: migrated contract-drawer to ts

* chore: fixed existing types in digits and logic

* chore: sort types properties in alphabetical order

* Kate/dtra 357/ts contract audit files (#23)

* refactor: apply suggestion from prev pr

* refactor: start ts migration of contract audit

* chore: change comment

* refactor: ts of contract audit item

* refactor: ts migration of contract details

* refactor: ts migration of contract history

* refactor: add preprepared types

* refactor: tests

* chore: apply nit

* refactor: apply suggestions

* refactor: apply suggestions

* chore: fix of sonar cloud

* Maryia/dtra-373/remove localize from ContractCardHeader component (#25)

* refactor: remove localize from contract-card-header

* refactor: use Localize component instead of localize helper

* build: install RTL deps in shared package

* fix: sonar cloud codesmells

* fix: build TS errors (#32)

* refactor: tests

* fix: more conflicts

* chore: empty commit

* maryia/fix: type issues on package 4 (#41)

* fix: type issues

* chore: file change from package 3

* chore: keep small changes from package 3

* chore: removed unnecessary todo comment

* refactor: apply suggestions

* fix: types in tests

* fix: test extention

* fix: wallet file

* fix: add turbos to types

---------

Co-authored-by: Henry Hein <henry@regentmarkets.com>
Co-authored-by: Maryia <103177211+maryia-deriv@users.noreply.github.com>
Co-authored-by: henry-deriv <118344354+henry-deriv@users.noreply.github.com>
kate-deriv added a commit that referenced this pull request Oct 11, 2023
* fix: ts-migrate trade-params

* fix: sonarcloud

* fix: pull in changes from tech debt 2 package

* fix: resolve comments

* fix: move type to common prop types

* fix: move type to common prop types

* fix: move type to common prop types file

* fix: resolve comments

* Kate / DTRA-321 / TS migration of trade-params and trade-params-mobile (#6)

* refactor: migrate trade params and started mobile version

* refactor: ts migration of trade params mobile

* chore: add nessasary prop

* refactor: apply suggestions

* chore: change todo text

* refactor: add import

* fix: circleCI error

* fix: ts migrate trade-footer-extensions.jsx

* fix: fix import

* fix: remove progress-slider-stream since its not used

* fix: resolve comments

* fix: reset with master

* fix: reset with master

* fix: reset with master

* fix: reset with master

* fix: circleCI

* fix: togglePositions folder

* fix: dtra-346 marketisclosed and marketcountdowntimer migration

* fix: bug

* Maryia/dtra-270/TS migration: trade-store (#5)

* chore: prepare for migration

* chore: add more types to trade-store

* chore: add more types to trade-store

* chore: add more types to trade-store

* chore: add more types to trade-store

* chore: migrated trade-store to ts

* chore: improve types in trade-store

* fix: type

* revert: hooks package installation

* refactor: address review

* fix: resolve comments

* feat: add ts migartion of store

* refactor: add prev changes

* chore: empty commit

* fix: add lost mocked

* fix: resolve comments

* Kate / DTRA-354 / Components/Form/Purchase files in Trader package (#21)

* refactor: ts migartion of purchase files

* refactor: remove duplicated types

* refactor: apply suggestions

* maryia/fix: sonarcloud warnings (#7)

* fix: sonarcloud warnings

* fix: Unexpected end of JSON input

* fix: bug

* fix: sonarcloud

* fix: reorder props

* fix: test cases

* fix: coveralls

* fix: coveralls

* fix: this component doesnt exist anymore, hence test was also removed

* henry/dtra-356/fix: ts-migration-digitsJSX (#24)

* fix: initial commit

* fix: ts migrate digits JSX

* fix: small type change

* fix: comment

* chore: removed unused state

* Maryia/dtra-355/Migrate ContractDrawer files to TS (#22)

* feat: migrated swipeable-components to TS

* feat: migrated market-closed-contract-overlay & index to TS

* chore: migrated contract-drawer-card.tsx to ts

* build: fix type

* chore: migrated contract-drawer to ts

* chore: fixed existing types in digits and logic

* chore: sort types properties in alphabetical order

* Kate/dtra 357/ts contract audit files (#23)

* refactor: apply suggestion from prev pr

* refactor: start ts migration of contract audit

* chore: change comment

* refactor: ts of contract audit item

* refactor: ts migration of contract details

* refactor: ts migration of contract history

* refactor: add preprepared types

* refactor: tests

* chore: apply nit

* refactor: apply suggestions

* refactor: apply suggestions

* chore: fix of sonar cloud

* Maryia/dtra-373/remove localize from ContractCardHeader component (#25)

* refactor: remove localize from contract-card-header

* refactor: use Localize component instead of localize helper

* build: install RTL deps in shared package

* feat: merge previous tech debt branch

* fix: sonar cloud codesmells

* Merge branch kate/ts_migration_trader_package_4 into kate/ts_migration_trader_package_5

* Kate / DTRA-378 / TS migration: Multiplier components and containers in Trader package (#26)

* refactor: ts of cancel deal and risk managment info

* fix: types in dialog tsx

* refactor: start ts of multiplier options

* refactor: ts of mult amount modal

* refactor: remove default val from basis component

* fix: type of amount mobile

* refactor: applied suggestions

* refactor: ts of multiplier info (#28)

* Henry/dtra 376/fix: ts migration positionsdrawer folder (#27)

* fix: positions drawer folder

* fix: coveralls

* fix: where is my commit

* fix: found commits

* fix: file rename

* fix: comments

* fix: comments

* fix: correct logic

* fix: remove unused props

* fix: types

* refactor: remove code mells

* fix: ts-migrate-populate header (#30)

* Maryia/DTRA-377/TS migration: TradingDatePicker + TradingTimePicker + TimePicker + Dialog (#29)

* chore: timepicker to ts

* chore: trading timepicker to ts

* chore: add types for TradingDatePicker & DatePicker

* refactor: added default values

* refactor: remove code small

* chore: empty commit

* fix: not using index as key (#31)

* fix: ternary bug

* fix: build TS errors (#32)

* refactor: apply suggestions

* refactor: change type of time

* chore: empty commit

* refactor: tests

* fix: conflicts

* fix: conflicts

* fix: tests

* fix: types in tests

* fix: test extention

* fix: add turbos to types back

* fix: add backup for target name

* fix: revert empty strings

---------

Co-authored-by: Henry Hein <henry@regentmarkets.com>
Co-authored-by: Maryia <103177211+maryia-deriv@users.noreply.github.com>
Co-authored-by: henry-deriv <118344354+henry-deriv@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants