Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
💄 rubocop fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Shana Moore committed Nov 22, 2023
1 parent 65583e3 commit 5273bbb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def enable?
values = StrategiesController::ENABLE_VALUES | ADDITIONAL_ENABLE_VALUES
values.include?(params[:commit])
end

def features_url(**_kargs)
hyrax.admin_features_path
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ def features_url(**_kargs)
end
end

Hyrax::Admin::StrategiesController.prepend(Hyrax::Admin::StrategiesControllerDecorator)
Hyrax::Admin::StrategiesController.prepend(Hyrax::Admin::StrategiesControllerDecorator)
8 changes: 4 additions & 4 deletions app/helpers/pdf_js_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module PdfJsHelper
def pdf_js_url(file_set_presenter)
# assumes that the download path exists if the file set has been characterized
path = if file_set_presenter.mime_type
path = if file_set_presenter.mime_type
hyrax.download_path(file_set_presenter.id)
else
file_set_presenter.solr_document["import_url_ssim"].first
Expand All @@ -14,16 +14,16 @@ def pdf_js_url(file_set_presenter)

def pdf_file_set_presenter(presenter)
# currently only supports one pdf per work, falls back to the first pdf file set in ordered members

# Commenting this line out because even PDFs that were not split will still have a representative media
# which will be used first in this logic, consider uncommenting once all imports finish
# representative_presenter(presenter) ||
# representative_presenter(presenter) ||
first_file_set_pdf(presenter)
end

def first_file_set_pdf(presenter)
pdf_file_set_presenters = presenter.file_set_presenters.select(&:pdf?)
reader, archival = pdf_file_set_presenters.partition do |fsp|
reader, archival = pdf_file_set_presenters.partition do |fsp|
fsp.solr_document["import_url_ssim"]&.first&.include? "READER"
end

Expand Down
2 changes: 1 addition & 1 deletion app/presenters/hyku/work_show_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def video_embed_viewer
def pdf_viewer?
return unless Flipflop.default_pdf_viewer?
return unless file_set_presenters.any?(&:pdf?)

# If all of the member_presenters are file_set presenters, return true
# this also means that there are no child works
member_presenters.all? { |presenter| presenter.is_a? Hyrax::FileSetPresenter }
Expand Down

0 comments on commit 5273bbb

Please sign in to comment.