Browse Source

linted and changed component file name

pull/673/head
Ted 3 years ago committed by JG
parent
commit
a85016a762
  1. 2
      app/components/search_result_caption_component.html.erb
  2. 2
      app/components/search_result_caption_component.rb
  3. 2
      app/views/case_logs/_log_list.html.erb
  4. 4
      app/views/organisations/_organisation_list.html.erb
  5. 4
      app/views/schemes/_scheme_list.html.erb
  6. 4
      app/views/users/_user_list.html.erb

2
app/components/view_result_component.html.erb → app/components/search_result_caption_component.html.erb

@ -4,4 +4,4 @@
<% else %>
<strong><%= count %></strong> total <%= item %>.
<% end %>
</span>
</span>

2
app/components/view_result_component.rb → app/components/search_result_caption_component.rb

@ -1,4 +1,4 @@
class ViewResultComponent < ViewComponent::Base
class SearchResultCaptionComponent < ViewComponent::Base
attr_reader :searched, :count, :item_label, :total_count, :item, :request
def initialize(searched:, count:, item_label:, total_count:, item:, request:)

2
app/views/case_logs/_log_list.html.erb

@ -1,7 +1,7 @@
<section class="app-table-group" tabindex="0" aria-labelledby="<%= title.dasherize %>">
<%= govuk_table do |table| %>
<%= table.caption(classes: %w[govuk-!-font-size-19 govuk-!-font-weight-regular], id: title.dasherize) do |caption| %>
<%= render(ViewResultComponent.new(searched: searched, count: pagy.count, item_label: item_label, total_count: total_count, item: "logs", request: request)) %>
<%= render(SearchResultCaptionComponent.new(searched:, count: pagy.count, item_label:, total_count:, item: "logs", request:)) %>
<%= govuk_link_to "Download (CSV)", "/logs.csv", type: "text/csv" %>
<% end %>
<%= table.head do |head| %>

4
app/views/organisations/_organisation_list.html.erb

@ -1,8 +1,8 @@
<section class="app-table-group" tabindex="0" aria-labelledby="<%= title.dasherize %>">
<%= govuk_table do |table| %>
<%= table.caption(classes: %w[govuk-!-font-size-19 govuk-!-font-weight-regular]) do |caption| %>
<%= render(ViewResultComponent.new(searched: searched, count: pagy.count, item_label: item_label, total_count: total_count, item: "organisations", request: request)) %>
<% end %>
<%= render(SearchResultCaptionComponent.new(searched:, count: pagy.count, item_label:, total_count:, item: "logs", request:)) %>
<% end %>
<%= table.head do |head| %>
<%= head.row do |row| %>
<% row.cell(header: true, text: "Name", html_attributes: {

4
app/views/schemes/_scheme_list.html.erb

@ -1,8 +1,8 @@
<section class="app-table-group" tabindex="0" aria-labelledby="<%= title.dasherize %>">
<%= govuk_table do |table| %>
<%= table.caption(classes: %w[govuk-!-font-size-19 govuk-!-font-weight-regular]) do |caption| %>
<%= render(ViewResultComponent.new(searched: searched, count: pagy.count, item_label: item_label, total_count: total_count, item: "schemes", request: request)) %>
<% end %>
<%= render(SearchResultCaptionComponent.new(searched:, count: pagy.count, item_label:, total_count:, item: "logs", request:)) %>
<% end %>
<%= table.head do |head| %>
<%= head.row do |row| %>
<% row.cell(header: true, text: "Code", html_attributes: {

4
app/views/users/_user_list.html.erb

@ -1,8 +1,8 @@
<section class="app-table-group" tabindex="0" aria-labelledby="<%= title.dasherize %>">
<%= govuk_table do |table| %>
<%= table.caption(classes: %w[govuk-!-font-size-19 govuk-!-font-weight-regular]) do |caption| %>
<%= render(ViewResultComponent.new(searched: searched, count: pagy.count, item_label: item_label, total_count: total_count, item: "users", request: request)) %>
<% if current_user.support? %>
<%= render(SearchResultCaptionComponent.new(searched:, count: pagy.count, item_label:, total_count:, item: "logs", request:)) %>
<% if current_user.support? %>
<% query = searched.present? ? "?search=#{searched}" : nil %>
<%= govuk_link_to "Download (CSV)", "/users.csv#{query}", type: "text/csv" %>
<% end %>

Loading…
Cancel
Save