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

likhith/POI status fix #6792

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import DetailComponent from './detail-component.jsx';
import { Documents } from './documents.jsx';
import { getDocumentIndex, DOCUMENT_TYPES } from './constants';
import UploadComplete from '../upload-complete';
import Verified from 'Components/poi/status/verified';
import Limited from 'Components/poi/status/limited';
import Expired from 'Components/poi/status/expired';

const checkNimcStep = documents => {
let has_nimc = false;
Expand All @@ -19,7 +22,16 @@ const checkNimcStep = documents => {
return has_nimc;
};

const Unsupported = ({ country_code, handlePOIforMT5Complete, ...props }) => {
const Unsupported = ({
country_code,
handlePOIforMT5Complete,
manual,
redirect_button,
needs_poa,
handleRequireSubmission,
allow_poi_resubmission,
...props
}) => {
const [detail, setDetail] = React.useState(null);
const toggleDetail = index => setDetail(index);

Expand All @@ -28,7 +40,16 @@ const Unsupported = ({ country_code, handlePOIforMT5Complete, ...props }) => {
country_code,
});

if (props?.manual?.status === identity_status_codes.pending) return <UploadComplete is_manual_upload />;
if (manual) {
if (manual.status === identity_status_codes.pending) return <UploadComplete is_manual_upload />;
else if ([identity_status_codes.rejected, identity_status_codes.suspected].includes(manual.status)) {
if (!allow_poi_resubmission) return <Limited />;
Copy link
Contributor

Choose a reason for hiding this comment

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

what happens when manual_status is rejected and allow_poi_resubmission is true? should'nt we allow client to resubmit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The default case handles that

} else if (manual.status === identity_status_codes.verified) {
return <Verified needs_poa={needs_poa} redirect_button={redirect_button} />;
} else if (manual.status === identity_status_codes.expired) {
return <Expired redirect_button={redirect_button} handleRequireSubmission={handleRequireSubmission} />;
}
}

if (detail !== null) {
return (
Expand Down
4 changes: 3 additions & 1 deletion packages/account/src/Modules/Page404/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export default from './Components/Page404.jsx';
import Page404 from './Components/Page404.jsx';

export default Page404;
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ 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) ||
// 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
(identity_status === identity_status_codes.verified && identity_status !== identity_last_attempt.status)
) {
switch (identity_status) {
case identity_status_codes.pending:
Expand Down Expand Up @@ -198,6 +196,9 @@ 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,6 +155,7 @@ const POISubmission = ({
country_code={selected_country.value}
is_from_external={is_from_external}
setIsCfdPoiCompleted={setIsCfdPoiCompleted}
allow_poi_resubmission={allow_poi_resubmission}
/>
);
default:
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/components/label/label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const available_modes = [
const available_sizes = ['regular', 'large'] as const;

type TLabel = {
mode: typeof available_modes[number];
size: typeof available_sizes[number];
mode: (typeof available_modes)[number];
size: (typeof available_sizes)[number];
className?: string;
};

Expand Down
1 change: 0 additions & 1 deletion packages/p2p/scripts/__tests__/extract-string.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ describe('Integration checks', () => {
console.log(e);
}
}

/* eslint-disable-next-line no-unused-expressions */
expect(Object.keys(errors)).toHaveLength(0);
});
Expand Down
2 changes: 2 additions & 0 deletions packages/trader/build/constants.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const CircularDependencyPlugin = require('circular-dependency-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
// const CopyPlugin = require('copy-webpack-plugin');
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need this change?
Rest is LGTM

// const HtmlWebPackPlugin = require('html-webpack-plugin');
// const HtmlWebpackTagsPlugin = require('html-webpack-tags-plugin');
const IgnorePlugin = require('webpack').IgnorePlugin;
Expand All @@ -13,6 +14,7 @@ const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');

const {
// copyConfig,
cssConfig,
// htmlInjectConfig,
// htmlOutputConfig,
Expand Down