-
Notifications
You must be signed in to change notification settings - Fork 0
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 #995 from UNC-Libraries/hyc-1737-class2
HYC-1737 - Hyrax 4 class override updates
- Loading branch information
Showing
27 changed files
with
174 additions
and
398 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
/tmp/* | ||
!/log/.keep | ||
!/tmp/.keep | ||
tmp | ||
|
||
# Ignore Byebug command history file. | ||
.byebug_history | ||
|
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 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/overrides/controllers/hyrax/file_sets_controller_override.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
11 changes: 0 additions & 11 deletions
11
app/overrides/controllers/hyrax/my/works_controller_override.rb
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...errides/forms/collection_form_override.rb → ...s/hyrax/forms/collection_form_override.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# frozen_string_literal: true | ||
# https://github.com/samvera/hyrax/blob/hyrax-v4.0.0/app/jobs/change_depositor_event_job.rb | ||
Hyrax::ChangeDepositorEventJob.class_eval do | ||
# [hyc-override] Overriding to make depositor a facet search and not link to user profile | ||
def action | ||
proxy_link = link_to(repo_object.proxy_depositor, search_catalog_path(f: { depositor_ssim: [repo_object.proxy_depositor] })) | ||
new_user_link = link_to(depositor, search_catalog_path(f: { depositor_ssim: [depositor] })) | ||
"User #{proxy_link} has transferred #{link_to_work repo_object.title.first} to user #{new_user_link}" | ||
end | ||
end |
11 changes: 0 additions & 11 deletions
11
app/overrides/jobs/content_depositor_change_event_job_override.rb
This file was deleted.
Oops, something went wrong.
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
5 changes: 3 additions & 2 deletions
5
app/overrides/presenters/hyrax/work_show_presenter_override.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
32 changes: 32 additions & 0 deletions
32
app/overrides/presenters/hyrax/workflow_presenter_override.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,32 @@ | ||
# frozen_string_literal: true | ||
# [hyc-override] https://github.com/samvera/hyrax/tree/hyrax-v4.0.0/app/presenters/hyrax/workflow_presenter.rb | ||
Hyrax::WorkflowPresenter.class_eval do | ||
def actions | ||
# [hyc-override] Hide panel from non-admins if the workflow action is to withdraw/delete the work | ||
return [] unless sipity_entity && current_ability && (current_ability.current_user.admin? || state != 'pending_deletion') | ||
actions = Hyrax::Workflow::PermissionQuery.scope_permitted_workflow_actions_available_for_current_state(entity: sipity_entity, user: current_ability.current_user) | ||
actions.map { |action| [action.name, action_label(action)] } | ||
end | ||
|
||
# [hyc-override] Add check to display message to MFA workflow depositor | ||
def is_mfa_in_review? | ||
return false unless sipity_entity | ||
|
||
sipity_entity&.workflow_name == 'art_mfa_deposit' && state == 'pending_review' | ||
end | ||
|
||
# [hyc-override] Add check to display attach works button to MFA workflow depositor | ||
def is_mfa? | ||
return false unless sipity_entity | ||
|
||
sipity_entity&.workflow_name == 'art_mfa_deposit' | ||
end | ||
|
||
# [hyc-override] Add permission checks to hide withdrawn files | ||
def in_workflow_state?(test_states = []) | ||
return false unless state && !test_states.blank? | ||
|
||
test_state_regex = test_states.join('|').gsub(/\s+/, '.+') | ||
!/#{test_state_regex}/.match(state).nil? | ||
end | ||
end |
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.