Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
cfb0a6d
add update interval to info on otp expirateion screen
jmdembe Feb 18, 2025
bb0c9ac
add class and value for screen reader frequency
jmdembe Feb 19, 2025
e704197
remove update frequency
jmdembe Feb 19, 2025
ee4abb0
use store value instead of hardcoded number
jmdembe Feb 19, 2025
3b17adf
update documentation and test setup
jmdembe Feb 19, 2025
566a04b
add test for new class
jmdembe Feb 19, 2025
2ddb808
first round of lintfixes for tests
jmdembe Feb 19, 2025
b78cb27
udo changes
jmdembe Feb 21, 2025
c0c0bcc
trying with the countdown component in screen reader container
jmdembe Feb 21, 2025
3ffc187
clean up syntax
jmdembe Feb 21, 2025
ad641ae
change start immediately
jmdembe Feb 21, 2025
06a9f5c
WIP: lintfix and creating untested modal
jmdembe Feb 21, 2025
fd12c11
clean up readme file
jmdembe Feb 21, 2025
a49d509
more changes to alerts
jmdembe Feb 21, 2025
49dc930
positive step: turn `aria-live` to off when alert appears so that we …
jmdembe Feb 21, 2025
c11b920
lintfix: remove console.log
jmdembe Feb 21, 2025
04e4323
remove more `screenReaderFrequency`, try putting an attribute to dela…
jmdembe Feb 24, 2025
17ae171
lintfixes
jmdembe Feb 24, 2025
e535937
add class to denote delay?
jmdembe Feb 25, 2025
e9bf0d2
add class to denote delay?
jmdembe Feb 25, 2025
fa8b30f
Merge branch 'jd/LG-15064-countdown-timer' of github.com:18F/identity…
jmdembe Feb 25, 2025
9533be7
remove `tag_options` because that did not work
jmdembe Feb 25, 2025
6b6e1d1
remove `delay_countdown_announcement`, change `<p>` to '<div>' tags
jmdembe Feb 26, 2025
a5a61b4
add new class, function with comment on where to go next
jmdembe Feb 27, 2025
bf2c0c8
remove added classes again, make change to countdown element
jmdembe Feb 27, 2025
ac114ec
lintfix
jmdembe Feb 27, 2025
2087cc6
add modifier to time so that screenreader time and visible time are s…
jmdembe Feb 28, 2025
51a607e
make update to try and get `show_at_remaining` to sync with visible b…
jmdembe Feb 28, 2025
db97b5a
rename configuration and `console.log`
jmdembe Feb 28, 2025
ec3dda9
remove config because it does not need to be hard coded
jmdembe Feb 28, 2025
f9a9c46
a11y test fix
jmdembe Feb 28, 2025
d261989
address code review comments
jmdembe Feb 28, 2025
64f1126
address unused helper and `>` in html
jmdembe Feb 28, 2025
aea01dd
Update app/components/countdown_component.rb
jmdembe Feb 28, 2025
b17418f
test to show that can be overriden
jmdembe Mar 3, 2025
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 app/components/alert_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= tag.div(**tag_options, class: css_class, role:) do %>
<%= tag.div(role:, **tag_options, class: css_class) do %>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It'd be good to include some test coverage for this change, specifically that it's possible to override the default role with another value.

<div class="usa-alert__body">
<%= content_tag(text_tag, content, class: 'usa-alert__text') %>
</div>
Expand Down
18 changes: 13 additions & 5 deletions app/views/two_factor_authentication/otp_verification/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,19 @@
<% end %>

<% if @presenter.otp_expiration.present? %>
<%= render CountdownAlertComponent.new(
show_at_remaining: IdentityConfig.store.otp_expiration_warning_seconds.seconds,
alert_options: { class: 'margin-bottom-4' },
countdown_options: { expiration: @presenter.otp_expiration },
) %>
<%= render CountdownAlertComponent.new(
show_at_remaining: IdentityConfig.store.otp_expiration_warning_seconds.seconds,
alert_options: { class: 'margin-bottom-4', role: 'presentation' },
countdown_options: { expiration: @presenter.otp_expiration },
) %>

<div class="usa-sr-only" role="timer" aria-live="polite" aria-atomic="true">
<%= render CountdownAlertComponent.new(
expiration: @presenter.otp_expiration,
show_at_remaining: IdentityConfig.store.otp_expiration_warning_seconds.seconds + 30.seconds,
countdown_options: { expiration: @presenter.otp_expiration, update_interval: 30.seconds },
) %>
</div>
<% end %>

<%= render PageHeadingComponent.new.with_content(@presenter.header) %>
Expand Down
9 changes: 9 additions & 0 deletions spec/components/countdown_alert_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,14 @@

expect(rendered).to have_css('.usa-alert[data-foo="bar"]')
end

it 'renders with a defined aria role' do
rendered = render_inline CountdownAlertComponent.new(
countdown_options: { expiration: },
alert_options: { role: 'region' },
)

expect(rendered).to have_selector('.usa-alert[role="region"]')
end
end
end