Skip to content

Commit

Permalink
update the works controller decorator to remove params in collections…
Browse files Browse the repository at this point in the history
…_service method on main (#1048)
  • Loading branch information
aprilrieger authored Jul 23, 2024
1 parent c8e5438 commit 9762688
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions app/controllers/hyrax/my/works_controller_decorator.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# frozen_string_literal: true

# OVERRIDE Hyrax 3.6.0 to add custom sort fields while in the dashboard for works
# OVERRIDE Hyrax 3.5.0 to update collections_service method to remove all params

module Hyrax
module My
module WorksControllerDecorator
module WorksControllerClassDecorator
def configure_facets
configure_blacklight do |config|
# clear facets copied from the CatalogController
Expand All @@ -22,8 +23,20 @@ def configure_facets
end
end
end

module WorksControllerDecorator
# OVERRIDE FROM HYRAX: CAN REMOVE AT 4.0
# https://github.com/samvera/hyrax/pull/5972
def collections_service
cloned = clone
cloned.params = {}
Hyrax::CollectionsService.new(cloned)
end
end
end
end

Hyrax::My::WorksController.singleton_class.send(:prepend, Hyrax::My::WorksControllerDecorator)
Hyrax::My::WorksController.singleton_class.send(:prepend, Hyrax::My::WorksControllerClassDecorator)
Hyrax::My::WorksController.configure_facets

Hyrax::My::WorksController.prepend(Hyrax::My::WorksControllerDecorator)

0 comments on commit 9762688

Please sign in to comment.