From 5142cc612e58060e390be1a34b533659ff3bdf95 Mon Sep 17 00:00:00 2001 From: Audrey Hamelers Date: Mon, 4 Nov 2024 12:42:53 +0100 Subject: [PATCH] Closes https://github.com/datadryad/dryad-product-roadmap/issues/3741 --- app/helpers/stash_engine/admin_dashboard_helper.rb | 2 ++ app/views/stash_engine/admin_dashboard/count.js.erb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/helpers/stash_engine/admin_dashboard_helper.rb b/app/helpers/stash_engine/admin_dashboard_helper.rb index 6d0181238..d11fd6392 100644 --- a/app/helpers/stash_engine/admin_dashboard_helper.rb +++ b/app/helpers/stash_engine/admin_dashboard_helper.rb @@ -1,3 +1,5 @@ +require 'csv' + module StashEngine # rubocop:disable Metrics/AbcSize, Metrics/ModuleLength, Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity module AdminDashboardHelper diff --git a/app/views/stash_engine/admin_dashboard/count.js.erb b/app/views/stash_engine/admin_dashboard/count.js.erb index f365f3998..dfc8ac222 100644 --- a/app/views/stash_engine/admin_dashboard/count.js.erb +++ b/app/views/stash_engine/admin_dashboard/count.js.erb @@ -1,2 +1,2 @@ -document.getElementById('count_and_export').innerHTML = `<%= number_with_delimiter(@count) %> results<%= 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 = `<%= number_with_delimiter(@count) %> results<%= 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]})) %>"; \ No newline at end of file