Skip to content

Commit

Permalink
Enable and fix ErbSafety check
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamineskola committed Apr 26, 2024
1 parent 4afd6d8 commit 4c30109
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .erb-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ linters:
- "text/javascript"
- "module"
ErbSafety:
enabled: false
enabled: true

# Enabling this caused a lot of test failures
NoJavascriptTagHelper:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
locals: {message: warning_message}
) %>
<p class="govuk-body">
<%= t(".reason_given", feedback: feedback).html_safe %>
<%= t(".reason_given_html", feedback: feedback) %>
</p>
<hr class="govuk-section-break govuk-section-break--l govuk-section-break--visible">
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<% end %>
<% if planning_application.result_override.present? %>
<p class="govuk-body">
<%= t(".the_applicant_believes").html_safe %>
<%= t(".the_applicant_believes_html") %>
</p>
<div class="govuk-inset-text">
<p class="govuk-body">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<div class="govuk-error-summary__body">
<ul class="govuk-list govuk-error-summary__list">
<% @consultation.errors.each do |error| %>
<li><%= error.message.html_safe %></li>
<li><%= error.message %></li>
<% end %>
</ul>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
:status,
"&nbsp;".html_safe,
class: "govuk-label govuk-radios__label"
) %>
) %> <%# erblint:disable ErbSafety %>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<div class="govuk-error-summary__body">
<ul class="govuk-list govuk-error-summary__list">
<% @planning_application.errors.each do |error| %>
<li><%= error.message.html_safe %></li>
<li><%= error.message.html_safe %></li><%# erblint:disable ErbSafety %>
<% end %>
</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/planning_applications/consultees/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<div class="govuk-error-summary__body">
<ul class="govuk-list govuk-error-summary__list">
<% @consultation.errors.each do |error| %>
<li><%= error.message.html_safe %></li>
<li><%= error.message %></li>
<% end %>
</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/planning_applications/consultees/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<div class="govuk-error-summary__body">
<ul class="govuk-list govuk-error-summary__list">
<% @consultation.errors.each do |error| %>
<li><%= error.message.html_safe %></li>
<li><%= error.message %></li>
<% end %>
</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/planning_applications/make_public.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<div class="govuk-error-summary__body">
<ul class="govuk-list govuk-error-summary__list">
<% @planning_application.errors.each do |error| %>
<li><%= error.message.html_safe %></li>
<li><%= error.message %></li>
<% end %>
</ul>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<div class="govuk-error-summary__body">
<ul class="govuk-list govuk-error-summary__list">
<% @consultation.errors.each do |error| %>
<li><%= error.message.html_safe %></li>
<li><%= error.message %></li>
<% end %>
</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/planning_applications/neighbours/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<div class="govuk-error-summary__body">
<ul class="govuk-list govuk-error-summary__list">
<% @consultation.errors.each do |error| %>
<li><%= error.message.html_safe %></li>
<li><%= error.message %></li>
<% end %>
</ul>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<div class="govuk-error-summary__body">
<ul class="govuk-list govuk-error-summary__list">
<% form.object.planning_application.errors.each do |error| %>
<li><%= error.message.html_safe %></li>
<li><%= error.message %></li>
<% end %>
</ul>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<span id="application-reference"><%= @planning_application.reference %></span>
<div id="site-notice-content">
<div style="width: 430px; font-family: Arial;">
<%= raw @planning_application.last_site_notice.preview_content %>
<%= raw @planning_application.last_site_notice.preview_content %> <%# erblint:disable ErbSafety %>
</div>
</div>
</div>
4 changes: 2 additions & 2 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ en:
documents_component:
manage_documents: Manage documents
feedback_component:
reason_given: <strong>Reason given:</strong> "%{feedback}"
reason_given_html: <strong>Reason given:</strong> "%{feedback}"
key_application_dates_component:
application_received: 'Application received:'
expiry_date: 'Expiry date:'
Expand All @@ -68,7 +68,7 @@ en:
pre_assessment_outcome_component:
details_identified_as: Details identified as relevant to the result
no_result: No result
the_applicant_believes: 'The applicant believes this result is <strong>incorrect</strong> because:'
the_applicant_believes_html: 'The applicant believes this result is <strong>incorrect</strong> because:'
the_applicant_or: The applicant or agent believes this result is inaccurate.
the_application_was: The application was not assessed on submission
this_application_has: This application has been updated. The result may no longer be accurate.
Expand Down

0 comments on commit 4c30109

Please sign in to comment.