blacklight 7.30.0 → 7.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/app/components/blacklight/document/action_component.html.erb +1 -1
- data/app/components/blacklight/icons/icon_component.rb +14 -2
- data/app/helpers/blacklight/icon_helper_behavior.rb +5 -3
- data/app/models/search_builder.rb +5 -0
- data/app/views/catalog/_search_results.html.erb +1 -2
- data/app/views/catalog/_search_results_header.html.erb +1 -0
- data/lib/blacklight.rb +6 -6
- data/lib/generators/blacklight/assets_generator.rb +9 -3
- data/lib/generators/blacklight/templates/catalog_controller.rb +2 -0
- data/lib/generators/blacklight/templates/solr/conf/solrconfig.xml +1 -1
- data/lib/generators/blacklight/templates/solr_document.rb +2 -0
- data/spec/helpers/blacklight/icon_helper_behavior_spec.rb +8 -3
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7693f7aa372d8e623d9cb996089c4a04bff5ea462b119263efbceec482f0085
|
4
|
+
data.tar.gz: e2c3b9c56f6158c05b97685cfebbc3dc38fbdee1052cd8b5c3e432900cbec35d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0e155b0bf0fa6f5b8c15ef317bb05198b91e871187a8f8fc846894f182e3a2883ae07caa9c3eceaa676a1b45ce94f34bd73e9d9a4b97ce55eb2da15d5c4ab6f
|
7
|
+
data.tar.gz: 69adc6ec4c6402a555bcf2f970adfb692ea5b9a5422375050f787b494d0f62d371859198db14d45373416d10743ee1759162900c25840994481edebd618527c6
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
7.
|
1
|
+
7.31.0
|
@@ -3,7 +3,7 @@
|
|
3
3
|
url,
|
4
4
|
id: @id,
|
5
5
|
class: @link_classes,
|
6
|
-
data: {}.merge(({ blacklight_modal: "trigger" } if @action.modal != false) || {}) %>
|
6
|
+
data: {}.merge(({ blacklight_modal: "trigger", turbo: false } if @action.modal != false) || {}) %>
|
7
7
|
<% else %>
|
8
8
|
<%= helpers.render(partial: @action.partial || @action.name.to_s, locals: { document: @document, document_action_config: @action }.merge(@options)) %>
|
9
9
|
<% end %>
|
@@ -6,15 +6,27 @@ module Blacklight
|
|
6
6
|
# You can override the default svg by setting:
|
7
7
|
# Blacklight::Icons::ListComponent.svg = '<svg>your SVG here</svg>'
|
8
8
|
class IconComponent < ::ViewComponent::Base
|
9
|
-
|
9
|
+
# rubocop:disable Metrics/ParameterLists
|
10
|
+
def initialize(svg: nil, tag: :span, name: nil, label: nil, aria_hidden: nil, classes: nil, **options)
|
10
11
|
self.svg = svg if svg
|
12
|
+
@classes = Array(classes) + ['blacklight-icons', "blacklight-icons-#{name}"]
|
13
|
+
@name = name
|
14
|
+
@tag = tag
|
15
|
+
@options = options.merge(aria: options.fetch(:aria, {}).reverse_merge(label: label, hidden: aria_hidden))
|
11
16
|
end
|
17
|
+
# rubocop:enable Metrics/ParameterLists
|
12
18
|
|
13
19
|
def call
|
14
|
-
svg&.html_safe # rubocop:disable Rails/OutputSafety
|
20
|
+
tag.public_send(@tag, svg&.html_safe, # rubocop:disable Rails/OutputSafety
|
21
|
+
class: @classes,
|
22
|
+
**@options)
|
15
23
|
end
|
16
24
|
|
17
25
|
class_attribute :svg
|
26
|
+
|
27
|
+
def name
|
28
|
+
@name ||= self.class.name.demodulize.underscore.sub('_component', '')
|
29
|
+
end
|
18
30
|
end
|
19
31
|
end
|
20
32
|
end
|
@@ -9,9 +9,11 @@ module Blacklight::IconHelperBehavior
|
|
9
9
|
# the svg everytime.
|
10
10
|
# @param [String, Symbol] icon_name
|
11
11
|
# @return [String]
|
12
|
-
def blacklight_icon(icon_name,
|
13
|
-
|
14
|
-
|
12
|
+
def blacklight_icon(icon_name, **kwargs)
|
13
|
+
render "Blacklight::Icons::#{icon_name.to_s.camelize}Component".constantize.new(**kwargs)
|
14
|
+
rescue NameError
|
15
|
+
Rails.cache.fetch([:blacklight_icons, icon_name, kwargs]) do
|
16
|
+
icon = Blacklight::Icon.new(icon_name, **kwargs)
|
15
17
|
tag.span(icon.svg.html_safe, **icon.options)
|
16
18
|
end
|
17
19
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
<h1 class="sr-only visually-hidden top-content-title"><%= t('blacklight.search.header') %></h1>
|
data/lib/blacklight.rb
CHANGED
@@ -60,11 +60,7 @@ module Blacklight
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def self.connection_config
|
63
|
-
Blacklight::RuntimeRegistry.connection_config ||=
|
64
|
-
raise "The #{::Rails.env} environment settings were not found in the blacklight.yml config" unless blacklight_yml[::Rails.env]
|
65
|
-
|
66
|
-
blacklight_yml[::Rails.env].symbolize_keys
|
67
|
-
end
|
63
|
+
Blacklight::RuntimeRegistry.connection_config ||= blacklight_yml[::Rails.env]&.symbolize_keys if blacklight_yml?
|
68
64
|
end
|
69
65
|
|
70
66
|
def self.connection_config=(value)
|
@@ -86,7 +82,7 @@ module Blacklight
|
|
86
82
|
require 'yaml'
|
87
83
|
|
88
84
|
return @blacklight_yml if @blacklight_yml
|
89
|
-
unless
|
85
|
+
unless blacklight_yml?
|
90
86
|
raise "You are missing a configuration file: #{blacklight_config_file}. Have you run \"rails generate blacklight:install\"?"
|
91
87
|
end
|
92
88
|
|
@@ -113,6 +109,10 @@ module Blacklight
|
|
113
109
|
@blacklight_yml
|
114
110
|
end
|
115
111
|
|
112
|
+
def self.blacklight_yml?
|
113
|
+
File.exist?(blacklight_config_file)
|
114
|
+
end
|
115
|
+
|
116
116
|
def self.logger
|
117
117
|
@logger ||= begin
|
118
118
|
::Rails.logger if defined? Rails && Rails.respond_to?(:logger)
|
@@ -15,8 +15,6 @@ module Blacklight
|
|
15
15
|
return unless Rails.version > '7'
|
16
16
|
|
17
17
|
gem "sassc-rails", "~> 2.1"
|
18
|
-
|
19
|
-
remove_file 'app/javascript/application.js'
|
20
18
|
end
|
21
19
|
|
22
20
|
# Add sprockets javascript if needed
|
@@ -37,7 +35,7 @@ module Blacklight
|
|
37
35
|
# Remove the empty generated app/assets/images directory. Without doing this,
|
38
36
|
# the default Sprockets 4 manifest will raise an exception.
|
39
37
|
def appease_sprockets4
|
40
|
-
return if !defined?(Sprockets::VERSION) || Sprockets::VERSION < '4'
|
38
|
+
return if !defined?(Sprockets::VERSION) || Sprockets::VERSION < '4' || using_importmap?
|
41
39
|
|
42
40
|
append_to_file 'app/assets/config/manifest.js', "\n//= link application.js"
|
43
41
|
empty_directory 'app/assets/images'
|
@@ -74,6 +72,14 @@ module Blacklight
|
|
74
72
|
|
75
73
|
private
|
76
74
|
|
75
|
+
def root
|
76
|
+
@root ||= Pathname(destination_root)
|
77
|
+
end
|
78
|
+
|
79
|
+
def using_importmap?
|
80
|
+
@using_importmap ||= root.join('config/importmap.rb').exist?
|
81
|
+
end
|
82
|
+
|
77
83
|
def turbolinks?
|
78
84
|
@turbolinks ||= application_js.include?('turbolinks')
|
79
85
|
end
|
@@ -17,7 +17,7 @@
|
|
17
17
|
</updateHandler>
|
18
18
|
|
19
19
|
<!-- solr lib dirs -->
|
20
|
-
<lib dir="${solr.install.dir:../../../..}/
|
20
|
+
<lib dir="${solr.install.dir:../../../..}/modules/analysis-extras/lib" />
|
21
21
|
<lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lib" />
|
22
22
|
<lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lucene-libs" />
|
23
23
|
|
@@ -2,9 +2,14 @@
|
|
2
2
|
|
3
3
|
RSpec.describe Blacklight::IconHelperBehavior do
|
4
4
|
describe '#blacklight_icon' do
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
subject(:icon) { helper.blacklight_icon(:search, classes: 'custom-class') }
|
6
|
+
|
7
|
+
it 'returns the svg' do
|
8
|
+
expect(icon).to have_css '.blacklight-icons svg'
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'adds classes to the wrappering element' do
|
12
|
+
expect(icon).to have_css '.custom-class svg'
|
8
13
|
end
|
9
14
|
end
|
10
15
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.31.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Rochkind
|
@@ -17,7 +17,7 @@ authors:
|
|
17
17
|
autorequire:
|
18
18
|
bindir: exe
|
19
19
|
cert_chain: []
|
20
|
-
date: 2022-10-
|
20
|
+
date: 2022-10-18 00:00:00.000000000 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
name: rails
|
@@ -555,6 +555,7 @@ files:
|
|
555
555
|
- app/models/concerns/blacklight/user.rb
|
556
556
|
- app/models/record_mailer.rb
|
557
557
|
- app/models/search.rb
|
558
|
+
- app/models/search_builder.rb
|
558
559
|
- app/models/solr_document.rb
|
559
560
|
- app/presenters/blacklight/clause_presenter.rb
|
560
561
|
- app/presenters/blacklight/document_presenter.rb
|
@@ -620,6 +621,7 @@ files:
|
|
620
621
|
- app/views/catalog/_search_form.html.erb
|
621
622
|
- app/views/catalog/_search_header.html.erb
|
622
623
|
- app/views/catalog/_search_results.html.erb
|
624
|
+
- app/views/catalog/_search_results_header.html.erb
|
623
625
|
- app/views/catalog/_search_sidebar.html.erb
|
624
626
|
- app/views/catalog/_show.html.erb
|
625
627
|
- app/views/catalog/_show_header.html.erb
|