diff --git a/app/javascript/packages/document-capture/components/document-capture-troubleshooting-options.spec.tsx b/app/javascript/packages/document-capture/components/document-capture-troubleshooting-options.spec.tsx index 553c48cb7fe..8baea2980f6 100644 --- a/app/javascript/packages/document-capture/components/document-capture-troubleshooting-options.spec.tsx +++ b/app/javascript/packages/document-capture/components/document-capture-troubleshooting-options.spec.tsx @@ -14,7 +14,6 @@ describe('DocumentCaptureTroubleshootingOptions', () => { const serviceProviderContext: ServiceProviderContextType = { name: 'Example SP', failureToProofURL: 'http://example.test/url/to/failure-to-proof', - getFailureToProofURL: () => '', }; const wrappers: Record = { MarketingSiteContext: ({ children }: { children?: ReactNode }) => ( @@ -55,62 +54,6 @@ describe('DocumentCaptureTroubleshootingOptions', () => { expect(links[1].target).to.equal('_blank'); }); - context('with associated service provider', () => { - it('renders troubleshooting options', () => { - const { getAllByRole } = render(, { - wrapper: wrappers.helpCenterAndServiceProviderContext, - }); - - const links = getAllByRole('link') as HTMLAnchorElement[]; - - expect(links).to.have.lengthOf(3); - expect(links[0].textContent).to.equal( - 'idv.troubleshooting.options.doc_capture_tipslinks.new_tab', - ); - expect(links[0].getAttribute('href')).to.equal( - 'https://example.com/redirect/?category=verify-your-identity&article=how-to-add-images-of-your-state-issued-id&location=document_capture_troubleshooting_options', - ); - expect(links[0].target).to.equal('_blank'); - expect(links[1].textContent).to.equal( - 'idv.troubleshooting.options.supported_documentslinks.new_tab', - ); - expect(links[1].getAttribute('href')).to.equal( - 'https://example.com/redirect/?category=verify-your-identity&article=accepted-state-issued-identification&location=document_capture_troubleshooting_options', - ); - expect(links[1].target).to.equal('_blank'); - expect(links[2].textContent).to.equal( - 'idv.troubleshooting.options.get_help_at_splinks.new_tab', - ); - expect(links[2].href).to.equal( - 'http://example.test/url/to/failure-to-proof?location=document_capture_troubleshooting_options', - ); - expect(links[2].target).to.equal('_blank'); - }); - - context('with location prop', () => { - it('appends location to links', () => { - const { getAllByRole } = render( - , - { - wrapper: wrappers.helpCenterAndServiceProviderContext, - }, - ); - - const links = getAllByRole('link') as HTMLAnchorElement[]; - - expect(links[0].href).to.equal( - 'https://example.com/redirect/?category=verify-your-identity&article=how-to-add-images-of-your-state-issued-id&location=custom', - ); - expect(links[1].href).to.equal( - 'https://example.com/redirect/?category=verify-your-identity&article=accepted-state-issued-identification&location=custom', - ); - expect(links[2].href).to.equal( - 'http://example.test/url/to/failure-to-proof?location=custom', - ); - }); - }); - }); - context('with heading prop', () => { it('shows heading text', () => { const { getByRole } = render( @@ -174,20 +117,6 @@ describe('DocumentCaptureTroubleshootingOptions', () => { }); }); - context('with sp option turned off', () => { - it('does not display the SP troubleshooting option', () => { - const { queryByRole } = render( - , - ); - - expect( - queryByRole('link', { - name: 'idv.troubleshooting.options.get_help_at_sp links.new_tab', - }), - ).to.not.exist(); - }); - }); - context('with document tips hidden', () => { it('renders nothing', () => { const { container } = render( @@ -196,23 +125,5 @@ describe('DocumentCaptureTroubleshootingOptions', () => { expect(container.innerHTML).to.be.empty(); }); - - context('with associated service provider', () => { - it('renders troubleshooting options', () => { - const { getAllByRole } = render( - , - { - wrapper: wrappers.helpCenterAndServiceProviderContext, - }, - ); - - const links = getAllByRole('link') as HTMLAnchorElement[]; - - expect(links).to.have.lengthOf(1); - expect(links[0].getAttribute('href')).to.equal( - 'http://example.test/url/to/failure-to-proof?location=document_capture_troubleshooting_options', - ); - }); - }); }); }); diff --git a/app/javascript/packages/document-capture/components/document-capture-troubleshooting-options.tsx b/app/javascript/packages/document-capture/components/document-capture-troubleshooting-options.tsx index df8b4a329a4..b5bbba9f5aa 100644 --- a/app/javascript/packages/document-capture/components/document-capture-troubleshooting-options.tsx +++ b/app/javascript/packages/document-capture/components/document-capture-troubleshooting-options.tsx @@ -2,7 +2,6 @@ import { useContext } from 'react'; import { TroubleshootingOptions } from '@18f/identity-components'; import { useI18n } from '@18f/identity-react-i18n'; import type { TroubleshootingOption } from '@18f/identity-components/troubleshooting-options'; -import ServiceProviderContext from '../context/service-provider'; import MarketingSiteContext from '../context/marketing-site'; import InPersonCallToAction from './in-person-call-to-action'; import { InPersonContext } from '../context'; @@ -27,12 +26,6 @@ interface DocumentCaptureTroubleshootingOptionsProps { * Whether to display alternative options for verifying. */ showAlternativeProofingOptions?: boolean; - - /** - * Whether or not to display option for getting - * help at SP - */ - showSPOption?: boolean; } function DocumentCaptureTroubleshootingOptions({ @@ -40,12 +33,10 @@ function DocumentCaptureTroubleshootingOptions({ location = 'document_capture_troubleshooting_options', showDocumentTips = true, showAlternativeProofingOptions, - showSPOption = true, }: DocumentCaptureTroubleshootingOptionsProps) { const { t } = useI18n(); const { inPersonURL } = useContext(InPersonContext); const { getHelpCenterURL } = useContext(MarketingSiteContext); - const { name: spName, getFailureToProofURL } = useContext(ServiceProviderContext); return ( <> @@ -72,12 +63,6 @@ function DocumentCaptureTroubleshootingOptions({ text: t('idv.troubleshooting.options.supported_documents'), isExternal: true, }, - spName && - showSPOption && { - url: getFailureToProofURL(location), - text: t('idv.troubleshooting.options.get_help_at_sp', { sp_name: spName }), - isExternal: true, - }, ].filter(Boolean) as TroubleshootingOption[] } /> diff --git a/app/javascript/packages/document-capture/components/document-capture-warning.tsx b/app/javascript/packages/document-capture/components/document-capture-warning.tsx index acb1acbdb02..93fb74a7232 100644 --- a/app/javascript/packages/document-capture/components/document-capture-warning.tsx +++ b/app/javascript/packages/document-capture/components/document-capture-warning.tsx @@ -134,7 +134,6 @@ function DocumentCaptureWarning({ } diff --git a/app/javascript/packages/document-capture/components/hybrid-doc-capture-warning.spec.tsx b/app/javascript/packages/document-capture/components/hybrid-doc-capture-warning.spec.tsx index 77c0691ecc9..6f2c2ac76ce 100644 --- a/app/javascript/packages/document-capture/components/hybrid-doc-capture-warning.spec.tsx +++ b/app/javascript/packages/document-capture/components/hybrid-doc-capture-warning.spec.tsx @@ -19,9 +19,7 @@ describe('HybridDocCaptureWarning', () => { describe('basic rendering', () => { it('renders a warning alert', () => { const { getByRole } = render( - '' }} - > + , ); @@ -34,9 +32,7 @@ describe('HybridDocCaptureWarning', () => { describe('without SP', () => { it('renders correct warning title', () => { const { getByRole } = render( - '' }} - > + , ); @@ -49,9 +45,7 @@ describe('HybridDocCaptureWarning', () => { it('does not render a third list item pertaining to SP services', () => { const { getByRole } = render( - '' }} - > + , ); @@ -67,9 +61,7 @@ describe('HybridDocCaptureWarning', () => { describe('with SP', () => { it('renders the correct warning title', () => { const { getByRole } = render( - '' }} - > + , ); @@ -83,9 +75,7 @@ describe('HybridDocCaptureWarning', () => { }); it('renders a third list item pertaining to SP services', () => { const { getByRole } = render( - '' }} - > + , ); diff --git a/app/javascript/packages/document-capture/components/in-person-troubleshooting-options.tsx b/app/javascript/packages/document-capture/components/in-person-troubleshooting-options.tsx index d644bc1e880..571e572c413 100644 --- a/app/javascript/packages/document-capture/components/in-person-troubleshooting-options.tsx +++ b/app/javascript/packages/document-capture/components/in-person-troubleshooting-options.tsx @@ -2,7 +2,6 @@ import { useContext } from 'react'; import { TroubleshootingOptions } from '@18f/identity-components'; import { useI18n } from '@18f/identity-react-i18n'; import type { TroubleshootingOption } from '@18f/identity-components/troubleshooting-options'; -import ServiceProviderContext from '../context/service-provider'; import MarketingSiteContext from '../context/marketing-site'; interface InPersonTroubleshootingOptionsProps { @@ -23,7 +22,6 @@ function InPersonTroubleshootingOptions({ }: InPersonTroubleshootingOptionsProps) { const { t } = useI18n(); const { getHelpCenterURL } = useContext(MarketingSiteContext); - const { name: spName, getFailureToProofURL } = useContext(ServiceProviderContext); return ( diff --git a/app/javascript/packages/document-capture/context/service-provider.tsx b/app/javascript/packages/document-capture/context/service-provider.tsx index 8c74c75ff2e..d5a78b57b6c 100644 --- a/app/javascript/packages/document-capture/context/service-provider.tsx +++ b/app/javascript/packages/document-capture/context/service-provider.tsx @@ -1,5 +1,4 @@ import { createContext, useMemo } from 'react'; -import { addSearchParams } from '@18f/identity-url'; import type { ReactNode } from 'react'; export interface ServiceProviderContextType { @@ -11,17 +10,11 @@ export interface ServiceProviderContextType { * URL to redirect user on failure to proof. */ failureToProofURL: string; - /** - * Returns failure to proof URL for a - * specific location within the step. - */ - getFailureToProofURL: (location: string) => string; } const ServiceProviderContext = createContext({ name: null, failureToProofURL: '', - getFailureToProofURL: () => '', }); ServiceProviderContext.displayName = 'ServiceProviderContext'; @@ -35,8 +28,6 @@ function ServiceProviderContextProvider({ value, children }: ServiceProviderCont const mergedValue = useMemo( () => ({ ...value, - getFailureToProofURL: (location: string) => - addSearchParams(value.failureToProofURL, { location }), }), [value], ); diff --git a/app/views/idv/phone_errors/_warning.html.erb b/app/views/idv/phone_errors/_warning.html.erb index 2148f16a020..c3c024bdc86 100644 --- a/app/views/idv/phone_errors/_warning.html.erb +++ b/app/views/idv/phone_errors/_warning.html.erb @@ -36,13 +36,5 @@ locals: text: t('idv.troubleshooting.options.verify_by_mail'), url: idv_request_letter_path, }, - decorated_sp_session.sp_name && { - url: return_to_sp_failure_to_proof_path( - step: 'phone', - location: local_assigns.fetch(:name, 'warning'), - ), - text: t('idv.troubleshooting.options.get_help_at_sp', sp_name: decorated_sp_session.sp_name), - new_tab: true, - }, ].select(&:present?), ) { yield } %> diff --git a/app/views/idv/session_errors/exception.html.erb b/app/views/idv/session_errors/exception.html.erb index cf8338fc047..381b181954c 100644 --- a/app/views/idv/session_errors/exception.html.erb +++ b/app/views/idv/session_errors/exception.html.erb @@ -12,15 +12,7 @@ text: t('idv.troubleshooting.options.contact_support', app_name: APP_NAME), new_tab: true, }, - decorated_sp_session.sp_name && { - url: return_to_sp_failure_to_proof_path( - step: 'verify_info', - location: request.params[:action], - ), - text: t('idv.troubleshooting.options.get_help_at_sp', sp_name: decorated_sp_session.sp_name), - new_tab: true, - }, - ].compact, + ], ) do %>

<%= t( diff --git a/config/locales/en.yml b/config/locales/en.yml index 2762d6a0065..04de63d3ba7 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1124,7 +1124,6 @@ idv.titles.unavailable: We are working to resolve an error idv.troubleshooting.headings.need_assistance: 'Need immediate assistance? Here’s how to get help:' idv.troubleshooting.options.contact_support: Contact %{app_name} Support idv.troubleshooting.options.doc_capture_tips: Tips for taking clear photos of your ID -idv.troubleshooting.options.get_help_at_sp: Get help at %{sp_name} idv.troubleshooting.options.learn_more_verify_by_mail: Learn more about verifying your address by mail idv.troubleshooting.options.learn_more_verify_by_phone: Learn more about what phone number to use idv.troubleshooting.options.learn_more_verify_by_phone_in_person: Learn more about verifying your phone number diff --git a/config/locales/es.yml b/config/locales/es.yml index a21141d92b8..e89e2df22d8 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -1123,7 +1123,6 @@ idv.titles.unavailable: Estamos trabajando para corregir un error idv.troubleshooting.headings.need_assistance: '¿Necesita ayuda inmediata? Así es como puede obtener ayuda:' idv.troubleshooting.options.contact_support: Contacte con el servicio de asistencia de %{app_name} idv.troubleshooting.options.doc_capture_tips: Consejos para tomar fotos nítidas de su identificación -idv.troubleshooting.options.get_help_at_sp: Obtenga ayuda en %{sp_name} idv.troubleshooting.options.learn_more_verify_by_mail: Obtenga más información sobre la verificación de su dirección por correo idv.troubleshooting.options.learn_more_verify_by_phone: Obtenga más información sobre el número de teléfono que debe usar idv.troubleshooting.options.learn_more_verify_by_phone_in_person: Obtenga más información sobre la verificación de su número de teléfono diff --git a/config/locales/fr.yml b/config/locales/fr.yml index e70ce8f7b85..70ca3406b9b 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -1124,7 +1124,6 @@ idv.titles.unavailable: Nous travaillons à la résolution d’une erreur idv.troubleshooting.headings.need_assistance: 'Vous avez besoin d’une assistance immédiate ? Voici comment obtenir de l’aide :' idv.troubleshooting.options.contact_support: Contacter le service d’assistance de %{app_name} idv.troubleshooting.options.doc_capture_tips: Conseils pour prendre des photos nettes de votre pièce d’identité -idv.troubleshooting.options.get_help_at_sp: Obtenir de l’aide sur %{sp_name} idv.troubleshooting.options.learn_more_verify_by_mail: En savoir plus sur la vérification de votre adresse par courrier idv.troubleshooting.options.learn_more_verify_by_phone: En savoir plus sur quel numéro de téléphone utiliser idv.troubleshooting.options.learn_more_verify_by_phone_in_person: En savoir plus sur la vérification de votre numéro de téléphone diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 74863801b54..47ab4050516 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1128,7 +1128,6 @@ idv.titles.unavailable: 我们正在争取解决错误。 idv.troubleshooting.headings.need_assistance: 需要立即帮助?以下是如何得到帮助的步骤: idv.troubleshooting.options.contact_support: 联系 %{app_name} 支持 idv.troubleshooting.options.doc_capture_tips: 拍出你身份证件清晰照片的提示。 -idv.troubleshooting.options.get_help_at_sp: 在 %{sp_name}得到帮助 idv.troubleshooting.options.learn_more_verify_by_mail: 对通过邮件验证你地址获得更多了解 idv.troubleshooting.options.learn_more_verify_by_phone: 了解有关使用什么号码的更多信息 idv.troubleshooting.options.learn_more_verify_by_phone_in_person: 对验证你的电话号码获得更多了解 diff --git a/spec/javascript/packages/document-capture/components/review-issues-step-spec.jsx b/spec/javascript/packages/document-capture/components/review-issues-step-spec.jsx index c62919ff0a7..c2a959ba8ae 100644 --- a/spec/javascript/packages/document-capture/components/review-issues-step-spec.jsx +++ b/spec/javascript/packages/document-capture/components/review-issues-step-spec.jsx @@ -223,44 +223,6 @@ describe('document-capture/components/review-issues-step', () => { }); }); - it('does not render sp help troubleshooting option for errored review', () => { - const { queryByRole } = render( - - - - - , - ); - - expect( - queryByRole('link', { name: 'idv.troubleshooting.options.get_help_at_sp links.new_tab' }), - ).to.not.exist(); - }); - - it('does render sp help troubleshooting option for errored review if in person url present', () => { - const { getByRole } = render( - - - - - , - ); - - expect( - getByRole('link', { name: 'idv.troubleshooting.options.get_help_at_sp links.new_tab' }).href, - ).to.equal('https://example.com/?step=document_capture&location=post_submission_warning'); - }); - it('renders alternative error messages with in person and doc type is not supported', async () => { const { getByRole, getByText, getByLabelText } = render( diff --git a/spec/javascript/packages/document-capture/context/service-provider-spec.jsx b/spec/javascript/packages/document-capture/context/service-provider-spec.jsx index 1c22ab6bf56..e01714c02aa 100644 --- a/spec/javascript/packages/document-capture/context/service-provider-spec.jsx +++ b/spec/javascript/packages/document-capture/context/service-provider-spec.jsx @@ -1,30 +1,13 @@ import { useContext } from 'react'; import { renderHook } from '@testing-library/react-hooks'; -import ServiceProviderContext, { - Provider, -} from '@18f/identity-document-capture/context/service-provider'; +import ServiceProviderContext from '@18f/identity-document-capture/context/service-provider'; describe('document-capture/context/service-provider', () => { it('has expected default properties', () => { const { result } = renderHook(() => useContext(ServiceProviderContext)); - expect(result.current).to.have.keys(['name', 'failureToProofURL', 'getFailureToProofURL']); + expect(result.current).to.have.keys(['name', 'failureToProofURL']); expect(result.current.name).to.be.null(); expect(result.current.failureToProofURL).to.be.a('string'); - expect(result.current.getFailureToProofURL).to.be.a('function'); - }); - - describe('Provider', () => { - it('customizes getFailureToProofURL to parameterize failureToProofURL location', () => { - const { result } = renderHook(() => useContext(ServiceProviderContext), { - wrapper: ({ children }) => ( - {children} - ), - }); - - const failureToProofURL = result.current.getFailureToProofURL('location name'); - - expect(failureToProofURL).to.equal('http://example.com/?a=1&location=location+name'); - }); }); }); diff --git a/spec/views/idv/phone_errors/_warning.html.erb_spec.rb b/spec/views/idv/phone_errors/_warning.html.erb_spec.rb index 70ff3c0b36e..488b0ac187b 100644 --- a/spec/views/idv/phone_errors/_warning.html.erb_spec.rb +++ b/spec/views/idv/phone_errors/_warning.html.erb_spec.rb @@ -45,44 +45,4 @@ end end end - - context 'without an SP' do - it 'renders a list of troubleshooting options' do - expect(rendered).not_to have_link( - t('idv.troubleshooting.options.get_help_at_sp', sp_name: sp_name), - href: return_to_sp_failure_to_proof_path, - ) - end - end - - context 'with an SP' do - let(:sp_name) { 'Example SP' } - - it 'renders a list of troubleshooting options' do - expect(rendered).to have_link( - t('idv.troubleshooting.options.get_help_at_sp', sp_name: sp_name), - href: return_to_sp_failure_to_proof_path(step: 'phone', location: 'warning'), - ) - end - - context 'without a name' do - it 'renders failure to proof url with default location' do - expect(rendered).to have_link( - t('idv.troubleshooting.options.get_help_at_sp', sp_name: sp_name), - href: return_to_sp_failure_to_proof_path(step: 'phone', location: 'warning'), - ) - end - end - - context 'with a name' do - let(:assigns) { { name: 'fail' } } - - it 'renders failure to proof url with name as location' do - expect(rendered).to have_link( - t('idv.troubleshooting.options.get_help_at_sp', sp_name: sp_name), - href: return_to_sp_failure_to_proof_path(step: 'phone', location: 'fail'), - ) - end - end - end end diff --git a/spec/views/idv/phone_errors/jobfail.html.erb_spec.rb b/spec/views/idv/phone_errors/jobfail.html.erb_spec.rb index 4a042c382f7..2fd22a7cea8 100644 --- a/spec/views/idv/phone_errors/jobfail.html.erb_spec.rb +++ b/spec/views/idv/phone_errors/jobfail.html.erb_spec.rb @@ -29,10 +29,6 @@ context 'gpo verification disabled' do it 'renders a list of troubleshooting options' do - expect(rendered).to have_link( - t('idv.troubleshooting.options.get_help_at_sp', sp_name: sp_name), - href: return_to_sp_failure_to_proof_path(step: 'phone', location: 'jobfail'), - ) expect(rendered).not_to have_link( t('idv.troubleshooting.options.verify_by_mail'), href: idv_request_letter_path, @@ -44,10 +40,6 @@ let(:gpo_letter_available) { true } it 'renders a list of troubleshooting options' do - expect(rendered).to have_link( - t('idv.troubleshooting.options.get_help_at_sp', sp_name: sp_name), - href: return_to_sp_failure_to_proof_path(step: 'phone', location: 'jobfail'), - ) expect(rendered).to have_link( t('idv.troubleshooting.options.verify_by_mail'), href: idv_request_letter_path, diff --git a/spec/views/idv/phone_errors/timeout.html.erb_spec.rb b/spec/views/idv/phone_errors/timeout.html.erb_spec.rb index c17eea3c4f3..9a9ba822bc0 100644 --- a/spec/views/idv/phone_errors/timeout.html.erb_spec.rb +++ b/spec/views/idv/phone_errors/timeout.html.erb_spec.rb @@ -29,10 +29,6 @@ context 'gpo verification disabled' do it 'renders a list of troubleshooting options' do - expect(rendered).to have_link( - t('idv.troubleshooting.options.get_help_at_sp', sp_name: sp_name), - href: return_to_sp_failure_to_proof_path(step: 'phone', location: 'timeout'), - ) expect(rendered).not_to have_link( t('idv.troubleshooting.options.verify_by_mail'), href: idv_request_letter_path, @@ -44,10 +40,6 @@ let(:gpo_letter_available) { true } it 'renders a list of troubleshooting options' do - expect(rendered).to have_link( - t('idv.troubleshooting.options.get_help_at_sp', sp_name: sp_name), - href: return_to_sp_failure_to_proof_path(step: 'phone', location: 'timeout'), - ) expect(rendered).to have_link( t('idv.troubleshooting.options.verify_by_mail'), href: idv_request_letter_path, diff --git a/spec/views/idv/phone_errors/warning.html.erb_spec.rb b/spec/views/idv/phone_errors/warning.html.erb_spec.rb index a94c30ef57b..77f1ee948cd 100644 --- a/spec/views/idv/phone_errors/warning.html.erb_spec.rb +++ b/spec/views/idv/phone_errors/warning.html.erb_spec.rb @@ -65,16 +65,6 @@ ) end - context 'no sp' do - let(:sp_name) { nil } - it 'does not prompt user to get help at sp' do - expect(rendered).not_to have_link( - t('idv.troubleshooting.options.get_help_at_sp', sp_name: sp_name), - href: return_to_sp_failure_to_proof_path(step: 'phone', location: 'warning'), - ) - end - end - context 'gpo verification disabled' do it 'does not render link to gpo flow' do expect(rendered).not_to have_link( diff --git a/spec/views/idv/session_errors/exception.html.erb_spec.rb b/spec/views/idv/session_errors/exception.html.erb_spec.rb index a10bd49ed4c..12165400e7b 100644 --- a/spec/views/idv/session_errors/exception.html.erb_spec.rb +++ b/spec/views/idv/session_errors/exception.html.erb_spec.rb @@ -34,10 +34,6 @@ let(:sp_issuer) { 'example-issuer' } it 'renders a list of troubleshooting options' do - expect(rendered).to have_link( - t('idv.troubleshooting.options.get_help_at_sp', sp_name: sp_name), - href: return_to_sp_failure_to_proof_path(step: 'verify_info', location: 'exception'), - ) expect(rendered).to have_link( t('idv.troubleshooting.options.contact_support', app_name: APP_NAME), href: MarketingSite.contact_url,