Browse Source

feat: fix back persistence behaviour and update similar issues elsewhere, also remove redundant back text in govuk back links

pull/1515/head
natdeanlewissoftwire 3 years ago
parent
commit
86344357ff
  1. 2
      app/views/devise/two_factor_authentication/resend.html.erb
  2. 2
      app/views/form/page.html.erb
  3. 1
      app/views/locations/availability.erb
  4. 1
      app/views/locations/check_answers.html.erb
  5. 1
      app/views/locations/index.html.erb
  6. 1
      app/views/locations/local_authority.html.erb
  7. 1
      app/views/locations/mobility_standards.html.erb
  8. 1
      app/views/locations/name.html.erb
  9. 1
      app/views/locations/postcode.html.erb
  10. 1
      app/views/locations/show.html.erb
  11. 1
      app/views/locations/toggle_active.html.erb
  12. 1
      app/views/locations/type_of_unit.html.erb
  13. 1
      app/views/locations/units.html.erb
  14. 1
      app/views/schemes/confirm_secondary.html.erb
  15. 5
      app/views/schemes/details.html.erb
  16. 5
      app/views/schemes/edit_name.html.erb
  17. 5
      app/views/schemes/new.html.erb
  18. 5
      app/views/schemes/primary_client_group.html.erb
  19. 1
      app/views/schemes/secondary_client_group.html.erb
  20. 1
      app/views/schemes/show.html.erb
  21. 1
      app/views/schemes/support.html.erb
  22. 1
      app/views/schemes/toggle_active.html.erb

2
app/views/devise/two_factor_authentication/resend.html.erb

@ -1,7 +1,7 @@
<% content_for :title, "Resend security code" %> <% content_for :title, "Resend security code" %>
<% content_for :before_content do %> <% content_for :before_content do %>
<%= govuk_back_link(href: "javascript:history.back()") %> <%= govuk_back_link(href: :back) %>
<% end %> <% end %>
<%= form_with(url: send("resend_code_#{resource_name}_two_factor_authentication_path"), html: { method: :get }) do |f| %> <%= form_with(url: send("resend_code_#{resource_name}_two_factor_authentication_path"), html: { method: :get }) do |f| %>

2
app/views/form/page.html.erb

@ -1,7 +1,7 @@
<% content_for :title, @page.header.presence || @page.questions.first.header.html_safe %> <% content_for :title, @page.header.presence || @page.questions.first.header.html_safe %>
<% content_for :before_content do %> <% content_for :before_content do %>
<%= govuk_back_link(href: "javascript:history.back()") %> <%= govuk_back_link(href: :back) %>
<% end %> <% end %>
<div data-controller="govukfrontend"></div> <div data-controller="govukfrontend"></div>

1
app/views/locations/availability.erb

@ -2,7 +2,6 @@
<% content_for :before_content do %> <% content_for :before_content do %>
<%= govuk_back_link( <%= govuk_back_link(
text: "Back",
href: params[:referrer] == "check_answers" ? scheme_location_check_answers_path(@scheme, @location, route: params[:route]) : scheme_location_mobility_standards_path(@scheme, @location, route: params[:route]), href: params[:referrer] == "check_answers" ? scheme_location_check_answers_path(@scheme, @location, route: params[:route]) : scheme_location_mobility_standards_path(@scheme, @location, route: params[:route]),
) %> ) %>
<% end %> <% end %>

1
app/views/locations/check_answers.html.erb

@ -3,7 +3,6 @@
<% content_for :before_content do %> <% content_for :before_content do %>
<%= govuk_back_link( <%= govuk_back_link(
text: "Back",
href: case params[:route] href: case params[:route]
when "locations" when "locations"
scheme_locations_path(@scheme) scheme_locations_path(@scheme)

1
app/views/locations/index.html.erb

@ -4,7 +4,6 @@
<% content_for :before_content do %> <% content_for :before_content do %>
<%= govuk_back_link( <%= govuk_back_link(
text: "Back",
href: "/schemes/#{@scheme.id}", href: "/schemes/#{@scheme.id}",
) %> ) %>
<% end %> <% end %>

1
app/views/locations/local_authority.html.erb

@ -2,7 +2,6 @@
<% content_for :before_content do %> <% content_for :before_content do %>
<%= govuk_back_link( <%= govuk_back_link(
text: "Back",
href: case params[:referrer] href: case params[:referrer]
when "check_local_authority" when "check_local_authority"
scheme_location_check_answers_path(@scheme, @location, route: params[:route]) scheme_location_check_answers_path(@scheme, @location, route: params[:route])

1
app/views/locations/mobility_standards.html.erb

@ -2,7 +2,6 @@
<% content_for :before_content do %> <% content_for :before_content do %>
<%= govuk_back_link( <%= govuk_back_link(
text: "Back",
href: params[:referrer] == "check_answers" ? scheme_location_check_answers_path(@scheme, @location, route: params[:route]) : scheme_location_type_of_unit_path(@scheme, @location, route: params[:route]), href: params[:referrer] == "check_answers" ? scheme_location_check_answers_path(@scheme, @location, route: params[:route]) : scheme_location_type_of_unit_path(@scheme, @location, route: params[:route]),
) %> ) %>
<% end %> <% end %>

1
app/views/locations/name.html.erb

@ -2,7 +2,6 @@
<% content_for :before_content do %> <% content_for :before_content do %>
<%= govuk_back_link( <%= govuk_back_link(
text: "Back",
href: case params[:referrer] href: case params[:referrer]
when "check_answers" when "check_answers"
scheme_location_check_answers_path(@scheme, @location, route: params[:route]) scheme_location_check_answers_path(@scheme, @location, route: params[:route])

1
app/views/locations/postcode.html.erb

@ -2,7 +2,6 @@
<% content_for :before_content do %> <% content_for :before_content do %>
<%= govuk_back_link( <%= govuk_back_link(
text: "Back",
href: if params[:referrer] == "check_answers" href: if params[:referrer] == "check_answers"
scheme_location_check_answers_path(@scheme, @location, route: params[:route]) scheme_location_check_answers_path(@scheme, @location, route: params[:route])
else else

1
app/views/locations/show.html.erb

@ -3,7 +3,6 @@
<% content_for :before_content do %> <% content_for :before_content do %>
<%= govuk_back_link( <%= govuk_back_link(
text: "Back",
href: scheme_locations_path(@scheme), href: scheme_locations_path(@scheme),
) %> ) %>
<% end %> <% end %>

1
app/views/locations/toggle_active.html.erb

@ -3,7 +3,6 @@
<% content_for :before_content do %> <% content_for :before_content do %>
<%= govuk_back_link( <%= govuk_back_link(
text: "Back",
href: scheme_location_path(@location.scheme, @location), href: scheme_location_path(@location.scheme, @location),
) %> ) %>
<% end %> <% end %>

1
app/views/locations/type_of_unit.html.erb

@ -2,7 +2,6 @@
<% content_for :before_content do %> <% content_for :before_content do %>
<%= govuk_back_link( <%= govuk_back_link(
text: "Back",
href: params[:referrer] == "check_answers" ? scheme_location_check_answers_path(@scheme, @location, route: params[:route]) : scheme_location_units_path(@scheme, @location, route: params[:route]), href: params[:referrer] == "check_answers" ? scheme_location_check_answers_path(@scheme, @location, route: params[:route]) : scheme_location_units_path(@scheme, @location, route: params[:route]),
) %> ) %>
<% end %> <% end %>

1
app/views/locations/units.html.erb

@ -2,7 +2,6 @@
<% content_for :before_content do %> <% content_for :before_content do %>
<%= govuk_back_link( <%= govuk_back_link(
text: "Back",
href: params[:referrer] == "check_answers" ? scheme_location_check_answers_path(@scheme, @location, route: params[:route]) : scheme_location_name_path(@scheme, @location, route: params[:route]), href: params[:referrer] == "check_answers" ? scheme_location_check_answers_path(@scheme, @location, route: params[:route]) : scheme_location_name_path(@scheme, @location, route: params[:route]),
) %> ) %>
<% end %> <% end %>

1
app/views/schemes/confirm_secondary.html.erb

@ -2,7 +2,6 @@
<% content_for :before_content do %> <% content_for :before_content do %>
<%= govuk_back_link( <%= govuk_back_link(
text: "Back",
href: request.query_parameters["check_answers"] ? "/schemes/#{@scheme.id}/check-answers" : "/schemes/#{@scheme.id}/primary-client-group", href: request.query_parameters["check_answers"] ? "/schemes/#{@scheme.id}/check-answers" : "/schemes/#{@scheme.id}/primary-client-group",
) %> ) %>
<% end %> <% end %>

5
app/views/schemes/details.html.erb

@ -1,10 +1,7 @@
<% content_for :title, "Create a new supported housing scheme" %> <% content_for :title, "Create a new supported housing scheme" %>
<% content_for :before_content do %> <% content_for :before_content do %>
<%= govuk_back_link( <%= govuk_back_link(href: :back) %>
text: "Back",
href: :back,
) %>
<% end %> <% end %>
<%= form_for(@scheme, method: :patch) do |f| %> <%= form_for(@scheme, method: :patch) do |f| %>

5
app/views/schemes/edit_name.html.erb

@ -1,10 +1,7 @@
<% content_for :title, "Scheme details" %> <% content_for :title, "Scheme details" %>
<% content_for :before_content do %> <% content_for :before_content do %>
<%= govuk_back_link( <%= govuk_back_link(href: :back) %>
text: "Back",
href: :back,
) %>
<% end %> <% end %>
<%= form_for(@scheme, method: :patch) do |f| %> <%= form_for(@scheme, method: :patch) do |f| %>

5
app/views/schemes/new.html.erb

@ -6,10 +6,7 @@
<% content_for :title, "Create a new supported housing scheme" %> <% content_for :title, "Create a new supported housing scheme" %>
<% content_for :before_content do %> <% content_for :before_content do %>
<%= govuk_back_link( <%= govuk_back_link(href: :back) %>
text: "Back",
href: "javascript:history.go(-1);",
) %>
<% end %> <% end %>
<h1 class="govuk-heading-l"> <h1 class="govuk-heading-l">

5
app/views/schemes/primary_client_group.html.erb

@ -7,10 +7,7 @@
<% end %> <% end %>
<% content_for :before_content do %> <% content_for :before_content do %>
<%= govuk_back_link( <%= govuk_back_link(href: back_button_path) %>
text: "Back",
href: back_button_path,
) %>
<% end %> <% end %>
<%= form_for(@scheme, method: :patch) do |f| %> <%= form_for(@scheme, method: :patch) do |f| %>

1
app/views/schemes/secondary_client_group.html.erb

@ -2,7 +2,6 @@
<% content_for :before_content do %> <% content_for :before_content do %>
<%= govuk_back_link( <%= govuk_back_link(
text: "Back",
href: request.query_parameters["check_answers"] ? "/schemes/#{@scheme.id}/check-answers" : "/schemes/#{@scheme.id}/confirm-secondary-client-group", href: request.query_parameters["check_answers"] ? "/schemes/#{@scheme.id}/check-answers" : "/schemes/#{@scheme.id}/confirm-secondary-client-group",
) %> ) %>
<% end %> <% end %>

1
app/views/schemes/show.html.erb

@ -3,7 +3,6 @@
<% content_for :before_content do %> <% content_for :before_content do %>
<%= govuk_back_link( <%= govuk_back_link(
text: "Back",
href: "/schemes", href: "/schemes",
) %> ) %>
<% end %> <% end %>

1
app/views/schemes/support.html.erb

@ -2,7 +2,6 @@
<% content_for :before_content do %> <% content_for :before_content do %>
<%= govuk_back_link( <%= govuk_back_link(
text: "Back",
href: request.query_parameters["check_answers"] ? "/schemes/#{@scheme.id}/check-answers" : "/schemes/#{@scheme.id}/secondary-client-group", href: request.query_parameters["check_answers"] ? "/schemes/#{@scheme.id}/check-answers" : "/schemes/#{@scheme.id}/secondary-client-group",
) %> ) %>
<% end %> <% end %>

1
app/views/schemes/toggle_active.html.erb

@ -3,7 +3,6 @@
<% content_for :before_content do %> <% content_for :before_content do %>
<%= govuk_back_link( <%= govuk_back_link(
text: "Back",
href: scheme_details_path(@scheme), href: scheme_details_path(@scheme),
) %> ) %>
<% end %> <% end %>

Loading…
Cancel
Save