blacklight 9.0.0.beta2 → 9.0.0.beta4
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/.rubocop.yml +11 -1
- data/.rubocop_todo.yml +24 -25
- data/VERSION +1 -1
- data/app/assets/builds/blacklight.css +8 -7
- data/app/assets/javascripts/blacklight/blacklight.esm.js +13 -5
- data/app/assets/javascripts/blacklight/blacklight.esm.js.map +1 -1
- data/app/assets/javascripts/blacklight/blacklight.js +13 -5
- data/app/assets/javascripts/blacklight/blacklight.js.map +1 -1
- data/app/assets/stylesheets/blacklight/_blacklight_base.scss +0 -1
- data/app/assets/stylesheets/blacklight/_facets.scss +10 -2
- data/app/components/blacklight/constraint_layout_component.html.erb +1 -6
- data/app/components/blacklight/constraint_layout_component.rb +9 -0
- data/app/components/blacklight/document/bookmark_component.html.erb +2 -2
- data/app/components/blacklight/document_component.html.erb +3 -3
- data/app/components/blacklight/document_component.rb +2 -2
- data/app/components/blacklight/document_title_component.rb +3 -0
- data/app/components/blacklight/facet_field_checkboxes_component.rb +6 -2
- data/app/components/blacklight/facet_field_component.rb +6 -2
- data/app/components/blacklight/facet_field_filter_component.rb +6 -2
- data/app/components/blacklight/facet_field_inclusive_constraint_component.rb +6 -4
- data/app/components/blacklight/facet_field_list_component.rb +6 -2
- data/app/components/blacklight/facet_field_no_layout_component.rb +6 -2
- data/app/components/blacklight/facet_item_component.rb +6 -2
- data/app/components/blacklight/facet_item_pivot_component.rb +1 -1
- data/app/components/blacklight/facets/filters_component.html.erb +2 -2
- data/app/components/blacklight/facets/filters_component.rb +14 -2
- data/app/components/blacklight/facets/list_component.html.erb +3 -3
- data/app/components/blacklight/facets/list_component.rb +4 -1
- data/app/components/blacklight/facets/pivot_list_component.rb +11 -0
- data/app/components/blacklight/icons/remove_component.rb +2 -2
- data/app/components/blacklight/response/facet_group_component.html.erb +2 -2
- data/app/components/blacklight/response/facet_group_component.rb +6 -2
- data/app/components/blacklight/system/flash_message_component.html.erb +1 -1
- data/app/components/blacklight/system/flash_message_component.rb +0 -9
- data/app/components/blacklight/system/modal_component.html.erb +1 -2
- data/app/controllers/concerns/blacklight/bookmarks.rb +10 -0
- data/app/controllers/concerns/blacklight/catalog.rb +6 -2
- data/app/helpers/blacklight/catalog_helper_behavior.rb +1 -1
- data/app/javascript/blacklight-frontend/bookmark_toggle.js +7 -2
- data/app/javascript/blacklight-frontend/checkbox_submit.js +5 -1
- data/app/javascript/blacklight-frontend/modal.js +2 -3
- data/app/presenters/blacklight/json_presenter.rb +7 -1
- data/app/views/blacklight/nav/_bookmark.html.erb +1 -1
- data/app/views/catalog/facet.html.erb +1 -1
- data/config/locales/blacklight.ar.yml +12 -11
- data/config/locales/blacklight.ca.yml +1 -0
- data/config/locales/blacklight.de.yml +13 -12
- data/config/locales/blacklight.en.yml +1 -0
- data/config/locales/blacklight.es.yml +11 -10
- data/config/locales/blacklight.fr.yml +12 -11
- data/config/locales/blacklight.hu.yml +13 -12
- data/config/locales/blacklight.it.yml +13 -12
- data/config/locales/blacklight.nl.yml +12 -11
- data/config/locales/blacklight.pt-BR.yml +13 -12
- data/config/locales/blacklight.sq.yml +12 -11
- data/config/locales/blacklight.zh.yml +9 -8
- data/lib/blacklight/configuration/facet_field.rb +1 -0
- data/lib/blacklight/configuration.rb +7 -1
- data/lib/blacklight/solr/repository.rb +4 -1
- data/lib/blacklight.rb +5 -3
- data/lib/generators/blacklight/templates/catalog_controller.rb +2 -2
- data/package.json +1 -1
- data/spec/components/blacklight/facets/list_component_spec.rb +5 -0
- data/spec/components/blacklight/facets/pivot_list_component_spec.rb +43 -0
- data/spec/features/modal_spec.rb +1 -1
- data/spec/models/blacklight/configuration_spec.rb +20 -0
- data/spec/presenters/blacklight/json_presenter_spec.rb +17 -0
- metadata +6 -5
- data/app/assets/stylesheets/blacklight/_icons.scss +0 -4
- data/app/views/catalog/_facet_pivot.html.erb +0 -3
@@ -32,25 +32,25 @@ nl:
|
|
32
32
|
apa: APA
|
33
33
|
chicago: Chicago
|
34
34
|
mla: MLA
|
35
|
-
did_you_mean:
|
35
|
+
did_you_mean: "Bedoelde u: %{options}?"
|
36
36
|
email:
|
37
37
|
errors:
|
38
38
|
to:
|
39
39
|
blank: U dient een ontvanger voor dit bericht op te geven.
|
40
40
|
invalid: U dient een geldig e-mailadres op te geven.
|
41
41
|
form:
|
42
|
-
message:
|
42
|
+
message: "Boodschap:"
|
43
43
|
submit: Verzenden
|
44
44
|
title: Email dit
|
45
|
-
to:
|
45
|
+
to: "Email:"
|
46
46
|
success: Email Verzonden
|
47
47
|
text:
|
48
48
|
default_title: N/A
|
49
|
-
message:
|
49
|
+
message: "Boodschap: %{message}"
|
50
50
|
subject:
|
51
|
-
one:
|
51
|
+
one: "Item Record: %{title}"
|
52
52
|
other: Item records
|
53
|
-
url:
|
53
|
+
url: "URL: %{url}"
|
54
54
|
entry_name:
|
55
55
|
default: ingang
|
56
56
|
grouped:
|
@@ -106,9 +106,9 @@ nl:
|
|
106
106
|
filters:
|
107
107
|
label: "%{label}:"
|
108
108
|
remove:
|
109
|
-
label_value:
|
109
|
+
label_value: "Verwijder zoekfilter %{label}: %{value}"
|
110
110
|
value: Verwijder zoekfilter %{value}
|
111
|
-
title:
|
111
|
+
title: "U zocht op:"
|
112
112
|
form:
|
113
113
|
search:
|
114
114
|
label: zoeken op
|
@@ -127,6 +127,7 @@ nl:
|
|
127
127
|
constraint: "%{label}: %{value}"
|
128
128
|
many_constraint_values: "%{values} geselecteerd"
|
129
129
|
title: "%{constraints} - %{application_name} Zoek resultaten"
|
130
|
+
joiner: " / "
|
130
131
|
pagination:
|
131
132
|
title: Zoeken navigatie
|
132
133
|
pagination_info:
|
@@ -155,7 +156,7 @@ nl:
|
|
155
156
|
start_over: Start Opnieuw
|
156
157
|
view:
|
157
158
|
list: Lijst
|
158
|
-
view_title:
|
159
|
+
view_title: "Bekijk resultaten als: "
|
159
160
|
zero_results:
|
160
161
|
modify_search: Probeer uw zoekopdracht aan te passen
|
161
162
|
search_everything: probeer door alles te zoeken
|
@@ -192,10 +193,10 @@ nl:
|
|
192
193
|
carrier_prompt: Gelieve uw carrier op te geven.
|
193
194
|
submit: Verzenden
|
194
195
|
title: SMS dit
|
195
|
-
to:
|
196
|
+
to: "Telefoonnummer:"
|
196
197
|
success: SMS Verzonden
|
197
198
|
text:
|
198
|
-
url:
|
199
|
+
url: "Link: %{url}"
|
199
200
|
tools:
|
200
201
|
citation: Citeer
|
201
202
|
clear: Leeg maken
|
@@ -32,25 +32,25 @@ pt-BR:
|
|
32
32
|
apa: APA
|
33
33
|
chicago: Chicago
|
34
34
|
mla: MLA
|
35
|
-
did_you_mean:
|
35
|
+
did_you_mean: "Você quis dizer: %{options}?"
|
36
36
|
email:
|
37
37
|
errors:
|
38
38
|
to:
|
39
39
|
blank: Você precisa especificar um destinaário para enviar esta mensagem
|
40
40
|
invalid: Verifique seu endereço de email
|
41
41
|
form:
|
42
|
-
message:
|
42
|
+
message: "Mensagem:"
|
43
43
|
submit: Enviar
|
44
44
|
title: Enviar por Email
|
45
|
-
to:
|
45
|
+
to: "Email:"
|
46
46
|
success: Email Enviado
|
47
47
|
text:
|
48
48
|
default_title: N/A
|
49
|
-
message:
|
49
|
+
message: "Mensagem: %{message}"
|
50
50
|
subject:
|
51
|
-
one:
|
51
|
+
one: "Item: %{title}"
|
52
52
|
other: Itens
|
53
|
-
url:
|
53
|
+
url: "URL: %{url}"
|
54
54
|
entry_name:
|
55
55
|
default: registro
|
56
56
|
grouped:
|
@@ -90,7 +90,7 @@ pt-BR:
|
|
90
90
|
close: Ocultar facetas
|
91
91
|
open: Mostrar facetas
|
92
92
|
missing:
|
93
|
-
|
93
|
+
- Ausência
|
94
94
|
more_html: mais <span class="visually-hidden">%{field_name}</span> »
|
95
95
|
pivot:
|
96
96
|
hide: Fechar
|
@@ -107,9 +107,9 @@ pt-BR:
|
|
107
107
|
filters:
|
108
108
|
label: "%{label}:"
|
109
109
|
remove:
|
110
|
-
label_value:
|
110
|
+
label_value: "Remover %{label}: %{value}"
|
111
111
|
value: Remover filtro %{value}
|
112
|
-
title:
|
112
|
+
title: "Sua busca por:"
|
113
113
|
form:
|
114
114
|
search:
|
115
115
|
label: busca
|
@@ -128,6 +128,7 @@ pt-BR:
|
|
128
128
|
constraint: "%{label}: %{value}"
|
129
129
|
many_constraint_values: "%{values} selecionado"
|
130
130
|
title: "%{constraints} - %{application_name} Resultado da Busca"
|
131
|
+
joiner: " / "
|
131
132
|
pagination:
|
132
133
|
title: Navegação nos Resultados
|
133
134
|
pagination_info:
|
@@ -156,7 +157,7 @@ pt-BR:
|
|
156
157
|
start_over: refazer busca
|
157
158
|
view:
|
158
159
|
list: Lista
|
159
|
-
view_title:
|
160
|
+
view_title: "Ver resultados como: "
|
160
161
|
zero_results:
|
161
162
|
modify_search: Tente modificar sua busca
|
162
163
|
search_everything: tente buscar em tudo
|
@@ -193,10 +194,10 @@ pt-BR:
|
|
193
194
|
carrier_prompt: Selecione a Operadora
|
194
195
|
submit: Enviar
|
195
196
|
title: Enviar por SMS
|
196
|
-
to:
|
197
|
+
to: "Celular:"
|
197
198
|
success: SMS Enviado
|
198
199
|
text:
|
199
|
-
url:
|
200
|
+
url: "Link: %{url}"
|
200
201
|
tools:
|
201
202
|
citation: Citar
|
202
203
|
clear: Limpar
|
@@ -32,25 +32,25 @@ sq:
|
|
32
32
|
apa: APA
|
33
33
|
chicago: Chicago
|
34
34
|
mla: MLA
|
35
|
-
did_you_mean:
|
35
|
+
did_you_mean: "A keni menduar: %{options}?"
|
36
36
|
email:
|
37
37
|
errors:
|
38
38
|
to:
|
39
39
|
blank: Duhet të shkruash një pranues për të dëguar mesazh
|
40
40
|
invalid: Duhet të shkruash një email adresë valide
|
41
41
|
form:
|
42
|
-
message:
|
42
|
+
message: "Mesazhi:"
|
43
43
|
submit: Dërgo
|
44
44
|
title: Dërgo Email
|
45
|
-
to:
|
45
|
+
to: "Email:"
|
46
46
|
success: Emaili u dëgua
|
47
47
|
text:
|
48
48
|
default_title: N/A
|
49
|
-
message:
|
49
|
+
message: "Mesazhi: %{message}"
|
50
50
|
subject:
|
51
|
-
one:
|
51
|
+
one: "Item Record: %{title}"
|
52
52
|
other: Item records
|
53
|
-
url:
|
53
|
+
url: "URL: %{url}"
|
54
54
|
entry_name:
|
55
55
|
default: entry
|
56
56
|
grouped:
|
@@ -106,9 +106,9 @@ sq:
|
|
106
106
|
filters:
|
107
107
|
label: "%{label}:"
|
108
108
|
remove:
|
109
|
-
label_value:
|
109
|
+
label_value: "Fshij kufizimin %{label}: %{value}"
|
110
110
|
value: Fshij kufizimin %{value}
|
111
|
-
title:
|
111
|
+
title: "Ju keni kërkuar për:"
|
112
112
|
form:
|
113
113
|
search:
|
114
114
|
label: kërko për
|
@@ -127,6 +127,7 @@ sq:
|
|
127
127
|
constraint: "%{label}: %{value}"
|
128
128
|
many_constraint_values: "%{values} zgjedhura"
|
129
129
|
title: "%{constraints} - %{application_name} Rezultatet e kërkimit"
|
130
|
+
joiner: " / "
|
130
131
|
pagination:
|
131
132
|
title: Navigimi i rezultateteve
|
132
133
|
pagination_info:
|
@@ -155,7 +156,7 @@ sq:
|
|
155
156
|
start_over: Fillo nga e para
|
156
157
|
view:
|
157
158
|
list: List
|
158
|
-
view_title:
|
159
|
+
view_title: "Shiko rezultatin si: "
|
159
160
|
zero_results:
|
160
161
|
modify_search: Provo të ndryshosh kërkimin
|
161
162
|
search_everything: provo të kërkosh çdo gjë
|
@@ -192,10 +193,10 @@ sq:
|
|
192
193
|
carrier_prompt: Ju lutemi zgjedheni operatorin
|
193
194
|
submit: Dërgo
|
194
195
|
title: SMS
|
195
|
-
to:
|
196
|
+
to: "Numri i telefonit:"
|
196
197
|
success: SMS-i u dëgua
|
197
198
|
text:
|
198
|
-
url:
|
199
|
+
url: "Link: %{url}"
|
199
200
|
tools:
|
200
201
|
citation: Citati
|
201
202
|
clear: Fshij
|
@@ -48,9 +48,9 @@ zh:
|
|
48
48
|
default_title: 无
|
49
49
|
message: 正文: %{message}
|
50
50
|
subject:
|
51
|
-
one:
|
51
|
+
one: "记录: %{title}"
|
52
52
|
other: 记录
|
53
|
-
url:
|
53
|
+
url: "网址: %{url}"
|
54
54
|
entry_name:
|
55
55
|
default: 条目
|
56
56
|
grouped:
|
@@ -106,7 +106,7 @@ zh:
|
|
106
106
|
filters:
|
107
107
|
label: "%{label}:"
|
108
108
|
remove:
|
109
|
-
label_value:
|
109
|
+
label_value: "删除限定条件 %{label}: %{value}"
|
110
110
|
value: 删除限定条件 %{value}
|
111
111
|
title: 你在搜索:
|
112
112
|
form:
|
@@ -127,10 +127,11 @@ zh:
|
|
127
127
|
constraint: "%{label}: %{value}"
|
128
128
|
many_constraint_values: "%{values} 已选"
|
129
129
|
title: "%{constraints} - %{application_name} 搜索结果"
|
130
|
+
joiner: " / "
|
130
131
|
pagination:
|
131
132
|
title: 搜索结果导航
|
132
133
|
pagination_info:
|
133
|
-
no_items_found:
|
134
|
+
no_items_found: "没有找到 %{entry_name} "
|
134
135
|
pages:
|
135
136
|
one: "<strong>%{start_num}</strong> - <strong>%{end_num}</strong> 共 <strong>%{total_num}</strong>"
|
136
137
|
other: "<strong>%{start_num}</strong> - <strong>%{end_num}</strong> 共 <strong>%{total_num}</strong>"
|
@@ -155,7 +156,7 @@ zh:
|
|
155
156
|
start_over: 重新开始
|
156
157
|
view:
|
157
158
|
list: 列表
|
158
|
-
view_title:
|
159
|
+
view_title: "以如下方式察看搜索结果: "
|
159
160
|
zero_results:
|
160
161
|
modify_search: 请更改你的搜索条件
|
161
162
|
search_everything: 试一试搜索所有记录
|
@@ -173,7 +174,7 @@ zh:
|
|
173
174
|
page_title: 搜索历史 - %{application_name}
|
174
175
|
recent: 你最近搜索历史
|
175
176
|
save: 保存
|
176
|
-
title:
|
177
|
+
title: ""
|
177
178
|
skip_links:
|
178
179
|
first_result: 转到第一个搜索结果
|
179
180
|
label: 跳过链接
|
@@ -192,10 +193,10 @@ zh:
|
|
192
193
|
carrier_prompt: 请选择运营商
|
193
194
|
submit: 发送
|
194
195
|
title: 通过短信发送
|
195
|
-
to:
|
196
|
+
to: "电话号码:"
|
196
197
|
success: 已发送短信
|
197
198
|
text:
|
198
|
-
url:
|
199
|
+
url: "链接: %{url}"
|
199
200
|
tools:
|
200
201
|
citation: 引用
|
201
202
|
clear: 清除
|
@@ -95,6 +95,7 @@ module Blacklight
|
|
95
95
|
def normalize_pivot_config!
|
96
96
|
self.item_presenter ||= Blacklight::FacetItemPivotPresenter
|
97
97
|
self.item_component ||= Blacklight::FacetItemPivotComponent
|
98
|
+
self.component ||= Blacklight::Facets::PivotListComponent
|
98
99
|
self.filter_class ||= Blacklight::SearchState::PivotFilterField
|
99
100
|
self.filter_query_builder ||= Blacklight::SearchState::PivotFilterField::QueryBuilder
|
100
101
|
end
|
@@ -96,6 +96,10 @@ module Blacklight
|
|
96
96
|
##
|
97
97
|
# == Response models
|
98
98
|
|
99
|
+
# @!attribute repository_class
|
100
|
+
# @return [Class] Class for sending and receiving requests from a search index
|
101
|
+
# defaults to the class configured in blacklight.yml
|
102
|
+
property :repository_class, default: Blacklight.repository_class
|
99
103
|
# @!attribute search_builder_class
|
100
104
|
# @return [Class] class for converting Blacklight parameters to request parameters for the repository_class
|
101
105
|
property :search_builder_class, default: ::SearchBuilder
|
@@ -162,6 +166,8 @@ module Blacklight
|
|
162
166
|
respond_to: OpenStructWithHashAccess.new,
|
163
167
|
# component class used to render the facet grouping
|
164
168
|
facet_group_component: Blacklight::Response::FacetGroupComponent,
|
169
|
+
# component class used to render the facet search and start at
|
170
|
+
facet_filters_component: Blacklight::Facets::FiltersComponent,
|
165
171
|
# component class used to render the facet pagination
|
166
172
|
facet_pagination_component: Blacklight::FacetFieldPaginationComponent,
|
167
173
|
# component class used to render search constraints
|
@@ -379,7 +385,7 @@ module Blacklight
|
|
379
385
|
|
380
386
|
# @return [Blacklight::Repository]
|
381
387
|
def repository
|
382
|
-
|
388
|
+
repository_class.new(self)
|
383
389
|
end
|
384
390
|
|
385
391
|
# @return [String] The destination for the link around the logo in the header
|
@@ -52,12 +52,15 @@ module Blacklight::Solr
|
|
52
52
|
|
53
53
|
##
|
54
54
|
# @return [boolean] true if the repository is reachable
|
55
|
-
def ping
|
55
|
+
def ping?
|
56
56
|
response = connection.send_and_receive 'admin/ping', {}
|
57
57
|
Blacklight.logger&.info("Ping [#{connection.uri}] returned: '#{response['status']}'")
|
58
58
|
response['status'] == "OK"
|
59
59
|
end
|
60
60
|
|
61
|
+
alias ping ping?
|
62
|
+
Blacklight.deprecation.deprecate_methods(Repository, ping: 'use Repository#ping? instead')
|
63
|
+
|
61
64
|
##
|
62
65
|
# Execute a solr query at the given path with the parameters
|
63
66
|
# TODO: Make this private after we have a way to abstract admin/luke and ping
|
data/lib/blacklight.rb
CHANGED
@@ -29,14 +29,16 @@ module Blacklight
|
|
29
29
|
# the class Blacklight::(name of the adapter)::Repository, e.g.
|
30
30
|
# elastic_search => Blacklight::ElasticSearch::Repository
|
31
31
|
def self.repository_class
|
32
|
-
|
32
|
+
if connection_config && !connection_config.key?(:adapter)
|
33
|
+
raise "The value for :adapter was not found in the blacklight.yml config"
|
34
|
+
end
|
35
|
+
|
36
|
+
case connection_config&.fetch(:adapter) || 'solr' # rubocop:disable Lint/LiteralAsCondition
|
33
37
|
when 'solr'
|
34
38
|
Blacklight::Solr::Repository
|
35
39
|
when /::/
|
36
40
|
connection_config[:adapter].constantize
|
37
41
|
else
|
38
|
-
raise "The value for :adapter was not found in the blacklight.yml config" unless connection_config.key? :adapter
|
39
|
-
|
40
42
|
Blacklight.const_get("#{connection_config.fetch(:adapter)}/Repository".classify)
|
41
43
|
end
|
42
44
|
end
|
@@ -65,8 +65,8 @@ class <%= controller_name.classify %>Controller < ApplicationController
|
|
65
65
|
config.add_results_collection_tool(:view_type_group)
|
66
66
|
|
67
67
|
config.add_show_tools_partial(:bookmark, component: Blacklight::Document::BookmarkComponent, if: :render_bookmarks_control?)
|
68
|
-
config.add_show_tools_partial(:email, callback: :email_action, validator: :
|
69
|
-
config.add_show_tools_partial(:sms, if: :render_sms_action?, callback: :sms_action, validator: :
|
68
|
+
config.add_show_tools_partial(:email, callback: :email_action, validator: :email_params_valid?)
|
69
|
+
config.add_show_tools_partial(:sms, if: :render_sms_action?, callback: :sms_action, validator: :sms_params_valid?)
|
70
70
|
config.add_show_tools_partial(:citation)
|
71
71
|
|
72
72
|
config.add_nav_action(:bookmark, partial: 'blacklight/nav/bookmark', if: :render_bookmarks_control?)
|
data/package.json
CHANGED
@@ -42,6 +42,11 @@ RSpec.describe Blacklight::Facets::ListComponent, type: :component do
|
|
42
42
|
expect(page).to have_css 'li', count: 2
|
43
43
|
end
|
44
44
|
|
45
|
+
it 'does not add a role attribute by default' do
|
46
|
+
expect(page).to have_css 'ul.facet-values'
|
47
|
+
expect(page).to have_no_css 'ul.facet-values[role]'
|
48
|
+
end
|
49
|
+
|
45
50
|
context 'with an active facet' do
|
46
51
|
let(:facet_field) do
|
47
52
|
instance_double(
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe Blacklight::Facets::PivotListComponent, type: :component do
|
6
|
+
before do
|
7
|
+
render_inline(described_class.new(facet_field: facet_field))
|
8
|
+
end
|
9
|
+
|
10
|
+
let(:facet_field) do
|
11
|
+
instance_double(
|
12
|
+
Blacklight::FacetFieldPresenter,
|
13
|
+
paginator: paginator,
|
14
|
+
facet_field: facet_config,
|
15
|
+
key: 'pivot_field',
|
16
|
+
label: 'Pivot Field',
|
17
|
+
active?: false,
|
18
|
+
collapsed?: false,
|
19
|
+
modal_path: nil,
|
20
|
+
values: []
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
let(:facet_config) do
|
25
|
+
Blacklight::Configuration::NullField.new(
|
26
|
+
key: 'pivot_field',
|
27
|
+
item_component: Blacklight::FacetItemPivotComponent,
|
28
|
+
item_presenter: Blacklight::FacetItemPivotPresenter,
|
29
|
+
pivot: %w[field_a field_b]
|
30
|
+
)
|
31
|
+
end
|
32
|
+
|
33
|
+
let(:paginator) do
|
34
|
+
instance_double(Blacklight::FacetPaginator, items: [
|
35
|
+
double(value: 'x', hits: 10),
|
36
|
+
double(value: 'y', hits: 33)
|
37
|
+
])
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'renders the facet items with role="tree"' do
|
41
|
+
expect(page).to have_css 'ul.facet-values[role="tree"]'
|
42
|
+
end
|
43
|
+
end
|
data/spec/features/modal_spec.rb
CHANGED
@@ -6,7 +6,7 @@ RSpec.describe 'Modal' do
|
|
6
6
|
expect(page).to have_no_selector 'dialog#blacklight-modal'
|
7
7
|
click_on 'Email'
|
8
8
|
expect(page).to have_css 'dialog#blacklight-modal'
|
9
|
-
|
9
|
+
find('button[aria-label=Close]').click
|
10
10
|
expect(page).to have_no_selector 'dialog#blacklight-modal'
|
11
11
|
end
|
12
12
|
end
|
@@ -5,6 +5,26 @@ RSpec.describe Blacklight::Configuration, :api do
|
|
5
5
|
described_class.new
|
6
6
|
end
|
7
7
|
|
8
|
+
describe "#repository" do
|
9
|
+
context 'when the class is configured in blacklight.yml' do
|
10
|
+
it "uses the default repository class" do
|
11
|
+
expect(config.repository).to be_a(Blacklight::Solr::Repository)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
context 'when the class is set in the configuration' do
|
16
|
+
let(:custom_repository_class) { Class.new(Blacklight::Solr::Repository) }
|
17
|
+
|
18
|
+
before do
|
19
|
+
config.repository_class = custom_repository_class
|
20
|
+
end
|
21
|
+
|
22
|
+
it "uses the custom repository class" do
|
23
|
+
expect(config.repository).to be_a(custom_repository_class)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
8
28
|
it "supports arbitrary configuration values" do
|
9
29
|
config.a = 1
|
10
30
|
|
@@ -56,5 +56,22 @@ RSpec.describe Blacklight::JsonPresenter, :api do
|
|
56
56
|
expect(search_facets.map(&:name)).to eq ['format_si']
|
57
57
|
end
|
58
58
|
end
|
59
|
+
|
60
|
+
context 'when facets are in multiple groups' do
|
61
|
+
before do
|
62
|
+
config.add_facet_field 'author_tsim', label: 'author', group: 'other-group'
|
63
|
+
end
|
64
|
+
|
65
|
+
let(:aggregations) do
|
66
|
+
{
|
67
|
+
'format_si' => Blacklight::Solr::Response::Facets::FacetField.new("format_si", [{ label: "Book", value: 'Book', hits: 20 }]),
|
68
|
+
'author_tsim' => Blacklight::Solr::Response::Facets::FacetField.new("author_tsim", [{ label: "Julie", value: 'Julie', hits: 1 }])
|
69
|
+
}
|
70
|
+
end
|
71
|
+
|
72
|
+
it 'filters out the facets that are not defined' do
|
73
|
+
expect(search_facets.map(&:name)).to eq %w[format_si author_tsim]
|
74
|
+
end
|
75
|
+
end
|
59
76
|
end
|
60
77
|
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: 9.0.0.
|
4
|
+
version: 9.0.0.beta4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Rochkind
|
@@ -16,7 +16,7 @@ authors:
|
|
16
16
|
- Justin Coyne
|
17
17
|
bindir: exe
|
18
18
|
cert_chain: []
|
19
|
-
date:
|
19
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: rails
|
@@ -448,7 +448,6 @@ files:
|
|
448
448
|
- app/assets/stylesheets/blacklight/_facets.scss
|
449
449
|
- app/assets/stylesheets/blacklight/_group.scss
|
450
450
|
- app/assets/stylesheets/blacklight/_header.scss
|
451
|
-
- app/assets/stylesheets/blacklight/_icons.scss
|
452
451
|
- app/assets/stylesheets/blacklight/_layout.scss
|
453
452
|
- app/assets/stylesheets/blacklight/_modal.scss
|
454
453
|
- app/assets/stylesheets/blacklight/_pagination.scss
|
@@ -519,6 +518,7 @@ files:
|
|
519
518
|
- app/components/blacklight/facets/list_component.html.erb
|
520
519
|
- app/components/blacklight/facets/list_component.rb
|
521
520
|
- app/components/blacklight/facets/no_layout_component.rb
|
521
|
+
- app/components/blacklight/facets/pivot_list_component.rb
|
522
522
|
- app/components/blacklight/facets/selected_value_component.rb
|
523
523
|
- app/components/blacklight/facets/suggest_component.html.erb
|
524
524
|
- app/components/blacklight/facets/suggest_component.rb
|
@@ -674,7 +674,6 @@ files:
|
|
674
674
|
- app/views/catalog/_document.rss.builder
|
675
675
|
- app/views/catalog/_document_list.html.erb
|
676
676
|
- app/views/catalog/_email_form.html.erb
|
677
|
-
- app/views/catalog/_facet_pivot.html.erb
|
678
677
|
- app/views/catalog/_field.json.jbuilder
|
679
678
|
- app/views/catalog/_group.html.erb
|
680
679
|
- app/views/catalog/_home.html.erb
|
@@ -860,6 +859,7 @@ files:
|
|
860
859
|
- spec/components/blacklight/facets/index_navigation_component_spec.rb
|
861
860
|
- spec/components/blacklight/facets/item_component_spec.rb
|
862
861
|
- spec/components/blacklight/facets/list_component_spec.rb
|
862
|
+
- spec/components/blacklight/facets/pivot_list_component_spec.rb
|
863
863
|
- spec/components/blacklight/facets/suggest_component_spec.rb
|
864
864
|
- spec/components/blacklight/header_component_spec.rb
|
865
865
|
- spec/components/blacklight/hidden_search_state_component_spec.rb
|
@@ -1023,7 +1023,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1023
1023
|
- !ruby/object:Gem::Version
|
1024
1024
|
version: '0'
|
1025
1025
|
requirements: []
|
1026
|
-
rubygems_version: 3.6.
|
1026
|
+
rubygems_version: 3.6.9
|
1027
1027
|
specification_version: 4
|
1028
1028
|
summary: Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr)
|
1029
1029
|
index.
|
@@ -1043,6 +1043,7 @@ test_files:
|
|
1043
1043
|
- spec/components/blacklight/facets/index_navigation_component_spec.rb
|
1044
1044
|
- spec/components/blacklight/facets/item_component_spec.rb
|
1045
1045
|
- spec/components/blacklight/facets/list_component_spec.rb
|
1046
|
+
- spec/components/blacklight/facets/pivot_list_component_spec.rb
|
1046
1047
|
- spec/components/blacklight/facets/suggest_component_spec.rb
|
1047
1048
|
- spec/components/blacklight/header_component_spec.rb
|
1048
1049
|
- spec/components/blacklight/hidden_search_state_component_spec.rb
|