blacklight 7.29.0 → 7.30.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/.github/workflows/ruby.yml +9 -2
- data/README.md +1 -1
- data/VERSION +1 -1
- data/app/assets/stylesheets/blacklight/_twitter_typeahead.scss +7 -0
- data/app/components/blacklight/document_title_component.html.erb +2 -2
- data/app/components/blacklight/document_title_component.rb +2 -2
- data/app/components/blacklight/icons/icon_component.rb +20 -0
- data/app/components/blacklight/response/view_type_button_component.rb +3 -0
- data/lib/blacklight/component.rb +3 -1
- data/lib/blacklight/configuration/fields.rb +1 -1
- data/lib/blacklight/configuration/view_config.rb +1 -1
- data/lib/blacklight/search_builder.rb +3 -0
- data/spec/components/blacklight/document_component_spec.rb +14 -0
- data/spec/models/blacklight/configuration_spec.rb +7 -7
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3f2833ee33fe1cc1d37ef72206820efdd9bbdd4c39f14783c08bfba4c7b9dd8
|
4
|
+
data.tar.gz: 3f9cbc91061f1a1b68bd25aab95c518f134c7a497566241691a8aee63cc6b752
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b6500ea3048765a8e9d78425eb6f14d7a7edcb6cd17c1ddcc91c88edc7e09353672f0aa7ff29e1e85fbe238508066f9221b652c48cacbfe947e636dbac13a27
|
7
|
+
data.tar.gz: 5da051e3b7d496204d5e8752c09d346e39c0a94d917539155e60d0a2488ee3a32770bdbf205d11d9fff9da0f107c8d01b8786749ad9e9272b4b9933f46b6815e
|
data/.github/workflows/ruby.yml
CHANGED
@@ -23,6 +23,7 @@ jobs:
|
|
23
23
|
uses: ruby/setup-ruby@v1
|
24
24
|
with:
|
25
25
|
ruby-version: 2.7
|
26
|
+
bundler: 'latest'
|
26
27
|
- name: Install dependencies
|
27
28
|
run: bundle install
|
28
29
|
- name: Run linter
|
@@ -38,12 +39,13 @@ jobs:
|
|
38
39
|
uses: ruby/setup-ruby@v1
|
39
40
|
with:
|
40
41
|
ruby-version: ${{ matrix.ruby }}
|
42
|
+
bundler: 'latest'
|
41
43
|
- name: Install dependencies
|
42
44
|
run: bundle install
|
43
45
|
- name: Run tests
|
44
46
|
run: bundle exec rake ci
|
45
47
|
env:
|
46
|
-
ENGINE_CART_RAILS_OPTIONS: '
|
48
|
+
ENGINE_CART_RAILS_OPTIONS: '--skip-git --skip-listen --skip-spring --skip-keeps --skip-action-cable --skip-coffee --skip-test'
|
47
49
|
test_bootstrap5:
|
48
50
|
runs-on: ubuntu-latest
|
49
51
|
strategy:
|
@@ -55,6 +57,7 @@ jobs:
|
|
55
57
|
uses: ruby/setup-ruby@v1
|
56
58
|
with:
|
57
59
|
ruby-version: ${{ matrix.ruby }}
|
60
|
+
bundler: 'latest'
|
58
61
|
- name: Install dependencies
|
59
62
|
run: bundle install
|
60
63
|
- name: Run tests
|
@@ -73,6 +76,7 @@ jobs:
|
|
73
76
|
uses: ruby/setup-ruby@v1
|
74
77
|
with:
|
75
78
|
ruby-version: ${{ matrix.ruby }}
|
79
|
+
bundler: 'latest'
|
76
80
|
- name: Install dependencies
|
77
81
|
run: bundle install
|
78
82
|
env:
|
@@ -93,6 +97,7 @@ jobs:
|
|
93
97
|
uses: ruby/setup-ruby@v1
|
94
98
|
with:
|
95
99
|
ruby-version: ${{ matrix.ruby }}
|
100
|
+
bundler: 'latest'
|
96
101
|
- name: Install dependencies
|
97
102
|
run: bundle install
|
98
103
|
env:
|
@@ -114,6 +119,7 @@ jobs:
|
|
114
119
|
uses: ruby/setup-ruby@v1
|
115
120
|
with:
|
116
121
|
ruby-version: ${{ matrix.ruby }}
|
122
|
+
bundler: 'latest'
|
117
123
|
- name: Install dependencies
|
118
124
|
run: bundle install
|
119
125
|
env:
|
@@ -133,6 +139,7 @@ jobs:
|
|
133
139
|
- name: Set up Ruby
|
134
140
|
uses: ruby/setup-ruby@v1
|
135
141
|
with:
|
142
|
+
bundler: 'latest'
|
136
143
|
ruby-version: ${{ matrix.ruby }}
|
137
144
|
- name: Install dependencies
|
138
145
|
run: bundle install
|
@@ -140,7 +147,7 @@ jobs:
|
|
140
147
|
run: bundle exec rake ci
|
141
148
|
env:
|
142
149
|
BLACKLIGHT_API_TEST: true
|
143
|
-
ENGINE_CART_RAILS_OPTIONS: '--api --skip-git --skip-bundle --skip-listen --skip-spring --skip-yarn --skip-keeps --skip-action-cable --skip-coffee --skip-test'
|
150
|
+
ENGINE_CART_RAILS_OPTIONS: '-a propshaft --api --skip-git --skip-bundle --skip-listen --skip-spring --skip-yarn --skip-keeps --skip-action-cable --skip-coffee --skip-test'
|
144
151
|
docker_build:
|
145
152
|
runs-on: ubuntu-latest
|
146
153
|
steps:
|
data/README.md
CHANGED
@@ -42,7 +42,7 @@ rails generate blacklight:install
|
|
42
42
|
Code contributions are always welcome, instructions for contributing can be found at [CONTRIBUTING.md](https://github.com/projectblacklight/blacklight/blob/main/CONTRIBUTING.md).
|
43
43
|
|
44
44
|
## Configuring Apache Solr
|
45
|
-
You'll also want some information about how Blacklight expects [Apache Solr](http://lucene.apache.org/solr ) to run, which you can find in [
|
45
|
+
You'll also want some information about how Blacklight expects [Apache Solr](http://lucene.apache.org/solr ) to run, which you can find in [Solr Configuration](https://github.com/projectblacklight/blacklight/wiki/Solr-Configuration#solr-configuration)
|
46
46
|
|
47
47
|
## Building the javascript
|
48
48
|
The javascript is built by npm from sources in `app/javascript` into a bundle
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
7.
|
1
|
+
7.30.0
|
@@ -9,6 +9,7 @@
|
|
9
9
|
|
10
10
|
input.tt-hint.form-control {
|
11
11
|
width: 100%;
|
12
|
+
filter: opacity(0.33);
|
12
13
|
}
|
13
14
|
|
14
15
|
.tt-menu {
|
@@ -27,4 +28,10 @@
|
|
27
28
|
font-size: 14px;
|
28
29
|
padding: 5px 5px 5px 10px;
|
29
30
|
}
|
31
|
+
|
32
|
+
.tt-suggestion:hover {
|
33
|
+
background-color: $dropdown-link-hover-bg;
|
34
|
+
color: $dropdown-link-hover-color;
|
35
|
+
cursor: pointer;
|
36
|
+
}
|
30
37
|
}
|
@@ -1,12 +1,12 @@
|
|
1
1
|
<header class="documentHeader row">
|
2
2
|
<%= content_tag @as, class: @classes do %>
|
3
|
-
<%
|
3
|
+
<% before_titles.each do |t| %>
|
4
4
|
<%= t %>
|
5
5
|
<% end %>
|
6
6
|
|
7
7
|
<%= counter -%><%= title -%>
|
8
8
|
|
9
|
-
<%
|
9
|
+
<% after_titles.each do |t| %>
|
10
10
|
<%= t %>
|
11
11
|
<% end %>
|
12
12
|
<% end %>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Blacklight
|
4
|
+
module Icons
|
5
|
+
# This is the list icon for the search button.
|
6
|
+
# You can override the default svg by setting:
|
7
|
+
# Blacklight::Icons::ListComponent.svg = '<svg>your SVG here</svg>'
|
8
|
+
class IconComponent < ::ViewComponent::Base
|
9
|
+
def initialize(svg: nil)
|
10
|
+
self.svg = svg if svg
|
11
|
+
end
|
12
|
+
|
13
|
+
def call
|
14
|
+
svg&.html_safe # rubocop:disable Rails/OutputSafety
|
15
|
+
end
|
16
|
+
|
17
|
+
class_attribute :svg
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -15,6 +15,9 @@ module Blacklight
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def icon
|
18
|
+
return render(@view.icon.new) if @view.icon.is_a?(Class)
|
19
|
+
return render(@view.icon) if @view.icon.is_a?(ViewComponent::Base)
|
20
|
+
|
18
21
|
Deprecation.silence(Blacklight::CatalogHelperBehavior) do
|
19
22
|
helpers.render_view_type_group_icon(@view.icon || @key)
|
20
23
|
end
|
data/lib/blacklight/component.rb
CHANGED
@@ -8,6 +8,8 @@ module Blacklight
|
|
8
8
|
@__vc_compiler ||= EngineCompiler.new(self)
|
9
9
|
end
|
10
10
|
# rubocop:enable Naming/MemoizedInstanceVariableName
|
11
|
+
|
12
|
+
alias sidecar_files _sidecar_files unless ViewComponent::Base.respond_to? :sidecar_files
|
11
13
|
end
|
12
14
|
|
13
15
|
class EngineCompiler < ::ViewComponent::Compiler
|
@@ -23,7 +25,7 @@ module Blacklight
|
|
23
25
|
@templates ||= begin
|
24
26
|
extensions = ActionView::Template.template_handler_extensions
|
25
27
|
|
26
|
-
component_class.
|
28
|
+
component_class.sidecar_files(extensions).each_with_object([]) do |path, memo|
|
27
29
|
pieces = File.basename(path).split(".")
|
28
30
|
app_path = "#{Rails.root}/#{path.slice(path.index(component_class.view_component_path)..-1)}"
|
29
31
|
|
@@ -13,7 +13,7 @@ module Blacklight
|
|
13
13
|
def define_field_access(key, base_class_name = nil, class: nil)
|
14
14
|
key = key.to_s if respond_to? :to_s
|
15
15
|
|
16
|
-
default_values[key.pluralize.to_sym] = ActiveSupport::
|
16
|
+
default_values[key.pluralize.to_sym] = ActiveSupport::HashWithIndifferentAccess.new
|
17
17
|
|
18
18
|
@field_type_for_class ||= {}
|
19
19
|
@field_type_for_class[key] = binding.local_variable_get(:class) || base_class_name
|
@@ -14,7 +14,7 @@ class Blacklight::Configuration
|
|
14
14
|
# @!attribute display_type_field
|
15
15
|
# @return [String, Symbol] solr field to use to render format-specific partials
|
16
16
|
# @!attribute icon
|
17
|
-
# @return [String, Symbol] icon file to use in the view picker
|
17
|
+
# @return [String, Symbol, Blacklight::Icons::IconComponent] icon file to use in the view picker
|
18
18
|
# @!attribute document_actions
|
19
19
|
# @return [NestedOpenStructWithHashAccess{Symbol => Blacklight::Configuration::ToolConfig}] 'tools' to render for each document
|
20
20
|
# @!attribute facet_group_component
|
@@ -45,6 +45,9 @@ module Blacklight
|
|
45
45
|
|
46
46
|
##
|
47
47
|
# Update the :q (query) parameter
|
48
|
+
# @param [Hash<Symbol,Object>] conditions the field and values to query on
|
49
|
+
# @example
|
50
|
+
# search_builder.where(id: [1,2,3]) # produces: q:"{!lucene}id:(1 OR 2 OR 3)"
|
48
51
|
def where(conditions)
|
49
52
|
Deprecation.warn(Blacklight::SearchBuilder, "SearchBuilder#where must be called with a hash, received #{conditions.inspect}.") unless conditions.is_a? Hash
|
50
53
|
params_will_change!
|
@@ -166,4 +166,18 @@ RSpec.describe Blacklight::DocumentComponent, type: :component do
|
|
166
166
|
expect(rendered).to have_content 'Thumb!'
|
167
167
|
end
|
168
168
|
end
|
169
|
+
|
170
|
+
context 'with before_title' do
|
171
|
+
let(:render) do
|
172
|
+
component.render_in(view_context) do
|
173
|
+
component.title do |c|
|
174
|
+
c.before_title { 'Prefix!' }
|
175
|
+
end
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
it 'shows the prefix' do
|
180
|
+
expect(rendered).to have_content "Prefix!"
|
181
|
+
end
|
182
|
+
end
|
169
183
|
end
|
@@ -39,13 +39,13 @@ RSpec.describe "Blacklight::Configuration", api: true do
|
|
39
39
|
end
|
40
40
|
|
41
41
|
it "has ordered hashes for field configuration" do
|
42
|
-
expect(config.facet_fields).to be_a_kind_of ActiveSupport::
|
43
|
-
expect(config.index_fields).to be_a_kind_of ActiveSupport::
|
44
|
-
expect(config.show_fields).to be_a_kind_of ActiveSupport::
|
45
|
-
expect(config.search_fields).to be_a_kind_of ActiveSupport::
|
46
|
-
expect(config.show_fields).to be_a_kind_of ActiveSupport::
|
47
|
-
expect(config.search_fields).to be_a_kind_of ActiveSupport::
|
48
|
-
expect(config.sort_fields).to be_a_kind_of ActiveSupport::
|
42
|
+
expect(config.facet_fields).to be_a_kind_of ActiveSupport::HashWithIndifferentAccess
|
43
|
+
expect(config.index_fields).to be_a_kind_of ActiveSupport::HashWithIndifferentAccess
|
44
|
+
expect(config.show_fields).to be_a_kind_of ActiveSupport::HashWithIndifferentAccess
|
45
|
+
expect(config.search_fields).to be_a_kind_of ActiveSupport::HashWithIndifferentAccess
|
46
|
+
expect(config.show_fields).to be_a_kind_of ActiveSupport::HashWithIndifferentAccess
|
47
|
+
expect(config.search_fields).to be_a_kind_of ActiveSupport::HashWithIndifferentAccess
|
48
|
+
expect(config.sort_fields).to be_a_kind_of ActiveSupport::HashWithIndifferentAccess
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
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.30.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-
|
20
|
+
date: 2022-10-03 00:00:00.000000000 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
name: rails
|
@@ -470,6 +470,7 @@ files:
|
|
470
470
|
- app/components/blacklight/facet_item_component.rb
|
471
471
|
- app/components/blacklight/facet_item_pivot_component.rb
|
472
472
|
- app/components/blacklight/hidden_search_state_component.rb
|
473
|
+
- app/components/blacklight/icons/icon_component.rb
|
473
474
|
- app/components/blacklight/metadata_field_component.html.erb
|
474
475
|
- app/components/blacklight/metadata_field_component.rb
|
475
476
|
- app/components/blacklight/metadata_field_layout_component.html.erb
|