-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6430 from 18F/stages/rc-2022-06-02
Deploy RC 193 to Production
- Loading branch information
Showing
215 changed files
with
2,843 additions
and
1,037 deletions.
There are no files selected for viewing
This file contains 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 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 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,28 @@ | ||
<noscript> | ||
<%= render StatusPageComponent.new(status: :error) do |c| %> | ||
<% c.header { header } %> | ||
|
||
<% if intro %> | ||
<p><%= intro %></p> | ||
<% end %> | ||
|
||
<p><%= t('components.javascript_required.browser_instructions') %></p> | ||
|
||
<ul class="usa-list"> | ||
<% browser_resources.each do |resource| %> | ||
<li><%= new_window_link_to resource[:name], resource[:url] %></li> | ||
<% end %> | ||
</ul> | ||
|
||
<p><strong><%= t('components.javascript_required.next_step') %></strong></p> | ||
<% end %> | ||
<link rel="stylesheet" href="<%= no_js_detect_css_path %>"> | ||
</noscript> | ||
<div class="js"> | ||
<% if was_no_js? %> | ||
<%= render AlertComponent.new(type: :success, class: 'margin-bottom-4') do %> | ||
<%= t('components.javascript_required.enabled_alert') %> | ||
<% end %> | ||
<% end %> | ||
<%= content %> | ||
</div> |
This file contains 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,25 @@ | ||
class JavascriptRequiredComponent < BaseComponent | ||
include LinkHelper | ||
|
||
attr_reader :header, :intro | ||
|
||
BROWSER_RESOURCES = [ | ||
{ name: 'Google Chrome', url: 'https://support.google.com' }, | ||
{ name: 'Mozilla Firefox', url: 'https://support.mozilla.org/en-US' }, | ||
{ name: 'Microsoft Edge', url: 'https://support.microsoft.com/en-us/microsoft-edge' }, | ||
{ name: 'Apple Safari', url: 'https://support.apple.com/safari' }, | ||
].to_set.freeze | ||
|
||
def initialize(header:, intro: nil) | ||
@header = header | ||
@intro = intro | ||
end | ||
|
||
def browser_resources | ||
BROWSER_RESOURCES | ||
end | ||
|
||
def was_no_js? | ||
session.delete(NoJsController::SESSION_KEY) == true | ||
end | ||
end |
This file contains 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 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 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 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 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 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 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 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 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 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 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 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 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 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,8 @@ | ||
class NoJsController < ApplicationController | ||
SESSION_KEY = :no_js_css | ||
|
||
def index | ||
session[SESSION_KEY] = true | ||
render body: '', content_type: 'text/css' | ||
end | ||
end |
This file contains 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 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 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 |
---|---|---|
@@ -1,21 +1,67 @@ | ||
module SignUp | ||
class CancellationsController < ApplicationController | ||
before_action :find_user | ||
before_action :ensure_in_setup | ||
before_action :ensure_valid_confirmation_token | ||
|
||
def new | ||
properties = ParseControllerFromReferer.new(request.referer).call | ||
analytics.track_event(Analytics::USER_REGISTRATION_CANCELLATION, properties) | ||
@presenter = CancellationPresenter.new(referer: request.referer, url_options: url_options) | ||
end | ||
|
||
def destroy | ||
track_account_deletion_event | ||
url_after_cancellation = decorated_session.cancel_link_url | ||
destroy_user | ||
flash[:success] = t('sign_up.cancel.success') | ||
redirect_to url_after_cancellation | ||
end | ||
|
||
private | ||
|
||
def track_account_deletion_event | ||
properties = ParseControllerFromReferer.new(request.referer).call | ||
analytics.account_deletion(**properties) | ||
end | ||
|
||
def destroy_user | ||
@user&.destroy! | ||
sign_out if @user | ||
end | ||
|
||
def find_user | ||
@user = current_user | ||
return if current_user | ||
|
||
confirmation_token = session[:user_confirmation_token] | ||
email_address = EmailAddress.find_with_confirmation_token(confirmation_token) | ||
@token_validator = EmailConfirmationTokenValidator.new(email_address, current_user) | ||
result = @token_validator.submit | ||
|
||
if result.success? | ||
@user = email_address.user | ||
else | ||
@user = nil | ||
end | ||
end | ||
|
||
def ensure_in_setup | ||
redirect_to root_url if !session[:user_confirmation_token] && two_factor_enabled | ||
redirect_to root_url if @user && MfaPolicy.new(@user).two_factor_enabled? | ||
end | ||
|
||
def ensure_valid_confirmation_token | ||
return if @user | ||
flash[:error] = error_message(@token_validator) | ||
redirect_to sign_up_email_resend_url(request_id: params[:_request_id]) | ||
end | ||
|
||
def two_factor_enabled | ||
current_user && MfaPolicy.new(current_user).two_factor_enabled? | ||
def error_message(token_validator) | ||
if token_validator.confirmation_period_expired? | ||
t('errors.messages.confirmation_period_expired') | ||
else | ||
t('errors.messages.confirmation_invalid_token') | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.