-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2117 from samvera/hyrax-5-clean-up-other-overrides
🧹 Clean up other overrides
- Loading branch information
Showing
24 changed files
with
159 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
app/presenters/hyrax/admin/dashboard_presenter_decorator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# frozen_string_literal: true | ||
|
||
# OVERRIDE Hyrax v5.0.0rc2 to fix user count. by joining roles, we keep the count correct even though there are many users | ||
module Hyrax | ||
module Admin | ||
module DashboardPresenterDecorator | ||
# @return [Fixnum] the number of currently registered users | ||
def user_count(start_date, end_date) | ||
::User.for_repository | ||
.where(guest: false) | ||
.where(created_at: start_date.to_date.beginning_of_day..end_date.to_date.end_of_day) | ||
.count | ||
end | ||
end | ||
end | ||
end | ||
|
||
Hyrax::Admin::DashboardPresenter.prepend(Hyrax::Admin::DashboardPresenterDecorator) |
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
app/presenters/hyrax/admin/workflow_roles_presenter_decorator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# frozen_string_literal: true | ||
|
||
# OVERRIDE Hyrax v5.0.0rc2 Expand to allow adding groups to workflow roles | ||
|
||
module Hyrax | ||
module Admin | ||
# Displays a list of users and their associated workflow roles | ||
module WorkflowRolesPresenterDecorator | ||
# OVERRIDE: New method for adding groups | ||
def groups | ||
Hyrax::Group.all | ||
end | ||
|
||
# OVERRIDE: New method for adding groups | ||
def group_presenter_for(group) | ||
agent = group.to_sipity_agent | ||
return unless agent | ||
Hyrax::Admin::WorkflowRolesPresenter::AgentPresenter.new(agent) | ||
end | ||
end | ||
end | ||
end | ||
|
||
Hyrax::Admin::WorkflowRolesPresenter.prepend(Hyrax::Admin::WorkflowRolesPresenterDecorator) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
app/search_builders/hyrax/collection_member_search_builder_decorator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
app/services/hyrax/file_set_derivatives_service_decorator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# frozen_string_literal: true | ||
|
||
# OVERRIDE Hyrax v5.0.0rc2 to increase the size of thumbnails | ||
|
||
module Hyrax | ||
module FileSetDerivativesServiceDecorator | ||
def create_pdf_derivatives(filename) | ||
Hydra::Derivatives::PdfDerivatives.create(filename, outputs: [{ label: :thumbnail, | ||
format: 'jpg', | ||
size: '676x986', | ||
url: derivative_url('thumbnail'), | ||
layer: 0 }]) | ||
extract_full_text(filename, uri) | ||
end | ||
|
||
def create_office_document_derivatives(filename) | ||
Hydra::Derivatives::DocumentDerivatives.create(filename, outputs: [{ label: :thumbnail, | ||
format: 'jpg', | ||
size: '600x450>', | ||
url: derivative_url('thumbnail'), | ||
layer: 0 }]) | ||
extract_full_text(filename, uri) | ||
end | ||
|
||
def create_image_derivatives(filename) | ||
# We're asking for layer 0, because otherwise pyramidal tiffs flatten all the layers together into the thumbnail | ||
Hydra::Derivatives::ImageDerivatives.create(filename, outputs: [{ label: :thumbnail, | ||
format: 'jpg', | ||
size: '600x450>', | ||
url: derivative_url('thumbnail'), | ||
layer: 0 }]) | ||
end | ||
end | ||
end | ||
|
||
Hyrax::FileSetDerivativesService.prepend(Hyrax::FileSetDerivativesServiceDecorator) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
4 changes: 3 additions & 1 deletion
4
lib/iiif_manifest/manifest_builder/canvas_builder_decorator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.