-
Notifications
You must be signed in to change notification settings - Fork 166
LG-5373: Update troubleshooting options on the IAL2 Add your ID step #5654
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
2974534
6dc923c
50ea7d5
3fa830d
569f284
98c1c2d
77d2e08
b62ad69
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| import { useContext } from 'react'; | ||
| import { TroubleshootingOptions } from '@18f/identity-components'; | ||
| import { useI18n } from '@18f/identity-react-i18n'; | ||
| import ServiceProviderContext from '../context/service-provider'; | ||
| import MarketingSiteContext from '../context/marketing-site'; | ||
|
|
||
| /** @typedef {import('@18f/identity-components/troubleshooting-options').TroubleshootingOption} TroubleshootingOption */ | ||
|
|
||
| function DocumentCaptureTroubleshootingOptions() { | ||
| const { t } = useI18n(); | ||
| const { documentCaptureTipsURL, supportedDocumentsURL } = useContext(MarketingSiteContext); | ||
| const { name: spName, getFailureToProofURL } = useContext(ServiceProviderContext); | ||
|
|
||
| return ( | ||
| <TroubleshootingOptions | ||
| heading={t('idv.troubleshooting.headings.having_trouble')} | ||
| options={ | ||
| /** @type {TroubleshootingOption[]} */ ([ | ||
| documentCaptureTipsURL && { | ||
| url: documentCaptureTipsURL, | ||
| text: t('idv.troubleshooting.options.doc_capture_tips'), | ||
| isExternal: true, | ||
| }, | ||
| supportedDocumentsURL && { | ||
| url: supportedDocumentsURL, | ||
| text: t('idv.troubleshooting.options.supported_documents'), | ||
| isExternal: true, | ||
| }, | ||
| spName && { | ||
| url: getFailureToProofURL('document_capture_troubleshooting_options'), | ||
| text: t('idv.troubleshooting.options.get_help_at_sp', { sp_name: spName }), | ||
| isExternal: true, | ||
| }, | ||
| ].filter(Boolean)) | ||
| } | ||
| /> | ||
| ); | ||
| } | ||
|
|
||
| export default DocumentCaptureTroubleshootingOptions; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,13 +53,18 @@ import { I18nContext } from '@18f/identity-react-i18n'; | |
| /** | ||
| * @typedef AppRootData | ||
| * | ||
| * @prop {string} documentCaptureTipsUrl URL to Marketing Site document capture tips. | ||
| * @prop {string} appName Application canonical name. | ||
| * @prop {string} maxCaptureAttemptsBeforeTips Number of failed attempts to allow before capture | ||
| * tips are shown. | ||
| * @prop {FlowPath} flowPath The user's session flow path, one of "standard" or "hybrid". | ||
| * @prop {string} startOverUrl URL to application DELETE path for session restart. | ||
| * @prop {string} cancelUrl URL to application path for session cancellation. | ||
| * @prop {string} documentCaptureTipsUrl | ||
| * @prop {string} supportedDocumentsUrl | ||
| * @prop {string} appName | ||
| * @prop {string} maxCaptureAttemptsBeforeTips | ||
| * @prop {FlowPath} flowPath | ||
| * @prop {string} startOverUrl | ||
| * @prop {string} cancelUrl | ||
| * | ||
| * @see AppContext | ||
| * @see MarketingSiteContext | ||
| * @see FailedCaptureAttemptsContext | ||
| * @see UploadContext | ||
|
Comment on lines
+64
to
+67
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. 👍 |
||
| */ | ||
|
|
||
| const { I18n: i18n, assets } = /** @type {DocumentCaptureGlobal} */ (window).LoginGov; | ||
|
|
@@ -152,6 +157,7 @@ loadPolyfills(['fetch', 'crypto', 'url']).then(async () => { | |
|
|
||
| const { | ||
| documentCaptureTipsUrl: documentCaptureTipsURL, | ||
| supportedDocumentsUrl: supportedDocumentsURL, | ||
| maxCaptureAttemptsBeforeTips, | ||
| appName, | ||
| flowPath, | ||
|
|
@@ -161,7 +167,7 @@ loadPolyfills(['fetch', 'crypto', 'url']).then(async () => { | |
|
|
||
| const App = composeComponents( | ||
| [AppContext.Provider, { value: { appName } }], | ||
| [MarketingSiteContext.Provider, { value: { documentCaptureTipsURL } }], | ||
| [MarketingSiteContext.Provider, { value: { documentCaptureTipsURL, supportedDocumentsURL } }], | ||
| [DeviceContext.Provider, { value: device }], | ||
| [AnalyticsContext.Provider, { value: { addPageAction, noticeError } }], | ||
| [ | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -86,6 +86,14 @@ def self.help_document_capture_tips_url | |||||||||||||||
| ).to_s | ||||||||||||||||
| end | ||||||||||||||||
|
|
||||||||||||||||
| def self.help_document_capture_supported_documents_url | ||||||||||||||||
|
Contributor
Author
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. I didn't notice an equivalent method was already available above: identity-idp/app/services/marketing_site.rb Lines 45 to 51 in b62ad69
I'll take care of this in #5662. |
||||||||||||||||
| URI.join( | ||||||||||||||||
| BASE_URL, | ||||||||||||||||
| locale_segment, | ||||||||||||||||
| 'help/verify-your-identity/accepted-state-issued-identification/', | ||||||||||||||||
| ).to_s | ||||||||||||||||
| end | ||||||||||||||||
|
|
||||||||||||||||
| def self.security_url | ||||||||||||||||
| URI.join(BASE_URL, locale_segment, 'security/').to_s | ||||||||||||||||
| end | ||||||||||||||||
|
|
||||||||||||||||
This file was deleted.
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.
would it make sense to do something like
@see AppRootDataor something to minimize duplication?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.
Hm, yeah, I see the concern about the duplication. I think it might be nice if we could set up
AppRootDatato be an intersection type of all the different context values it's picking from, or vice-versa this context type aPick<AppRootData, 'foo'|'bar'|'baz'>. One issue is that the dataset capitalization for the properties is different from the context capitalization, so the names don't line up exactly.I think it could just be enough to do like you suggest with a
@see, even if it's not "linked up" in a way that TypeScript/IDE/etc could follow, and avoid the extended property descriptions in all but the one canonical source.