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
19 changes: 19 additions & 0 deletions app/services/maintenance_window.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
class MaintenanceWindow
attr_reader :start, :finish, :now

def initialize(start:, finish:, now: nil, display_time_zone: 'America/New_York')
@start = parse(start, display_time_zone: display_time_zone)
@finish = parse(finish, display_time_zone: display_time_zone)
@now = now || Time.zone.now
end

def active?
(start...finish).cover?(now) if start && finish
end

private

def parse(time_str, display_time_zone:)
Time.zone.parse(time_str).in_time_zone(display_time_zone) if time_str.present?
end
end
2 changes: 2 additions & 0 deletions app/views/devise/sessions/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<% title t('titles.visitors.index') %>
<% request_id = params[:request_id] || sp_session[:request_id] %>

<%= render 'shared/maintenance_window_alert' %>

<% if decorated_session.sp_name %>
<div class='center'>
<%= image_tag(asset_url('user-access.svg'), width: '280', alt: '') %>
Expand Down
45 changes: 23 additions & 22 deletions app/views/idv/cac/choose_method.html.erb
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
<h1 class="h3 mt0 mb1"><%= t('cac_proofing.headings.choose_method') %></h1>
<%= t('cac_proofing.info.choose_method') %>
<hr/>
<br/>
<%= image_tag asset_url('dod-logo.jpg'), height: 150 %>
<br/>
<%= simple_form_for :cac,
url: url_for,
method: 'put',
html: { autocomplete: 'off', role: 'form', class: 'mt2' } do |f| %>
<button class="btn btn-primary" type="submit"><%= t('cac_proofing.buttons.use_cac') %></button>
<%= render 'shared/maintenance_window_alert' do %>
<h1 class="h3 mt0 mb1"><%= t('cac_proofing.headings.choose_method') %></h1>
Comment on lines +1 to +2
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this is just indenting & wrapping in a block (recommend that you hide whitespace for this diff)

<%= t('cac_proofing.info.choose_method') %>
<hr/>
<br/>
<%= image_tag asset_url('dod-logo.jpg'), height: 150 %>
<br/>
<%= simple_form_for :cac,
url: url_for,
method: 'put',
html: { autocomplete: 'off', role: 'form', class: 'mt2' } do |f| %>
<button class="btn btn-primary" type="submit"><%= t('cac_proofing.buttons.use_cac') %></button>
<% end %>
<br/>
<br/>
<hr/>
<%= image_tag asset_url('state-id-confirm@3x.png'), height: 150 %>
<br/>
<br/>
<%= link_to t('cac_proofing.buttons.use_doc_auth'), idv_doc_auth_path, class: 'btn btn-primary' %>
<br/>
<br/>
<div class="mt2 pt1 border-top"><%= link_to t('links.cancel'), idv_cancel_path %></div>
<% end %>
<br/>
<br/>
<hr/>
<%= image_tag asset_url('state-id-confirm@3x.png'), height: 150 %>
<br/>
<br/>
<%= link_to t('cac_proofing.buttons.use_doc_auth'), idv_doc_auth_path, class: 'btn btn-primary' %>
<br/>
<br/>
<div class="mt2 pt1 border-top"><%= link_to t('links.cancel'), idv_cancel_path %></div>

188 changes: 95 additions & 93 deletions app/views/idv/doc_auth/welcome.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,113 +3,115 @@
<div class='alert alert-error'><%= flow_session[:error_message] %></div>
<% end %>

<h1 class='h3 my0'><%= t('doc_auth.headings.welcome') %></h1>
<p class='mt-tiny mb3'><%= t('doc_auth.info.welcome') %></p>
<h1 class='h3 mb2'><%= t('doc_auth.instructions.welcome') %></h1>
<%= render 'shared/maintenance_window_alert' do %>
<h1 class='h3 my0'><%= t('doc_auth.headings.welcome') %></h1>
Comment on lines +6 to +7
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ditto, this is just indenting & wrapping in a block (recommend that you hide whitespace for this diff)

<p class='mt-tiny mb3'><%= t('doc_auth.info.welcome') %></p>
<h1 class='h3 mb2'><%= t('doc_auth.instructions.welcome') %></h1>

<ul class='list-reset'>
<li class='pt2 pb1'>
<div class='inline-block mr2 mt1 align-top circle circle-number bg-blue white'>
<%= step += 1 %>
</div>
<div class='mr1 inline-block'>
<div class='h1 inline-block bold'>
<%= t('doc_auth.instructions.bullet1') %>
<ul class='list-reset'>
<li class='pt2 pb1'>
<div class='inline-block mr2 mt1 align-top circle circle-number bg-blue white'>
<%= step += 1 %>
</div>
<br/>
<div>
<%= t('doc_auth.instructions.text1') %>
<div class='mr1 inline-block'>
<div class='h1 inline-block bold'>
<%= t('doc_auth.instructions.bullet1') %>
</div>
<br/>
<div>
<%= t('doc_auth.instructions.text1') %>
</div>
</div>
</div>
</li>
<% if liveness_checking_enabled? %>
<li class='pt2 pb1'>
<div class='inline-block mr2 mt1 align-top circle circle-number bg-blue white'>
<%= step += 1 %>
</div>
<div class='mr1 inline-block'>
<div class='h1 inline-block bold'>
<%= t('doc_auth.instructions.bullet1a') %>
</li>
<% if liveness_checking_enabled? %>
<li class='pt2 pb1'>
<div class='inline-block mr2 mt1 align-top circle circle-number bg-blue white'>
<%= step += 1 %>
</div>
<br/>
<div>
<%= t('doc_auth.instructions.text1a') %>
<div class='mr1 inline-block'>
<div class='h1 inline-block bold'>
<%= t('doc_auth.instructions.bullet1a') %>
</div>
<br/>
<div>
<%= t('doc_auth.instructions.text1a') %>
</div>
</div>
</div>
</li>
<% end %>
<li class='pt2 pb1'>
<div class='inline-block mr2 mt1 align-top circle circle-number bg-blue white'>
<%= step += 1 %>
</div>
<div class='mr1 inline-block'>
<div class='h1 inline-block bold'>
<%= t('doc_auth.instructions.bullet2') %>
</li>
<% end %>
<li class='pt2 pb1'>
<div class='inline-block mr2 mt1 align-top circle circle-number bg-blue white'>
<%= step += 1 %>
</div>
<br/>
<div>
<%= t('doc_auth.instructions.text2') %>
<div class='mr1 inline-block'>
<div class='h1 inline-block bold'>
<%= t('doc_auth.instructions.bullet2') %>
</div>
<br/>
<div>
<%= t('doc_auth.instructions.text2') %>
</div>
</div>
</div>
</li>
<li class='pt2 pb1'>
<div class='inline-block mr2 mt1 align-top circle circle-number bg-blue white'>
<%= step += 1 %>
</div>
<div class='mr1 inline-block'>
<div class='h1 inline-block bold'>
<%= t('doc_auth.instructions.bullet3') %>
</li>
<li class='pt2 pb1'>
<div class='inline-block mr2 mt1 align-top circle circle-number bg-blue white'>
<%= step += 1 %>
</div>
<br/>
<div>
<%= t('doc_auth.instructions.text3') %>
<div class='mr1 inline-block'>
<div class='h1 inline-block bold'>
<%= t('doc_auth.instructions.bullet3') %>
</div>
<br/>
<div>
<%= t('doc_auth.instructions.text3') %>
</div>
</div>
</div>
</li>
<li class='pt2 pb1'>
<div class='inline-block mr2 mt1 align-top circle circle-number bg-blue white'>
<%= step += 1 %>
</div>
<div class='mr1 inline-block'>
<div class='h1 inline-block bold'>
<%= t('doc_auth.instructions.bullet4') %>
</li>
<li class='pt2 pb1'>
<div class='inline-block mr2 mt1 align-top circle circle-number bg-blue white'>
<%= step += 1 %>
</div>
<br/>
<div>
<%= t('doc_auth.instructions.text4') %>
<div class='mr1 inline-block'>
<div class='h1 inline-block bold'>
<%= t('doc_auth.instructions.bullet4') %>
</div>
<br/>
<div>
<%= t('doc_auth.instructions.text4') %>
</div>
</div>
</div>
</li>
</ul>
</li>
</ul>

<%= simple_form_for :doc_auth,
url: url_for,
method: 'put',
html: { autocomplete: 'off', role: 'form', class: 'mt2 js-consent-form' } do |f| %>
<br/>
<label class="mtn1 mb3" for="ial2_consent_given">
<div class="checkbox">
<%= check_box_tag :ial2_consent_given, true, false %>
<span class="indicator"></span>
<%= t('doc_auth.instructions.consent') %>
<%= link_to(t('doc_auth.instructions.learn_more'), 'https://login.gov/policy/', target: '_blank') %>
</div>
</label>
<%= f.button :submit, t('doc_auth.buttons.continue'), class: 'btn btn-primary btn-wide sm-col-6 col-6 no-auto-enable' %>
<% end %>
<%= simple_form_for :doc_auth,
url: url_for,
method: 'put',
html: { autocomplete: 'off', role: 'form', class: 'mt2 js-consent-form' } do |f| %>
<br/>
<label class="mtn1 mb3" for="ial2_consent_given">
<div class="checkbox">
<%= check_box_tag :ial2_consent_given, true, false %>
<span class="indicator"></span>
<%= t('doc_auth.instructions.consent') %>
<%= link_to(t('doc_auth.instructions.learn_more'), 'https://login.gov/policy/', target: '_blank') %>
</div>
</label>
<%= f.button :submit, t('doc_auth.buttons.continue'), class: 'btn btn-primary btn-wide sm-col-6 col-6 no-auto-enable' %>
<% end %>

<br/>
<br/>


<% if user_fully_authenticated? %>
<%= render 'shared/cancel', link: idv_cancel_path %>
<% else %>
<div class='mt2 pt1 border-top'>
<%= link_to(t('two_factor_authentication.choose_another_option'), two_factor_options_path) %>
</div>
<% end %>
<% if user_fully_authenticated? %>
<%= render 'shared/cancel', link: idv_cancel_path %>
<% else %>
<div class='mt2 pt1 border-top'>
<%= link_to(t('two_factor_authentication.choose_another_option'), two_factor_options_path) %>
</div>
<% end %>


<%= javascript_pack_tag('clipboard') %>
<%= javascript_pack_tag('ial2-consent-button') %>
<%= javascript_pack_tag('document-capture-welcome') if FeatureManagement.document_capture_step_enabled? %>
<%= javascript_pack_tag('clipboard') %>
<%= javascript_pack_tag('ial2-consent-button') %>
<%= javascript_pack_tag('document-capture-welcome') if FeatureManagement.document_capture_step_enabled? %>
<% end %>
3 changes: 2 additions & 1 deletion app/views/shared/_alert.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<%
type = local_assigns.fetch(:type, 'other')
role = type === 'error' ? 'alert' : 'status'
text_tag = local_assigns.fetch(:text_tag, 'p')

classes = [
'usa-alert',
Expand All @@ -12,6 +13,6 @@

<%= tag.div class: classes, role: role do %>
<div class="usa-alert__body">
<p class="usa-alert__text"><%= message %></p>
<%= content_tag(text_tag, message, class: 'usa-alert__text') %>
</div>
<% end %>
22 changes: 22 additions & 0 deletions app/views/shared/_maintenance_window_alert.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<%
maintenance_window = MaintenanceWindow.new(
start: Figaro.env.acuant_maintenance_window_start,
finish: Figaro.env.acuant_maintenance_window_finish,
Comment on lines +3 to +4
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In the future, we can make these start/end variables we pass in, but I figured for the time being, we have just the one maintenance window, so I hardcoded it here

now: local_assigns[:now],
)
%>
<% if maintenance_window.active? %>
<%= render 'shared/alert', { type: 'warning', class: 'margin-bottom-2', text_tag: 'div' } do %>
<p>
<%= t('notices.maintenance.currently_under_maintenance_html',
finish: l(maintenance_window.finish,
format: t('time.formats.event_timestamp_with_zone'))) %>
</p>
<p class="margin-bottom-0">
<%= t('notices.maintenance.need_assistance') %>
<%= link_to(t('notices.maintenance.contact_us'), MarketingSite.contact_url) %>
</p>
<% end %>
<% else %>
<%= yield %>
<% end %>
4 changes: 4 additions & 0 deletions config/application.yml.default
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ aamva_cert_enabled: 'true'
aamva_sp_banlist_issuers: '[]'
account_reset_token_valid_for_days: '1'
account_reset_wait_period_days: '1'
acuant_maintenance_window_start: '2020-09-19T03:00:00Z' # 9/18 11pm Eastern
acuant_maintenance_window_finish: '2020-09-19T05:00:00Z' # 9/19 1am Eastern
acuant_assure_id_password: ''
acuant_assure_id_subscription_id: ''
acuant_assure_id_username: ''
Expand Down Expand Up @@ -351,6 +353,8 @@ test:
aamva_public_key: 123abc
aamva_verification_url: https://example.org:12345/verification/url
account_reset_auth_token: test
acuant_maintenance_window_start: ''
acuant_maintenance_window_finish: ''
acuant_assure_id_url: https://example.com
acuant_facial_match_url: https://facial_match.example.com
acuant_max_attempts: '4'
Expand Down
5 changes: 5 additions & 0 deletions config/locales/notices/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ en:
use_diff_email:
link: create a new account
text_html: Or, %{link} using a different email address.
maintenance:
contact_us: Contact us
currently_under_maintenance_html: We are currently <b>under maintenance until
%{finish}</b> for some of our services.
need_assistance: Need assistance?
password_changed: You changed your password.
phone_confirmed: Phone confirmed successfully.
piv_cac_configured: PIV/CAC card linked successfully.
Expand Down
5 changes: 5 additions & 0 deletions config/locales/notices/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ es:
use_diff_email:
link: crear una cuenta nueva
text_html: O, %{link} utilizando un email diferente.
maintenance:
contact_us: Contacta con nosotros
currently_under_maintenance_html: Actualmente estamos <b>en mantenimiento hasta
el %{finish}</b> para algunos de nuestros servicios.
need_assistance: "¿Necesita ayuda?"
password_changed: Ha cambiado su contraseña.
phone_confirmed: Teléfono confirmado con éxito.
piv_cac_configured: Tarjeta PIV/CAC vinculada con éxito.
Expand Down
5 changes: 5 additions & 0 deletions config/locales/notices/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ fr:
use_diff_email:
link: Créer un nouveau compte
text_html: Ou, %{link} en utilisant une adresse courriel différente.
maintenance:
contact_us: Nous contacter
currently_under_maintenance_html: Nous sommes actuellement <b>en maintenance
jusqu'au %{finish}</b> pour certains de nos services.
need_assistance: Besoin d'assistance?
password_changed: Vous avez changé votre mot de passe.
phone_confirmed: Téléphone confirmé avec succès.
piv_cac_configured: Carte PIV/CAC liée avec succès.
Expand Down
1 change: 1 addition & 0 deletions config/locales/time/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ en:
formats:
event_timestamp: "%B %-d, %Y at %-l:%M %p"
event_timestamp_utc: "%B %-d, %Y at %-l:%M %p UTC"
event_timestamp_with_zone: "%B %-d, %Y at %-l:%M %p %Z"
pm: PM
1 change: 1 addition & 0 deletions config/locales/time/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ es:
formats:
event_timestamp: "%e de %B de %Y a las %H:%M"
event_timestamp_utc: "%e de %B de %Y a las %H:%M UTC"
event_timestamp_with_zone: "%e de %B de %Y a las %H:%M %Z"
pm: PM
1 change: 1 addition & 0 deletions config/locales/time/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ fr:
formats:
event_timestamp: "%e %B %Y à %H:%M"
event_timestamp_utc: "%e %B %Y à %H:%M UTC"
event_timestamp_with_zone: "%e %B %Y à %H:%M %Z"
pm: P.M.
Loading