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
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ group :test do
gem 'rails-controller-testing', '>= 1.0.4'
gem 'rspec-retry'
gem 'shoulda-matchers', '~> 4.0', require: false
gem 'webdrivers', '~> 4.0'
gem 'webdrivers', '~> 5.2.0'
gem 'webmock'
gem 'zonebie'
end
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -692,10 +692,10 @@ GEM
openssl (~> 2.2)
safety_net_attestation (~> 0.4.0)
tpm-key_attestation (~> 0.10.0)
webdrivers (4.7.0)
webdrivers (5.2.0)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (> 3.141, < 5.0)
selenium-webdriver (~> 4.0)
webmock (3.14.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
Expand Down Expand Up @@ -830,7 +830,7 @@ DEPENDENCIES
valid_email (>= 0.1.3)
view_component (~> 2.51.0)
webauthn (~> 2.1)
webdrivers (~> 4.0)
webdrivers (~> 5.2.0)
webmock
xmldsig (~> 0.6)
xmlenc (~> 0.7, >= 0.7.1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@
margin-bottom: 0;
}

&::before {
&.troubleshooting-options--divider::before {
@include u-margin-bottom(4);
background-color: color('secondary');
content: '';
display: block;
height: 4px;
width: 5rem;
}

& + &::before {
content: none;
}
}

.troubleshooting-options__heading {
Expand Down
4 changes: 1 addition & 3 deletions app/controllers/account_reset/pending_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ def confirm; end

def cancel
analytics.pending_account_reset_cancelled
irs_attempts_api_tracker.account_reset_cancel_request(
success: true,
)
irs_attempts_api_tracker.account_reset_cancel_request
AccountReset::CancelRequestForUser.new(current_user).call
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/idv/gpo_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def step_indicator_current_step

def update_tracking
analytics.idv_gpo_address_letter_requested(resend: resend_requested?)
irs_attempts_api_tracker.idv_gpo_letter_requested(success: true, resend: resend_requested?)
irs_attempts_api_tracker.idv_gpo_letter_requested(resend: resend_requested?)
create_user_event(:gpo_mail_sent, current_user)

ProofingComponent.create_or_find_by(user: current_user).update(address_check: 'gpo_letter')
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/idv/personal_key_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def personal_key

def generate_personal_key
cacher = Pii::Cacher.new(current_user, user_session)
irs_attempts_api_tracker.idv_personal_key_generated(success: true)
irs_attempts_api_tracker.idv_personal_key_generated
idv_session.profile.encrypt_recovery_pii(cacher.fetch)
end

Expand Down
1 change: 0 additions & 1 deletion app/controllers/sign_up/email_confirmations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def clear_setup_piv_cac_from_sign_in
def process_successful_confirmation
process_valid_confirmation_token
request_id = params.fetch(:_request_id, '')
Funnel::Registration::ConfirmEmail.call(@user.id)
redirect_to sign_up_enter_password_url(
request_id: request_id, confirmation_token: @confirmation_token,
)
Expand Down
1 change: 0 additions & 1 deletion app/controllers/sign_up/passwords_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def process_successful_password_creation
).call
@user.email_addresses.take.update(confirmed_at: now)

Funnel::Registration::AddPassword.call(@user.id)
sign_in_and_redirect_user
end

Expand Down
4 changes: 4 additions & 0 deletions app/forms/edit_phone_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ def default_phone_configuration?
phone_configuration == user.default_phone_configuration
end

def one_phone_configured?
user.phone_configurations.count == 1
end

private

attr_writer :delivery_preference, :make_default_number
Expand Down
1 change: 0 additions & 1 deletion app/forms/register_user_email_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ def process_successful_submission(request_id, instructions)
self.success = true
user.accepted_terms_at = Time.zone.now
user.save!
Funnel::Registration::Create.call(user.id)
SendSignUpEmailConfirmation.new(user).call(
request_id: email_request_id(request_id),
instructions: instructions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,24 @@ describe('TroubleshootingOptions', () => {
const tag = getByText('components.troubleshooting_options.new_feature');
expect(tag.classList.contains('text-uppercase')).to.eq(true);
});

it('renders with expected classes', () => {
const { container } = render(<TroubleshootingOptions {...DEFAULT_PROPS} />);

const element = container.firstElementChild!;

expect(element.classList.contains('troubleshooting-options')).to.be.true();
expect(element.classList.contains('troubleshooting-options--divider')).to.be.true();
});

context('with divider disabled', () => {
it('renders with expected classes', () => {
const { container } = render(<TroubleshootingOptions {...DEFAULT_PROPS} divider={false} />);

const element = container.firstElementChild!;

expect(element.classList.contains('troubleshooting-options')).to.be.true();
expect(element.classList.contains('troubleshooting-options--divider')).to.be.false();
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,30 @@ interface TroubleshootingOptionsProps {
options: TroubleshootingOption[];

isNewFeatures?: boolean;

divider?: boolean;
}

function TroubleshootingOptions({
headingTag = 'h2',
heading,
options,
isNewFeatures,
divider = true,
}: TroubleshootingOptionsProps) {
const { t } = useI18n();

if (!options.length) {
return null;
}

const classes = ['troubleshooting-options', divider && 'troubleshooting-options--divider']
.filter(Boolean)
.join(' ');
const HeadingTag = headingTag;

return (
<section className="troubleshooting-options">
<section className={classes}>
{isNewFeatures && (
<span className="usa-tag bg-accent-cool-darker text-uppercase display-inline-block">
{t('components.troubleshooting_options.new_feature')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ function DocumentCaptureTroubleshootingOptions({
heading={formatHTML(t('idv.troubleshooting.headings.are_you_near'), {
wbr: 'wbr',
})}
divider={false}
options={[
{
url: '#location',
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/reports/deleted_user_accounts_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def perform(_date)
issuers = report_hash['issuers']
report = deleted_user_accounts_data_for_issuers(issuers)
emails.each do |email|
UserMailer.deleted_user_accounts_report(
ReportMailer.deleted_user_accounts_report(
email: email,
name: name,
issuers: issuers,
Expand Down
15 changes: 0 additions & 15 deletions app/jobs/reports/query_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,5 @@ def quote(value)
ActiveRecord::Base.connection.quote(value)
end
end

# Wrapper around PG::Result#stream_each, runs a query and yields each row to the block
# as it is returned from the DB
# @param [String] SQL query
# @yieldparam [Hash] row
def stream_query(query)
ActiveRecord::Base.logger.debug(query) # using send_query skips ActiveRecord logging
connection = ActiveRecord::Base.connection.raw_connection
connection.send_query(query)
connection.set_single_row_mode
connection.get_result.stream_each do |row|
yield row
end
connection.get_result
end
end
end
17 changes: 17 additions & 0 deletions app/mailers/report_mailer.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class ReportMailer < ActionMailer::Base
include Mailable

before_action :attach_images

def sps_over_quota_limit(email)
mail(to: email, subject: t('report_mailer.sps_over_quota_limit.subject'))
end

def deleted_user_accounts_report(email:, name:, issuers:, data:)
@name = name
@issuers = issuers
@data = data
attachments['deleted_user_accounts.csv'] = data
mail(to: email, subject: t('report_mailer.deleted_accounts_report.subject'))
end
end
12 changes: 0 additions & 12 deletions app/mailers/user_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -197,18 +197,6 @@ def add_email_associated_with_another_account(email)
mail(to: email, subject: t('mailer.email_reuse_notice.subject'))
end

def sps_over_quota_limit(email)
mail(to: email, subject: t('user_mailer.sps_over_quota_limit.subject'))
end

def deleted_user_accounts_report(email:, name:, issuers:, data:)
@name = name
@issuers = issuers
@data = data
attachments['deleted_user_accounts.csv'] = data
mail(to: email, subject: t('user_mailer.deleted_accounts_report.subject'))
end

def account_verified(user, email_address, date_time:, sp_name:, disavowal_token:)
return unless email_should_receive_nonessential_notifications?(email_address.email)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,19 @@ def call(issuer:, iaa:, iaa_start_date:, iaa_end_date:)

with_retries(
max_tries: 3,
rescue: [PG::TRSerializationFailure, PG::UnableToSend],
rescue: [
ActiveRecord::SerializationFailure,
PG::ConnectionBad,
PG::TRSerializationFailure,
PG::UnableToSend,
],
handler: proc do
ial_to_year_month_to_users = temp_copy
ActiveRecord::Base.connection.reconnect!
end,
) do
Reports::BaseReport.transaction_with_timeout do
stream_query(query) do |row|
ActiveRecord::Base.connection.execute(query).each do |row|
user_id = row['user_id']
year_month = row['year_month']
auth_count = row['auth_count']
Expand Down Expand Up @@ -116,10 +121,6 @@ def build_queries(issuer:, months:)
SQL
end
end

def default_call
yield
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,19 @@ def call(key:, issuers:, start_date:, end_date:)

with_retries(
max_tries: 3,
rescue: [PG::TRSerializationFailure, PG::UnableToSend],
rescue: [
ActiveRecord::SerializationFailure,
PG::ConnectionBad,
PG::TRSerializationFailure,
PG::UnableToSend,
],
handler: proc do
ial_to_year_month_to_users = temp_copy
ActiveRecord::Base.connection.reconnect!
end,
) do
Reports::BaseReport.transaction_with_timeout do
stream_query(query) do |row|
ActiveRecord::Base.connection.execute(query).each do |row|
user_id = row['user_id']
year_month = row['year_month']
auth_count = row['auth_count']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def self.call
return unless Db::ServiceProviderQuotaLimit::AnySpOverQuotaLimit.call
email_list = IdentityConfig.store.sps_over_quota_limit_notify_email_list
email_list.each do |email|
UserMailer.sps_over_quota_limit(email).deliver_now_or_later
ReportMailer.sps_over_quota_limit(email).deliver_now_or_later
end
end
end
Expand Down
20 changes: 4 additions & 16 deletions app/services/funnel/registration/add_mfa.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,11 @@ module Registration
class AddMfa
def self.call(user_id, mfa_method, analytics)
now = Time.zone.now
funnel = RegistrationLog.find_by(user_id: user_id)
return if funnel.blank? || funnel.second_mfa.present?
funnel = RegistrationLog.where(user_id: user_id).first_or_create(submitted_at: now)
return if funnel.registered_at.present?

if funnel.first_mfa.present?
params = {
second_mfa: mfa_method,
}
else
params = {
first_mfa: mfa_method,
first_mfa_at: now,
registered_at: now,
}
analytics.user_registration_user_fully_registered(mfa_method: mfa_method)
end

funnel.update!(params)
analytics.user_registration_user_fully_registered(mfa_method: mfa_method)
funnel.update!(registered_at: now)
end
end
end
Expand Down
11 changes: 0 additions & 11 deletions app/services/funnel/registration/add_password.rb

This file was deleted.

11 changes: 0 additions & 11 deletions app/services/funnel/registration/confirm_email.rb

This file was deleted.

11 changes: 0 additions & 11 deletions app/services/funnel/registration/create.rb

This file was deleted.

9 changes: 0 additions & 9 deletions app/services/funnel/registration/range_submitted_count.rb

This file was deleted.

9 changes: 0 additions & 9 deletions app/services/funnel/registration/total_submitted_count.rb

This file was deleted.

Loading