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-353 /TS migration of trader package 4 #9657

Merged
Merged
Show file tree
Hide file tree
Changes from 81 commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
bae55f7
fix: ts-migrate trade-params
henry-deriv Jul 25, 2023
4ac6bb7
fix: sonarcloud
henry-deriv Jul 25, 2023
2e59904
Merge branch 'master' of github.com:binary-com/deriv-app into henry/w…
henry-deriv Jul 25, 2023
332faef
Merge branch 'master' of github.com:binary-com/deriv-app into henry/d…
henry-deriv Jul 25, 2023
7130bc7
fix: pull in changes from tech debt 2 package
henry-deriv Jul 26, 2023
8120e75
Merge branch 'master' of github.com:binary-com/deriv-app into henry/d…
henry-deriv Jul 26, 2023
0b9147d
fix: resolve comments
henry-deriv Jul 27, 2023
233224d
fix: move type to common prop types
henry-deriv Jul 31, 2023
9517546
fix: move type to common prop types
henry-deriv Jul 31, 2023
48bb038
Merge branch 'master' of github.com:binary-com/deriv-app into henry/d…
henry-deriv Jul 31, 2023
9bf6a53
fix: move type to common prop types file
henry-deriv Jul 31, 2023
50d5a86
fix: resolve comments
henry-deriv Jul 31, 2023
7e10d2f
Kate / DTRA-321 / TS migration of trade-params and trade-params-mobil…
kate-deriv Jul 31, 2023
399417b
fix: circleCI error
henry-deriv Jul 31, 2023
9e66480
fix: resolve conflicts
henry-deriv Aug 3, 2023
08a31bb
fix: ts migrate trade-footer-extensions.jsx
henry-deriv Aug 3, 2023
028df01
fix: fix import
henry-deriv Aug 3, 2023
c89ec2d
fix: remove progress-slider-stream since its not used
henry-deriv Aug 3, 2023
2c2d5b4
fix: resolve comments
henry-deriv Aug 3, 2023
ef2fa81
fix: reset with master
henry-deriv Aug 3, 2023
8f9b5e2
fix: reset with master
henry-deriv Aug 3, 2023
bb34a5e
fix: reset with master
henry-deriv Aug 3, 2023
8526837
fix: reset with master
henry-deriv Aug 3, 2023
f926720
fix: circleCI
henry-deriv Aug 3, 2023
bc9cb56
fix: togglePositions folder
henry-deriv Aug 4, 2023
cd89b38
fix: dtra-346 marketisclosed and marketcountdowntimer migration
henry-deriv Aug 4, 2023
10b37b9
Merge branch 'master' of github.com:binary-com/deriv-app into henry/d…
henry-deriv Aug 4, 2023
8a31dd4
fix: bug
henry-deriv Aug 7, 2023
5e341bd
Maryia/dtra-270/TS migration: trade-store (#5)
maryia-deriv Aug 9, 2023
45dec2c
fix: resolve conflicts
henry-deriv Aug 9, 2023
2e03e52
fix: resolve conflicts
henry-deriv Aug 9, 2023
8c7a4b0
fix: resolve comments
henry-deriv Aug 10, 2023
cf55989
feat: add ts migartion of store
kate-deriv Aug 10, 2023
cd5556b
refactor: add prev changes
kate-deriv Aug 10, 2023
4ca1c7a
Merge branch master of github.com:binary-com/deriv-app into kate/ts_m…
kate-deriv Aug 10, 2023
0d29044
chore: empty commit
kate-deriv Aug 10, 2023
781447c
fix: add lost mocked
kate-deriv Aug 10, 2023
a243f5c
fix: resolve comments
henry-deriv Aug 11, 2023
e6bbc42
fix: merge conflicts
henry-deriv Aug 11, 2023
1af31df
Merge branch 'master' into kate/ts_migration_trader_package_4
kate-deriv Aug 11, 2023
778d74d
Kate / DTRA-354 / Components/Form/Purchase files in Trader package (#21)
kate-deriv Aug 14, 2023
79bf3c1
maryia/fix: sonarcloud warnings (#7)
maryia-deriv Aug 15, 2023
9ab887a
Merge branch henry/dtra-317/tech-debt-package-3 into kate/ts_migratio…
kate-deriv Aug 15, 2023
eb28c12
fix: bug
henry-deriv Aug 16, 2023
16ebb57
fix: resolve conflict
henry-deriv Aug 16, 2023
2c76f62
fix: sonarcloud
henry-deriv Aug 16, 2023
0160b2b
fix: reorder props
henry-deriv Aug 16, 2023
159efaa
fix: test cases
henry-deriv Aug 16, 2023
c9d1156
fix: coveralls
henry-deriv Aug 17, 2023
4daf7b1
fix: coveralls
henry-deriv Aug 17, 2023
8daf97a
fix: conflict and coveralls
henry-deriv Aug 17, 2023
98f5e45
fix: this component doesnt exist anymore, hence test was also removed
henry-deriv Aug 17, 2023
ff0bf4a
Merge branch 'master' of github.com:binary-com/deriv-app into henry/d…
henry-deriv Aug 17, 2023
ceef0ba
Merge branch henry/dtra-317/tech-debt-package-3 into kate/ts_migratio…
kate-deriv Aug 18, 2023
73d154f
Merge branch 'master' into kate/ts_migration_trader_package_4
kate-deriv Aug 21, 2023
bca1185
henry/dtra-356/fix: ts-migration-digitsJSX (#24)
henry-deriv Aug 22, 2023
5477ae5
chore: removed unused state
kate-deriv Aug 22, 2023
2b82010
Maryia/dtra-355/Migrate ContractDrawer files to TS (#22)
maryia-deriv Aug 23, 2023
070a003
Kate/dtra 357/ts contract audit files (#23)
kate-deriv Aug 24, 2023
7147560
chore: fix of sonar cloud
kate-deriv Aug 24, 2023
2cf925b
Maryia/dtra-373/remove localize from ContractCardHeader component (#25)
maryia-deriv Aug 24, 2023
915ea63
fix: sonar cloud codesmells
kate-deriv Aug 24, 2023
1eb7495
Merge branch master into kate/ts_migration_trader_package_4
kate-deriv Aug 24, 2023
84d584a
Merge branch master into kate/ts_migration_trader_package_4
kate-deriv Sep 7, 2023
622582a
Merge branch 'master' into kate/ts_migration_trader_package_4
kate-deriv Sep 7, 2023
b4fef01
fix: build TS errors (#32)
maryia-deriv Sep 7, 2023
b6b5b0f
Merge branch master into kate/ts_migration_trader_package_4
kate-deriv Sep 18, 2023
16a0bcd
refactor: tests
kate-deriv Sep 19, 2023
302ed80
Merge branch master into kate/ts_migration_trader_package_4
kate-deriv Sep 20, 2023
1b75800
fix: more conflicts
kate-deriv Sep 20, 2023
53a3ac1
Merge branch 'master' into kate/ts_migration_trader_package_4
kate-deriv Sep 20, 2023
6ff9682
Merge branch 'master' into kate/ts_migration_trader_package_4
kate-deriv Sep 20, 2023
bcbf91f
chore: empty commit
kate-deriv Sep 20, 2023
b2e0f0d
Merge branch master into kate/ts_migration_trader_package_4
kate-deriv Sep 21, 2023
9520016
Merge branch master into kate/ts_migration_trader_package_4
kate-deriv Sep 26, 2023
e74b4b2
Merge branch master into kate/ts_migration_trader_package_4
kate-deriv Sep 26, 2023
a84c80f
Merge branch master into kate/ts_migration_trader_package_4
kate-deriv Sep 27, 2023
e14156c
maryia/fix: type issues on package 4 (#41)
maryia-deriv Sep 28, 2023
5953d36
Merge branch master into kate/ts_migration_trader_package_4
kate-deriv Sep 28, 2023
6e61e4d
refactor: apply suggestions
kate-deriv Sep 28, 2023
e607757
Merge branch master into kate/ts_migration_trader_package_4
kate-deriv Oct 2, 2023
a969cb5
fix: types in tests
kate-deriv Oct 2, 2023
b11012f
fix: test extention
kate-deriv Oct 2, 2023
b4762e5
Merge branch master into kate/ts_migration_trader_package_4
kate-deriv Oct 3, 2023
83041e7
Merge branch 'master' into kate/ts_migration_trader_package_4
kate-deriv Oct 3, 2023
61ef36f
fix: wallet file
kate-deriv Oct 3, 2023
b683179
Merge branch master into kate/ts_migration_trader_package_4
kate-deriv Oct 4, 2023
9d9f52d
Merge branch 'master' into kate/ts_migration_trader_package_4
kate-deriv Oct 4, 2023
9f6924a
fix: add turbos to types
kate-deriv Oct 4, 2023
d901140
Merge branch 'master' into kate/ts_migration_trader_package_4
kate-deriv Oct 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
172 changes: 171 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/analytics/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { default as RudderStack } from './rudderstack';
export type { TEvents } from './rudderstack';
2 changes: 1 addition & 1 deletion packages/analytics/src/rudderstack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ type IdentifyAction = {
language: string;
};

type TEvents = {
export type TEvents = {
ce_chart_types_form: ChartTypesFormAction;
ce_indicators_types_form: IndicatorsTypesFormAction;
ce_market_types_form: MarketTypesFormAction;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ describe('<ErrorComponent/>', () => {
redirect_label: 'test_label',
should_clear_error_on_click: true,
should_show_refresh: true,
app_routing_history: [{ pathname: '/cashier' }],
redirectOnClick: jest.fn(),
setError: jest.fn(),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ import React from 'react';
import { useHistory } from 'react-router-dom';
import { PageErrorContainer } from '@deriv/components';
import { routes } from '@deriv/shared';
import { TRootStore } from '../../../types';
import { localize, Localize } from '@deriv/translations';
import { TCoreStores } from '@deriv/stores/types';

type TErrorComponentProps = TCoreStores['common']['error'] & {
setError?: (has_error: boolean, error: React.ReactNode | null) => void;
};

const ErrorComponent = ({
header,
Expand All @@ -14,7 +18,7 @@ const ErrorComponent = ({
setError,
should_clear_error_on_click,
should_show_refresh = true,
}: TRootStore['common']['error']) => {
}: TErrorComponentProps) => {
const history = useHistory();

React.useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type TArrowButton = {
is_open?: boolean;
onClick: () => void;
title?: string;
position: 'top' | 'bottom';
position?: 'top' | 'bottom';
};

const IconArrow = ({ className }: { className?: string }) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type TAccumulatorCardBody = {
getContractById: React.ComponentProps<typeof ToggleCardDialog>['getContractById'];
indicative?: number;
is_sold: boolean;
onMouseLeave: () => void;
onMouseLeave?: () => void;
removeToast: (toast_id: string) => void;
setCurrentFocus: (value: string) => void;
status?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ export type TGeneralContractCardBodyProps = {
has_progress_slider: boolean;
is_mobile: boolean;
is_sold: boolean;
onMouseLeave: () => void;
onMouseLeave?: () => void;
removeToast: (toast_id: string) => void;
setCurrentFocus: (name: string) => void;
status?: string;
toggleCancellationWarning: () => void;
toggleCancellationWarning: (state_change?: boolean) => void;
progress_slider?: React.ReactNode;
is_positions?: boolean;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ export type TCardFooterPropTypes = {
contract_info: TContractInfo;
getCardLabels: TGetCardLables;
is_multiplier?: boolean;
is_positions: boolean;
is_positions?: boolean;
is_sell_requested: boolean;
onClickCancel: (contract_id?: number) => void;
onClickSell: (contract_id?: number) => void;
onFooterEntered?: () => void;
server_time: moment.Moment;
should_show_transition: boolean;
should_show_transition?: boolean;
};

const CardFooter = ({
Expand All @@ -32,7 +32,7 @@ const CardFooter = ({
server_time,
should_show_transition,
}: TCardFooterPropTypes) => {
const { in_prop } = useNewRowTransition(should_show_transition);
const { in_prop } = useNewRowTransition(!!should_show_transition);

const is_valid_to_cancel = isValidToCancel(contract_info);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import React from 'react';
import classNames from 'classnames';
import { CSSTransition } from 'react-transition-group';
import { localize } from '@deriv/translations';
import {
isHighLow,
getCurrentTick,
getGrowthRatePercentage,
getContractSubtype,
isAccumulatorContract,
isSmartTraderContract,
isBot,
isMobile,
isTurbosContract,
getLocalizedTurbosSubtype,
} from '@deriv/shared';
import ContractTypeCell from './contract-type-cell';
import Button from '../../button';
Expand Down Expand Up @@ -83,8 +82,7 @@ const ContractCardHeader = ({
},
{
is_param_displayed: is_turbos,
displayed_param:
getContractSubtype(contract_type || '') === 'Long' ? localize('Long') : localize('Short'),
displayed_param: getLocalizedTurbosSubtype(contract_type),
},
],
[multiplier, growth_rate, is_accumulator, is_turbos, contract_type]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type TContractTypeCellProps = {
is_high_low: boolean;
multiplier?: number;
type?: string;
displayed_trade_param?: string;
displayed_trade_param?: React.ReactNode;
};

const ContractTypeCell = ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export type TContractUpdateFormProps = Pick<
contract: TContractStore;
error_message_alignment?: string;
getCardLabels: TGetCardLables;
onMouseLeave: () => void;
onMouseLeave?: () => void;
removeToast: (toast_id: string) => void;
setCurrentFocus: (name: string | null) => void;
status: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ import { TGetCardLables, TGetContractPath } from '../types';
type TContractCardProps = {
contract_info: TContractInfo;
getCardLabels: TGetCardLables;
getContractPath: TGetContractPath;
getContractPath?: TGetContractPath;
is_multiplier: boolean;
is_positions: boolean;
is_unsupported: boolean;
onClickRemove: (contract_id: number) => void;
is_positions?: boolean;
is_unsupported?: boolean;
onClickRemove?: (contract_id?: number) => void;
profit_loss: number;
result: string;
result?: string;
should_show_result_overlay: boolean;
toggleUnsupportedContractModal: (is_unsupported_contract_modal_visible: boolean) => void;
toggleUnsupportedContractModal?: (is_unsupported_contract_modal_visible: boolean) => void;
};

const ContractCard = ({
Expand Down Expand Up @@ -53,7 +53,7 @@ const ContractCard = ({
is_multiplier={is_multiplier}
is_visible={!!contract_info.is_sold}
onClickRemove={onClickRemove}
onClick={() => toggleUnsupportedContractModal(true)}
onClick={() => toggleUnsupportedContractModal?.(true)}
result={result || fallback_result}
is_positions={is_positions}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import { TGetCardLables, TGetContractPath } from '../../types';
type TResultOverlayProps = {
contract_id?: number;
getCardLabels: TGetCardLables;
getContractPath: TGetContractPath;
getContractPath?: TGetContractPath;
is_multiplier?: boolean;
is_positions: boolean;
is_unsupported: boolean;
is_positions?: boolean;
is_unsupported?: boolean;
is_visible: boolean;
onClick: () => void;
onClickRemove: (contract_id: number) => void;
onClickRemove?: (contract_id?: number) => void;
result: string;
};

Expand Down Expand Up @@ -88,7 +88,7 @@ const ResultOverlay = ({
<span
id={`dc_contract_card_${contract_id}_result_close_icon`}
className='dc-result__close-btn'
onClick={() => onClickRemove(Number(contract_id))}
onClick={() => onClickRemove?.(contract_id)}
/>
)}
{getContractPath && (
Expand Down
Loading
Loading