diff --git a/Gemfile.lock b/Gemfile.lock index c19c6a6d..f004cd78 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -6,7 +6,6 @@ PATH activejob (>= 6.0) activerecord (>= 6.0) job-iteration (~> 1.1) - pagy (~> 3.9) railties (>= 6.0) GEM @@ -112,7 +111,6 @@ GEM nokogiri (1.11.1) mini_portile2 (~> 2.5.0) racc (~> 1.4) - pagy (3.11.0) parallel (1.20.1) parser (2.7.2.0) ast (~> 2.4.1) diff --git a/app/controllers/maintenance_tasks/application_controller.rb b/app/controllers/maintenance_tasks/application_controller.rb index e15c030c..56b9e02a 100644 --- a/app/controllers/maintenance_tasks/application_controller.rb +++ b/app/controllers/maintenance_tasks/application_controller.rb @@ -5,8 +5,6 @@ module MaintenanceTasks # # Can be extended to add different authentication and authorization code. class ApplicationController < ActionController::Base - include Pagy::Backend - BULMA_CDN = 'https://cdn.jsdelivr.net' content_security_policy do |policy| diff --git a/app/controllers/maintenance_tasks/tasks_controller.rb b/app/controllers/maintenance_tasks/tasks_controller.rb index 8fe5ebf5..b4c3ebe6 100644 --- a/app/controllers/maintenance_tasks/tasks_controller.rb +++ b/app/controllers/maintenance_tasks/tasks_controller.rb @@ -20,9 +20,7 @@ def index def show @task = TaskData.find(params.fetch(:id)) set_refresh if @task.last_run&.active? - @runs_page = RunsPage.new(@task.previous_runs, params[:cursor]) - # @pagy, @previous_runs = pagy(@task.previous_runs) end # Runs a given Task and redirects to the Task page. diff --git a/app/helpers/maintenance_tasks/application_helper.rb b/app/helpers/maintenance_tasks/application_helper.rb index 2a610dda..352e88b4 100644 --- a/app/helpers/maintenance_tasks/application_helper.rb +++ b/app/helpers/maintenance_tasks/application_helper.rb @@ -4,17 +4,6 @@ module MaintenanceTasks # # @api private module ApplicationHelper - include Pagy::Frontend - - # Renders pagination for the page, if there is more than one page present. - # - # @param pagy [Pagy] the pagy instance containing pagination details, - # including the number of pages the results are spread across. - # @return [String] the HTML to render for pagination. - def pagination(pagy) - raw(pagy_bulma_nav(pagy)) if pagy.pages > 1 - end - # Renders a time element with the given datetime, worded as relative to the # current time. # diff --git a/lib/maintenance_tasks.rb b/lib/maintenance_tasks.rb index 0804aa3a..c8d741e9 100644 --- a/lib/maintenance_tasks.rb +++ b/lib/maintenance_tasks.rb @@ -6,8 +6,6 @@ require 'job-iteration' require 'maintenance_tasks/engine' -require 'pagy' -require 'pagy/extras/bulma' # Force the TaskJob class to load so we can verify upstream compatibility with # the JobIteration gem diff --git a/maintenance_tasks.gemspec b/maintenance_tasks.gemspec index 723975d1..e040abd8 100644 --- a/maintenance_tasks.gemspec +++ b/maintenance_tasks.gemspec @@ -26,6 +26,5 @@ Gem::Specification.new do |spec| spec.add_dependency('activejob', '>= 6.0') spec.add_dependency('activerecord', '>= 6.0') spec.add_dependency('job-iteration', '~> 1.1') - spec.add_dependency('pagy', '~> 3.9') spec.add_dependency('railties', '>= 6.0') end diff --git a/test/helpers/maintenance_tasks/application_helper_test.rb b/test/helpers/maintenance_tasks/application_helper_test.rb index c4bae936..60afa2f5 100644 --- a/test/helpers/maintenance_tasks/application_helper_test.rb +++ b/test/helpers/maintenance_tasks/application_helper_test.rb @@ -3,20 +3,6 @@ module MaintenanceTasks class ApplicationHelperTest < ActionView::TestCase - setup { @pagy = mock } - - test '#pagination returns nil if pages is less than or equal to 1' do - @pagy.expects(pages: 1) - expects(:pagy_bulma_nav).never - assert_nil pagination(@pagy) - end - - test '#pagination returns pagination element if pages is greater than 1' do - @pagy.expects(pages: 2) - expects(:pagy_bulma_nav).with(@pagy).returns('pagination') - assert_equal 'pagination', pagination(@pagy) - end - test '#time_ago returns a time element with the given datetime worded as relative to now and ISO 8601 UTC time in title attribute' do travel_to Time.zone.local(2020, 1, 9, 9, 41, 44) time = Time.zone.local(2020, 01, 01, 01, 00, 00)