Skip to content

Commit

Permalink
Merge branch master into WALL-4850-Password-change-and-account-creati…
Browse files Browse the repository at this point in the history
…on-success-message-are-not-shown
  • Loading branch information
heorhi-deriv committed Oct 24, 2024
2 parents 9ffc670 + a059bd1 commit 805ca07
Show file tree
Hide file tree
Showing 268 changed files with 6,191 additions and 11,320 deletions.
9 changes: 4 additions & 5 deletions package-lock.json

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

1 change: 0 additions & 1 deletion packages/account/build/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ module.exports = function (env) {
'financial-details-config': 'Configs/financial-details-config',
'get-status-badge-config': 'Configs/get-status-badge-config',
'personal-details-config': 'Configs/personal-details-config',
'poi-poa-docs-submitted': 'Components/poi-poa-docs-submitted/poi-poa-docs-submitted',
'risk-tolerance-warning-modal': 'Components/trading-assessment/risk-tolerance-warning-modal',
'sent-email-modal': 'Components/sent-email-modal',
'terms-of-use-config': 'Configs/terms-of-use-config',
Expand Down
4 changes: 2 additions & 2 deletions packages/account/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@deriv-com/quill-ui": "1.18.0",
"@deriv/components": "^1.0.0",
"@deriv/hooks": "^1.0.0",
"@deriv/quill-icons": "1.23.3",
"@deriv/quill-icons": "1.23.14",
"@deriv/shared": "^1.0.0",
"@deriv/stores": "^1.0.0",
"@deriv/translations": "^1.0.0",
Expand Down Expand Up @@ -94,4 +94,4 @@
"typescript": "^4.6.3",
"webpack": "^5.81.0"
}
}
}

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@ describe('<Submitted />', () => {

it('should render the Submitted component', () => {
renderWithRouter(<Submitted needs_poi />);
expect(screen.getByText('Your documents were submitted successfully')).toBeInTheDocument();
expect(screen.getByText('Review in progress')).toBeInTheDocument();
});

it('should show submit_poi message if needs_poi is true', () => {
renderWithRouter(<Submitted needs_poi />);
expect(screen.getByText('You must also submit a proof of identity.')).toBeInTheDocument();
expect(screen.getByText('To start trading, you also need to verify your identity.')).toBeInTheDocument();
});

it('should show review message if needs_poi is true', () => {
renderWithRouter(<Submitted needs_poi />);
expect(
screen.getByText('We’ll review your documents and notify you of its status within 1 to 3 days.')
screen.getByText('Your proof of address is under review. We’ll get back to you in 1–3 working days.')
).toBeInTheDocument();
});

it('should show ContinueTradingButton if no props are passed', () => {
renderWithRouter(<Submitted />);
expect(screen.getByTestId('continue-trading-button')).toBeInTheDocument();
expect(screen.getByText("Return to Trader's Hub")).toBeInTheDocument();
});
});
22 changes: 13 additions & 9 deletions packages/account/src/Components/poa/status/submitted/submitted.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
import React from 'react';
import { Icon, Text } from '@deriv/components';
import { localize } from '@deriv/translations';
import { isNavigationFromP2P, isNavigationFromDerivGO } from '@deriv/shared';
import ContinueTradingButton from '../../continue-trading-button';
import { isNavigationFromP2P, isNavigationFromDerivGO, routes } from '@deriv/shared';
import IconMessageContent from '../../../icon-message-content';
import PoiButton from '../../../poi/poi-button';
import RouteButton from '../../../route-button';
import { TPoaStatusProps } from '../../../../Types';

export const Submitted = ({ needs_poi, redirect_button }: TPoaStatusProps) => {
const message = localize('Your documents were submitted successfully');
const message = localize('Review in progress');
const is_redirected_from_platform = isNavigationFromP2P() || isNavigationFromDerivGO();
if (needs_poi) {
return (
<div className='account-management__container'>
<IconMessageContent message={message} icon={<Icon icon='IcPoaVerified' size={128} />}>
<div className='account-management__text-container'>
<Text align='center' size='xs' as='p'>
{localize('We’ll review your documents and notify you of its status within 1 to 3 days.')}
{localize(
'Your proof of address is under review. We’ll get back to you in 1–3 working days.'
)}
</Text>
<Text align='center' size='xs' as='p'>
{localize('You must also submit a proof of identity.')}
{localize('To start trading, you also need to verify your identity.')}
</Text>
</div>
<PoiButton />
<RouteButton button_label={localize('Next')} route={routes.proof_of_identity} />
</IconMessageContent>
</div>
);
Expand All @@ -31,10 +32,13 @@ export const Submitted = ({ needs_poi, redirect_button }: TPoaStatusProps) => {
<div className='account-management__container'>
<IconMessageContent
message={message}
text={localize('We’ll review your documents and notify you of its status within 1 to 3 days.')}
text={localize('Your proof of address is under review. We’ll get back to you in 1–3 working days.')}
icon={<Icon icon='IcPoaVerified' size={128} />}
>
{redirect_button || (!is_redirected_from_platform && <ContinueTradingButton />)}
{redirect_button ||
(!is_redirected_from_platform && (
<RouteButton button_label={localize("Return to Trader's Hub")} route={routes.traders_hub} />
))}
</IconMessageContent>
</div>
);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,12 @@ describe('<IdvSubmitComplete/>', () => {

expect(screen.getByText('DerivLightWaitingPoiIcon')).toBeInTheDocument();
expect(screen.getByText('Mock Redirect Button')).toBeInTheDocument();
expect(screen.getByText('Your documents were submitted successfully')).toBeInTheDocument();
expect(
screen.getByText('We’ll review your documents and notify you of its status within 5 minutes.')
).toBeInTheDocument();
expect(screen.queryByText('Your profile is updated')).not.toBeInTheDocument();
expect(screen.queryByText('Your document has been submitted')).not.toBeInTheDocument();
expect(screen.queryByText('Review in progress')).toBeInTheDocument();
expect(
screen.queryByText(
"We'll review your proof of identity again and will give you an update as soon as possible."
)
).not.toBeInTheDocument();
expect(screen.queryByText("Next, we'll need your proof of address.")).not.toBeInTheDocument();
screen.queryByText('Your proof of identity is under review. We’ll get back to you within 5 minutes.')
).toBeInTheDocument();
expect(screen.queryByText('To start trading, you also need to verify your address.')).not.toBeInTheDocument();
});

it('should render IdvSubmitComplete component needs_poa not external, without mismatch_status and redirect_button', () => {
Expand All @@ -74,16 +68,12 @@ describe('<IdvSubmitComplete/>', () => {
renderComponent({ props: new_props });

expect(screen.getByText('DerivLightWaitingPoiIcon')).toBeInTheDocument();
expect(screen.getByText('Your documents were submitted successfully')).toBeInTheDocument();
expect(screen.getByText('Submit proof of address')).toBeInTheDocument();
expect(screen.getByText("Next, we'll need your proof of address.")).toBeInTheDocument();
expect(screen.queryByText('Your profile is updated')).not.toBeInTheDocument();
expect(screen.queryByText('Your document has been submitted')).not.toBeInTheDocument();
expect(screen.queryByText('Review in progress')).toBeInTheDocument();
expect(
screen.queryByText(
"We'll review your proof of identity again and will give you an update as soon as possible."
)
).not.toBeInTheDocument();
screen.queryByText('Your proof of identity is under review. We’ll get back to you within 5 minutes.')
).toBeInTheDocument();
expect(screen.queryByText('To start trading, you also need to verify your address.')).toBeInTheDocument();
expect(screen.queryByText('Next')).toBeInTheDocument();
});

it('should render IdvSubmitComplete component with mismatch_status ', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const IdvSubmitComplete = observer(
if (is_expired_or_failed_error)
return <Localize i18n_default_text='Your document has been submitted' />;
}
return <Localize i18n_default_text='Your documents were submitted successfully' />;
return <Localize i18n_default_text='Review in progress' />;
};

const getDescriptionText = () => {
Expand All @@ -42,13 +42,11 @@ const IdvSubmitComplete = observer(
<Localize i18n_default_text="We'll review your proof of identity again and will give you an update as soon as possible." />
);
return (
<Localize i18n_default_text='We’ll review your documents and notify you of its status within 5 minutes.' />
<Localize i18n_default_text='Your proof of identity is under review. We’ll get back to you within 5 minutes.' />
);
};

const poa_button = !is_from_external && (
<PoaButton custom_text={<Localize i18n_default_text='Submit proof of address' />} />
);
const poa_button = !is_from_external && <PoaButton custom_text={<Localize i18n_default_text='Next' />} />;

return (
<div className={clsx('proof-of-identity__container', 'proof-of-identity__container--status')}>
Expand All @@ -62,7 +60,7 @@ const IdvSubmitComplete = observer(
{needs_poa ? (
<React.Fragment>
<Text className='text' size='xs' align='center'>
<Localize i18n_default_text="Next, we'll need your proof of address." />
<Localize i18n_default_text='To start trading, you also need to verify your address.' />
</Text>
{poa_button}
</React.Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type TDetailComponent = {
is_from_external?: boolean;
is_for_mt5?: boolean;
handlePOIforMT5Complete?: () => void;
needs_poa?: boolean;
};

const DetailComponent = ({
Expand All @@ -44,6 +45,7 @@ const DetailComponent = ({
is_from_external,
is_for_mt5,
handlePOIforMT5Complete,
needs_poa,
...props
}: TDetailComponent) => {
const [status, setStatus] = React.useState('');
Expand Down Expand Up @@ -121,7 +123,7 @@ const DetailComponent = ({
case STATUS.IS_UPLOADING:
return <Loading is_fullscreen={false} is_slow_loading status={[localize('Uploading documents')]} />;
case STATUS.IS_COMPLETED:
return <UploadComplete is_from_external={true} needs_poa={false} is_manual_upload />;
return <UploadComplete is_from_external needs_poa={needs_poa} is_manual_upload />;
case STATUS.IS_FAILED:
return <POIManualUploadFailed error={response_error} />;
case STATUS.IS_DUPLICATE_UPLOAD:
Expand Down
Loading

0 comments on commit 805ca07

Please sign in to comment.