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

Use main blacklight-hierarchy gem instead of TRLN's local fork. Resol… #423

Merged
merged 1 commit into from
Jun 14, 2024
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 VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.1
2.3.2
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

@import 'blacklight_advanced_search';

@import 'blacklight/hierarchy/hierarchy';

@import 'font-awesome';

@import 'chosen';
53 changes: 20 additions & 33 deletions app/assets/stylesheets/trln_argon/trln_argon_shared.scss
Original file line number Diff line number Diff line change
Expand Up @@ -554,47 +554,35 @@ body.blacklight-trln-show {
/* FACETS */
/* =============== */

$hierarchy-facet-expand-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc. --><path fill='#{$gray-600}' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z'/></svg>");
// Blacklight Hierarchy Icons
// https://github.com/sul-dlss/blacklight-hierarchy/blob/main/README.md#changing-the-icons

$b-h-closed-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d='M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z'/></svg>");

$b-h-opened-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d='M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z'/></svg>");

.facet-hierarchy {
ul {
padding-left: 0.5rem;
li {
margin-top: 0.25rem;
margin-bottom: 0.25rem;
&.h-leaf {
// Keep this padding-left the same width as .toggle-handle
padding-left: 1.2rem;
}
.twiddle > .toggle-handle {
.toggle-icon {
background-color: $gray-600;
min-width: 1rem;
min-height: 1rem;
background-image: none;
mask-repeat: no-repeat;
mask-position: center;
}
.closed {
mask-image: $b-h-closed-icon;
}
.opened {
mask-image: $b-h-opened-icon;
}
}

.twiddle-open > .facet-label > a {
font-weight: bold;
}

.twiddle > .toggle-handle {
width: 1.2rem;
}

.twiddle > .toggle-handle .toggle-icon {
min-height: 0.8rem;
min-width: 0.8rem;
max-width: 0.8rem;
margin-right: 0.2rem;
margin-top: 0.2rem;
background-size: contain;
background-repeat: no-repeat;

&.closed {
background-image: escape-svg($hierarchy-facet-expand-icon);
}
&.opened {
background-image: escape-svg($hierarchy-facet-expand-icon);
transform: rotate(90deg);
}
}

.facet-label, .facet-count {
line-height: 1.2rem;
}
Expand All @@ -604,7 +592,6 @@ $hierarchy-facet-expand-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.
}
}


#checkbox_wrapper_access_type_f { // avalable online
display: flex;
flex-wrap: wrap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ $trln-purple: #490e6f !default;
$unc-blue: #467aaa !default;
$shared-links-color: #490e6f !default;


//== Media query breakpoints (from bootstrap v4.6)

// Old BS-3 based media queries used the following values:
Expand Down
13 changes: 0 additions & 13 deletions lib/generators/trln_argon/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,7 @@ def verify_blacklight_installed
raise 'Install Blacklight before installing TRLN Argon.'
end

# Load our TRLN fork of the blacklight-hierarchy gem
# TODO: remove in favor of trln_argon.gemspec once our fork is
# published on rubygems
def install_trln_fork_hierarchy
say_status('warning', 'Installing TRLN fork of blacklight-hierarchy', :yellow)

gem 'blacklight-hierarchy', git: 'https://github.com/trln/blacklight-hierarchy', tag: 'v6.3.1'
Bundler.with_clean_env do
run 'bundle install'
end
end

def run_dependency_generators
generate 'blacklight_hierarchy:install'
generate 'blacklight_range_limit:install'
end

Expand Down
5 changes: 2 additions & 3 deletions lib/trln_argon/controller_override.rb
Original file line number Diff line number Diff line change
Expand Up @@ -264,16 +264,15 @@ module ControllerOverride
advanced_search_component: TrlnArgon::AdvancedSearchFacetFieldComponent

# Hierarchical facet configuration
# See: https://github.com/trln/blacklight-hierarchy/blob/main/README.md
# See: https://github.com/sul-dlss/blacklight-hierarchy/blob/main/README.md
config.facet_display ||= {}
cnf_components = TrlnArgon::Fields::CALL_NUMBER_FACET.to_s.split('_')
lf_components = TrlnArgon::Fields::LOCATION_HIERARCHY_FACET.to_s.split('_')
config.facet_display[:hierarchy] = {
# blacklight-hierarchy gem requires this mapping;
# prefix + final component (separated by _) e.g.,
# 'location_hierarchy' => [['f'], ':']
# TRLN CUSTOMIZATION adds an optional third element to specify
# a custom FacetItemPresenter.
# An optional third element can specify a custom FacetItemPresenter.
cnf_components[0..-2].join('_') => [[cnf_components[-1]],
'|'],
lf_components[0..-2].join('_') => [[lf_components[-1]],
Expand Down
1 change: 1 addition & 0 deletions lib/trln_argon/engine.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require 'blacklight'
require 'blacklight_advanced_search'
require 'blacklight-hierarchy'
require 'blacklight_range_limit'
require 'rails_autolink'
require 'library_stdnums'
Expand Down
3 changes: 1 addition & 2 deletions trln_argon.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ Gem::Specification.new do |s|
s.add_dependency 'rails', '~> 7'
s.add_dependency 'blacklight', '~> 7.0'
s.add_dependency 'blacklight_advanced_search', '~> 8.0.0.alpha2'
# TODO: when trln-blacklight-hierarchy fork is published on rubygems, reference it here
# s.add_dependency 'trln-blacklight-hierarchy'
s.add_dependency 'blacklight-hierarchy', '~> 6.3'
s.add_dependency 'blacklight_range_limit', '~> 7'
s.add_dependency 'git', '>= 1.11.0', "< 2"
s.add_dependency 'rails_autolink', '~> 1.1'
Expand Down
Loading