Skip to content

Commit

Permalink
CRIMAPP-1531 search results table can scroll (#783)
Browse files Browse the repository at this point in the history
  • Loading branch information
timpeat authored Jan 3, 2025
1 parent 579be2f commit d4704bd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
4 changes: 4 additions & 0 deletions app/assets/stylesheets/local/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ html {
color: $govuk-link-colour;
}

.app-table-container {
overflow-x: auto
}

.app-table {
thead {
position: sticky;
Expand Down
30 changes: 15 additions & 15 deletions app/views/casework/application_searches/search.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

<div class="govuk-grid-row">
<div class="govuk-grid-column-full govuk-!-margin-bottom-5">
<h1 class="govuk-heading-xl"><%=t '.heading' %></h1>
<h1 class="govuk-heading-xl"><%= t '.heading' %></h1>
<%= render @search.filter %>
</div>
</div>

<% if @search.results.empty? %>
<%= render 'no_search_results'%>
<%= render 'no_search_results' %>
<% else %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-one-half">
Expand All @@ -19,20 +19,20 @@
</div>

<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<div class="govuk-grid-column-full app-table-container">
<table class="govuk-table app-table">
<%= render DataTable::HeadComponent.new(sorting: @search.sorting, filter: @search.filter) do |head|
head.with_row do |row|
row.with_cell(colname: :applicant_name)
row.with_cell(colname: :reference)
row.with_cell(colname: :application_type)
row.with_cell(colname: :case_type)
row.with_cell(colname: :submitted_at)
row.with_cell(colname: :reviewed_at)
row.with_cell(colname: :closed_by)
row.with_cell(colname: :status)
end
end %>
<%= render DataTable::HeadComponent.new(sorting: @search.sorting, filter: @search.filter) do |head| %>
<% head.with_row do |row|
row.with_cell(colname: :applicant_name)
row.with_cell(colname: :reference)
row.with_cell(colname: :application_type)
row.with_cell(colname: :case_type)
row.with_cell(colname: :submitted_at)
row.with_cell(colname: :reviewed_at)
row.with_cell(colname: :closed_by)
row.with_cell(colname: :status)
end %>
<% end %>
<tbody class="govuk-table__body">
<%= render partial: 'search_results_table_body',
collection: @search.results,
Expand Down

0 comments on commit d4704bd

Please sign in to comment.