Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rostislav / WALL-243 / TS migration Cashier (deriv-com#7746)
* refactor: migration done * refactor: init pr * Rostislav / 85420 / Migrate cashier `utils` to TS (#2) * refactor: init pr * refactor: refactored utils/validator to ts + moved it to shared * refactor: added more typescript shenanigans to validator * refactor: a minor change * refactor: import refactored * refactor: some more progress with the validator to avoid the build failing hopefully * refactor: validator ts issues fixed * refactor: more ts fixes to get this to work * refactor: removed validator from cashier * refactor: added tests for validator/errors in shared * refactor: applied suggested changes * refactor: some more any -> unknown refactoring * refactor: fixed cringe mistake * refactor: fixed a small mistake * Update packages/cashier/src/utils/server_time.ts Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com> --------- Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com> * Rostislav / 85418 / Migrate disable-withdrawal-modal Component (#4) * refactor: ts migration * refactor: rmved the file * Rostislav / 85421 / Migrate cashier constants to TS (#3) * refactor: init pr * refactor: constants.js migrated * refactor: tsx'd transaction-status.js * refactor: tsx'd static-url.jsx * refactor: test deploy again * refactor: tests fixed * refactor: import fixed * refactor: removed the usage of PlatformContext and its is_appstore from StaticUrl * refactor: added eslint-disable-next-line * refactor: removed "return undefined" and typed return value * refactor: refactored types out into type file * refactor: added more constants * refactor: removed ! from recent-transaction.tsx * refactor: removed ts-ignore * refactor: more importing types instead of defining whats defined * refactor: fixed tests * refactor: capitalized status codes * refactor: rollbacked status codes in tests some more (lowercase -> CAPS) * refactor: removed unused import * refactor: Types -> ../types * refactor: added "as const" in constants.ts * refactor: new typeguards + improved readability * Update packages/cashier/src/constants/transaction-status.tsx Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com> * refactor: fixed typeguards * refactor: type fixes * refactor: mockRootStore type changed to TStores (@hamid-deriv's suggestion) * refactor: added default return for transaction status --------- Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com> * Rostislav / WALL-257 / TS migration of Payment Agent Transfer UI component and store (#7) * refactor: init pr * refactor: migrated the store * refactor: migrated components * refactor: fixed mockStore * refactor: minor fix * refactor: more minor fixes * refactor: a few more minor fixes * refactor: one more import fix * refactor: tests fix * refactor: pa transfer request amount type string -> number * Update packages/cashier/src/types/props.types.ts Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com> * refactor: applied @farzin-deriv's suggestion * refactor: applied more suggestions --------- Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com> * Rostislav / WALL-256 / TS migration of payment agent UI component and store (#6) * refactor: init pr * refactor: pa deposit details * refactor: mad webstorm suggestion (lets have it like this for now) * refactor: pa card helpers * refactor: pa card helpers (+ this one) * refactor: pa detail + spec * refactor: pa detail index * refactor: pa + spec * refactor: pa card deposit details spec * refactor: pa card listed withdraw form (to revisit) * refactor: pa card listed withdraw form (index) * refactor: pa card description * refactor: added types * refactor: types export * refactor: pa search box * refactor: pa withdraw form * refactor: pa card (to revisit) * refactor: pa container spec * refactor: pa container (to revisit) * refactor: pa container index * refactor: pa container index +1 * refactor: pa receipt index * refactor: pa index * refactor: pa withdraw confirm index * refactor: pa receipt (revisit after pa store) * refactor: pa receipt spec +1 * refactor: pa listed withdraw form * refactor: pa withdraw confirm + spec (to revisit after pa store) * refactor: pa listed withdraw form spec * refactor: pa disclaimer * refactor: pa receipt (revisit after pa store) * refactor: side note * refactor: stores types updated * refactor: store refactored + types added + few more changes * refactor: logic changed + store tests fixed * refactor: tests fixed it seems * fix: mockStore fixed * refactor: param type simplified for getNormalizedPaymentMethod * refactor: removed unused scss + minor changes * refactor: payment-agent.spec.tsx final * refactor: simplified payment-agent-card.tsx a bit * refactor: pa container spec removed TRootStore * refactor: a few changes to tests + a few ts errors resolved * refactor: init pr * refactor: init pr * refactor: trigger deploy * refactor: trigger deploy * refactor: old logic for banks and payment agents restored in PA store + type alias removed * Update packages/cashier/src/pages/payment-agent/payment-agent-withdrawal-locked/payment-agent-withdrawal-locked.tsx Co-authored-by: George Usynin <103181646+heorhi-deriv@users.noreply.github.com> * Update packages/cashier/src/pages/payment-agent/payment-agent-withdrawal-locked/payment-agent-withdrawal-locked.tsx Co-authored-by: George Usynin <103181646+heorhi-deriv@users.noreply.github.com> * refactor: changed `undefined` fallback to '' in pa listed withdraw form * refactor: renamed the types to start with 'T' * refactor: tests should be fixed now * refactor: one more tests fix * refactor: ReactNode -> React.ReactNode * refactor: a minor change * refactor: tests re-run check * refactor: a minor change * Update packages/stores/types.ts Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com> * Update packages/stores/src/mockStore.ts Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com> * refactor: more suggestions applied * refactor: suggestions * refactor: React.ReactNode | string => React.ReactNode * refactor: PaymentAgentCard default values set for boolean params * refactor: formatting post merge-conflict problem fixed * refactor: verification_code removed from props and is being set from client store * refactor: prev commit changes fix in tests (oops) * refactor: one more test fix * refactor: tests fix * refactor: cashier store ts fix * refactor: type problems in PaymentAgentCard fixed with the help of @heorhi-deriv * Update packages/cashier/src/pages/payment-agent/payment-agent-withdraw-confirm/payment-agent-withdraw-confirm.tsx Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com> * fix: tests fix --------- Co-authored-by: George Usynin <103181646+heorhi-deriv@users.noreply.github.com> Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com> * Rostislav / WALL-261 / Migrate remaining cashier js to ts (#8) * refactor: init pr * refactor: refactored app to ts * refactor: cashier pages index.js -> .ts * refactor: remove a bunch of import aliases * refactor: revert accidental committed changes * refactor: some changes to the request types * refactor: sonarcloud fixes + removing TRootStore * refactor: continue removing TRootStore from everywhere * refactor: remove redundant static typing for mockStore call results + continue removing TRootStore * refactor: remove TRootStore completely * refactor: const mockRootStore -> const mock_root_store (convention for consts) * refactor: more spec refactoring * refactor: remove TRootStore from non-specs as well * fix: tests fix * refactor: removed imports for beforeEach * refactor: remove redundant cast * fix: fixing tests * fix: fixing tests * fix: fixing tests * fix: fix tests * refactor: a bunch of errors resolved * fix: test fix * fix: cast amount to number * fix: a few more forgotten number casts * fix: fixing tests * fix: fixing code smells * fix: fixing code smells * fix: fixing code smells * refactor: remove import of a removed type * refactor: rolled back on bad refactor + +{smth} -> Number({smth}) * refactor: ref and ReactPortal problems resolved * refactor: pa withdraw form spec type errors resolved * refactor: more refactoring in cashier tests * fix: tests fix * Update packages/shared/src/utils/validator/errors.ts Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com> * Update packages/components/src/components/input/input.tsx Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com> * refactor: revert back to TRootStore for a bunch of stores * refactor: TCoreStores changed + withdraw store change revert * refactor: Array<T> -> T[] * refactor: PA store param type: TStores -> TRootStore * refactor: crypto-fiat-converter.spec.tsx type errors resolved * refactor: crypto transactions ts changes * Update packages/cashier/src/components/crypto-transactions-history/__tests__/crypto-transactions-renderer.spec.tsx Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com> * Update packages/cashier/src/components/crypto-transactions-history/__tests__/crypto-transactions-renderer.spec.tsx Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com> * Update packages/cashier/src/components/crypto-transactions-history/__tests__/crypto-transactions-renderer.spec.tsx Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com> * refactor: error.tsx and error.spec.tsx type errors resolved * refactor: recent-transaction.tsx status null return value accounted for * refactor: crypto-transactions-renderer.spec.tsx removed unused import * refactor: error.tsx props type adjusted * refactor: payment-agent-store.ts added await on async call * refactor: Array<T> => T[] in more cashier files + account-transfer-store.ts type error resolution * refactor: TWebsocketCall functions types made async * Update packages/stores/types.ts Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com> * fix: pa transfer store tests oddity fixed * fix: @farzin-deriv's suggestions * fix: another suggestion applied * fix: another suggestion applied * refactor: TStores-related refactoring * refactor: TStores-related refactoring * refactor: ClientStore.account_limits.daily_transfers types changed * fix: mockStore account_limits type inconsistency * refactor: fixing more ts errors * refactor: TClientStore account_limits type now used from api types * refactor: some of the more risky changes * fix: tests fix * refactor: accidental auto change rollback * refactor: remove auto changes * refactor: remove auto changes * refactor: ErrorDialog-related type errors fixed * refactor: withdraw.tsx-related type errors fixed * refactor: withdrawal-locked.spec.tsx-related type errors resolved * refactor: more type errors resolved * refactor: package-lock.json set to master * refactor: remove icons.js from changes * refactor: remve type errors from pa store and pa transfer store * refactor: minor refactoring * refactor: minor refactoring * refactor: removing more type errors * refactor: insignificant change reverted * refactor: { [key: string]: never } -> Record<string, never> * refactor: small type change in tests * refactor: got rid of a bunch of code smells * refactor: got rid of a bunch more code smells * refactor: got rid of a bunch more code smells * fix: tests fix * fix: qa fix * fix: tests fix --------- Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com> Co-authored-by: George Usynin <103181646+heorhi-deriv@users.noreply.github.com> Co-authored-by: hirad-deriv <hirad@re-work.dev>
- Loading branch information