blacklight 7.32.0 → 7.33.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17b8b14189b4ced9faa60d183fa887eb6962dba4d55f3718fee11ff4bed59388
4
- data.tar.gz: dd1f5ea853080c0732313b3ab64de8d310634786cfbcfe5ddde6691bc2137820
3
+ metadata.gz: cddd27d147401ca52ab08c98094933b5327eff0fb3e160eaa960975a9697246f
4
+ data.tar.gz: f714a77235467a6088f021d4b44e2d1826a407a5cf922eb53d78ac163a470f6a
5
5
  SHA512:
6
- metadata.gz: d481b3b290ca1030fcc593fad5ef8fdbe3e5a42091c4138af3efaaa58b45322f32d8e4956e6d92d01d305e762d4e2a3886f9caa193ba4197920d18d989184308
7
- data.tar.gz: f6010fc1c00b31fddce8d2e73794655dbe3c1c690e65bedace78c693a4c36a884f5ac0589681717e3852bf9e1ff41109a7d5de2c2d4957e835c59afd53cfcfcb
6
+ metadata.gz: ab11dc139997c5398b1c83cc72ddf1142598bf3e50f8bdca34d2e74fb7e9159b209237ad11a60cc23fe8313eab0436f03615e81ae204480a2552173d24b967d8
7
+ data.tar.gz: 7a1b670887503b620af4b36ce44504c155f494b3d1c1e35ed57d8f90471c7e7aeb1be5fb815d383baf98de89d2924ec481a2ba4c3567b9a0ed222f02a47f5596
data/VERSION CHANGED
@@ -1 +1 @@
1
- 7.32.0
1
+ 7.33.0
@@ -23,19 +23,12 @@
23
23
  cursor: pointer;
24
24
  }
25
25
 
26
- .no-js .sort-pagination {
27
- & {
28
- @extend .clearfix;
26
+ .no-js {
27
+ .btn-group:focus-within {
28
+ .dropdown-menu {
29
+ @extend .show;
30
+ }
29
31
  }
30
- .dropdown-menu {
31
- background: none;
32
- box-shadow: none;
33
- border: none;
34
- position: relative;
35
- display: block;
36
- float: none;
37
- }
38
-
39
32
  }
40
33
 
41
34
  .view-type {
@@ -37,6 +37,30 @@
37
37
  }
38
38
  }
39
39
 
40
+ .no-js {
41
+ @include media-breakpoint-down(lg) {
42
+ #sidebar {
43
+ order: 6 !important;
44
+ }
45
+ }
46
+
47
+ .facet-content.collapse {
48
+ display: block;
49
+ }
50
+
51
+ .facet-toggle-handle {
52
+ display: none;
53
+ }
54
+
55
+ .pivot-facet.collapse {
56
+ display: block;
57
+ }
58
+
59
+ .facets-collapse.collapse {
60
+ display: block;
61
+ }
62
+ }
63
+
40
64
  .facets-header {
41
65
  display: flex;
42
66
  justify-content: space-between;
@@ -58,11 +58,9 @@ module Blacklight::Bookmarks
58
58
  create
59
59
  end
60
60
 
61
- # For adding a single bookmark, suggest use PUT/#update to
62
- # /bookmarks/$docuemnt_id instead.
63
- # But this method, accessed via POST to /bookmarks, can be used for
64
- # creating multiple bookmarks at once, by posting with keys
65
- # such as bookmarks[n][document_id], bookmarks[n][title].
61
+ # For adding a single bookmark, suggest use PUT to /bookmarks/:document_id instead (triggering the #update method).
62
+ # This method, accessed via POST to /bookmarks, can be used for creating multiple bookmarks at once, by posting
63
+ # with keys such as bookmarks[n][document_id], bookmarks[n][title].
66
64
  # It can also be used for creating a single bookmark by including keys
67
65
  # bookmark[title] and bookmark[document_id], but in that case #update
68
66
  # is simpler.
@@ -17,6 +17,8 @@ json.data do
17
17
  json.id document.id
18
18
  json.type doc_presenter.display_type.first
19
19
  json.attributes do
20
+ json.title doc_presenter.heading unless doc_presenter.fields_to_render.any? { |field_name, _field, _field_presenter| field_name.to_s == 'title' }
21
+
20
22
  doc_presenter.fields_to_render.each do |field_name, field, field_presenter|
21
23
  json.partial! 'field', field: field,
22
24
  field_name: field_name,
@@ -11,6 +11,8 @@ json.data do
11
11
  json.id @document.id
12
12
  json.type doc_presenter.display_type.first
13
13
  json.attributes do
14
+ json.title doc_presenter.heading unless doc_presenter.fields_to_render.any? { |field_name, _field, _field_presenter| field_name.to_s == 'title' }
15
+
14
16
  doc_presenter.fields_to_render.each do |field_name, field, field_presenter|
15
17
  json.partial! 'field', field: field,
16
18
  field_name: field_name,
@@ -9,10 +9,13 @@
9
9
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
10
10
 
11
11
  <title><%= render_page_title %></title>
12
+ <script>
13
+ document.querySelector('html').classList.remove('no-js');
14
+ </script>
12
15
  <%= opensearch_description_tag application_name, opensearch_catalog_url(format: 'xml') %>
13
16
  <%= favicon_link_tag %>
14
- <%= stylesheet_link_tag "application", media: "all" %>
15
- <%= javascript_include_tag "application" %>
17
+ <%= stylesheet_link_tag "application", media: "all", "data-turbo-track": "reload" %>
18
+ <%= javascript_include_tag "application", "data-turbo-track": "reload" %>
16
19
 
17
20
  <%= csrf_meta_tags %>
18
21
  <%= content_for(:head) %>
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blacklight-frontend",
3
- "version": "7.25.0",
3
+ "version": "7.32.0",
4
4
  "description": "[![Build Status](https://travis-ci.com/projectblacklight/blacklight.png?branch=main)](https://travis-ci.com/projectblacklight/blacklight) [![Gem Version](https://badge.fury.io/rb/blacklight.png)](http://badge.fury.io/rb/blacklight) [![Coverage Status](https://coveralls.io/repos/github/projectblacklight/blacklight/badge.svg?branch=main)](https://coveralls.io/github/projectblacklight/blacklight?branch=main)",
5
5
  "main": "app/assets/javascripts/blacklight",
6
6
  "scripts": {
@@ -151,7 +151,7 @@ RSpec.describe CatalogController, api: true do
151
151
  it "gets the documents" do
152
152
  expect(docs).to have(10).documents
153
153
  expect(docs.first['attributes'].keys).to match_array(
154
- %w[author_tsim format language_ssim lc_callnum_ssim published_ssim title_tsim]
154
+ %w[author_tsim format language_ssim lc_callnum_ssim published_ssim title title_tsim]
155
155
  )
156
156
  expect(docs.first['links']['self']).to eq solr_document_url(id: docs.first['id'])
157
157
  end
@@ -327,7 +327,7 @@ RSpec.describe CatalogController, api: true do
327
327
  json = JSON.parse response.body
328
328
  expect(json["data"]["attributes"].keys).to match_array(
329
329
  %w[author_tsim format isbn_ssim language_ssim lc_callnum_ssim
330
- published_ssim subtitle_tsim title_tsim url_suppl_ssim]
330
+ published_ssim subtitle_tsim title title_tsim url_suppl_ssim]
331
331
  )
332
332
  end
333
333
  end
@@ -40,6 +40,15 @@ RSpec.describe "Bookmarks" do
40
40
  expect(page).to have_content 'Successfully removed bookmark.'
41
41
  end
42
42
 
43
+ it 'shows bookmarks as checkboxes', js: true do
44
+ visit solr_document_path('2007020969')
45
+ check 'Bookmark'
46
+
47
+ visit solr_document_path('2007020969')
48
+ expect(page).to have_css('input[type="checkbox"]:checked')
49
+ uncheck 'In Bookmarks'
50
+ end
51
+
43
52
  it "adds bookmarks after a user logs in" do
44
53
  visit solr_document_path('2007020969')
45
54
  click_button 'Bookmark'
@@ -10,7 +10,7 @@ RSpec.describe "catalog/index.json", api: true do
10
10
  end
11
11
  let(:config) do
12
12
  Blacklight::Configuration.new do |config|
13
- config.add_index_field 'title', label: 'Title', field: 'title_tsim'
13
+ config.index.title_field = 'title_tsim'
14
14
  config.add_facet_field :format
15
15
  end
16
16
  end
@@ -66,14 +66,7 @@ RSpec.describe "catalog/index.json", api: true do
66
66
  id: '123',
67
67
  type: 'Book',
68
68
  attributes: {
69
- 'title': {
70
- id: 'http://test.host/catalog/123#title',
71
- type: 'document_value',
72
- attributes: {
73
- value: 'Book1',
74
- label: 'Title'
75
- }
76
- }
69
+ title: 'Book1'
77
70
  },
78
71
  links: { self: 'http://test.host/catalog/123' }
79
72
  },
@@ -81,14 +74,7 @@ RSpec.describe "catalog/index.json", api: true do
81
74
  id: '456',
82
75
  type: 'Article',
83
76
  attributes: {
84
- 'title': {
85
- id: 'http://test.host/catalog/456#title',
86
- type: 'document_value',
87
- attributes: {
88
- value: 'Article1',
89
- label: 'Title'
90
- }
91
- }
77
+ title: 'Article1'
92
78
  },
93
79
  links: { self: 'http://test.host/catalog/456' }
94
80
  }
@@ -6,7 +6,7 @@ RSpec.describe "catalog/show.json" do
6
6
  end
7
7
  let(:config) do
8
8
  Blacklight::Configuration.new do |config|
9
- config.add_show_field 'title', label: 'Title', field: 'title_tsim'
9
+ config.show.title_field = 'title_tsim'
10
10
  end
11
11
  end
12
12
 
@@ -27,14 +27,7 @@ RSpec.describe "catalog/show.json" do
27
27
  id: '123',
28
28
  type: 'Book',
29
29
  attributes: {
30
- 'title' => {
31
- id: 'http://test.host/catalog/123#title',
32
- type: 'document_value',
33
- attributes: {
34
- value: 'Book1',
35
- label: 'Title'
36
- }
37
- }
30
+ 'title' => 'Book1'
38
31
  }
39
32
  })
40
33
  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.32.0
4
+ version: 7.33.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-11-16 00:00:00.000000000 Z
20
+ date: 2022-12-12 00:00:00.000000000 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: rails