Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DONT MERGE - FOR PROD DEPLOY: i1046-admin-can-deposit-works-into-collections #1047

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Loading