Skip to content

Commit

Permalink
Allow to renew expired verifications (if renewable) (#8192)
Browse files Browse the repository at this point in the history
* allow to renew expired verifications (if renewable)

* fix test

* rubocop
  • Loading branch information
microstudi authored and andreslucena committed May 19, 2022
1 parent 33634ee commit 450064a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Expand Up @@ -7,14 +7,14 @@
<% if @granted_authorizations.any? %>
<div class="card card--list">
<% @granted_authorizations.each do |authorization| %>
<% if authorization.expired? %>
<%= link_to authorization_method(authorization).root_path(**url_params), title: t(".expired_verification"), class: "card--list__item" do %>
<% render partial: "granted_authorization", locals: { authorization: authorization } %>
<% end %>
<% elsif authorization.renewable? %>
<% if authorization.renewable? %>
<%= link_to "#", title: t(".show_renew_info"), data: { open: "renew-modal", "open-url": renew_modal_authorizations_path(handler: authorization.name) }, class: "card--list__item authorization-renewable" do %>
<%= render partial: "granted_authorization", locals: { authorization: authorization } %>
<% end %>
<% elsif authorization.expired? %>
<%= link_to authorization_method(authorization).root_path(**url_params), title: t(".expired_verification"), class: "card--list__item" do %>
<% render partial: "granted_authorization", locals: { authorization: authorization } %>
<% end %>
<% else %>
<div class="card--list__item">
<%= render partial: "granted_authorization", locals: { authorization: authorization } %>
Expand Down
4 changes: 4 additions & 0 deletions decidim-verifications/spec/system/authorizations_spec.rb
Expand Up @@ -243,6 +243,10 @@
click_link "Example authorization"
end

within "#renew-modal" do
click_link "Continue"
end

fill_in "Document number", with: "123456789X"
click_button "Send"

Expand Down

0 comments on commit 450064a

Please sign in to comment.