blacklight 7.0.0.rc1 → 7.0.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +30 -18
- data/.rubocop_todo.yml +308 -67
- data/.solr_wrapper.yml +8 -1
- data/.travis.yml +15 -13
- data/Gemfile +2 -0
- data/README.md +2 -2
- data/Rakefile +2 -0
- data/VERSION +1 -1
- data/Vagrantfile +2 -0
- data/app/assets/javascripts/blacklight/blacklight.js +17 -17
- data/app/assets/stylesheets/blacklight/_blacklight_base.scss +17 -16
- data/app/assets/stylesheets/blacklight/_facets.scss +2 -13
- data/app/assets/stylesheets/blacklight/_icons.scss +8 -2
- data/app/assets/stylesheets/blacklight/_search_form.scss +7 -0
- data/app/assets/stylesheets/blacklight/blacklight.scss +1 -1
- data/app/builders/blacklight/action_builder.rb +1 -0
- data/app/controllers/concerns/blacklight/bookmarks.rb +19 -13
- data/app/controllers/concerns/blacklight/catalog.rb +19 -7
- data/app/controllers/concerns/blacklight/controller.rb +12 -18
- data/app/controllers/concerns/blacklight/facet.rb +3 -0
- data/app/controllers/concerns/blacklight/search_context.rb +7 -3
- data/app/controllers/concerns/blacklight/search_history.rb +1 -6
- data/app/controllers/concerns/blacklight/token_based_user.rb +3 -1
- data/app/helpers/blacklight/blacklight_helper_behavior.rb +5 -1
- data/app/helpers/blacklight/configuration_helper_behavior.rb +5 -3
- data/app/helpers/blacklight/facets_helper_behavior.rb +15 -12
- data/app/helpers/blacklight/icon_helper_behavior.rb +2 -0
- data/app/helpers/blacklight/render_constraints_helper_behavior.rb +2 -0
- data/app/helpers/blacklight/render_partials_helper_behavior.rb +2 -2
- data/app/helpers/blacklight/search_history_constraints_helper_behavior.rb +1 -0
- data/app/helpers/blacklight/url_helper_behavior.rb +29 -14
- data/app/javascript/blacklight/checkbox_submit.js +9 -8
- data/app/javascript/blacklight/core.js +8 -6
- data/app/javascript/blacklight/modal.js +1 -3
- data/app/javascript/blacklight/search_context.js +0 -1
- data/app/models/blacklight/icon.rb +3 -0
- data/app/models/blacklight/suggest_search.rb +3 -14
- data/app/models/bookmark.rb +1 -1
- data/app/models/concerns/blacklight/document.rb +3 -1
- data/app/models/concerns/blacklight/solr/document.rb +1 -0
- data/app/models/concerns/blacklight/suggest/response.rb +5 -3
- data/app/models/concerns/blacklight/user.rb +1 -0
- data/app/models/search.rb +1 -0
- data/app/presenters/blacklight/document_presenter.rb +38 -0
- data/app/presenters/blacklight/field_presenter.rb +2 -0
- data/app/presenters/blacklight/index_presenter.rb +13 -5
- data/app/presenters/blacklight/json_presenter.rb +5 -12
- data/app/presenters/blacklight/link_alternate_presenter.rb +2 -0
- data/app/presenters/blacklight/rendering/abstract_step.rb +2 -0
- data/app/presenters/blacklight/rendering/helper_method.rb +2 -0
- data/app/presenters/blacklight/rendering/join.rb +2 -0
- data/app/presenters/blacklight/rendering/link_to_facet.rb +4 -0
- data/app/presenters/blacklight/rendering/microdata.rb +3 -0
- data/app/presenters/blacklight/rendering/pipeline.rb +2 -0
- data/app/presenters/blacklight/rendering/terminator.rb +2 -0
- data/app/presenters/blacklight/search_bar_presenter.rb +2 -0
- data/app/presenters/blacklight/show_presenter.rb +8 -5
- data/app/presenters/blacklight/thumbnail_presenter.rb +2 -0
- data/app/services/blacklight/document_factory.rb +2 -0
- data/app/services/blacklight/field_retriever.rb +2 -0
- data/app/services/blacklight/search_service.rb +7 -9
- data/app/values/blacklight/types.rb +3 -0
- data/app/views/bookmarks/index.html.erb +12 -13
- data/app/views/catalog/_citation.html.erb +4 -4
- data/app/views/catalog/_constraints.html.erb +2 -0
- data/app/views/catalog/_did_you_mean.html.erb +1 -1
- data/app/views/catalog/_document.atom.builder +17 -16
- data/app/views/catalog/_document.rss.builder +2 -0
- data/app/views/catalog/_facet_index_navigation.html.erb +5 -4
- data/app/views/catalog/_facet_layout.html.erb +3 -5
- data/app/views/catalog/_facets.html.erb +5 -4
- data/app/views/catalog/_field.json.jbuilder +10 -0
- data/app/views/catalog/_group.html.erb +1 -1
- data/app/views/catalog/_home_text.html.erb +5 -5
- data/app/views/catalog/_index.html.erb +5 -7
- data/app/views/catalog/_index_header.html.erb +1 -1
- data/app/views/catalog/_per_page_widget.html.erb +1 -1
- data/app/views/catalog/_results_pagination.html.erb +2 -2
- data/app/views/catalog/_search_form.html.erb +1 -1
- data/app/views/catalog/_search_results.html.erb +2 -2
- data/app/views/catalog/_show.html.erb +3 -5
- data/app/views/catalog/_show_more_like_this.html.erb +1 -1
- data/app/views/catalog/_show_sidebar.html.erb +1 -1
- data/app/views/catalog/_show_tools.html.erb +1 -1
- data/app/views/catalog/_sort_widget.html.erb +1 -1
- data/app/views/catalog/_zero_results.html.erb +1 -1
- data/app/views/catalog/citation.js.erb +1 -1
- data/app/views/catalog/facet.html.erb +5 -4
- data/app/views/catalog/facet.json.jbuilder +2 -0
- data/app/views/catalog/index.atom.builder +4 -2
- data/app/views/catalog/index.json.jbuilder +29 -10
- data/app/views/catalog/index.rss.builder +2 -0
- data/app/views/catalog/opensearch.xml.builder +3 -1
- data/app/views/catalog/show.json.jbuilder +21 -0
- data/app/views/kaminari/blacklight/_first_page.html.erb +1 -1
- data/app/views/kaminari/blacklight/_last_page.html.erb +1 -1
- data/app/views/kaminari/blacklight/_next_page.html.erb +3 -3
- data/app/views/kaminari/blacklight/_page.html.erb +4 -2
- data/app/views/kaminari/blacklight/_prev_page.html.erb +2 -2
- data/app/views/layouts/blacklight.html.erb +4 -4
- data/app/views/layouts/blacklight/base.html.erb +1 -9
- data/app/views/search_history/index.html.erb +3 -3
- data/app/views/shared/_header_navbar.html.erb +1 -1
- data/app/views/shared/_modal.html.erb +2 -2
- data/blacklight.gemspec +7 -6
- data/config/i18n-tasks.yml +17 -0
- data/config/locales/blacklight.de.yml +72 -57
- data/config/locales/blacklight.en.yml +11 -1
- data/config/locales/blacklight.es.yml +15 -1
- data/config/locales/blacklight.fr.yml +17 -8
- data/config/locales/blacklight.hu.yml +3 -1
- data/config/locales/blacklight.it.yml +16 -1
- data/config/locales/blacklight.nl.yml +3 -1
- data/config/locales/blacklight.pt-BR.yml +19 -2
- data/config/locales/blacklight.sq.yml +3 -1
- data/config/locales/blacklight.zh.yml +3 -1
- data/config/routes.rb +0 -1
- data/lib/blacklight.rb +3 -0
- data/lib/blacklight/abstract_repository.rb +12 -0
- data/lib/blacklight/configuration.rb +21 -3
- data/lib/blacklight/configuration/context.rb +11 -0
- data/lib/blacklight/configuration/fields.rb +31 -26
- data/lib/blacklight/configuration/null_field.rb +2 -0
- data/lib/blacklight/engine.rb +4 -1
- data/lib/blacklight/routes/exportable.rb +1 -3
- data/lib/blacklight/routes/searchable.rb +2 -3
- data/lib/blacklight/runtime_registry.rb +2 -0
- data/lib/blacklight/search_builder.rb +2 -0
- data/lib/blacklight/search_state.rb +2 -0
- data/lib/blacklight/solr/repository.rb +34 -0
- data/lib/blacklight/solr/response/spelling.rb +1 -0
- data/lib/generators/blacklight/assets_generator.rb +10 -9
- data/lib/generators/blacklight/controller_generator.rb +1 -1
- data/lib/generators/blacklight/install_generator.rb +7 -14
- data/lib/generators/blacklight/solr_generator.rb +8 -0
- data/lib/generators/blacklight/templates/alternate_controller.rb +4 -4
- data/lib/generators/blacklight/templates/catalog_controller.rb +7 -1
- data/lib/generators/blacklight/templates/solr/conf/schema.xml +20 -22
- data/lib/generators/blacklight/user_generator.rb +2 -0
- data/lib/railties/blacklight.rake +9 -13
- data/package-lock.json +544 -406
- data/package.json +3 -2
- data/spec/controllers/alternate_controller_spec.rb +4 -3
- data/spec/controllers/application_controller_spec.rb +0 -4
- data/spec/controllers/blacklight/base_spec.rb +5 -2
- data/spec/controllers/blacklight/catalog/component_configuration_spec.rb +4 -4
- data/spec/controllers/blacklight/facet_spec.rb +0 -1
- data/spec/controllers/blacklight/search_fields_spec.rb +25 -22
- data/spec/controllers/bookmarks_controller_spec.rb +45 -10
- data/spec/controllers/catalog_controller_spec.rb +206 -138
- data/spec/controllers/search_history_controller_spec.rb +4 -4
- data/spec/features/alternate_controller_spec.rb +3 -3
- data/spec/features/autocomplete_spec.rb +2 -0
- data/spec/features/did_you_mean_spec.rb +4 -3
- data/spec/features/facets_spec.rb +7 -7
- data/spec/features/record_view_spec.rb +11 -12
- data/spec/features/search_context_spec.rb +4 -5
- data/spec/features/search_crawler_spec.rb +3 -5
- data/spec/features/search_filters_spec.rb +44 -44
- data/spec/features/search_history_spec.rb +5 -3
- data/spec/features/search_pagination_spec.rb +3 -1
- data/spec/features/search_results_spec.rb +11 -8
- data/spec/features/search_spec.rb +3 -3
- data/spec/features/sitelinks_search_box.rb +4 -4
- data/spec/helpers/blacklight/configuration_helper_behavior_spec.rb +30 -30
- data/spec/helpers/blacklight/facets_helper_behavior_spec.rb +65 -59
- data/spec/helpers/blacklight/hash_as_hidden_fields_behavior_spec.rb +1 -1
- data/spec/helpers/blacklight/icon_helper_behavior_spec.rb +2 -0
- data/spec/helpers/blacklight/render_constraints_helper_behavior_spec.rb +8 -3
- data/spec/helpers/blacklight/render_partials_helper_behavior_spec.rb +16 -4
- data/spec/helpers/blacklight/search_history_constraints_helper_behavior_spec.rb +21 -22
- data/spec/helpers/blacklight/suggest_helper_behavior_spec.rb +6 -1
- data/spec/helpers/blacklight/url_helper_behavior_spec.rb +49 -43
- data/spec/helpers/blacklight_helper_spec.rb +28 -12
- data/spec/helpers/catalog_helper_spec.rb +50 -47
- data/spec/i18n_spec.rb +18 -0
- data/spec/integration/generators/blacklight/solr_generator_spec.rb +18 -10
- data/spec/lib/blacklight/configuration/facet_field_spec.rb +2 -0
- data/spec/lib/blacklight/configuration/field_spec.rb +3 -0
- data/spec/lib/blacklight/open_struct_with_hash_access_spec.rb +15 -20
- data/spec/lib/blacklight/parameters_spec.rb +3 -1
- data/spec/lib/blacklight/search_state_spec.rb +51 -34
- data/spec/lib/blacklight_spec.rb +13 -14
- data/spec/lib/tasks/blacklight_task_spec.rb +3 -5
- data/spec/models/blacklight/configurable_spec.rb +11 -13
- data/spec/models/blacklight/configuration/context_spec.rb +9 -10
- data/spec/models/blacklight/configuration_spec.rb +103 -91
- data/spec/models/blacklight/document/active_model_shim_spec.rb +5 -6
- data/spec/models/blacklight/document/cache_key_spec.rb +9 -2
- data/spec/models/blacklight/document/dublin_core_spec.rb +16 -19
- data/spec/models/blacklight/document/email_spec.rb +9 -9
- data/spec/models/blacklight/document/sms_spec.rb +9 -9
- data/spec/models/blacklight/document_spec.rb +9 -8
- data/spec/models/blacklight/facet_paginator_spec.rb +40 -30
- data/spec/models/blacklight/icon_spec.rb +12 -2
- data/spec/models/blacklight/search_builder_spec.rb +12 -3
- data/spec/models/blacklight/solr/document_spec.rb +216 -219
- data/spec/models/blacklight/solr/facet_paginator_spec.rb +6 -4
- data/spec/models/blacklight/solr/repository_spec.rb +37 -34
- data/spec/models/blacklight/solr/request_spec.rb +17 -18
- data/spec/models/blacklight/solr/response/facets_spec.rb +58 -58
- data/spec/models/blacklight/solr/response/group_response_spec.rb +16 -22
- data/spec/models/blacklight/solr/response/group_spec.rb +18 -25
- data/spec/models/blacklight/solr/response_spec.rb +48 -50
- data/spec/models/blacklight/solr/search_builder_spec.rb +120 -121
- data/spec/models/blacklight/suggest/response_spec.rb +6 -4
- data/spec/models/blacklight/suggest_search_spec.rb +9 -16
- data/spec/models/blacklight/user_spec.rb +9 -11
- data/spec/models/bookmark_spec.rb +6 -5
- data/spec/models/record_mailer_spec.rb +22 -20
- data/spec/models/search_spec.rb +18 -17
- data/spec/models/solr_document_spec.rb +6 -2
- data/spec/presenters/blacklight/document_presenter_spec.rb +86 -0
- data/spec/presenters/blacklight/index_presenter_spec.rb +186 -0
- data/spec/presenters/blacklight/json_presenter_spec.rb +59 -0
- data/spec/presenters/blacklight/link_alternate_presenter_spec.rb +3 -0
- data/spec/presenters/blacklight/search_bar_presenter_spec.rb +7 -0
- data/spec/presenters/{show_presenter_spec.rb → blacklight/show_presenter_spec.rb} +138 -91
- data/spec/presenters/pipeline_spec.rb +15 -8
- data/spec/presenters/thumbnail_presenter_spec.rb +5 -2
- data/spec/routing/catalog_routing_spec.rb +12 -14
- data/spec/services/blacklight/search_service_spec.rb +112 -70
- data/spec/spec_helper.rb +6 -2
- data/spec/support/features.rb +1 -1
- data/spec/support/features/session_helpers.rb +4 -4
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +12 -13
- data/spec/views/catalog/_constraints.html.erb_spec.rb +2 -3
- data/spec/views/catalog/_constraints_element.html.erb_spec.rb +9 -5
- data/spec/views/catalog/_document.html.erb_spec.rb +4 -4
- data/spec/views/catalog/_document_list.html.erb_spec.rb +1 -0
- data/spec/views/catalog/_facet_index_navigation.html.erb_spec.rb +4 -4
- data/spec/views/catalog/_facet_layout.html.erb_spec.rb +3 -3
- data/spec/views/catalog/_facets.html.erb_spec.rb +8 -10
- data/spec/views/catalog/_index.html.erb_spec.rb +13 -14
- data/spec/views/catalog/_index_header.html.erb_spec.rb +5 -8
- data/spec/views/catalog/_paginate_compact.html.erb_spec.rb +3 -3
- data/spec/views/catalog/_show.html.erb_spec.rb +12 -13
- data/spec/views/catalog/_show_sidebar.erb_spec.rb +4 -7
- data/spec/views/catalog/_show_tools.html.erb_spec.rb +2 -2
- data/spec/views/catalog/_sort_and_per_page.html.erb_spec.rb +0 -1
- data/spec/views/catalog/_sort_widget.html.erb_spec.rb +3 -1
- data/spec/views/catalog/_thumbnail.html.erb_spec.rb +6 -8
- data/spec/views/catalog/_view_type_group.html.erb_spec.rb +7 -9
- data/spec/views/catalog/email_success.html.erb_spec.rb +0 -1
- data/spec/views/catalog/facet.html.erb_spec.rb +3 -2
- data/spec/views/catalog/facet.json.jbuilder_spec.rb +3 -2
- data/spec/views/catalog/index.atom.builder_spec.rb +9 -4
- data/spec/views/catalog/index.html.erb_spec.rb +2 -1
- data/spec/views/catalog/index.json.jbuilder_spec.rb +84 -36
- data/spec/views/catalog/show.html.erb_spec.rb +6 -6
- data/spec/views/catalog/show.json.jbuilder_spec.rb +40 -0
- data/spec/views/catalog/sms_success.html.erb_spec.rb +0 -1
- data/spec/views/shared/_user_util_links.html.erb_spec.rb +1 -4
- data/tasks/blacklight.rake +6 -4
- data/template.demo.rb +2 -0
- metadata +50 -24
- data/app/javascript/blacklight/autofocus.js +0 -20
- data/spec/presenters/index_presenter_spec.rb +0 -150
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.describe "catalog/show.json" do
|
4
|
+
let(:document) do
|
5
|
+
SolrDocument.new(id: '123', title_tsim: 'Book1', author_tsim: 'Julie', format: 'Book')
|
6
|
+
end
|
7
|
+
let(:config) do
|
8
|
+
Blacklight::Configuration.new do |config|
|
9
|
+
config.add_show_field 'title', label: 'Title', field: 'title_tsim'
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
let(:hash) do
|
14
|
+
render template: "catalog/show.json", format: :json
|
15
|
+
JSON.parse(rendered).with_indifferent_access
|
16
|
+
end
|
17
|
+
|
18
|
+
before do
|
19
|
+
allow(view).to receive(:blacklight_config).and_return(config)
|
20
|
+
assign :document, document
|
21
|
+
end
|
22
|
+
|
23
|
+
it "includes document attributes" do
|
24
|
+
expect(hash).to include(data:
|
25
|
+
{
|
26
|
+
id: '123',
|
27
|
+
type: 'Book',
|
28
|
+
attributes: {
|
29
|
+
'title' => {
|
30
|
+
id: 'http://test.host/catalog/123#title',
|
31
|
+
type: 'document_value',
|
32
|
+
attributes: {
|
33
|
+
value: 'Book1',
|
34
|
+
label: 'Title'
|
35
|
+
}
|
36
|
+
}
|
37
|
+
}
|
38
|
+
})
|
39
|
+
end
|
40
|
+
end
|
@@ -1,12 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
RSpec.describe "shared/_user_util_links" do
|
4
|
-
|
5
4
|
let(:blacklight_config) do
|
6
5
|
Blacklight::Configuration.new.configure do |config|
|
7
6
|
config.navbar.partials = { bookmark: Blacklight::Configuration::ToolConfig.new(partial: 'blacklight/nav/bookmark', if: :render_bookmarks_control?) }
|
8
7
|
end
|
9
|
-
|
10
8
|
end
|
11
9
|
|
12
10
|
it "renders the correct bookmark count" do
|
@@ -16,7 +14,6 @@ RSpec.describe "shared/_user_util_links" do
|
|
16
14
|
allow(view).to receive(:has_user_authentication_provider?).and_return false
|
17
15
|
allow(view).to receive_message_chain(:current_or_guest_user, :bookmarks, :count).and_return(count)
|
18
16
|
render "shared/user_util_links"
|
19
|
-
expect(rendered).to have_selector('#bookmarks_nav span.badge[data-role=bookmark-counter]', text:
|
17
|
+
expect(rendered).to have_selector('#bookmarks_nav span.badge[data-role=bookmark-counter]', text: count.to_s)
|
20
18
|
end
|
21
|
-
|
22
19
|
end
|
data/tasks/blacklight.rake
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'solr_wrapper'
|
2
4
|
require 'engine_cart/rake_task'
|
3
5
|
|
@@ -13,8 +15,8 @@ EngineCart.fingerprint_proc = EngineCart.rails_fingerprint_proc
|
|
13
15
|
|
14
16
|
desc "Run test suite"
|
15
17
|
task ci: ['blacklight:generate'] do
|
16
|
-
SolrWrapper.wrap
|
17
|
-
solr.with_collection
|
18
|
+
SolrWrapper.wrap do |solr|
|
19
|
+
solr.with_collection do
|
18
20
|
within_test_app do
|
19
21
|
system "RAILS_ENV=test rake blacklight:index:seed"
|
20
22
|
end
|
@@ -52,8 +54,8 @@ namespace :blacklight do
|
|
52
54
|
Rake::Task['engine_cart:generate'].invoke
|
53
55
|
end
|
54
56
|
|
55
|
-
SolrWrapper.wrap
|
56
|
-
solr.with_collection
|
57
|
+
SolrWrapper.wrap do |solr|
|
58
|
+
solr.with_collection do
|
57
59
|
Rake::Task['blacklight:internal:seed'].invoke
|
58
60
|
|
59
61
|
within_test_app do
|
data/template.demo.rb
CHANGED
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.0.0.
|
4
|
+
version: 7.0.0.rc2
|
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: 2018-
|
20
|
+
date: 2018-11-26 00:00:00.000000000 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
name: rails
|
@@ -25,14 +25,14 @@ dependencies:
|
|
25
25
|
requirements:
|
26
26
|
- - "~>"
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: '5.
|
28
|
+
version: '5.1'
|
29
29
|
type: :runtime
|
30
30
|
prerelease: false
|
31
31
|
version_requirements: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
33
|
- - "~>"
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: '5.
|
35
|
+
version: '5.1'
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: globalid
|
38
38
|
requirement: !ruby/object:Gem::Requirement
|
@@ -51,16 +51,16 @@ dependencies:
|
|
51
51
|
name: jbuilder
|
52
52
|
requirement: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- - "
|
54
|
+
- - "~>"
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: '
|
56
|
+
version: '2.7'
|
57
57
|
type: :runtime
|
58
58
|
prerelease: false
|
59
59
|
version_requirements: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
|
-
- - "
|
61
|
+
- - "~>"
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: '
|
63
|
+
version: '2.7'
|
64
64
|
- !ruby/object:Gem::Dependency
|
65
65
|
name: nokogiri
|
66
66
|
requirement: !ruby/object:Gem::Requirement
|
@@ -185,42 +185,42 @@ dependencies:
|
|
185
185
|
requirements:
|
186
186
|
- - "~>"
|
187
187
|
- !ruby/object:Gem::Version
|
188
|
-
version: '
|
188
|
+
version: '3'
|
189
189
|
type: :development
|
190
190
|
prerelease: false
|
191
191
|
version_requirements: !ruby/object:Gem::Requirement
|
192
192
|
requirements:
|
193
193
|
- - "~>"
|
194
194
|
- !ruby/object:Gem::Version
|
195
|
-
version: '
|
195
|
+
version: '3'
|
196
196
|
- !ruby/object:Gem::Dependency
|
197
197
|
name: chromedriver-helper
|
198
198
|
requirement: !ruby/object:Gem::Requirement
|
199
199
|
requirements:
|
200
|
-
- - "
|
200
|
+
- - "<"
|
201
201
|
- !ruby/object:Gem::Version
|
202
|
-
version:
|
202
|
+
version: 2.0.0
|
203
203
|
type: :development
|
204
204
|
prerelease: false
|
205
205
|
version_requirements: !ruby/object:Gem::Requirement
|
206
206
|
requirements:
|
207
|
-
- - "
|
207
|
+
- - "<"
|
208
208
|
- !ruby/object:Gem::Version
|
209
|
-
version:
|
209
|
+
version: 2.0.0
|
210
210
|
- !ruby/object:Gem::Dependency
|
211
211
|
name: selenium-webdriver
|
212
212
|
requirement: !ruby/object:Gem::Requirement
|
213
213
|
requirements:
|
214
214
|
- - ">="
|
215
215
|
- !ruby/object:Gem::Version
|
216
|
-
version:
|
216
|
+
version: 3.13.1
|
217
217
|
type: :development
|
218
218
|
prerelease: false
|
219
219
|
version_requirements: !ruby/object:Gem::Requirement
|
220
220
|
requirements:
|
221
221
|
- - ">="
|
222
222
|
- !ruby/object:Gem::Version
|
223
|
-
version:
|
223
|
+
version: 3.13.1
|
224
224
|
- !ruby/object:Gem::Dependency
|
225
225
|
name: engine_cart
|
226
226
|
requirement: !ruby/object:Gem::Requirement
|
@@ -283,14 +283,14 @@ dependencies:
|
|
283
283
|
requirements:
|
284
284
|
- - "~>"
|
285
285
|
- !ruby/object:Gem::Version
|
286
|
-
version:
|
286
|
+
version: 0.60.0
|
287
287
|
type: :development
|
288
288
|
prerelease: false
|
289
289
|
version_requirements: !ruby/object:Gem::Requirement
|
290
290
|
requirements:
|
291
291
|
- - "~>"
|
292
292
|
- !ruby/object:Gem::Version
|
293
|
-
version:
|
293
|
+
version: 0.60.0
|
294
294
|
- !ruby/object:Gem::Dependency
|
295
295
|
name: rubocop-rspec
|
296
296
|
requirement: !ruby/object:Gem::Requirement
|
@@ -305,6 +305,20 @@ dependencies:
|
|
305
305
|
- - "~>"
|
306
306
|
- !ruby/object:Gem::Version
|
307
307
|
version: '1.8'
|
308
|
+
- !ruby/object:Gem::Dependency
|
309
|
+
name: i18n-tasks
|
310
|
+
requirement: !ruby/object:Gem::Requirement
|
311
|
+
requirements:
|
312
|
+
- - ">="
|
313
|
+
- !ruby/object:Gem::Version
|
314
|
+
version: '0'
|
315
|
+
type: :development
|
316
|
+
prerelease: false
|
317
|
+
version_requirements: !ruby/object:Gem::Requirement
|
318
|
+
requirements:
|
319
|
+
- - ">="
|
320
|
+
- !ruby/object:Gem::Version
|
321
|
+
version: '0'
|
308
322
|
description: |-
|
309
323
|
Blacklight is an open source Solr user interface discovery platform.
|
310
324
|
You can use Blacklight to enable searching and browsing of your
|
@@ -351,6 +365,7 @@ files:
|
|
351
365
|
- app/assets/stylesheets/blacklight/_mixins.scss
|
352
366
|
- app/assets/stylesheets/blacklight/_modal.scss
|
353
367
|
- app/assets/stylesheets/blacklight/_pagination.scss
|
368
|
+
- app/assets/stylesheets/blacklight/_search_form.scss
|
354
369
|
- app/assets/stylesheets/blacklight/_search_history.scss
|
355
370
|
- app/assets/stylesheets/blacklight/_search_results.scss
|
356
371
|
- app/assets/stylesheets/blacklight/_twitter_typeahead.scss
|
@@ -386,7 +401,6 @@ files:
|
|
386
401
|
- app/helpers/blacklight_helper.rb
|
387
402
|
- app/helpers/catalog_helper.rb
|
388
403
|
- app/javascript/blacklight/autocomplete.js
|
389
|
-
- app/javascript/blacklight/autofocus.js
|
390
404
|
- app/javascript/blacklight/bookmark_toggle.js
|
391
405
|
- app/javascript/blacklight/checkbox_submit.js
|
392
406
|
- app/javascript/blacklight/collapsable.js
|
@@ -416,6 +430,7 @@ files:
|
|
416
430
|
- app/models/record_mailer.rb
|
417
431
|
- app/models/search.rb
|
418
432
|
- app/models/solr_document.rb
|
433
|
+
- app/presenters/blacklight/document_presenter.rb
|
419
434
|
- app/presenters/blacklight/field_presenter.rb
|
420
435
|
- app/presenters/blacklight/index_presenter.rb
|
421
436
|
- app/presenters/blacklight/json_presenter.rb
|
@@ -456,6 +471,7 @@ files:
|
|
456
471
|
- app/views/catalog/_facet_pagination.html.erb
|
457
472
|
- app/views/catalog/_facet_pivot.html.erb
|
458
473
|
- app/views/catalog/_facets.html.erb
|
474
|
+
- app/views/catalog/_field.json.jbuilder
|
459
475
|
- app/views/catalog/_group.html.erb
|
460
476
|
- app/views/catalog/_home.html.erb
|
461
477
|
- app/views/catalog/_home_text.html.erb
|
@@ -495,6 +511,7 @@ files:
|
|
495
511
|
- app/views/catalog/opensearch.xml.builder
|
496
512
|
- app/views/catalog/send_email_record.erb
|
497
513
|
- app/views/catalog/show.html.erb
|
514
|
+
- app/views/catalog/show.json.jbuilder
|
498
515
|
- app/views/catalog/sms.html.erb
|
499
516
|
- app/views/catalog/sms_success.html.erb
|
500
517
|
- app/views/kaminari/blacklight/_first_page.html.erb
|
@@ -521,6 +538,7 @@ files:
|
|
521
538
|
- app/views/shared/_sitelinks_search_box.html.erb
|
522
539
|
- app/views/shared/_user_util_links.html.erb
|
523
540
|
- blacklight.gemspec
|
541
|
+
- config/i18n-tasks.yml
|
524
542
|
- config/locales/blacklight.de.yml
|
525
543
|
- config/locales/blacklight.en.yml
|
526
544
|
- config/locales/blacklight.es.yml
|
@@ -648,6 +666,7 @@ files:
|
|
648
666
|
- spec/helpers/blacklight/url_helper_behavior_spec.rb
|
649
667
|
- spec/helpers/blacklight_helper_spec.rb
|
650
668
|
- spec/helpers/catalog_helper_spec.rb
|
669
|
+
- spec/i18n_spec.rb
|
651
670
|
- spec/integration/generators/blacklight/solr_generator_spec.rb
|
652
671
|
- spec/lib/blacklight/configuration/facet_field_spec.rb
|
653
672
|
- spec/lib/blacklight/configuration/field_spec.rb
|
@@ -685,11 +704,13 @@ files:
|
|
685
704
|
- spec/models/record_mailer_spec.rb
|
686
705
|
- spec/models/search_spec.rb
|
687
706
|
- spec/models/solr_document_spec.rb
|
707
|
+
- spec/presenters/blacklight/document_presenter_spec.rb
|
708
|
+
- spec/presenters/blacklight/index_presenter_spec.rb
|
709
|
+
- spec/presenters/blacklight/json_presenter_spec.rb
|
688
710
|
- spec/presenters/blacklight/link_alternate_presenter_spec.rb
|
689
711
|
- spec/presenters/blacklight/search_bar_presenter_spec.rb
|
690
|
-
- spec/presenters/
|
712
|
+
- spec/presenters/blacklight/show_presenter_spec.rb
|
691
713
|
- spec/presenters/pipeline_spec.rb
|
692
|
-
- spec/presenters/show_presenter_spec.rb
|
693
714
|
- spec/presenters/thumbnail_presenter_spec.rb
|
694
715
|
- spec/routing/catalog_routing_spec.rb
|
695
716
|
- spec/services/blacklight/search_service_spec.rb
|
@@ -725,6 +746,7 @@ files:
|
|
725
746
|
- spec/views/catalog/index.json.jbuilder_spec.rb
|
726
747
|
- spec/views/catalog/opensearch.xml.builder_spec.rb
|
727
748
|
- spec/views/catalog/show.html.erb_spec.rb
|
749
|
+
- spec/views/catalog/show.json.jbuilder_spec.rb
|
728
750
|
- spec/views/catalog/sms_success.html.erb_spec.rb
|
729
751
|
- spec/views/shared/_user_util_links.html.erb_spec.rb
|
730
752
|
- tasks/blacklight.rake
|
@@ -749,7 +771,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
749
771
|
version: 1.3.1
|
750
772
|
requirements: []
|
751
773
|
rubyforge_project:
|
752
|
-
rubygems_version: 2.
|
774
|
+
rubygems_version: 2.6.11
|
753
775
|
signing_key:
|
754
776
|
specification_version: 4
|
755
777
|
summary: Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr)
|
@@ -793,6 +815,7 @@ test_files:
|
|
793
815
|
- spec/helpers/blacklight/url_helper_behavior_spec.rb
|
794
816
|
- spec/helpers/blacklight_helper_spec.rb
|
795
817
|
- spec/helpers/catalog_helper_spec.rb
|
818
|
+
- spec/i18n_spec.rb
|
796
819
|
- spec/integration/generators/blacklight/solr_generator_spec.rb
|
797
820
|
- spec/lib/blacklight/configuration/facet_field_spec.rb
|
798
821
|
- spec/lib/blacklight/configuration/field_spec.rb
|
@@ -830,11 +853,13 @@ test_files:
|
|
830
853
|
- spec/models/record_mailer_spec.rb
|
831
854
|
- spec/models/search_spec.rb
|
832
855
|
- spec/models/solr_document_spec.rb
|
856
|
+
- spec/presenters/blacklight/document_presenter_spec.rb
|
857
|
+
- spec/presenters/blacklight/index_presenter_spec.rb
|
858
|
+
- spec/presenters/blacklight/json_presenter_spec.rb
|
833
859
|
- spec/presenters/blacklight/link_alternate_presenter_spec.rb
|
834
860
|
- spec/presenters/blacklight/search_bar_presenter_spec.rb
|
835
|
-
- spec/presenters/
|
861
|
+
- spec/presenters/blacklight/show_presenter_spec.rb
|
836
862
|
- spec/presenters/pipeline_spec.rb
|
837
|
-
- spec/presenters/show_presenter_spec.rb
|
838
863
|
- spec/presenters/thumbnail_presenter_spec.rb
|
839
864
|
- spec/routing/catalog_routing_spec.rb
|
840
865
|
- spec/services/blacklight/search_service_spec.rb
|
@@ -870,5 +895,6 @@ test_files:
|
|
870
895
|
- spec/views/catalog/index.json.jbuilder_spec.rb
|
871
896
|
- spec/views/catalog/opensearch.xml.builder_spec.rb
|
872
897
|
- spec/views/catalog/show.html.erb_spec.rb
|
898
|
+
- spec/views/catalog/show.json.jbuilder_spec.rb
|
873
899
|
- spec/views/catalog/sms_success.html.erb_spec.rb
|
874
900
|
- spec/views/shared/_user_util_links.html.erb_spec.rb
|
@@ -1,20 +0,0 @@
|
|
1
|
-
//= require blacklight/core
|
2
|
-
(function($) {
|
3
|
-
Blacklight.doSearchAutofocusFallback = function() {
|
4
|
-
if (typeof Blacklight.do_search_autofocus_fallback == 'function') {
|
5
|
-
console.warn("do_search_autofocus_fallback is deprecated. Use doSearchAutofocusFallback instead.");
|
6
|
-
return Blacklight.do_search_autofocus_fallback();
|
7
|
-
}
|
8
|
-
if (typeof Modernizer != 'undefined') {
|
9
|
-
if (Modernizr.autofocus) {
|
10
|
-
return;
|
11
|
-
}
|
12
|
-
}
|
13
|
-
|
14
|
-
$('input[autofocus]').focus();
|
15
|
-
}
|
16
|
-
|
17
|
-
Blacklight.onLoad(function() {
|
18
|
-
Blacklight.doSearchAutofocusFallback();
|
19
|
-
});
|
20
|
-
})(jQuery);
|
@@ -1,150 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
RSpec.describe Blacklight::IndexPresenter do
|
4
|
-
include Capybara::RSpecMatchers
|
5
|
-
let(:request_context) { double(document_index_view_type: 'list') }
|
6
|
-
let(:config) { Blacklight::Configuration.new }
|
7
|
-
|
8
|
-
subject { presenter }
|
9
|
-
let(:presenter) { described_class.new(document, request_context, config) }
|
10
|
-
let(:parameter_class) { ActionController::Parameters }
|
11
|
-
let(:params) { parameter_class.new }
|
12
|
-
let(:controller) { double }
|
13
|
-
let(:search_state) { Blacklight::SearchState.new(params, config, controller) }
|
14
|
-
|
15
|
-
let(:document) do
|
16
|
-
SolrDocument.new(id: 1,
|
17
|
-
'link_to_facet_true' => 'x',
|
18
|
-
'link_to_facet_named' => 'x',
|
19
|
-
'qwer' => 'document qwer value',
|
20
|
-
'mnbv' => 'document mnbv value')
|
21
|
-
end
|
22
|
-
|
23
|
-
before do
|
24
|
-
allow(request_context).to receive(:search_state).and_return(search_state)
|
25
|
-
end
|
26
|
-
|
27
|
-
describe "field_value" do
|
28
|
-
let(:config) do
|
29
|
-
Blacklight::Configuration.new.configure do |config|
|
30
|
-
config.add_index_field 'qwer'
|
31
|
-
config.add_index_field 'asdf', :helper_method => :render_asdf_index_field
|
32
|
-
config.add_index_field 'link_to_facet_true', :link_to_facet => true
|
33
|
-
config.add_index_field 'link_to_facet_named', :link_to_facet => :some_field
|
34
|
-
config.add_index_field 'highlight', :highlight => true
|
35
|
-
config.add_index_field 'solr_doc_accessor', :accessor => true
|
36
|
-
config.add_index_field 'explicit_accessor', :accessor => :solr_doc_accessor
|
37
|
-
config.add_index_field 'explicit_accessor_with_arg', :accessor => :solr_doc_accessor_with_arg
|
38
|
-
config.add_index_field 'alias', field: 'qwer'
|
39
|
-
config.add_index_field 'with_default', default: 'value'
|
40
|
-
end
|
41
|
-
end
|
42
|
-
it "checks for an explicit value" do
|
43
|
-
value = subject.field_value 'asdf', :value => 'asdf'
|
44
|
-
expect(value).to eq 'asdf'
|
45
|
-
end
|
46
|
-
|
47
|
-
it "checks for a helper method to call" do
|
48
|
-
allow(request_context).to receive(:render_asdf_index_field).and_return('custom asdf value')
|
49
|
-
value = subject.field_value 'asdf'
|
50
|
-
expect(value).to eq 'custom asdf value'
|
51
|
-
end
|
52
|
-
|
53
|
-
it "checks for a link_to_facet" do
|
54
|
-
allow(request_context).to receive(:search_action_path).with('f' => { 'link_to_facet_true' => ['x'] }).and_return('/foo')
|
55
|
-
allow(request_context).to receive(:link_to).with("x", '/foo').and_return('bar')
|
56
|
-
value = subject.field_value 'link_to_facet_true'
|
57
|
-
expect(value).to eq 'bar'
|
58
|
-
end
|
59
|
-
|
60
|
-
it "checks for a link_to_facet with a field name" do
|
61
|
-
allow(request_context).to receive(:search_action_path).with('f' => { 'some_field' => ['x'] }).and_return('/foo')
|
62
|
-
allow(request_context).to receive(:link_to).with("x", '/foo').and_return('bar')
|
63
|
-
value = subject.field_value 'link_to_facet_named'
|
64
|
-
expect(value).to eq 'bar'
|
65
|
-
end
|
66
|
-
|
67
|
-
it "gracefully handles when no highlight field is available" do
|
68
|
-
allow(document).to receive(:has_highlight_field?).and_return(false)
|
69
|
-
value = subject.field_value 'highlight'
|
70
|
-
expect(value).to be_blank
|
71
|
-
end
|
72
|
-
|
73
|
-
it "checks for a highlighted field" do
|
74
|
-
allow(document).to receive(:has_highlight_field?).and_return(true)
|
75
|
-
allow(document).to receive(:highlight_field).with('highlight').and_return(['<em>highlight</em>'.html_safe])
|
76
|
-
value = subject.field_value 'highlight'
|
77
|
-
expect(value).to eq '<em>highlight</em>'
|
78
|
-
end
|
79
|
-
|
80
|
-
it "checks the document field value" do
|
81
|
-
value = subject.field_value 'qwer'
|
82
|
-
expect(value).to eq 'document qwer value'
|
83
|
-
end
|
84
|
-
|
85
|
-
it "works with index fields that aren't explicitly defined" do
|
86
|
-
value = subject.field_value 'mnbv'
|
87
|
-
expect(value).to eq 'document mnbv value'
|
88
|
-
end
|
89
|
-
|
90
|
-
it "calls an accessor on the solr document" do
|
91
|
-
allow(document).to receive_messages(solr_doc_accessor: "123")
|
92
|
-
value = subject.field_value 'solr_doc_accessor'
|
93
|
-
expect(value).to eq "123"
|
94
|
-
end
|
95
|
-
|
96
|
-
it "calls an explicit accessor on the solr document" do
|
97
|
-
allow(document).to receive_messages(solr_doc_accessor: "123")
|
98
|
-
value = subject.field_value 'explicit_accessor'
|
99
|
-
expect(value).to eq "123"
|
100
|
-
end
|
101
|
-
|
102
|
-
it "calls an accessor on the solr document with the field as an argument" do
|
103
|
-
allow(document).to receive(:solr_doc_accessor_with_arg).with('explicit_accessor_with_arg').and_return("123")
|
104
|
-
value = subject.field_value 'explicit_accessor_with_arg'
|
105
|
-
expect(value).to eq "123"
|
106
|
-
end
|
107
|
-
|
108
|
-
it "supports solr field configuration" do
|
109
|
-
value = subject.field_value 'alias'
|
110
|
-
expect(value).to eq "document qwer value"
|
111
|
-
end
|
112
|
-
|
113
|
-
it "supports default values in the field configuration" do
|
114
|
-
value = subject.field_value 'with_default'
|
115
|
-
expect(value).to eq "value"
|
116
|
-
end
|
117
|
-
end
|
118
|
-
|
119
|
-
describe '#field_values' do
|
120
|
-
context 'for a field with the helper_method option' do
|
121
|
-
let(:field_name) { 'field_with_helper' }
|
122
|
-
let(:field_config) { config.add_facet_field 'field_with_helper', helper_method: 'render_field_with_helper' }
|
123
|
-
let(:document) do
|
124
|
-
SolrDocument.new(id: 1, 'field_with_helper' => 'value')
|
125
|
-
end
|
126
|
-
|
127
|
-
it "checks call the helper method with arguments" do
|
128
|
-
allow(request_context).to receive(:render_field_with_helper) do |*args|
|
129
|
-
args.first
|
130
|
-
end
|
131
|
-
|
132
|
-
render_options = { a: 1 }
|
133
|
-
|
134
|
-
options = subject.send(:field_values, field_config, a: 1)
|
135
|
-
|
136
|
-
expect(options).to include :document, :field, :value, :config, :a
|
137
|
-
expect(options[:document]).to eq document
|
138
|
-
expect(options[:field]).to eq 'field_with_helper'
|
139
|
-
expect(options[:value]).to eq ['value']
|
140
|
-
expect(options[:config]).to eq field_config
|
141
|
-
expect(options[:a]).to eq 1
|
142
|
-
end
|
143
|
-
end
|
144
|
-
end
|
145
|
-
|
146
|
-
describe "#thumbnail" do
|
147
|
-
subject { presenter.thumbnail }
|
148
|
-
it { is_expected.to be_instance_of Blacklight::ThumbnailPresenter }
|
149
|
-
end
|
150
|
-
end
|