-
Notifications
You must be signed in to change notification settings - Fork 166
LG-7355 new Getting Started page #8794
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
Merged
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
a5a3e17
New GettingStartedController copied from WelcomeController
soniaconnolly 1d36aad
Remove StepIndicator from GettingStartedController
soniaconnolly d06a4f1
Add GettingStartedAbTestConcern and before action in WelcomeController
soniaconnolly 8b0d1dc
Specs for ABTest behavior
soniaconnolly 8e72759
Add config flag and ABTestBucket.
soniaconnolly 21020aa
Update getting_started_controller_spec and analytics
soniaconnolly ca77d16
Add agreement checkbox and specs
soniaconnolly 35e5a83
Change the setup in getting_started_ab_test_concern_spec
soniaconnolly 9ef7308
Remove unneeded components from Getting Started template and add feat…
soniaconnolly ed8f9f9
Add new translation keys
soniaconnolly 394c55d
Add new translation text and page formatting
soniaconnolly c2e549b
Register both welcome and agreement steps in DocAuthLog
soniaconnolly 06e5286
Lint
soniaconnolly a3b3289
Test agreement checkbox in getting started feature spec
soniaconnolly f5dc4ce
Remove unneeded locals when rendering show in WelcomeController
soniaconnolly 05dd0ca
Add Agreement feature specs and make them pass
soniaconnolly bdf5e63
I18n lint
soniaconnolly 6545ddb
Put parameters on own line, fix downcase of SP name
soniaconnolly b4bbe58
Merge remote-tracking branch 'origin/main' into sonia-lg-7355-new-get…
soniaconnolly 9ef31de
Fix bad merge in analytics_events
soniaconnolly f42300f
Clean up Funnel::DocAuth::RegisterStep code layout
soniaconnolly 72c9834
Replace no_sp_name with APP_NAME when there's no SP
soniaconnolly b44e98b
Fix capitalization of APP_NAME in Welcome show template
soniaconnolly f014e8b
Add show template spec and external_redirect analytics spec
soniaconnolly b20e2b8
Update spec to match analytics arg change
soniaconnolly 5fc58f2
Change A/B test buckets to :welcome and :getting_started instead of :…
soniaconnolly 2d23223
Use FakeABTestBucket to avoid any_instance stub
soniaconnolly 0fbec4d
Merge remote-tracking branch 'origin/main' into sonia-lg-7355-new-get…
soniaconnolly d1a4723
Only redirect if bucket is :getting_started, stay on Welcome for all …
soniaconnolly File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
app/controllers/concerns/idv/getting_started_ab_test_concern.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| module Idv | ||
| module GettingStartedAbTestConcern | ||
| def getting_started_a_b_test_bucket | ||
| AbTests::IDV_GETTING_STARTED.bucket(sp_session[:request_id] || session.id) | ||
| end | ||
|
|
||
| def maybe_redirect_for_getting_started_ab_test | ||
| return if getting_started_a_b_test_bucket != :getting_started | ||
|
|
||
| redirect_to idv_getting_started_url | ||
| end | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| module Idv | ||
| class GettingStartedController < ApplicationController | ||
| include IdvStepConcern | ||
| include StepUtilitiesConcern | ||
|
|
||
| before_action :confirm_agreement_needed | ||
|
|
||
| def show | ||
| analytics.idv_doc_auth_getting_started_visited(**analytics_arguments) | ||
|
|
||
| # Register both Welcome and Agreement steps in DocAuthLog | ||
| Funnel::DocAuth::RegisterStep.new(current_user.id, sp_session[:issuer]). | ||
| call('welcome', :view, true) | ||
| Funnel::DocAuth::RegisterStep.new(current_user.id, sp_session[:issuer]). | ||
| call('agreement', :view, true) | ||
|
|
||
| @sp_name = decorated_session.sp_name || APP_NAME | ||
| @title = t('doc_auth.headings.getting_started', sp_name: @sp_name) | ||
|
|
||
| render :show, locals: { flow_session: flow_session } | ||
| end | ||
|
|
||
| def update | ||
| flow_session[:skip_upload_step] = true unless FeatureManagement.idv_allow_hybrid_flow? | ||
| skip_to_capture if params[:skip_upload] | ||
|
|
||
| result = Idv::ConsentForm.new.submit(consent_form_params) | ||
|
|
||
| analytics.idv_doc_auth_getting_started_submitted( | ||
| **analytics_arguments.merge(result.to_h), | ||
| ) | ||
|
|
||
| if result.success? | ||
| idv_session.idv_consent_given = true | ||
|
|
||
| create_document_capture_session | ||
| cancel_previous_in_person_enrollments | ||
|
|
||
| redirect_to idv_hybrid_handoff_url | ||
| else | ||
| redirect_to idv_getting_started_url | ||
| end | ||
| end | ||
|
|
||
| private | ||
|
|
||
| def analytics_arguments | ||
| { | ||
| step: 'getting_started', | ||
| analytics_id: 'Doc Auth', | ||
| irs_reproofing: irs_reproofing?, | ||
| } | ||
| end | ||
|
|
||
| def create_document_capture_session | ||
| document_capture_session = DocumentCaptureSession.create( | ||
| user_id: current_user.id, | ||
| issuer: sp_session[:issuer], | ||
| ) | ||
| flow_session[:document_capture_session_uuid] = document_capture_session.uuid | ||
| end | ||
|
|
||
| def cancel_previous_in_person_enrollments | ||
| return unless IdentityConfig.store.in_person_proofing_enabled | ||
| UspsInPersonProofing::EnrollmentHelper. | ||
| cancel_stale_establishing_enrollments_for_user(current_user) | ||
| end | ||
|
|
||
| def skip_to_capture | ||
| flow_session[:skip_upload_step] = true | ||
| idv_session.flow_path = 'standard' | ||
| end | ||
|
|
||
| def consent_form_params | ||
| params.require(:doc_auth).permit(:ial2_consent_given) | ||
| end | ||
|
|
||
| def confirm_agreement_needed | ||
| return unless idv_session.idv_consent_given | ||
|
|
||
| redirect_to idv_hybrid_handoff_url | ||
| end | ||
| end | ||
| end | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
soniaconnolly marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| <% title @title %> | ||
|
|
||
| <%= render 'shared/maintenance_window_alert' do %> | ||
| <%= render JavascriptRequiredComponent.new( | ||
| header: t('idv.getting_started.no_js_header'), | ||
| intro: t('idv.getting_started.no_js_intro', sp_name: @sp_name), | ||
| ) do %> | ||
|
|
||
| <% if @current_user&.reproof_for_irs?(service_provider: @current_sp) %> | ||
| <%= render AlertComponent.new( | ||
| type: :info, | ||
| message: t('doc_auth.info.irs_reproofing_explanation'), | ||
| class: ['margin-bottom-2', 'usa-alert--info-important'], | ||
| ) | ||
| %> | ||
| <% end %> | ||
|
|
||
| <%= render AlertComponent.new( | ||
| type: :error, | ||
| class: [ | ||
| 'js-consent-form-alert', | ||
soniaconnolly marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 'margin-bottom-4', | ||
| flow_session[:error_message].blank? && 'display-none', | ||
| ].select(&:present?), | ||
| message: flow_session[:error_message].presence || t('errors.doc_auth.consent_form'), | ||
| ) %> | ||
|
|
||
| <%= render PageHeadingComponent.new.with_content(@title) %> | ||
| <p> | ||
| <%= t( | ||
| 'doc_auth.info.getting_started_html', | ||
| sp_name: @sp_name, | ||
| link_html: new_tab_link_to( | ||
| t('doc_auth.info.getting_started_learn_more'), | ||
| help_center_redirect_path( | ||
| category: 'verify-your-identity', | ||
| article: 'how-to-verify-your-identity', | ||
| flow: :idv, | ||
| step: :getting_started, | ||
| location: 'intro_paragraph', | ||
| ), | ||
| ), | ||
| ) %> | ||
| </p> | ||
|
|
||
| <h2><%= t('doc_auth.getting_started.instructions.getting_started') %></h2> | ||
|
|
||
| <%= render ProcessListComponent.new(heading_level: :h3, class: 'margin-y-3') do |c| %> | ||
| <%= c.with_item(heading: t('doc_auth.getting_started.instructions.bullet1')) do %> | ||
| <p><%= t('doc_auth.getting_started.instructions.text1') %></p> | ||
| <% end %> | ||
| <%= c.with_item(heading: t('doc_auth.getting_started.instructions.bullet2')) do %> | ||
| <p><%= t('doc_auth.getting_started.instructions.text2') %></p> | ||
| <% end %> | ||
| <%= c.with_item(heading: t('doc_auth.getting_started.instructions.bullet3')) do %> | ||
| <p><%= t('doc_auth.getting_started.instructions.text3') %></p> | ||
| <% end %> | ||
| <%= c.with_item(heading: t('doc_auth.getting_started.instructions.bullet4', app_name: APP_NAME)) do %> | ||
| <p><%= t('doc_auth.getting_started.instructions.text4') %></p> | ||
| <% end %> | ||
| <% end %> | ||
|
|
||
| <%= simple_form_for( | ||
| :doc_auth, | ||
| url: url_for, | ||
| method: 'put', | ||
| html: { autocomplete: 'off', class: 'margin-top-2 margin-bottom-5 js-consent-continue-form' }, | ||
| ) do |f| %> | ||
| <%= render ClickObserverComponent.new(event_name: 'IdV: consent checkbox toggled') do %> | ||
| <%= render ValidatedFieldComponent.new( | ||
| form: f, | ||
| name: :ial2_consent_given, | ||
| as: :boolean, | ||
| label: t('doc_auth.getting_started.instructions.consent', app_name: APP_NAME), | ||
| required: true, | ||
| ) %> | ||
| <% end %> | ||
| <p class="margin-top-2"> | ||
| <%= new_tab_link_to( | ||
| t('doc_auth.getting_started.instructions.learn_more'), | ||
| policy_redirect_url(flow: :idv, step: :getting_started, location: :consent), | ||
| ) %> | ||
| </p> | ||
| <div class="margin-top-4"> | ||
| <%= render( | ||
| SpinnerButtonComponent.new( | ||
| type: :submit, | ||
| big: true, | ||
| wide: true, | ||
| spin_on_click: false, | ||
| ).with_content(t('doc_auth.buttons.continue')), | ||
| ) %> | ||
| </div> | ||
| <% end %> | ||
|
|
||
| <%= render 'shared/cancel', link: idv_cancel_path(step: 'getting_started') %> | ||
| <% end %> | ||
| <% end %> | ||
|
|
||
| <%= javascript_packs_tag_once('document-capture-welcome') %> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.