Skip to content

Commit

Permalink
Merge pull request #670 from scientist-softserv/i654-remove-featured-…
Browse files Browse the repository at this point in the history
…collection-block

🎁 Remove featured collections block
  • Loading branch information
sjproctor authored Jul 30, 2024
2 parents 7172909 + 5403a41 commit eb26094
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/views/hyrax/homepage/_home_content.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<div class="tab-content">
<div class="tab-pane active" id="tab-col2-first">
<h2 class="sr-only"><%= t('hyrax.homepage.admin_sets.title') %></h2>
<%= render 'featured_collection_section' %>
<%#= render 'featured_collection_section' %>
</div>
<%# add check for featured researcher %>
<% if @presenter.display_featured_researcher? %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<%# OVERRIDE: Hyrax v3.4.2 - add featured collections section, remove div classes %>
<div>
<h2 class="sr-only"><%= t('hyrax.homepage.admin_sets.title') %></h2>
<%= render 'featured_collection_section' %>
<%#= render 'featured_collection_section' %>
</div>
<%# OVERRIDE: Hyrax v3.4.2 - add browse collection section, remove div classes %>
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="col-xs-12 col-md-8 institutional-repository collections-container mb-40">
<div class="col-sm-12">
<h3>Featured Collections</h3>
<%= render 'featured_collection_section' %>
<%#= render 'featured_collection_section' %>
</div>
</div>
<div class="col-xs-12 col-md-4 institutional-repository">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div class="col-xs-12 featured-collection-section">
<div class="pb-30">
<h3>Collections</h3>
<%= render 'featured_collection_section' %>
<%#= render 'featured_collection_section' %>
</div>
</div>
</div>
Expand Down
18 changes: 13 additions & 5 deletions lib/reprocessor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@
## Reprocessor for iterating through large sets of ids
# There are two steps for any reprocessing. The first is to store all the ids to processin a ids.log file.
# The second to to run a lambda against every id
# No matter whether it is the first run or not, a run of the Reprocessor should always start with Reprocessor.load('tmp/imports/SOME_UNIQUE_NAME')
# This creates a context for the Reprocessor to run. After that, calling Reprocessor.capture_ids (or capture_work_ids, capture_file_set_ids or capture collection_ids)
# No matter whether it is the first run or not, a run of the Reprocessor should
# always start with Reprocessor.load('tmp/imports/SOME_UNIQUE_NAME')
# This creates a context for the Reprocessor to run.
# After that, calling Reprocessor.capture_ids (or capture_work_ids, capture_file_set_ids or capture collection_ids)
# will record all the ids in a file
# finally, once all the ids are split, then calling Reprocessor.process_ids with a lambda (like Reprocessor.process_ids(Reprocessor.save)) to call the process on each item
# At any point, the process can be stopped (or killed) and then resumed by doing Reprocessor.load(SAME_PATH) and then calling the process_ids again.
# finally, once all the ids are split, then calling Reprocessor.process_ids with a lambda
# (like Reprocessor.process_ids(Reprocessor.save)) to call the process on each item
# At any point, the process can be stopped (or killed) and then resumed by doing Reprocessor.load(SAME_PATH)
# and then calling the process_ids again.
class Reprocessor # rubocop:disable Metrics/ClassLength
include Singleton

Expand All @@ -29,7 +33,8 @@ def initialize

# Missing methods will be delegated to `instance` if an implementation is available.
# Else `NoMethodError` will be raised via call to `super`
def self.method_missing method_name, *args
# rubocop:disable Style/MethodMissing, Lint/ShadowingOuterLocalVariable, Rails/Output
def self.method_missing(method_name, *args)
if instance.respond_to? method_name
puts "** Defining new method: '#{method_name}'"
(class << self; self; end).instance_eval do
Expand All @@ -42,6 +47,7 @@ def self.method_missing method_name, *args
super
end
end
# rubocop:enable Style/MethodMissing, Lint/ShadowingOuterLocalVariable, Rails/Output

SETTINGS.each do |method|
define_singleton_method(method) do |*args|
Expand Down Expand Up @@ -125,6 +131,7 @@ def capture_bulkrax_entry_ids(query)
end
end

# rubocop:disable Style/RescueStandardError
def process_ids(lamb)
progress(id_line_size)
line_counter = 0
Expand All @@ -149,6 +156,7 @@ def process_ids(lamb)
break if limit && current_location >= limit
end
end
# rubocop:enable Style/RescueStandardError

def error(line, exception)
msg = "#{line} - #{exception.message[0..200]}"
Expand Down
2 changes: 1 addition & 1 deletion spec/indexers/uri_to_string_behavior_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
'User-Agent' => 'Ruby RDF.rb/3.1.15'
}
# rubocop:enable Matrics/LineLength
# rubocop:enable Metrics/LineLength
)
.to_return(status: 200, body: "", headers: {})
end
Expand Down

0 comments on commit eb26094

Please sign in to comment.