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

Hirad/79281/disable available accounts #6793

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
8f76aa2
translations: 📚 sync translations with crowdin (#6366)
github-actions[bot] Sep 5, 2022
d96ad5c
translations: 📚 sync translations with crowdin (#6373)
github-actions[bot] Sep 5, 2022
492178b
fix bug (#6154)
eduard-deriv Sep 6, 2022
77a1889
yauheni/ 70488/ edit note in self-exclusion message box (#6044)
yauheni-deriv Sep 6, 2022
3f9f181
Akmal / Ignore IDV verification if client is high risk && withdrawals…
akmal-deriv Sep 6, 2022
fa1fad5
fix:tax_number_validation (#6259)
amina-deriv Sep 6, 2022
3e5a76d
george / rm65047 / convert routes, cashier, error-component component…
heorhi-deriv Sep 6, 2022
773d105
george / rm65033 / ts migration of withdraw UI components (#6343)
heorhi-deriv Sep 6, 2022
c13a0b0
update deriv go redirection link (#6386)
carolsachdeva Sep 6, 2022
1a37dd2
Farzin/68320/Update cashier withdrawal locked status if PA already wi…
farzin-deriv Sep 6, 2022
cc3e244
Jim/73479/appstore-workspace-ts-fix (#6208)
jim-deriv Sep 6, 2022
7ebb3bb
Niloofar Sadeghi / Trader Typescript configuration issue (#6275)
niloofar-deriv Sep 6, 2022
d03e7ad
Niloofar Sadeghi / Add typescript configuration on reports (#6276)
niloofar-deriv Sep 6, 2022
503e77e
george / rm65041 / migrate p2p-cashier component to TS (#6177)
heorhi-deriv Sep 6, 2022
eeeb533
Vinu/Ts onramp cashier (#5727)
vinu-deriv Sep 6, 2022
c9e1a45
hamid/65036/migrate-account-transfer-to-ts (#6305)
Sep 6, 2022
dd6a168
Niloofar Sadeghi / Account typscript configuration issue (#6273)
niloofar-deriv Sep 6, 2022
b18455a
Niloofar Sadeghi / Circleci issue (#6402)
niloofar-deriv Sep 6, 2022
0917f24
Niloofar Sadeghi / Add typescript to each workspace dependency (#6306)
niloofar-deriv Sep 6, 2022
65a42d7
Shayan/74388/fix ts config on cfd (#6351)
shayan-deriv Sep 6, 2022
dec040c
translations: 📚 sync translations with crowdin (#6405)
github-actions[bot] Sep 6, 2022
f8619e6
hamid/75726/missing-grey-box-side-note (#6410)
Sep 7, 2022
b14fbc2
translations: 📚 sync translations with crowdin (#6413)
github-actions[bot] Sep 8, 2022
451abb4
Revert "george / rm65041 / migrate p2p-cashier component to TS (#6177…
carolsachdeva Sep 8, 2022
b142e79
P2p 2fa feature (#6422)
carolsachdeva Sep 8, 2022
0e09734
translations: 📚 sync translations with crowdin (#6426)
github-actions[bot] Sep 8, 2022
2f27d54
Added scroll to cfd personal details modal (#6235)
hirad-deriv Sep 14, 2022
d19609e
Shayan/74387/Update TS Config and Fix TS Errors on Cashier (#6284)
shayan-deriv Sep 14, 2022
795865b
Fixed the font size for non authenticated svg accounts (#6077)
hirad-deriv Sep 14, 2022
b364103
Farzin/70813/Fix date picker month issue for non english languages (#…
farzin-deriv Sep 14, 2022
0c3a61c
remove disabled country validation from citizenship (#6236)
amina-deriv Sep 14, 2022
c0898c2
farabi/improved-numpad-for-visibility (#6241)
farabi-deriv Sep 14, 2022
48aad23
farabi / added a new tooltip for contract type 'both' (#6189)
farabi-deriv Sep 14, 2022
2760f6d
george / rm73888 / fix Transfer button enabling when amount field is …
heorhi-deriv Sep 14, 2022
e0e2ddd
likhith/incorporating a nation id image for ZW (#6175)
likhith-deriv Sep 14, 2022
55a816a
george / rm74876 / missing payment agent's phone number and url addre…
heorhi-deriv Sep 14, 2022
027d726
Niloofar Sadeghi / Jest issue with typescript (#6442)
niloofar-deriv Sep 14, 2022
9253d96
translations: 📚 sync translations with crowdin (#6470)
github-actions[bot] Sep 14, 2022
033893e
translations: 📚 sync translations with crowdin (#6471)
github-actions[bot] Sep 14, 2022
ce856a9
translations: 📚 sync translations with crowdin (#6472)
github-actions[bot] Sep 14, 2022
4442a7d
translations: 📚 sync translations with crowdin (#6475)
github-actions[bot] Sep 14, 2022
a55a866
translations: 📚 sync translations with crowdin (#6476)
github-actions[bot] Sep 14, 2022
4c4c896
use github action token (#6335)
balakrishna-deriv Sep 14, 2022
a9995ce
mobile_fix (#6481)
amina-deriv Sep 14, 2022
90789a8
translations: 📚 sync translations with crowdin (#6482)
github-actions[bot] Sep 15, 2022
d081cf2
translations: 📚 sync translations with crowdin (#6486)
github-actions[bot] Sep 15, 2022
6be0607
fix auto pr creation (#6487)
balakrishna-deriv Sep 15, 2022
6be4ce6
translations: 📚 sync translations with crowdin (#6489)
github-actions[bot] Sep 15, 2022
a3f5a33
translations: 📚 sync translations with crowdin (#6491)
github-actions[bot] Sep 15, 2022
8f6d6f8
translations: 📚 sync translations with crowdin (#6493)
github-actions[bot] Sep 15, 2022
9ec3655
carol/Derivgo link (#6445)
carolsachdeva Sep 16, 2022
d36b73f
thisyahlen/ test coverage for cfd-account-card component (#5903)
thisyahlen-deriv Sep 16, 2022
d539afb
Maryia/chore: add test coverage for cfd-dashboard (#6181)
maryia-deriv Sep 16, 2022
b6440a6
Fix word break in payment agent contant details (#5953)
Sep 16, 2022
88219a3
thisyahlen/ test coverage for investor-password-manager (#5973)
thisyahlen-deriv Sep 16, 2022
c137a1e
thisyahlen/cfd-server-error-dialog test coverage (#5767)
thisyahlen-deriv Sep 16, 2022
35ce204
thisyahlen/test coverage on compare-accounts-content container (#5847)
thisyahlen-deriv Sep 16, 2022
dbcdfd3
likhith/test cases for CFD password modal (#6202)
likhith-deriv Sep 16, 2022
25b4963
hamid/hide-reset-balance (#6104)
Sep 16, 2022
fc8c9fd
translations: 📚 sync translations with crowdin (#6508)
github-actions[bot] Sep 16, 2022
b895798
hamid/76567/fix-word-break-pa (#6511)
Sep 17, 2022
b7f09b3
carol/ P2P: Remove confirm modal (#6430)
carolsachdeva Sep 20, 2022
df36349
Suisin/created scam warning pop up message (#6358)
suisin-deriv Sep 21, 2022
5b8451e
likhith/track js reading loginid of undefined (#6452)
likhith-deriv Sep 21, 2022
71b2327
translations: 📚 sync translations with crowdin (#6548)
github-actions[bot] Sep 22, 2022
22abe27
hamid/74062/cfd-dashboard-demo-account (#6427)
Sep 23, 2022
27c929c
translations: 📚 sync translations with crowdin (#6569)
github-actions[bot] Sep 23, 2022
e78ac5a
translations: 📚 sync translations with crowdin (#6570)
github-actions[bot] Sep 23, 2022
44c2181
translations: 📚 sync translations with crowdin (#6571)
github-actions[bot] Sep 23, 2022
97cdd6a
translations: 📚 sync translations with crowdin (#6572)
github-actions[bot] Sep 23, 2022
54edd31
Pulled from main branch
hirad-deriv Oct 7, 2022
52a81c3
Pulled from main branch
hirad-deriv Oct 10, 2022
9604c47
Merge branch 'pre-appstore' of https://github.com/binary-com/deriv-ap…
hirad-deriv Oct 11, 2022
a25764b
Merge branch 'pre-appstore' of https://github.com/binary-com/deriv-ap…
hirad-deriv Oct 18, 2022
753263e
Fixed translation files
hirad-deriv Oct 20, 2022
153a137
Fixed translation files
hirad-deriv Oct 20, 2022
a0b0a66
Merge branch 'pre-appstore' of https://github.com/binary-com/deriv-ap…
hirad-deriv Oct 20, 2022
64c5d96
Merge branch 'pre-appstore' of https://github.com/binary-com/deriv-ap…
hirad-deriv Oct 20, 2022
cf1fa4c
Fixed the issue where accounts do not get disabled when they exist
hirad-deriv Oct 20, 2022
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
26 changes: 26 additions & 0 deletions packages/appstore/src/modules/trading-hub/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { Button } from '@deriv/components';
import { useHistory } from 'react-router-dom';
import { routes } from '@deriv/shared';
import TotalAssets from 'Components/total-assets';
import { DetailsOfEachMT5Loginid } from '@deriv/api-types';

const TradingHub: React.FC = () => {
const store = useStores();
Expand All @@ -36,13 +37,38 @@ const TradingHub: React.FC = () => {
is_mt5_trade_modal_visible,
togglePasswordManagerModal,
toggleMT5TradeModal,
getRealSyntheticAccountsExistingData,
getRealFinancialAccountsExistingData,
} = modules.cfd;
const { platform } = common;
const { is_dark_mode_on, is_tour_open, toggleIsTourOpen } = ui;
/*TODO: We need to show this component whenever user click on tour guide button*/
const [tab_account_type, setTabAccountType] = React.useState<TAccountCategory>('real');
const history = useHistory();

type TCurrentList = DetailsOfEachMT5Loginid & {
enabled: number;
};

const existing_accounts_data = (acc_type: 'synthetic' | 'financial') => {
const should_be_enabled = (list_item: TCurrentList) =>
platform === 'dxtrade' ? list_item.enabled === 1 : true;
const acc = Object.keys(current_list).some(
key => key.startsWith(`${platform}.real.${acc_type}`) && should_be_enabled(current_list[key])
)
? Object.keys(current_list)
.filter(key => key.startsWith(`${platform}.real.${acc_type}`))
.reduce((_acc, cur) => {
_acc.push(current_list[cur]);
return _acc;
}, [] as DetailsOfEachMT5Loginid[])
: undefined;
return acc;
};

getRealSyntheticAccountsExistingData(existing_accounts_data('synthetic'));
getRealFinancialAccountsExistingData(existing_accounts_data('financial'));

type TOpenAccountTransferMeta = {
category: string;
type?: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/cfd/build/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = function (env) {
cfd: path.resolve(__dirname, '../src', 'index.tsx'),
CFDStore: 'Stores/Modules/CFD/cfd-store',
CompareAccountsModal: 'Containers/compare-accounts-modal.tsx',
JurisdictionModal: 'Containers/jurisdiction-modal.tsx',
JurisdictionModal: 'Containers/jurisdiction-modal/jurisdiction-modal.tsx',
CFDPasswordModal: 'Containers/cfd-password-modal.tsx',
CFDDbviOnBoarding: 'Containers/cfd-dbvi-onboarding.tsx',
CFDPersonalDetailsModal: 'Containers/cfd-personal-details-modal.tsx',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const VerificationStatusBanner = ({
account_type,
card_classname,
disabled,
context,
is_virtual,
type_of_card,
should_restrict_bvi_account_creation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import VerificationStatusBanner from './jurisdiction-card-banner';
const JurisdictionCard = ({
account_type,
disabled,
context,
jurisdiction_selected_shortcode,
financial_available_accounts,
setJurisdictionSelectedShortcode,
Expand Down Expand Up @@ -87,6 +88,7 @@ const JurisdictionCard = ({
type_of_card={type_of_card}
card_classname={card_classname}
disabled={disabled}
context={context}
account_type={account_type}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const JurisdictionCheckBox = ({
is_checked,
jurisdiction_selected_shortcode,
onCheck,
context,
should_restrict_bvi_account_creation,
}: TJurisdictionCheckBoxProps) => {
const {
Expand Down Expand Up @@ -75,7 +76,7 @@ const JurisdictionCheckBox = ({
<React.Fragment>
{shouldShowCheckBox() && (
<div className={class_name}>
<Checkbox onChange={onCheck} value={is_checked} label={getCheckboxLabel()} />
<Checkbox context={context} onChange={onCheck} value={is_checked} label={getCheckboxLabel()} />
</div>
)}
</React.Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const JurisdictionModalContent = ({
synthetic_available_accounts,
financial_available_accounts,
checked,
context,
setChecked,
real_synthetic_accounts_existing_data,
real_financial_accounts_existing_data,
Expand Down Expand Up @@ -43,6 +44,7 @@ const JurisdictionModalContent = ({
<JurisdictionCard
key={`${account_type}_${card}`}
type_of_card={card}
context={context}
disabled={disableCard(card)}
jurisdiction_selected_shortcode={jurisdiction_selected_shortcode}
synthetic_available_accounts={synthetic_available_accounts}
Expand All @@ -57,12 +59,14 @@ const JurisdictionModalContent = ({
account_status={account_status}
card_classname={card_classname}
account_type={account_type}
context={context}
jurisdiction_selected_shortcode={jurisdiction_selected_shortcode}
should_restrict_bvi_account_creation={should_restrict_bvi_account_creation}
/>
<JurisdictionCheckBox
account_status={account_status}
is_checked={checked}
context={context}
onCheck={() => setChecked(!checked)}
class_name={`${card_classname}__jurisdiction-checkbox`}
jurisdiction_selected_shortcode={jurisdiction_selected_shortcode}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { TJurisdictionModalFootNoteProps } from '../props.types';
const FooterNote = ({
account_status,
account_type,
context,
jurisdiction_selected_shortcode,
card_classname,
should_restrict_bvi_account_creation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const JurisdictionModal = ({
enableApp,
is_jurisdiction_modal_visible,
is_eu,
context,
is_virtual,
jurisdiction_selected_shortcode,
openPasswordModal,
Expand Down Expand Up @@ -219,6 +220,7 @@ const JurisdictionModal = ({
real_synthetic_accounts_existing_data={real_synthetic_accounts_existing_data}
jurisdiction_selected_shortcode={jurisdiction_selected_shortcode}
setChecked={setChecked}
context={context}
setJurisdictionSelectedShortcode={setJurisdictionSelectedShortcode}
synthetic_available_accounts={synthetic_available_accounts}
should_restrict_bvi_account_creation={should_restrict_bvi_account_creation}
Expand Down Expand Up @@ -250,6 +252,7 @@ const JurisdictionModal = ({
title={modal_title}
toggleModal={toggleJurisdictionModal}
type='button'
context={context}
height='664px'
width={account_type.type === 'synthetic' ? '1040px' : '1200px'}
exit_classname='cfd-modal--custom-exit'
Expand All @@ -261,6 +264,7 @@ const JurisdictionModal = ({
<MobileDialog
portal_element_id='deriv_app'
title={modal_title}
context={context}
visible={is_jurisdiction_modal_visible}
onClose={toggleJurisdictionModal}
>
Expand Down
6 changes: 6 additions & 0 deletions packages/cfd/src/Containers/props.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ export type TCFDPasswordManagerModal = {

export type TJurisdictionCardProps = {
jurisdiction_selected_shortcode: string;
context: RootStore;
synthetic_available_accounts: TTradingPlatformAvailableAccount[];
financial_available_accounts: TTradingPlatformAvailableAccount[];
setJurisdictionSelectedShortcode: (card_type: string) => void;
Expand All @@ -181,6 +182,7 @@ export type TJurisdictionCardProps = {
export type TVerificationStatusBannerProps = {
account_status: GetAccountStatus;
account_type: string;
context: RootStore;
card_classname: string;
disabled: boolean;
is_virtual: boolean;
Expand All @@ -190,6 +192,7 @@ export type TVerificationStatusBannerProps = {

export type TJurisdictionCheckBoxProps = {
account_status: GetAccountStatus;
context: RootStore;
class_name: string;
is_checked: boolean;
jurisdiction_selected_shortcode: string;
Expand All @@ -207,6 +210,7 @@ export type TJurisdictionModalProps = {
type: string;
category: string;
};
context: RootStore;
account_settings: GetSettings;
account_status: GetAccountStatus;
disableApp: () => void;
Expand All @@ -230,6 +234,7 @@ export type TJurisdictionModalProps = {

export type TJurisdictionModalContentProps = {
account_status: GetAccountStatus;
context: RootStore;
account_type: string;
jurisdiction_selected_shortcode: string;
setJurisdictionSelectedShortcode: (card_type: string) => void;
Expand All @@ -245,6 +250,7 @@ export type TJurisdictionModalContentProps = {

export type TJurisdictionModalFootNoteProps = {
account_status: GetAccountStatus;
context: RootStore;
card_classname: string;
account_type: string;
jurisdiction_selected_shortcode: string;
Expand Down