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

Akmal / feat: re-trigger barrier validation to show any error messages hidden that were hidden behind th e action sheet #17571

Merged
merged 11 commits into from
Dec 23, 2024
Merged
1,007 changes: 820 additions & 187 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/account/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@deriv-com/utils": "^0.0.36",
"@deriv-com/ui": "1.36.4",
"@deriv/api": "^1.0.0",
"@deriv-com/quill-ui": "1.21.0",
"@deriv-com/quill-ui": "1.23.1",
"@deriv/components": "^1.0.0",
"@deriv/hooks": "^1.0.0",
"@deriv/quill-icons": "1.23.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/appstore/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ module.exports = function (env) {
'@deriv/account': true,
'@deriv/cashier': true,
'@deriv/cfd': true,
'@deriv-com/analytics': `@deriv-com/analytics`,
'@deriv-com/analytics': '@deriv-com/analytics',
'@deriv-com/translations': '@deriv-com/translations',
},
],
Expand Down
2 changes: 1 addition & 1 deletion packages/bot-web-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"webpack-cli": "^5.1.4"
},
"dependencies": {
"@deriv-com/quill-ui": "1.21.0",
"@deriv-com/quill-ui": "1.23.1",
"@deriv-com/ui": "1.36.4",
"@deriv/api": "^1.0.0",
"@deriv/api-types": "1.0.172",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"@datadog/browser-rum": "^5.11.0",
"@deriv-com/analytics": "1.26.2",
"@deriv-com/quill-tokens": "2.0.4",
"@deriv-com/quill-ui": "1.21.0",
"@deriv-com/quill-ui": "1.23.1",
"@deriv-com/translations": "1.3.9",
"@deriv-com/ui": "1.36.4",
"@deriv-com/utils": "^0.0.36",
Expand Down
14 changes: 7 additions & 7 deletions packages/shared/src/utils/constants/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const getLocalizedBasis = () =>
payout: localize('Payout'),
stake: localize('Stake'),
turbos: localize('Turbos'),
} as const);
}) as const;

/**
* components can be undef or an array containing any of: 'start_date', 'barrier', 'last_digit'
Expand Down Expand Up @@ -245,7 +245,7 @@ export const getContractCategoriesConfig = () =>
},
Vanillas: { name: localize('Vanillas'), categories: [TRADE_TYPES.VANILLA.CALL, TRADE_TYPES.VANILLA.PUT] },
Accumulators: { name: localize('Accumulators'), categories: [TRADE_TYPES.ACCUMULATOR] },
} as const);
}) as const;

export const unsupported_contract_types_list = [
// TODO: remove these once all contract types are supported
Expand Down Expand Up @@ -312,7 +312,7 @@ export const getCardLabels = () =>
TICKS: localize('Ticks'),
TOTAL_PROFIT_LOSS: localize('Total profit/loss:'),
WON: localize('Won'),
} as const);
}) as const;

export const getCardLabelsV2 = () =>
({
Expand Down Expand Up @@ -378,7 +378,7 @@ export const getCardLabelsV2 = () =>
RESET_BARRIER: localize('Reset barrier'),
RESET_TIME: localize('Reset time'),
SELECTED_TICK: localize('Selected tick'),
} as const);
}) as const;

export const getMarketNamesMap = () =>
({
Expand Down Expand Up @@ -487,7 +487,7 @@ export const getMarketNamesMap = () =>
CRYETHUSD: localize('ETH/USD'),
CRYEOSUSD: localize('EOS/USD'),
CRYLTCUSD: localize('LTC/USD'),
} as const);
}) as const;

export const getUnsupportedContracts = () =>
({
Expand All @@ -499,7 +499,7 @@ export const getUnsupportedContracts = () =>
name: localize('Spread Down'),
position: 'bottom',
},
} as const);
}) as const;

/**
* // Config to display details such as trade buttons, their positions, and names of trade types
Expand Down Expand Up @@ -659,7 +659,7 @@ export const getSupportedContracts = (is_high_low?: boolean) =>
// position: 'top',
// }
// and also to DTRADER_FLAGS in FeatureFlagsStore, e.g.: sharkfin: false,
} as const);
}) as const;

export const TRADE_FEATURE_FLAGS = ['sharkfin', 'dtrader_v2'];

Expand Down
2 changes: 1 addition & 1 deletion packages/trader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"dependencies": {
"@deriv-com/analytics": "1.26.2",
"@deriv-com/quill-tokens": "2.0.4",
"@deriv-com/quill-ui": "1.21.0",
"@deriv-com/quill-ui": "1.23.1",
"@deriv-com/utils": "^0.0.36",
"@deriv-com/ui": "1.36.4",
"@deriv/api-types": "1.0.172",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ const BarrierInput = observer(
onAction: () => {
if (validation_errors.barrier_1.length === 0) {
onClose(true);

// This is a workaround to re-trigger any validation errors that were hidden behind the action sheet
handleOnChange({
target: { name: 'barrier_1', value: barrier_1.replace(/[+-]/g, '') },
});
} else {
setShouldShowError(true);
}
Expand Down
Loading