Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BL-1171: Update blacklight_range_limit. #1944

Merged
merged 1 commit into from
Jun 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem "blacklight", "~> 7.8.0"
gem "blacklight_advanced_search", git: "https://github.com/projectblacklight/blacklight_advanced_search.git"
gem "blacklight-marc", git: "https://github.com/projectblacklight/blacklight-marc.git", ref: "v7.0.0.rc1"
gem "blacklight_range_limit", git: "https://github.com/projectblacklight/blacklight_range_limit.git", ref: "v7.0.0.rc2"
gem "blacklight_range_limit", git: "https://github.com/projectblacklight/blacklight_range_limit.git", ref: "v7.8.0"
group :development, :test do
gem "solr_wrapper", ">= 0.3"
gem "rspec-rails"
Expand Down
13 changes: 4 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,11 @@ GIT

GIT
remote: https://github.com/projectblacklight/blacklight_range_limit.git
revision: 6826dfb8b73554a79f26ca7ff375b0062e37bb22
ref: v7.0.0.rc2
revision: 44bfecba9d3c123fa01d6874288b0dc452fdb2a6
ref: v7.8.0
specs:
blacklight_range_limit (7.0.0.rc2)
blacklight
jquery-rails
rails (>= 3.0)
tether-rails
blacklight_range_limit (7.8.0)
blacklight (>= 7.0)

GIT
remote: https://github.com/tulibraries/alma_rb.git
Expand Down Expand Up @@ -506,8 +503,6 @@ GEM
json
term-ansicolor (1.7.1)
tins (~> 1.0)
tether-rails (1.4.0)
rails (>= 3.1)
thor (1.0.1)
thread_safe (0.3.6)
tilt (2.0.10)
Expand Down
6 changes: 6 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,9 @@ $(document).on('turbolinks:load', function() {
document.getElementById("main-toggler-icon").classList.toggle("change");
}
}

// This hack helps with a race condition bug in blacklight_range_limit gem.
// REF: BL-1171 and project_blacklight/blacklight_range_limit#111
window.addEventListener('load', function(event) {
$("#facet-pub_date_sort").trigger("shown.bs.collapse");
});
4 changes: 4 additions & 0 deletions app/assets/stylesheets/icons.css.erb
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,10 @@ span.remove-icon {
padding-left: 1.25rem;
}

.range_limit span.remove-icon {
display: none;
}

span.plus-icon {
background: transparent url(<%= asset_path "icons/plus.svg" %>) no-repeat top left;
padding-left: 1.25rem;
Expand Down
6 changes: 6 additions & 0 deletions app/assets/stylesheets/tucob.scss.erb
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,12 @@ img {
to { -webkit-transform: rotate(360deg); }
}

// Overrides blacklight_range_limit settings.
.range_limit .chart_js {
margin-left: 0px !important;
margin-right: 0px !important;
}

// This is a trick that can be used when chrome tools is displaying extra white space
// It helps to identify which element is causing the problem
// * {
Expand Down
22 changes: 22 additions & 0 deletions app/helpers/render_constraints_helper_behavior_override.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,26 @@ def render_filter_element(facet, values, path)
classes: ["filter", "filter-" + facet.parameterize])
end, "\n")
end
##
# Override with v7.5.0 version do to bug.
#
# @see https://github.com/projectblacklight/blacklight_range_limit/issues/152
# #
def render_constraints_filters(my_params = params)
content = super(my_params)
# add a constraint for ranges?
if my_params[:range].present? && my_params[:range].respond_to?(:each_pair)
my_params[:range].each_pair do |solr_field, hash|

next unless hash["missing"] || (!hash["begin"].blank?) || (!hash["end"].blank?)
content << render_constraint_element(
facet_field_label(solr_field),
range_display(solr_field, my_params),
escape_value: false,
remove: remove_range_param(solr_field, my_params)
)
end
end
return content
end
end