Skip to content

Commit

Permalink
Merge branch 'deriv-com:master' into WALL-4850-Password-change-and-ac…
Browse files Browse the repository at this point in the history
…count-creation-success-message-are-not-shown
  • Loading branch information
heorhi-deriv authored Oct 25, 2024
2 parents 73bb600 + ab9e7a6 commit 4cd1b0f
Show file tree
Hide file tree
Showing 30 changed files with 2,140 additions and 673 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('getStatusBadgeConfig', () => {
let account_status: TMT5AccountStatus;
const openFailedVerificationModal = jest.fn();
const setIsVerificationModalVisible = jest.fn();
const selected_account_type = 'test type';
const selected_account_type = {};

const renderCheck = (
account_status: Parameters<typeof getStatusBadgeConfig>[0],
Expand Down
13 changes: 10 additions & 3 deletions packages/account/src/Configs/get-status-badge-config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { Link } from 'react-router-dom';

const getStatusBadgeConfig = (
mt5_account_status: TMT5AccountStatus,
openFailedVerificationModal?: (selected_account_type: string) => void,
selected_account_type?: string,
openFailedVerificationModal?: (selected_account_type: Record<string, unknown>) => void,
selected_account_type?: Record<string, unknown>,
setIsVerificationModalVisible?: (value: boolean) => void,
user_account_status?: { poi_status: TAuthStatusCodes; poa_status: TAuthStatusCodes }
) => {
Expand Down Expand Up @@ -36,7 +36,14 @@ const getStatusBadgeConfig = (
key={1}
className='link-verification-failed'
onClick={() => {
openFailedVerificationModal?.(selected_account_type ?? '');
if (selected_account_type) {
selected_account_type.client_kyc_status = {
poi_status: user_account_status?.poi_status,
poa_status: user_account_status?.poa_status,
};
selected_account_type;
openFailedVerificationModal?.(selected_account_type ?? '');
}
}}
/>,
]}
Expand Down
1 change: 1 addition & 0 deletions packages/appstore/src/components/cfds-listing/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ const CFDsListing = observer(() => {

return (
<TradingAppCard
client_kyc_status={existing_account?.client_kyc_status}
action_type={existing_account.action_type}
availability={selected_region}
clickable_icon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import OpenPositionsSVGModal from '../modals/open-positions-svg-modal';
import './trading-app-card.scss';

const TradingAppCard = ({
client_kyc_status,
availability,
name,
icon,
Expand Down Expand Up @@ -94,7 +95,10 @@ const TradingAppCard = ({
openFailedVerificationModal,
selected_mt5_jurisdiction,
setIsVerificationModalVisible,
{ poi_status: authentication?.identity?.status, poa_status: authentication?.document?.status }
{
poi_status: client_kyc_status?.poi_status ?? authentication?.identity?.status,
poa_status: client_kyc_status?.poa_status ?? authentication?.document?.status,
}
);

const handleStatusBadgeClick = (mt5_acc_auth_status: string) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,15 @@ const FailedVerificationModal = () => {
open_failed_verification_for,
startTrade,
} = traders_hub;
const { account_status } = client;
const { account_status, client_kyc_status } = client;
const { toggleCFDVerificationModal, current_list } = cfd;
const { disableApp, enableApp, is_mt5_verification_failed_modal, setIsMT5VerificationFailedModal } = ui;
const is_from_multipliers = open_failed_verification_for === 'multipliers';
const has_mf_mt5_account = Object.keys(current_list)
.map(key => current_list[key])
.some(account => account.landing_company_short === Jurisdiction.MALTA_INVEST);

const { poi_resubmit_for_maltainvest, poi_resubmit_for_bvi_labuan_vanuatu, need_poa_resubmission } =
getAuthenticationStatusInfo(account_status);
const { poi_resubmit_for_maltainvest } = getAuthenticationStatusInfo(account_status);
const history = useHistory();

const closeModal = () => {
Expand Down Expand Up @@ -117,9 +116,10 @@ const FailedVerificationModal = () => {
if (is_from_multipliers || open_failed_verification_for === 'maltainvest') {
return poi_resubmit_for_maltainvest;
}
return poi_resubmit_for_bvi_labuan_vanuatu;
return ['rejected', 'expired', 'suspected'].includes(client_kyc_status?.poi_status);
};
const should_resubmit_poa = need_poa_resubmission;

const should_resubmit_poa = ['rejected', 'expired', 'suspected'].includes(client_kyc_status?.poa_status);
const from_account_label = is_from_multipliers ? localize('Multipliers') : localize('MT5');

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
}

@mixin margin-top-for-size($size) {
margin-top: calculate-margin-top(var(--component-stepper-node-size-#{$size}),
margin-top: calculate-margin-top(
var(--component-stepper-node-size-#{$size}),
var(--component-stepper-spacing-3xs),
var(--semantic-typography-body-#{$size}-bold-default-lineHeight)) !important;
var(--semantic-typography-body-#{$size}-bold-default-lineHeight)
) !important;
}

.quill-steps-container {
Expand Down Expand Up @@ -63,7 +65,6 @@
}

&__label {

&--disabled {
color: var(--component-stepper-node-border-color-incomplete) !important;
}
Expand Down Expand Up @@ -91,11 +92,11 @@
}

&--size-sm {
height: calc((var(--component-stepper-track-height-sm) + var(--component-stepper-track-height-sm)) * 2)
height: calc((var(--component-stepper-track-height-sm) + var(--component-stepper-track-height-sm)) * 2);
}

&--size-md {
height: calc(var(--component-stepper-track-height-md) + var(--component-stepper-track-height-md))
height: calc(var(--component-stepper-track-height-md) + var(--component-stepper-track-height-md));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -185,4 +185,4 @@
right: 2.4rem;
}
}
}
}
5 changes: 5 additions & 0 deletions packages/core/src/Stores/traders-hub-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -823,11 +823,16 @@ export default class TradersHubStore extends BaseStore {
openFailedVerificationModal(selected_account_type) {
const {
common,
client,
modules: { cfd },
} = this.root_store;
const { setJurisdictionSelectedShortcode, setAccountType } = cfd;
const { setAppstorePlatform } = common;

if (selected_account_type?.client_kyc_status) {
client.setClientKYCStatus(selected_account_type.client_kyc_status);
}

if (selected_account_type?.platform === CFD_PLATFORMS.MT5) {
setAppstorePlatform(selected_account_type.platform);
setAccountType({
Expand Down
2 changes: 1 addition & 1 deletion packages/translations/crowdin/messages.json

Large diffs are not rendered by default.

Loading

0 comments on commit 4cd1b0f

Please sign in to comment.