Skip to content

Commit

Permalink
Revert "fix: display the status for manual upload (#6093)" (#6590)
Browse files Browse the repository at this point in the history
This reverts commit 1f5392f.
  • Loading branch information
carolsachdeva authored Sep 27, 2022
1 parent 1f5392f commit fddb1ed
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@ import classNames from 'classnames';
import { localize } from '@deriv/translations';
import { Timeline } from '@deriv/components';
import { isMobile } from '@deriv/shared';
import { identity_status_codes } from 'Sections/Verification/ProofOfIdentity/proof-of-identity-utils.js';
import Verified from 'Components/poi/status/verified';
import Limited from 'Components/poi/status/limited';
import Expired from 'Components/poi/status/expired';
import DetailComponent from './detail-component.jsx';
import { Documents } from './documents.jsx';
import { getDocumentIndex, DOCUMENT_TYPES } from './constants';
import UploadComplete from '../upload-complete';

const checkNimcStep = documents => {
let has_nimc = false;
Expand All @@ -25,28 +20,11 @@ const checkNimcStep = documents => {
const Unsupported = ({ country_code, ...props }) => {
const [detail, setDetail] = React.useState(null);
const toggleDetail = index => setDetail(index);

const documents = getDocumentIndex({
setDetail,
country_code,
});

if (props?.manual) {
if (props.manual.status === identity_status_codes.pending) return <UploadComplete />;
else if ([identity_status_codes.rejected, identity_status_codes.suspected].includes(props.manual.status)) {
if (!props?.allow_poi_resubmission) return <Limited />;
} else if (props.manual.status === identity_status_codes.verified) {
return <Verified needs_poa={props.needs_poa} redirect_button={props.redirect_button} />;
} else if (props.manual.status === identity_status_codes.expired) {
return (
<Expired
redirect_button={props.redirect_button}
handleRequireSubmission={props.handleRequireSubmission}
/>
);
}
}

if (detail !== null) {
return (
<DetailComponent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,10 @@ import UploadComplete from 'Components/poi/status/upload-complete';
import Expired from 'Components/poi/status/expired';
import Verified from 'Components/poi/status/verified';
import RejectedReasons from 'Components/poi/status/rejected-reasons';
import Unsupported from 'Components/poi/status/unsupported';
import Limited from 'Components/poi/status/limited';
import { identity_status_codes } from './proof-of-identity-utils';

const Onfido = ({
handleRequireSubmission,
is_from_external,
needs_poa,
onfido,
redirect_button,
manual,
setIsCfdPoiCompleted,
}) => {
const Onfido = ({ handleRequireSubmission, is_from_external, needs_poa, onfido, redirect_button }) => {
const { status, submissions_left, last_rejected: rejected_reasons } = onfido;

switch (status) {
Expand All @@ -28,15 +20,7 @@ const Onfido = ({
);
case identity_status_codes.rejected:
case identity_status_codes.suspected:
if (Number(submissions_left) < 1) {
return (
<Unsupported
manual={manual}
is_from_external={is_from_external}
setIsCfdPoiCompleted={setIsCfdPoiCompleted}
/>
);
}
if (Number(submissions_left) < 1) return <Limited handleRequireSubmission={handleRequireSubmission} />;
return (
<RejectedReasons
rejected_reasons={rejected_reasons}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ const ProofOfIdentityContainer = ({
} else if (
!identity_last_attempt ||
// Prioritise verified status from back office. How we know this is if there is mismatch between current statuses (Should be refactored)
(identity_status === identity_status_codes.verified && identity_status !== identity_last_attempt.status)
(identity_status === identity_status_codes.verified && identity_status !== identity_last_attempt.status) ||
// Prioritise pending status from back office. We can't rely on last attempt as it doesn't get updated after manual upload (Should be refactored)
identity_status === identity_status_codes.pending
) {
switch (identity_status) {
case identity_status_codes.pending:
Expand Down Expand Up @@ -184,8 +186,6 @@ const ProofOfIdentityContainer = ({
is_from_external={!!is_from_external}
needs_poa={needs_poa}
onfido={onfido}
manual={manual}
setIsCfdPoiCompleted={setIsCfdPoiCompleted}
redirect_button={redirect_button}
/>
);
Expand All @@ -195,9 +195,6 @@ const ProofOfIdentityContainer = ({
manual={manual}
is_from_external={is_from_external}
setIsCfdPoiCompleted={setIsCfdPoiCompleted}
needs_poa={needs_poa}
redirect_button={redirect_button}
handleRequireSubmission={handleRequireSubmission}
/>
);
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ const POISubmission = ({
country_code={selected_country.value}
is_from_external={is_from_external}
setIsCfdPoiCompleted={setIsCfdPoiCompleted}
allow_poi_resubmission={allow_poi_resubmission}
/>
);
default:
Expand Down

1 comment on commit fddb1ed

@vercel
Copy link

@vercel vercel bot commented on fddb1ed Sep 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

deriv-app – ./

deriv-app.vercel.app
binary.sx
deriv-app-git-master.binary.sx
deriv-app.binary.sx

Please sign in to comment.