Skip to content

Commit

Permalink
Merge pull request #177 from ukparliament/development
Browse files Browse the repository at this point in the history
Development merge
  • Loading branch information
j-corry authored Sep 13, 2024
2 parents 38a9c3b + f366611 commit f12aeeb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/models/search_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,10 @@ def facets
facet_field_data = search.dig(:data, 'facets')
return [] if facet_field_data.blank?

facet_field_data.slice("type_sesrollup", "publisher_ses", "legislature_ses", "date_dt", "department_ses",
facet_field_data.slice("type_sesrollup", "legislature_ses", "date_dt", "department_ses",
"member_ses", "tablingMember_ses", "askingMember_ses", "leadMember_ses",
"answeringMember_ses", "legislativeStage_ses", "legislationTitle_ses", "subject_ses",
"topic_ses", "year").map { |k, v| { field_name: k, facets: sort_facets(v['buckets']) } }
"topic_ses", "year", "publisher_ses").map { |k, v| { field_name: k, facets: sort_facets(v['buckets']) } }
end

def type_facets
Expand Down
4 changes: 2 additions & 2 deletions app/views/search/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@
<div class="filter-container" data-controller="expand-facet">
<%= render 'applied_filters' %>
<%= render 'search/results/facets/type_facet' %>
<% @search_data.facets.select { |h| ["publisher_ses"].include?(h.dig(:field_name)) }.each do |facet_field| %>
<% @search_data.facets.select { |h| ["legislature_ses"].include?(h.dig(:field_name)) }.each do |facet_field| %>
<%= render 'filter_section', facet_field: format_facets(facet_field) %>
<% end %>
<%= render 'search/results/facets/date_facet' %>
<%= render 'search/results/facets/session_facet', facet_data: @search_data.session_facets %>
<% @search_data.facets.select { |h| ["session_t", "department_ses", "member_ses", "tablingMember_ses", "askingMember_ses", "leadMember_ses", "answeringMember_ses", "legislativeStage_ses", "legislationTitle_ses", "subject_ses"].include?(h.dig(:field_name)) }.each do |facet_field| %>
<% @search_data.facets.select { |h| ["session_t", "department_ses", "member_ses", "tablingMember_ses", "askingMember_ses", "leadMember_ses", "answeringMember_ses", "legislativeStage_ses", "legislationTitle_ses", "subject_ses", "publisher_ses"].include?(h.dig(:field_name)) }.each do |facet_field| %>
<%= render 'filter_section', facet_field: format_facets(facet_field) %>
<% end %>
</div>
Expand Down

0 comments on commit f12aeeb

Please sign in to comment.