Skip to content

LG-7446 Create "Cancel" Links and Supporting Cancellation Code for Identity Proofing Process (1 of n)#7124

Merged
gangelo merged 5 commits intomainfrom
lg-7446-create-cancel-links
Oct 13, 2022
Merged

LG-7446 Create "Cancel" Links and Supporting Cancellation Code for Identity Proofing Process (1 of n)#7124
gangelo merged 5 commits intomainfrom
lg-7446-create-cancel-links

Conversation

@gangelo
Copy link
Contributor

@gangelo gangelo commented Oct 11, 2022

See also Pr LG-7446 Create "Cancel" Links and Supporting Cancellation Code for Identity Proofing Process (2 of n)

Provides for cancellation functionality from within the Inherited Proofing (IP) process.

An IP cancellations controller is needed to handle the IP cancellation process, as the current IDV CancellationsController is bound to IDV-specific code that would make it very difficult to benefit from its use via inheritance.

The IP cancellation process needs to behave like the current IDV cancellation process, both from a UI/user experience and programmatic standpoint (session reset/cleanup, etc. NOTE: The latter should occur automatically as a byproduct of using the current IDV cancellation controller. Although care should be taken if any refactoring/deviation from the current cancellation process takes place, that the session reset/cleanup is handled appropriately.

🎫 Ticket

LG-7446

🛠 Summary of changes

NOTE: This is feature branch 1 of what most likely be (at most) several feature branches.

In this feature branch:

  • Create a skeleton InheritedProofingCancellationsController needed to handle the Inherited Proofing (IP) cancellation process (action implementation details and specs to be added on subsequent feature branch(es)).
  • Create views for the aforementioned controller.
  • Create i18n .yml files for aforementioned views.
  • Create routes for aforementioned controller actions.
  • Create concern to satisfy Brakeman gem "Render path contains parameter value" violations.

In subsequent feature branch(es):

  • Complete actions for InheritedProofingCancellationsController controller.
  • Complete specs for the aforementioned controller.
  • Create "Cancel" links on appropriate views to implement cancellation logic.
  • Complete specs for InheritedProofingCancellationsController.
  • (Potentially) Create/implement InheritedProofingSessionsController. to handle "Start Over" cancellation action (see app/views/idv/inherited_proofing_cancellations/new.html.erb:12) and associated specs.

📜 Testing Plan

Provide a checklist of steps to confirm the changes.

  • Automated tests (in subsequent feature branch).
  • Manual testing via Sinatra app (when feature branches completed).

👀 Screenshots

TODO: Add screenshots of "Cancel" links in relevant views - this will be added in subsequent feature branches.

🚀 Notes for Deployment

Feature Flipper IdentityConfig.store.inherited_proofing_enabled needs to be turned on in the relevant environment order to access the greater IP process.

@gangelo gangelo self-assigned this Oct 11, 2022
@gangelo gangelo force-pushed the lg-7446-create-cancel-links branch 5 times, most recently from 853dca3 to 6f46d46 Compare October 12, 2022 14:23
@gangelo gangelo changed the title LG-7446 Create "Cancel" Links for Identity Proofing Process LG-7446 Create "Cancel" Links for Identity Proofing Process (1 of n) Oct 12, 2022
@gangelo gangelo changed the title LG-7446 Create "Cancel" Links for Identity Proofing Process (1 of n) LG-7446 Create "Cancel" Links and Supporting Cancellation Code for Identity Proofing Process (1 of n) Oct 12, 2022
@gangelo gangelo added the inherited proofing Pull Requests for the Inherited Proofing feature label Oct 12, 2022
@gangelo gangelo marked this pull request as ready for review October 12, 2022 15:44
@gangelo gangelo requested a review from jmhooper October 12, 2022 15:45
@gangelo gangelo force-pushed the lg-7446-create-cancel-links branch 2 times, most recently from 8c8f6ad to a8c4e45 Compare October 12, 2022 16:16
@gangelo gangelo force-pushed the lg-7446-create-cancel-links branch 2 times, most recently from 6b570c1 to 108db88 Compare October 12, 2022 21:29
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest renaming this to AllowlistedFlowStepConcern as a more inclusive name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do. I assume you meant AllowWhitelistedFlowStepConcern

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that @mitchellhenke was accurate in suggesting AllowlistedFlowStepConcern, since there's a preference to avoid the term "whitelist" in favor of "allowlist" in the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, I'll change that in the next branch.

@gangelo gangelo force-pushed the lg-7446-create-cancel-links branch from 108db88 to db117cb Compare October 13, 2022 12:03
The IdentityConfig.store.inherited_proofing_enabled returns false in
preparation for use in the Inherited Proofing (IP) cancellations controller
that needs to be created. Eventually, this code may get thrown away
once IP goes live; however, this makes for less lines of code that
need to be removed once/if it does.

changelog: Improvements, Upcoming Features, LG-7446 Create Inherited Proofing Cancellation Links and Process
Specs to be added in subsequent PR when controller actions
are fleshed out.
Specifically, the "Render path contains parameter value" violation.

This commit whitelists the flow steps expected and raises an error
if params[:step] is not found in the whitelist.

Confidence: Weak
Category: Dynamic Render Path
Check: Render
Message: Render path contains parameter value
Code: render(action => ButtonComponent.new(:action =>
  (lambda do  button_to(idv_inherited_proofing_cancel_path(:step => params[:step]),
  { **tag_options }, &block)  end), :method => :put, :big => true, :wide => true,
  :outline => true).with_content(t("inherited_proofing.cancel.actions.keep_going")), {})
File: app/views/idv/inherited_proofing_cancellations/new.html.erb
Line: 23

Confidence: Weak
Category: Dynamic Render Path
Check: Render
Message: Render path contains parameter value
Code: render(action => SpinnerButtonComponent.new(:action =>
  (lambda do  button_to(idv_inherited_proofing_cancel_path(:step => params[:step],
  :location => "cancel"), { **tag_options }, &block)  end), :method => :delete,
  :big => true, :wide => true, :outline => true,
  :form => ({ :data => ({ :form_steps_wait => "" }) }))
  .with_content(CancellationsPresenter.new(:sp_name =>
  decorated_session.sp_name, :url_options => url_options).exit_action_text), {})
File: app/views/idv/inherited_proofing_cancellations/new.html.erb
Line: 44
@gangelo gangelo merged commit bd50e63 into main Oct 13, 2022
@gangelo gangelo deleted the lg-7446-create-cancel-links branch October 13, 2022 14:26
<% c.header { t('inherited_proofing.cancel.headings.confirmation.hybrid') } %>

<p><%= t('inherited_proofing.cancel.instructions.switch_back') %></p>
<%= image_tag(asset_url('inherited_proofing/switch.png'), width: 193, alt: t('inherited_proofing.cancel.instructions.switch_back_image')) %>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a second copy of this image, or could we have used the existing idv/switch.png ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I didn't see this, looking back on it. Yea, was trying to make a clear distinction because there were no figma's for these yet; hindsight, that's probably more reason to reuse it.

@@ -0,0 +1,55 @@
<% title t('titles.inherited_proofing.cancellation_prompt') %>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it have been possible to reuse the same cancellation screen as in IdV, rather than creating a copy? I worry about keeping these in sync.

@mdiarra3 mdiarra3 mentioned this pull request Oct 17, 2022
mdiarra3 added a commit that referenced this pull request Oct 17, 2022
* LG-7446 Create "Cancel" Links and Supporting Cancellation Code for Identity Proofing Process (1 of n) (#7124)

* Create concern to render 404 if

The IdentityConfig.store.inherited_proofing_enabled returns false in
preparation for use in the Inherited Proofing (IP) cancellations controller
that needs to be created. Eventually, this code may get thrown away
once IP goes live; however, this makes for less lines of code that
need to be removed once/if it does.

changelog: Improvements, Upcoming Features, LG-7446 Create Inherited Proofing Cancellation Links and Process

* Add skeleton InheritedProofingCancellationsController

Specs to be added in subsequent PR when controller actions
are fleshed out.

* Add InheritedProofingCancellationsController views and i18n

* Add routes for InheritedProofingCancellationsController actions

* Satisfy Brakeman violations

Specifically, the "Render path contains parameter value" violation.

This commit whitelists the flow steps expected and raises an error
if params[:step] is not found in the whitelist.

Confidence: Weak
Category: Dynamic Render Path
Check: Render
Message: Render path contains parameter value
Code: render(action => ButtonComponent.new(:action =>
  (lambda do  button_to(idv_inherited_proofing_cancel_path(:step => params[:step]),
  { **tag_options }, &block)  end), :method => :put, :big => true, :wide => true,
  :outline => true).with_content(t("inherited_proofing.cancel.actions.keep_going")), {})
File: app/views/idv/inherited_proofing_cancellations/new.html.erb
Line: 23

Confidence: Weak
Category: Dynamic Render Path
Check: Render
Message: Render path contains parameter value
Code: render(action => SpinnerButtonComponent.new(:action =>
  (lambda do  button_to(idv_inherited_proofing_cancel_path(:step => params[:step],
  :location => "cancel"), { **tag_options }, &block)  end), :method => :delete,
  :big => true, :wide => true, :outline => true,
  :form => ({ :data => ({ :form_steps_wait => "" }) }))
  .with_content(CancellationsPresenter.new(:sp_name =>
  decorated_session.sp_name, :url_options => url_options).exit_action_text), {})
File: app/views/idv/inherited_proofing_cancellations/new.html.erb
Line: 44

* Remove unused analytics events (#7142)

changelog: Internal, Analytics, Remove unused analytics events

* Remove JavaScript optimization from asset pipeline (#7136)

changelog: Internal, Build Tooling, Remove redundant JavaScript optimization step

* Remove unused support for proc methods in frontend logger (#7143)

changelog: Internal, Analytics, Remove unused feature support in frontend logger

Last usages removed in #7110

* Ensure all UserMailer emails do not use plaintext emails as parameters (#7106)

* Ensure all UserMailer emails have matching User and EmailAddress parameters and plaintext emails are not used as parameters

changelog: Internal, Email, Ensure all UserMailer emails have matching User and EmailAddress parameters and plaintext emails are not used as parameters

Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>

* fix mailer previews

Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>

* Prepare to drop unused registration_logs columns (LG-6317) (#7131)

- Make registration_logs.submitted_at nullable, stop writing it
- Ignore other columns

changelog: Internal, Logging, Stop writing extra registration_logs timestamps

* LG-7251 Update SAML SP request flow to POST internally instead of GET (#6894)

* Update SAML SP request flow to POST internally instead of GET

* Add route for internal SAML auth POST requests

* changelog: Improvements, Service Provider Authentication, Update SAML Authentication Flow

* Add feature flag for SAML internal POST update, tests for the flag

* Allow longer wait delay for in-person feature specs (#7145)

**Why**: Clicking "Continue" from the "prepare" step will wait for a client-side logging event before continuing to the "State ID" step, which often cannot complete before the 0.5 second tolerance allowed by default in local development environments.

changelog: Internal, Automated Testing, Improve reliability of feature specs

* LG-7702: record the issuer of the SP requesting idv in the profile. (#7125)

* LG-7702: record the issuer of the SP requesting idv in the profile.

changelog: Internal, Identity Verification, Track the agency requesting identity verification.

* record the initiating sp as an association
* use the issuer as the foreign key

* changelog: Improvements, In-Person Proofing, updates translations in french and spanish (#7139)

* LG-7446 Create "Cancel" Links and Supporting Cancellation Code for Identity Proofing Process (2 of n) (#7144)

* Segregate Inherited Proofing routes

changelog: Improvements, Upcoming Features, LG-7446 Create Inherited Proofing Cancellation Links and Process

* Rename concern to avoid whitelist in naming

- Flow step whitelist should be compared as strings
so this was changed as well.
- ...not Symbols, because they will be compared against
params[:step] which will be a String value.
- Remove unnecessary code

* Add InheritedProofingCancellationsController specs

Co-authored-by: Gene M. Angelo, Jr <web.gma@gmail.com>
Co-authored-by: Andrew Duthie <andrew.duthie@gsa.gov>
Co-authored-by: Mitchell Henke <mitchell.henke@gsa.gov>
Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>
Co-authored-by: Julia Allen <51330839+julialeague@users.noreply.github.com>
Co-authored-by: Doug Price <douglas.price@gsa.gov>
Co-authored-by: Matt Gardner <wilburnforce@gmail.com>
This was referenced Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inherited proofing Pull Requests for the Inherited Proofing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants