Skip to content

Commit

Permalink
Merge pull request #1903 from datadryad/saved-search-bug
Browse files Browse the repository at this point in the history
Allow CSV downloads of admin saved searches
  • Loading branch information
alinvetian authored Nov 4, 2024
2 parents 4c07c6c + 5142cc6 commit 8e3ce30
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/helpers/stash_engine/admin_dashboard_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'csv'

module StashEngine
# rubocop:disable Metrics/AbcSize, Metrics/ModuleLength, Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
module AdminDashboardHelper
Expand Down
2 changes: 1 addition & 1 deletion app/views/stash_engine/admin_dashboard/count.js.erb
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
document.getElementById('count_and_export').innerHTML = `<span><b><%= number_with_delimiter(@count) %></b> results</span><%= link_to "Export all as CSV", stash_url_helpers.admin_dashboard_results_path(format: :csv), class: 'o-link__buttonlink' %>`;
document.getElementById('count_and_export').innerHTML = `<span><b><%= number_with_delimiter(@count) %></b> results</span><%= link_to "Export all as CSV", stash_url_helpers.admin_dashboard_results_path(format: :csv, search: params[:search]), class: 'o-link__buttonlink' %>`;
document.getElementById('admin-pagination').innerHTML = "<%= escape_javascript(render(partial: 'pagination', locals: {count: @count, page: params[:page], page_size: params[:page_size], sort: params[:sort], direction: params[:direction], search: params[:search]})) %>";

0 comments on commit 8e3ce30

Please sign in to comment.