Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/controllers/idv/welcome_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ def show
Funnel::DocAuth::RegisterStep.new(current_user.id, sp_session[:issuer]).
call('welcome', :view, true)

@sp_name = decorated_session.sp_name || APP_NAME
@title = t('doc_auth.headings.getting_started', sp_name: @sp_name)

@ab_test_bucket = getting_started_ab_test_bucket

render :show
end

Expand Down
106 changes: 106 additions & 0 deletions app/views/idv/welcome/_welcome_default.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<% title t('doc_auth.headings.welcome') %>

<% content_for(:pre_flash_content) do %>
<%= render StepIndicatorComponent.new(
steps: Idv::StepIndicatorConcern::STEP_INDICATOR_STEPS,
current_step: :getting_started,
locale_scope: 'idv',
class: 'margin-x-neg-2 margin-top-neg-4 tablet:margin-x-neg-6 tablet:margin-top-neg-4',
) %>
<% end %>

<%= render JavascriptRequiredComponent.new(
header: t('idv.welcome.no_js_header'),
intro: t('idv.welcome.no_js_intro', sp_name: decorated_session.sp_name || APP_NAME),
) do %>

<%= render PageHeadingComponent.new.with_content(t('doc_auth.headings.welcome')) %>
<p>
<%= t('doc_auth.info.welcome', sp_name: decorated_session.sp_name || APP_NAME) %>
</p>

<h2><%= t('doc_auth.instructions.welcome') %></h2>

<%= render ProcessListComponent.new(heading_level: :h3, class: 'margin-y-3') do |c| %>
<%= c.with_item(heading: t('doc_auth.instructions.bullet1')) do %>
<p><%= t('doc_auth.instructions.text1') %></p>
<% end %>
<%= c.with_item(heading: t('doc_auth.instructions.bullet2')) do %>
<p><%= t('doc_auth.instructions.text2') %></p>
<% end %>
<%= c.with_item(heading: t('doc_auth.instructions.bullet3')) do %>
<ul class="usa-list">
<% t('doc_auth.instructions.text3_html').each do |bullet_item| %>
<li><%= bullet_item %></li>
<% end %>
</ul>
<%= new_tab_link_to(
t('idv.troubleshooting.options.learn_more_address_verification_options'),
help_center_redirect_path(
category: 'verify-your-identity',
article: 'phone-number',
flow: :idv,
step: :welcome,
location: 'you_will_need',
),
) %>
<% end %>
<% end %>

<%= simple_form_for :doc_auth,
url: url_for,
method: 'put',
html: { autocomplete: 'off', class: 'margin-y-5 js-consent-continue-form' } do |f| %>
<%= f.submit t('doc_auth.buttons.continue') %>
<% end %>

<%= render(
'shared/troubleshooting_options',
heading_tag: :h3,
heading: t('idv.troubleshooting.headings.missing_required_items'),
options: [
{
url: help_center_redirect_path(
category: 'verify-your-identity',
article: 'accepted-state-issued-identification',
flow: :idv,
step: :welcome,
location: 'missing_items',
),
text: t('idv.troubleshooting.options.supported_documents'),
new_tab: true,
},
{
url: help_center_redirect_path(
category: 'verify-your-identity',
article: 'phone-number',
flow: :idv,
step: :welcome,
location: 'missing_items',
),
text: t('idv.troubleshooting.options.learn_more_address_verification_options'),
new_tab: true,
},
decorated_session.sp_name && {
url: return_to_sp_failure_to_proof_url(step: 'welcome', location: 'missing_items'),
text: t('idv.troubleshooting.options.get_help_at_sp', sp_name: decorated_session.sp_name),
new_tab: true,
},
].select(&:present?),
) %>

<h3><%= t('doc_auth.instructions.privacy') %></h3>
<p>
<%= t('doc_auth.info.privacy', app_name: APP_NAME) %>
</p>
<p>
<%= new_tab_link_to(
t('doc_auth.instructions.learn_more'),
policy_redirect_url(flow: :idv, step: :welcome, location: :footer),
) %>
</p>

<%= render 'shared/cancel', link: idv_cancel_path(step: 'welcome') %>
<% end %>

<%= javascript_packs_tag_once('document-capture-welcome') %>
65 changes: 65 additions & 0 deletions app/views/idv/welcome/_welcome_new.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<% title @title %>

<%= render JavascriptRequiredComponent.new(
header: t('idv.getting_started.no_js_header'),
intro: t('idv.getting_started.no_js_intro', sp_name: @sp_name),
) do %>

<%= 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| %>

<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 %>

<%= javascript_packs_tag_once('document-capture-welcome') %>
109 changes: 4 additions & 105 deletions app/views/idv/welcome/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,106 +1,5 @@
<% title t('doc_auth.headings.welcome') %>

<% content_for(:pre_flash_content) do %>
<%= render StepIndicatorComponent.new(
steps: Idv::StepIndicatorConcern::STEP_INDICATOR_STEPS,
current_step: :getting_started,
locale_scope: 'idv',
class: 'margin-x-neg-2 margin-top-neg-4 tablet:margin-x-neg-6 tablet:margin-top-neg-4',
) %>
<% if @ab_test_bucket == :welcome_new %>
<%= render 'welcome_new' %>
<% else %>
<%= render 'welcome_default' %>
<% end %>

<%= render JavascriptRequiredComponent.new(
header: t('idv.welcome.no_js_header'),
intro: t('idv.welcome.no_js_intro', sp_name: decorated_session.sp_name || APP_NAME),
) do %>

<%= render PageHeadingComponent.new.with_content(t('doc_auth.headings.welcome')) %>
<p>
<%= t('doc_auth.info.welcome', sp_name: decorated_session.sp_name || APP_NAME) %>
</p>

<h2><%= t('doc_auth.instructions.welcome') %></h2>

<%= render ProcessListComponent.new(heading_level: :h3, class: 'margin-y-3') do |c| %>
<%= c.with_item(heading: t('doc_auth.instructions.bullet1')) do %>
<p><%= t('doc_auth.instructions.text1') %></p>
<% end %>
<%= c.with_item(heading: t('doc_auth.instructions.bullet2')) do %>
<p><%= t('doc_auth.instructions.text2') %></p>
<% end %>
<%= c.with_item(heading: t('doc_auth.instructions.bullet3')) do %>
<ul class="usa-list">
<% t('doc_auth.instructions.text3_html').each do |bullet_item| %>
<li><%= bullet_item %></li>
<% end %>
</ul>
<%= new_tab_link_to(
t('idv.troubleshooting.options.learn_more_address_verification_options'),
help_center_redirect_path(
category: 'verify-your-identity',
article: 'phone-number',
flow: :idv,
step: :welcome,
location: 'you_will_need',
),
) %>
<% end %>
<% end %>

<%= simple_form_for :doc_auth,
url: url_for,
method: 'put',
html: { autocomplete: 'off', class: 'margin-y-5 js-consent-continue-form' } do |f| %>
<%= f.submit t('doc_auth.buttons.continue') %>
<% end %>

<%= render(
'shared/troubleshooting_options',
heading_tag: :h3,
heading: t('idv.troubleshooting.headings.missing_required_items'),
options: [
{
url: help_center_redirect_path(
category: 'verify-your-identity',
article: 'accepted-state-issued-identification',
flow: :idv,
step: :welcome,
location: 'missing_items',
),
text: t('idv.troubleshooting.options.supported_documents'),
new_tab: true,
},
{
url: help_center_redirect_path(
category: 'verify-your-identity',
article: 'phone-number',
flow: :idv,
step: :welcome,
location: 'missing_items',
),
text: t('idv.troubleshooting.options.learn_more_address_verification_options'),
new_tab: true,
},
decorated_session.sp_name && {
url: return_to_sp_failure_to_proof_url(step: 'welcome', location: 'missing_items'),
text: t('idv.troubleshooting.options.get_help_at_sp', sp_name: decorated_session.sp_name),
new_tab: true,
},
].select(&:present?),
) %>

<h3><%= t('doc_auth.instructions.privacy') %></h3>
<p>
<%= t('doc_auth.info.privacy', app_name: APP_NAME) %>
</p>
<p>
<%= new_tab_link_to(
t('doc_auth.instructions.learn_more'),
policy_redirect_url(flow: :idv, step: :welcome, location: :footer),
) %>
</p>

<%= render 'shared/cancel', link: idv_cancel_path(step: 'welcome') %>
<% end %>

<%= javascript_packs_tag_once('document-capture-welcome') %>
2 changes: 1 addition & 1 deletion config/application.yml.default
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ idv_acuant_sdk_version_default: '11.8.2'
idv_acuant_sdk_version_alternate: '11.8.1'
idv_acuant_sdk_upgrade_a_b_testing_enabled: false
idv_acuant_sdk_upgrade_a_b_testing_percent: 50
idv_getting_started_a_b_testing: '{"welcome":100,"getting_started":0}'
idv_getting_started_a_b_testing: '{"welcome_default":100, "welcome_new":0, "getting_started":0}'
idv_send_link_attempt_window_in_minutes: 10
idv_send_link_max_attempts: 5
idv_tmx_test_csp_disabled_emails: '[]'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def index
case discriminator
when user.uuid
:getting_started
else :welcome
else :welcome_default
end
end
end
Expand All @@ -35,7 +35,7 @@ def index
allow(controller).to receive(:current_user).and_return(user2)
end
it 'returns the bucket based on user id' do
expect(controller.getting_started_ab_test_bucket).to eq(:welcome)
expect(controller.getting_started_ab_test_bucket).to eq(:welcome_default)
end
end
end
Expand Down Expand Up @@ -85,7 +85,7 @@ def index
context 'A/B test specifies welcome page' do
before do
allow(controller).to receive(:getting_started_ab_test_bucket).
and_return(:welcome)
and_return(:welcome_default)
end

it 'does not redirect users away from welcome page' do
Expand Down
18 changes: 18 additions & 0 deletions spec/controllers/idv/welcome_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,24 @@

expect(response).to redirect_to(idv_please_call_url)
end

context 'getting_started_ab_test_bucket values' do
render_views

it 'renders the welcome_new template for :welcome_new' do
allow(controller).to receive(:getting_started_ab_test_bucket).and_return(:welcome_new)

get :show
expect(response).to render_template(partial: '_welcome_new')
end

it 'it renders the welcome_default template for :welcome_default' do
allow(controller).to receive(:getting_started_ab_test_bucket).and_return(:welcome_default)

get :show
expect(response).to render_template(partial: '_welcome_default')
end
end
end

describe '#update' do
Expand Down
Loading