Skip to content

Commit

Permalink
⚠️ Resolve loading issues
Browse files Browse the repository at this point in the history
This commit will resolve some zeitwerk work issues and also remove the
SavedSearchesController as it is deprecated.

Ref:
- projectblacklight/blacklight_advanced_search#105
  • Loading branch information
kirkkwang committed Dec 10, 2024
1 parent 2adc395 commit 51956c4
Show file tree
Hide file tree
Showing 13 changed files with 76 additions and 58 deletions.
2 changes: 2 additions & 0 deletions hydra/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@

# Ignore Byebug command history file.
.byebug_history

public/assets/*
4 changes: 2 additions & 2 deletions hydra/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ gem 'bootsnap', '>= 1.4.2', require: false
gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript'


# OAI-PMH
# OAI-PMH
# =====================================================
gem 'blacklight_oai_provider', github: 'projectblacklight/blacklight_oai_provider', ref: '428da77'

Expand All @@ -50,7 +50,7 @@ gem 'whenever', require: false
# =====================================================
# Switch the comments on these two lines to work on Bulkrax locally
# gem 'bulkrax', git: 'https://github.com/samvera-labs/bulkrax.git' , ref: 'b689afa'
gem 'bulkrax'
gem 'bulkrax', github: 'samvera/bulkrax', branch: 'hydra-rails-7-support'

# Dependices for Thumbnail Creation
# =====================================================
Expand Down
45 changes: 28 additions & 17 deletions hydra/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,28 @@ GIT
rsolr (>= 1.1.2, < 3)
ruby-progressbar (~> 1.0)

GIT
remote: https://github.com/samvera/bulkrax.git
revision: b1774c34fc0951f885230520e4b97d38fe4c0dad
branch: hydra-rails-7-support
specs:
bulkrax (8.3.0)
bagit (~> 0.6.0)
coderay
denormalize_fields
iso8601 (~> 0.9.0)
kaminari
language_list (~> 1.2, >= 1.2.1)
libxml-ruby (~> 5.0)
loofah (>= 2.2.3)
marcel
oai (>= 0.4, < 2.x)
rack (>= 2.0.6)
rails (>= 5.1.6)
rdf (>= 2.0.2, < 4.0)
rubyzip
simple_form

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -139,21 +161,6 @@ GEM
autoprefixer-rails (>= 9.1.0)
popper_js (>= 2.11.8, < 3)
builder (3.3.0)
bulkrax (7.0.0)
bagit (~> 0.4)
coderay
denormalize_fields
iso8601 (~> 0.9.0)
kaminari
language_list (~> 1.2, >= 1.2.1)
libxml-ruby (~> 3.2.4)
loofah (>= 2.2.3)
oai (>= 0.4, < 2.x)
rack (>= 2.0.6)
rails (>= 5.1.6)
rdf (>= 2.0.2, < 4.0)
rubyzip
simple_form
byebug (11.1.3)
cancancan (3.6.1)
childprocess (5.1.0)
Expand Down Expand Up @@ -216,6 +223,7 @@ GEM
net-http (>= 0.5.0)
fcrepo_wrapper (0.9.0)
ruby-progressbar
ffi (1.17.0-aarch64-linux-gnu)
ffi (1.17.0-x86_64-linux-gnu)
fiddle (1.1.5)
fugit (1.11.1)
Expand Down Expand Up @@ -311,7 +319,7 @@ GEM
parslet
rdf (~> 3.0)
rdf-vocab (~> 3.0)
libxml-ruby (3.2.4)
libxml-ruby (5.0.3)
link_header (0.0.8)
linkeddata (3.3.1)
json-ld (~> 3.3)
Expand Down Expand Up @@ -378,6 +386,8 @@ GEM
net-smtp (0.5.0)
net-protocol
nio4r (2.7.4)
nokogiri (1.17.0-aarch64-linux)
racc (~> 1.4)
nokogiri (1.17.0-x86_64-linux)
racc (~> 1.4)
oai (1.2.1)
Expand Down Expand Up @@ -691,6 +701,7 @@ GEM
zeitwerk (2.7.1)

PLATFORMS
aarch64-linux
x86_64-linux

DEPENDENCIES
Expand All @@ -703,7 +714,7 @@ DEPENDENCIES
blacklight_range_limit
bootsnap (>= 1.4.2)
bootstrap (~> 5.1)
bulkrax
bulkrax!
bundler
byebug
coffee-rails (~> 4.2)
Expand Down
4 changes: 4 additions & 0 deletions hydra/app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@ def authenticate_if_needed
# removing the following 2 lines will re-enable devise auth
def authenticate_user!
end

def current_user
super || guest_user
end
end
6 changes: 0 additions & 6 deletions hydra/app/controllers/saved_searches_controller.rb

This file was deleted.

3 changes: 1 addition & 2 deletions hydra/app/controllers/search_history_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
class SearchHistoryController < ApplicationController
include Blacklight::SearchHistory

helper BlacklightRangeLimit::ViewHelperOverride
helper BlacklightAdvancedSearch::RenderConstraintsOverride
helper RangeLimitHelper
end
7 changes: 6 additions & 1 deletion hydra/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Application < Rails::Application
config.load_defaults 5.2

# Autoload lib/ folder including all subdirectories
config.autoload_paths += Dir["#{config.root}/lib/**/"]
config.autoload_paths << Rails.root.join('lib')

# use SideKiq by default
config.active_job.queue_adapter = :sidekiq
Expand All @@ -21,6 +21,11 @@ class Application < Rails::Application
Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")).sort.each do |c|
Rails.configuration.cache_classes ? require(c) : load(c)
end

Dir.glob(File.join(File.dirname(__FILE__), "../lib/**/*_decorator*.rb")).sort.each do |c|
puts c
Rails.configuration.cache_classes ? require(c) : load(c)
end
end

# Settings in config/environments/* take precedence over those specified here.
Expand Down
8 changes: 4 additions & 4 deletions hydra/config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
# Suppress logger output for asset requests.
config.assets.quiet = true

# Email Tests
# Email Tests
config.action_mailer.raise_delivery_errors = true
config.action_mailer.perform_deliveries = true
config.action_mailer.delivery_method = :smtp
Expand All @@ -75,7 +75,7 @@
port: 25,
enable_starttls_auto: true
}

# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true

Expand All @@ -84,8 +84,8 @@
config.file_watcher = ActiveSupport::EventedFileUpdateChecker

config.active_job.queue_adapter = :sidekiq

# developers can add their individual ips to this value. This configuration can also take an array
config.web_console.allowed_ips = %w(127.0.0.1 172.0.0.0/8)
config.web_console.allowed_ips = %w(127.0.0.1 172.0.0.0/8 0.0.0.0/0)
config.web_console.development_only = false
end
5 changes: 0 additions & 5 deletions hydra/config/initializers/bulkrax.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,3 @@
# # specific delimeter should likely be present in the multi_value_element_split_on expression.
# # config.multi_value_element_join_on = ' | '
# end

# Sidebar for hyrax 3+ support
if Object.const_defined?(:Hyrax) && ::Hyrax::DashboardController&.respond_to?(:sidebar_partials)
Hyrax::DashboardController.sidebar_partials[:repository_content] << 'hyrax/dashboard/sidebar/bulkrax_sidebar_additions'
end
6 changes: 3 additions & 3 deletions hydra/config/initializers/inflections.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
# end

# These inflection rules are supported but not enabled by default:
# ActiveSupport::Inflector.inflections(:en) do |inflect|
# inflect.acronym 'RESTful'
# end
ActiveSupport::Inflector.inflections(:en) do |inflect|
inflect.acronym 'API' # needed because of Bulkrax::API
end
8 changes: 8 additions & 0 deletions hydra/config/initializers/zeitwerk.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Bulkrax is still a very Hyrax focused gem and though there has been
# work to make it more generic, there are still some Hyrax specific
# constants that are loaded when the gem is loaded. This initializer
# will ignore all files that have 'hyrax' in the path so that Bulkrax
# can be used in this Hydra application
Dir.glob(Bulkrax::Engine.root.join('**', '*hyrax*')).each do |path|
Rails.autoloaders.main.ignore(path) if File.directory?(path)
end
36 changes: 18 additions & 18 deletions hydra/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
t.bigint "importerexporter_id"
t.text "raw_metadata"
t.text "parsed_metadata"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "last_error_at"
t.datetime "last_succeeded_at"
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.datetime "last_error_at", precision: nil
t.datetime "last_succeeded_at", precision: nil
t.string "importerexporter_type", default: "Bulkrax::Importer"
t.integer "import_attempts", default: 0
t.string "status_message", default: "Pending"
Expand Down Expand Up @@ -65,10 +65,10 @@
t.string "export_source"
t.string "export_from"
t.string "export_type"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "last_error_at"
t.datetime "last_succeeded_at"
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.datetime "last_error_at", precision: nil
t.datetime "last_succeeded_at", precision: nil
t.date "start_date"
t.date "finish_date"
t.string "work_visibility"
Expand All @@ -86,8 +86,8 @@
t.integer "processed_records", default: 0
t.integer "deleted_records", default: 0
t.integer "failed_records", default: 0
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.integer "processed_collections", default: 0
t.integer "failed_collections", default: 0
t.integer "total_collection_entries", default: 0
Expand All @@ -111,11 +111,11 @@
t.integer "limit"
t.text "parser_fields"
t.text "field_mapping"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.boolean "validate_only"
t.datetime "last_error_at"
t.datetime "last_succeeded_at"
t.datetime "last_error_at", precision: nil
t.datetime "last_succeeded_at", precision: nil
t.string "status_message", default: "Pending"
t.index ["user_id"], name: "index_bulkrax_importers_on_user_id"
end
Expand All @@ -124,8 +124,8 @@
t.bigint "importer_run_id", null: false
t.string "parent_id", null: false
t.string "child_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.integer "order", default: 0
t.index ["child_id"], name: "index_bulkrax_pending_relationships_on_child_id"
t.index ["importer_run_id"], name: "index_bulkrax_pending_relationships_on_importer_run_id"
Expand All @@ -141,8 +141,8 @@
t.string "statusable_type"
t.integer "runnable_id"
t.string "runnable_type"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.index ["error_class"], name: "index_bulkrax_statuses_on_error_class"
t.index ["runnable_id", "runnable_type"], name: "bulkrax_statuses_runnable_idx"
t.index ["statusable_id", "statusable_type"], name: "bulkrax_statuses_statusable_idx"
Expand Down

0 comments on commit 51956c4

Please sign in to comment.