-
Notifications
You must be signed in to change notification settings - Fork 166
LG-6970 create inherited proofing basic landing page #6823
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
jscodefix
merged 8 commits into
main
from
LG-6970-inherited-proofing-basic-landing-page
Aug 25, 2022
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a8ee43a
LG-6970 create inherited proofing basic landing page
jscodefix 2d3238e
fix lint errors for 2 files (get_started.html.erb, en.yml)
jscodefix c304eaf
add inherited_proofing_enabled feature flag
jscodefix b422eec
Fix formatting
gangelo 94490cb
Add missing translations to pass specs
gangelo 817f62c
Make placeholders consistent :S
gangelo 9fd884a
Fix inconsistent interpolation across fr and es locales
gangelo 32ed3b1
optimize template button as a submit (w/o js-consent-continue-form)
jscodefix 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
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,12 @@ | ||
| module Idv | ||
| class InheritedProofingController < ApplicationController | ||
| include Flow::FlowStateMachine | ||
|
|
||
| FLOW_STATE_MACHINE_SETTINGS = { | ||
| step_url: :idv_inherited_proofing_step_url, | ||
| final_url: nil, | ||
| flow: Idv::Flows::InheritedProofingFlow, | ||
| analytics_id: nil, | ||
| }.freeze | ||
| 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,19 @@ | ||
| module Idv | ||
| module Flows | ||
| class InheritedProofingFlow < Flow::BaseFlow | ||
| STEPS = { | ||
| get_started: Idv::Steps::InheritedProofing::GetStartedStep, | ||
| }.freeze | ||
|
|
||
| STEP_INDICATOR_STEPS = [ | ||
| { name: :getting_started }, | ||
| ].freeze | ||
|
|
||
| ACTIONS = {}.freeze | ||
|
|
||
| def initialize(controller, session, name) | ||
| super(controller, STEPS, ACTIONS, session[name]) | ||
| end | ||
| end | ||
| end | ||
| end |
9 changes: 9 additions & 0 deletions
9
app/services/idv/steps/inherited_proofing/get_started_step.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,9 @@ | ||
| module Idv | ||
| module Steps | ||
| module InheritedProofing | ||
| class GetStartedStep < DocAuthBaseStep | ||
| STEP_INDICATOR_STEP = :getting_started | ||
| end | ||
| 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,11 @@ | ||
| module Idv | ||
| module Steps | ||
| class InheritedProofingBaseStep < Flow::BaseStep | ||
| def initialize(flow) | ||
| super(flow, :inherited_proofing) | ||
| end | ||
|
|
||
| delegate :idv_session, :session, :flow_path, to: :@flow | ||
| 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,38 @@ | ||
| <% title t('inherited_proofing.headings.welcome') %> | ||
|
|
||
| <%= render JavascriptRequiredComponent.new( | ||
| header: t('idv.welcome.no_js_header'), | ||
| intro: t('idv.welcome.no_js_intro', sp_name: decorated_session.sp_name || t('inherited_proofing.info.no_sp_name')), | ||
| ) do %> | ||
| <%= render PageHeadingComponent.new.with_content(t('inherited_proofing.headings.welcome')) %> | ||
| <p> | ||
| <%= t('inherited_proofing.info.welcome_html', sp_name: decorated_session.sp_name || t('inherited_proofing.info.no_sp_name')) %> | ||
| </p> | ||
| <h2><%= t('inherited_proofing.instructions.welcome') %></h2> | ||
|
|
||
| <%= render ProcessListComponent.new(heading_level: :h3, class: 'margin-y-3') do |c| %> | ||
| <%= c.item(heading: t('inherited_proofing.instructions.bullet1')) %> | ||
| <% end %> | ||
|
|
||
| <%= simple_form_for :inherited_proofing, | ||
| url: url_for, | ||
| method: 'put', | ||
| html: { autocomplete: 'off', class: 'margin-y-5 js-consent-continue-form' } do |f| %> | ||
| <%= f.button :button, | ||
| t('inherited_proofing.buttons.continue'), | ||
| type: :submit, | ||
| class: 'usa-button--big usa-button--wide' %> | ||
| <% end %> | ||
|
|
||
| <h3><%= t('inherited_proofing.instructions.privacy') %></h3> | ||
| <p> | ||
| <%= t( | ||
| 'inherited_proofing.info.privacy_html', | ||
| app_name: APP_NAME, | ||
| link: new_window_link_to( | ||
| t('inherited_proofing.instructions.learn_more'), | ||
| MarketingSite.security_and_privacy_practices_url, | ||
| ), | ||
| ) %> | ||
| </p> | ||
| <% 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,17 @@ | ||
| --- | ||
|
gangelo marked this conversation as resolved.
|
||
| en: | ||
| inherited_proofing: | ||
| buttons: | ||
| continue: Continue | ||
| headings: | ||
| welcome: Get started verifying your identity | ||
| info: | ||
| no_sp_name: The agency that you are trying to access | ||
| privacy_html: '%{app_name} is a secure, government website that adheres to the highest standards in data | ||
| protection. We only use your data to verify your identity. %{link} about our privacy and security measures.' | ||
| welcome_html: '%{sp_name} needs to make sure you are you — not someone pretending to be you.' | ||
| instructions: | ||
| bullet1: A phone number on a phone plan associated with your name | ||
| learn_more: Learn more | ||
| privacy: Our privacy and security standards | ||
| welcome: 'To verify your identity, you will need:' | ||
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
47 changes: 47 additions & 0 deletions
47
spec/controllers/idv/inherited_proofing_controller_spec.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,47 @@ | ||
| require 'rails_helper' | ||
|
|
||
| describe Idv::InheritedProofingController do | ||
| describe '#index' do | ||
| it 'redirects to the first step' do | ||
| get :index | ||
|
|
||
| expect(response).to redirect_to idv_inherited_proofing_step_url(step: :get_started) | ||
| end | ||
| end | ||
|
|
||
| describe '#show' do | ||
| it 'renders the correct template' do | ||
| expect(subject).to receive(:render).with( | ||
| template: 'layouts/flow_step', | ||
| locals: hash_including( | ||
| :flow_session, | ||
| flow_namespace: 'idv', | ||
| step_template: 'idv/inherited_proofing/get_started', | ||
| step_indicator: hash_including( | ||
| :steps, | ||
| current_step: :getting_started, | ||
| ), | ||
| ), | ||
| ).and_call_original | ||
|
|
||
| get :show, params: { step: 'get_started' } | ||
| end | ||
|
|
||
| it 'redirects to the configured next step' do | ||
| mock_next_step(:some_next_step) | ||
| get :show, params: { step: 'getting_started' } | ||
|
|
||
| expect(response).to redirect_to idv_inherited_proofing_step_url(:some_next_step) | ||
| end | ||
|
|
||
| it 'redirects to the first step if a non-existent step is given' do | ||
| get :show, params: { step: 'non_existent_step' } | ||
|
|
||
| expect(response).to redirect_to idv_inherited_proofing_step_url(step: :get_started) | ||
| end | ||
| end | ||
|
|
||
| def mock_next_step(step) | ||
| allow_any_instance_of(Idv::Flows::InheritedProofingFlow).to receive(:next_step).and_return(step) | ||
| end | ||
| end |
20 changes: 20 additions & 0 deletions
20
spec/views/idv/inherited_proofing/get_started.html.erb_spec.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,20 @@ | ||
| require 'rails_helper' | ||
|
|
||
| describe 'idv/inherited_proofing/get_started.html.erb' do | ||
| let(:flow_session) { {} } | ||
| let(:sp_name) { nil } | ||
|
|
||
| before do | ||
| @decorated_session = instance_double(ServiceProviderSessionDecorator) | ||
| allow(@decorated_session).to receive(:sp_name).and_return(sp_name) | ||
| allow(view).to receive(:decorated_session).and_return(@decorated_session) | ||
| allow(view).to receive(:flow_session).and_return(flow_session) | ||
| allow(view).to receive(:url_for).and_return('https://www.example.com/') | ||
| end | ||
|
|
||
| it 'renders the Continue button' do | ||
| render template: 'idv/inherited_proofing/get_started' | ||
|
|
||
| expect(rendered).to have_button(t('inherited_proofing.buttons.continue')) | ||
| end | ||
| end |
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.
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.
I suggest using the
submithelper here, which bakes in the standard conventions of a submit button: