-
Notifications
You must be signed in to change notification settings - Fork 166
LG-12994: fix messages when there are multiple doc auth errors #10635
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
Changes from all commits
c03dbda
918db14
ecf4c1a
9efe071
b9d80d2
a550e91
7ef0b47
d76cf42
9fff2cc
a836997
00ee41a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,8 +22,6 @@ interface DocumentCaptureWarningProps { | |
| hasDismissed: boolean; | ||
| } | ||
|
|
||
| const DISPLAY_ATTEMPTS = 3; | ||
|
|
||
| type GetHeadingArguments = { | ||
| isResultCodeInvalid: boolean; | ||
| isFailedDocType: boolean; | ||
|
|
@@ -53,18 +51,8 @@ function getHeading({ | |
| return t('errors.doc_auth.rate_limited_heading'); | ||
| } | ||
|
|
||
| function getSubheading({ | ||
| nonIppOrFailedResult, | ||
| isFailedDocType, | ||
| isFailedSelfieLivenessOrQuality, | ||
| isFailedSelfie, | ||
| t, | ||
| }) { | ||
| const showSubheading = | ||
| !nonIppOrFailedResult && | ||
| !isFailedDocType && | ||
| !isFailedSelfieLivenessOrQuality && | ||
| !isFailedSelfie; | ||
| function getSubheading({ nonIppOrFailedResult, t }) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's nice how much simpler this is. |
||
| const showSubheading = !nonIppOrFailedResult; | ||
|
|
||
| if (showSubheading) { | ||
| return <h2>{t('errors.doc_auth.rate_limited_subheading')}</h2>; | ||
|
|
@@ -101,9 +89,6 @@ function DocumentCaptureWarning({ | |
| : t('idv.failure.button.try_online'); | ||
| const subheading = getSubheading({ | ||
| nonIppOrFailedResult, | ||
| isFailedDocType, | ||
| isFailedSelfieLivenessOrQuality, | ||
| isFailedSelfie, | ||
| t, | ||
| }); | ||
| const subheadingRef = useRef<HTMLDivElement>(null); | ||
|
|
@@ -142,24 +127,17 @@ function DocumentCaptureWarning({ | |
| <div ref={errorMessageDisplayedRef}> | ||
| <UnknownError | ||
| unknownFieldErrors={unknownFieldErrors} | ||
| remainingSubmitAttempts={remainingSubmitAttempts} | ||
| isFailedDocType={isFailedDocType} | ||
| isFailedSelfie={isFailedSelfie} | ||
| isFailedSelfieLivenessOrQuality={isFailedSelfieLivenessOrQuality} | ||
| hasDismissed={hasDismissed} | ||
| /> | ||
| </div> | ||
|
|
||
| {!isFailedDocType && | ||
| !isFailedSelfie && | ||
| !isFailedSelfieLivenessOrQuality && | ||
| remainingSubmitAttempts <= DISPLAY_ATTEMPTS && ( | ||
| <p> | ||
| <HtmlTextWithStrongNoWrap | ||
| text={t('idv.failure.attempts_html', { count: remainingSubmitAttempts })} | ||
| /> | ||
| </p> | ||
| )} | ||
| <p> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Always show on the interstitial page before going back to the reupload page 👍 |
||
| <HtmlTextWithStrongNoWrap | ||
| text={t('idv.failure.attempts_html', { count: remainingSubmitAttempts })} | ||
| /> | ||
| </p> | ||
| </Warning> | ||
| {nonIppOrFailedResult && <Cancel />} | ||
| </> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -339,8 +339,8 @@ def generate_doc_auth_errors(response_info) | |
| unknown_error_handler.handle(response_info).to_h | ||
| end | ||
|
|
||
| def self.general_error(liveness_enabled) | ||
| liveness_enabled ? Errors::GENERAL_ERROR_LIVENESS : Errors::GENERAL_ERROR | ||
| def self.general_error(_liveness_enabled) | ||
night-jellyfish marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Errors::GENERAL_ERROR | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Simplify, only use the |
||
| end | ||
|
|
||
| def self.wrapped_general_error(liveness_enabled) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always show on the re-upload page 👍