+
{header_Text}
diff --git a/packages/account/src/Configs/poi-error-config.tsx b/packages/account/src/Configs/poi-error-config.tsx
index 894448d0f553..9dc5be193344 100644
--- a/packages/account/src/Configs/poi-error-config.tsx
+++ b/packages/account/src/Configs/poi-error-config.tsx
@@ -11,3 +11,10 @@ export const DUPLICATE_ACCOUNT_ERROR_MESSAGE = (
components={[ window.LC_API.open_chat_window()} />]}
/>
);
+
+export const CLAIMED_DOCUMENT_ERROR_MESSAGE = (
+ window.LC_API.open_chat_window()} />]}
+ />
+);
diff --git a/packages/account/src/Constants/api-error-codes.ts b/packages/account/src/Constants/api-error-codes.ts
index 2cfe24828993..10449548c446 100644
--- a/packages/account/src/Constants/api-error-codes.ts
+++ b/packages/account/src/Constants/api-error-codes.ts
@@ -3,4 +3,5 @@
*/
export const API_ERROR_CODES = Object.freeze({
DUPLICATE_ACCOUNT: 'DuplicateAccount',
+ CLAIMED_DOCUMENT: 'ClaimedDocument',
});
diff --git a/packages/core/src/sass/app/_common/components/account-common.scss b/packages/core/src/sass/app/_common/components/account-common.scss
index 21b4722f8085..b54c358cfb64 100644
--- a/packages/core/src/sass/app/_common/components/account-common.scss
+++ b/packages/core/src/sass/app/_common/components/account-common.scss
@@ -644,6 +644,12 @@
overflow-y: scroll;
justify-content: center;
padding: 0 1.6rem;
+
+ &--status{
+ height: 100%;
+ width: 100%;
+ position: absolute;
+ }
}
&--reset {
@@ -675,13 +681,15 @@
.icon {
width: 128px;
height: 128px;
- margin-top: 5.2rem;
margin-bottom: 2.6rem;
+ @include desktop{
+ margin-top: 5.2rem;
+ }
+
@include mobile {
width: 72px;
height: 72px;
- margin-top: 2.6rem;
}
}
@@ -715,7 +723,6 @@
&__text {
@include mobile {
- width: 94%;
text-align: center;
}
}
From 05264c2a2bba641dccbd90cc2ea4ab39d250210d Mon Sep 17 00:00:00 2001
From: Likhith Kolayari
Date: Wed, 11 Oct 2023 14:04:47 +0400
Subject: [PATCH 106/115] fix: incorporated new error code and styles as per
new figma
---
.../idv-document-submit.tsx | 22 ++++++++++++-------
.../poi/idv-status/idv-failed/idv-failed.tsx | 17 ++++++++------
2 files changed, 24 insertions(+), 15 deletions(-)
diff --git a/packages/account/src/Components/poi/idv-document-submit/idv-document-submit.tsx b/packages/account/src/Components/poi/idv-document-submit/idv-document-submit.tsx
index e7362e6444ee..8174c1d269a2 100644
--- a/packages/account/src/Components/poi/idv-document-submit/idv-document-submit.tsx
+++ b/packages/account/src/Components/poi/idv-document-submit/idv-document-submit.tsx
@@ -1,7 +1,7 @@
import React from 'react';
import classNames from 'classnames';
-import { Form, Formik, FormikErrors, FormikHelpers } from 'formik';
-import { ResidenceList, IdentityVerificationAddDocumentResponse } from '@deriv/api-types';
+import { Form, Formik, FormikErrors, FormikHelpers, FormikState } from 'formik';
+import { ResidenceList } from '@deriv/api-types';
import { Button, HintBox, Text } from '@deriv/components';
import { Localize, localize } from '@deriv/translations';
import {
@@ -106,7 +106,11 @@ const IdvDocumentSubmit = observer(({ handleBack, handleViewComplete, selected_c
const submitHandler = async (
values: TIdvDocumentSubmitForm,
- { setSubmitting, setStatus }: FormikHelpers
+ {
+ setSubmitting,
+ setStatus,
+ status,
+ }: FormikHelpers & FormikState
) => {
setSubmitting(true);
@@ -116,14 +120,16 @@ const IdvDocumentSubmit = observer(({ handleBack, handleViewComplete, selected_c
if (data?.error) {
const response_error =
- data.error?.code === 'DuplicateAccount' ? DUPLICATE_ACCOUNT_ERROR_MESSAGE : GENERIC_ERROR_MESSAGE;
- setStatus({ error_message: response_error });
+ data.error?.code === API_ERROR_CODES.DUPLICATE_ACCOUNT
+ ? DUPLICATE_ACCOUNT_ERROR_MESSAGE
+ : GENERIC_ERROR_MESSAGE;
+ setStatus({ ...status, error_message: response_error });
setSubmitting(false);
return;
}
const get_settings = await WS.authorized.storage.getSettings();
if (get_settings?.error) {
- setStatus({ error_message: get_settings?.error?.message ?? GENERIC_ERROR_MESSAGE });
+ setStatus({ ...status, error_message: get_settings?.error?.message ?? GENERIC_ERROR_MESSAGE });
setSubmitting(false);
return;
}
@@ -134,11 +140,11 @@ const IdvDocumentSubmit = observer(({ handleBack, handleViewComplete, selected_c
};
const idv_update_response = await WS.send(submit_data);
- if (idv_update_response.error) {
+ if (idv_update_response?.error) {
const response_error =
idv_update_response.error?.code === API_ERROR_CODES.CLAIMED_DOCUMENT
? CLAIMED_DOCUMENT_ERROR_MESSAGE
- : GENERIC_ERROR_MESSAGE;
+ : idv_update_response.error?.message ?? GENERIC_ERROR_MESSAGE;
setStatus({ error_msg: response_error });
setSubmitting(false);
return;
diff --git a/packages/account/src/Components/poi/idv-status/idv-failed/idv-failed.tsx b/packages/account/src/Components/poi/idv-status/idv-failed/idv-failed.tsx
index 76c49cabdb0c..6b68d38f168f 100644
--- a/packages/account/src/Components/poi/idv-status/idv-failed/idv-failed.tsx
+++ b/packages/account/src/Components/poi/idv-status/idv-failed/idv-failed.tsx
@@ -1,6 +1,6 @@
import React from 'react';
import classNames from 'classnames';
-import { Form, Formik, FormikHelpers, FormikValues } from 'formik';
+import { Form, Formik, FormikHelpers, FormikState, FormikValues } from 'formik';
import { GetAccountStatus, GetSettings, ResidenceList } from '@deriv/api-types';
import { Button, DesktopWrapper, HintBox, Loading, Text } from '@deriv/components';
import {
@@ -251,9 +251,12 @@ const IdvFailed = ({
setIsAlreadyAttempted,
]);
- const onSubmit = async (values: TIdvFailedForm, { setStatus, setSubmitting }: FormikHelpers) => {
+ const onSubmit = async (
+ values: TIdvFailedForm,
+ { setStatus, setSubmitting, status }: FormikHelpers & FormikState
+ ) => {
setSubmitting(true);
- setStatus({ error_msg: null });
+ setStatus({ ...status, error_msg: null });
const { document_number, document_type } = values;
const request = makeSettingsRequest(
values,
@@ -266,7 +269,7 @@ const IdvFailed = ({
data.error?.code === API_ERROR_CODES.DUPLICATE_ACCOUNT
? DUPLICATE_ACCOUNT_ERROR_MESSAGE
: GENERIC_ERROR_MESSAGE;
- setStatus({ error_msg: response_error });
+ setStatus({ ...status, error_msg: response_error });
setSubmitting(false);
} else {
const response = await WS.authorized.storage.getSettings();
@@ -288,12 +291,12 @@ const IdvFailed = ({
return;
}
const idv_update_response = await WS.send(submit_data);
- if (idv_update_response.error) {
+ if (idv_update_response?.error) {
const response_error =
idv_update_response.error?.code === API_ERROR_CODES.CLAIMED_DOCUMENT
? CLAIMED_DOCUMENT_ERROR_MESSAGE
- : GENERIC_ERROR_MESSAGE;
- setStatus({ error_msg: response_error });
+ : idv_update_response?.error?.message ?? GENERIC_ERROR_MESSAGE;
+ setStatus({ ...status, error_msg: response_error });
setSubmitting(false);
return;
}
From 929df14bb8d5dabcc5cc7d598f0626dfd06cc674 Mon Sep 17 00:00:00 2001
From: Likhith Kolayari
Date: Thu, 12 Oct 2023 09:51:01 +0400
Subject: [PATCH 107/115] Merge branch 'master' into
likhith/kyc-195/display-idv-error-messages
---
.../sass/app/_common/components/account-common.scss | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/packages/core/src/sass/app/_common/components/account-common.scss b/packages/core/src/sass/app/_common/components/account-common.scss
index b54c358cfb64..68fb648ef26e 100644
--- a/packages/core/src/sass/app/_common/components/account-common.scss
+++ b/packages/core/src/sass/app/_common/components/account-common.scss
@@ -456,16 +456,6 @@
}
}
}
- .proof-of-identity__inner-container {
- @include desktop {
- &--incl-image {
- display: grid;
- align-items: center;
- column-gap: 1.5rem;
- grid-template-columns: auto 0.5fr;
- }
- }
- }
.additional-field {
margin-top: 0.8rem;
From 54abf1a3f6f6306c50294994f9e389cf70c6d46a Mon Sep 17 00:00:00 2001
From: Likhith Kolayari
Date: Thu, 26 Oct 2023 13:24:17 +0400
Subject: [PATCH 108/115] fix: code smells
---
packages/account/src/Components/forms/idv-form.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/account/src/Components/forms/idv-form.tsx b/packages/account/src/Components/forms/idv-form.tsx
index 1525bff34a7f..d83994230356 100644
--- a/packages/account/src/Components/forms/idv-form.tsx
+++ b/packages/account/src/Components/forms/idv-form.tsx
@@ -2,7 +2,7 @@ import React from 'react';
import classNames from 'classnames';
import { Field, FormikProps, FieldProps, useFormikContext } from 'formik';
import { ResidenceList } from '@deriv/api-types';
-import { Autocomplete, DesktopWrapper, Input, MobileWrapper, SelectNative, Text } from '@deriv/components';
+import { Autocomplete, DesktopWrapper, Input, MobileWrapper, SelectNative } from '@deriv/components';
import { formatInput, getIDVNotApplicableOption } from '@deriv/shared';
import { localize } from '@deriv/translations';
import {
From a96871f552acafa715898a44ae3820cff4861b0a Mon Sep 17 00:00:00 2001
From: Likhith Kolayari
Date: Mon, 30 Oct 2023 13:08:24 +0400
Subject: [PATCH 109/115] chore: trigger rebuild
From 0c989c1aecdde5489a2a561541f0bb5fb057d635 Mon Sep 17 00:00:00 2001
From: Likhith Kolayari
Date: Mon, 30 Oct 2023 14:40:07 +0400
Subject: [PATCH 110/115] fix: issue with checkbox
---
.../idv-document-submit.tsx | 9 +--------
.../poi/idv-status/idv-failed/idv-failed.tsx | 20 +++++++++++--------
packages/account/src/Types/common.type.ts | 1 +
3 files changed, 14 insertions(+), 16 deletions(-)
diff --git a/packages/account/src/Components/poi/idv-document-submit/idv-document-submit.tsx b/packages/account/src/Components/poi/idv-document-submit/idv-document-submit.tsx
index 8a1d21b92f43..6c2cd30ceb3e 100644
--- a/packages/account/src/Components/poi/idv-document-submit/idv-document-submit.tsx
+++ b/packages/account/src/Components/poi/idv-document-submit/idv-document-submit.tsx
@@ -158,14 +158,7 @@ const IdvDocumentSubmit = observer(({ handleBack, handleViewComplete, selected_c
};
return (
-
+
{({ dirty, isSubmitting, isValid, values, status }) => (