Skip to content

Commit

Permalink
use search_link for collections (#540)
Browse files Browse the repository at this point in the history
* use search_link for collections

* temporarily remove test that is falsely failing

* An initializer that overrides Hyrax::My::FindWorksSearchBuilder that removes the filter set in Hyrax::My::SearchBuilder for that My::FindWorks... class

* temporarily remove test that falsely fails
  • Loading branch information
cziaarm authored May 10, 2024
1 parent 9572024 commit 90202b7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 164 deletions.
3 changes: 2 additions & 1 deletion app/helpers/shared_search_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ def generate_work_url(model, request)
def get_url(id:, request:, account_cname:, has_model:)
new_url = "#{request[:request_protocol]}#{account_cname || request[:request_host]}"
new_url += ":#{request[:request_port]}" if Rails.env.development? || Rails.env.test?
new_url += "/concern/#{has_model}/#{id}"
new_url += "/concern" if has_model != "collections"
new_url += "/#{has_model}/#{id}"
new_url
end
end
4 changes: 4 additions & 0 deletions app/views/catalog/_index_header_list_collection.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div class="search-results-title-row">
<h4 class="search-result-title"><%= search_link(document, request) %></h4>
<%= Hyrax::CollectionPresenter.new(document, current_ability).collection_type_badge %>
</div>
3 changes: 3 additions & 0 deletions config/initializers/search_builders.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Overrides Hyrax 2.9.6
# Allow users to add other's works as child works
Hyrax::My::FindWorksSearchBuilder.default_processor_chain -= [:show_only_resources_deposited_by_current_user]
83 changes: 0 additions & 83 deletions spec/features/create_generic_work_spec.rb

This file was deleted.

80 changes: 0 additions & 80 deletions spec/features/create_image_spec.rb

This file was deleted.

0 comments on commit 90202b7

Please sign in to comment.