arclight 0.3.2 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +32 -0
  3. data/.rubocop.yml +4 -2
  4. data/.rubocop_todo.yml +199 -34
  5. data/Gemfile +5 -0
  6. data/README.md +3 -3
  7. data/app/assets/images/blacklight/bookmark.svg +1 -1
  8. data/app/assets/images/blacklight/collection.svg +1 -1
  9. data/app/assets/images/blacklight/compact.svg +1 -1
  10. data/app/assets/images/blacklight/container.svg +1 -1
  11. data/app/assets/images/blacklight/ead.svg +1 -1
  12. data/app/assets/images/blacklight/file.svg +1 -1
  13. data/app/assets/images/blacklight/folder.svg +1 -1
  14. data/app/assets/images/blacklight/list.svg +1 -1
  15. data/app/assets/images/blacklight/online.svg +1 -1
  16. data/app/assets/images/blacklight/pdf.svg +1 -1
  17. data/app/assets/images/blacklight/repository.svg +1 -1
  18. data/app/assets/javascripts/arclight/context_navigation.js +12 -47
  19. data/app/assets/stylesheets/arclight/application.scss +1 -0
  20. data/app/assets/stylesheets/arclight/modules/icons.scss +4 -0
  21. data/app/assets/stylesheets/arclight/modules/layout.scss +8 -8
  22. data/app/controllers/concerns/arclight/field_config_helpers.rb +1 -1
  23. data/app/helpers/arclight_helper.rb +3 -3
  24. data/app/views/arclight/requests/_aeon_web_ead.html.erb +1 -1
  25. data/app/views/catalog/_index_collection_context_default.html.erb +1 -1
  26. data/app/views/catalog/_search_form.html.erb +5 -1
  27. data/arclight.gemspec +10 -9
  28. data/lib/arclight/engine.rb +3 -9
  29. data/lib/arclight/repository.rb +2 -2
  30. data/lib/arclight/traject/ead2_config.rb +1 -0
  31. data/lib/arclight/version.rb +1 -1
  32. data/lib/generators/arclight/install_generator.rb +15 -2
  33. data/lib/generators/arclight/templates/catalog_controller.rb +6 -0
  34. data/package.json +4 -4
  35. data/solr/conf/schema.xml +2 -2
  36. data/solr/conf/solrconfig.xml +1 -0
  37. data/template.rb +1 -1
  38. metadata +56 -30
  39. data/.travis.yml +0 -28
  40. data/lib/generators/arclight/templates/arclight.js +0 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6e12ccfeeb5aa7746c2cec7ac945c267fdd7bf9a351f158acf68cce9d278960
4
- data.tar.gz: 3d3d9d64bd2ea6aab1948f3b97eb2ead2ffbe094a11fed01c2bb1cbe83c82cb5
3
+ metadata.gz: 5ad2c5251cf3130cce536075a7a1049031b459535566a6654f5601be20318820
4
+ data.tar.gz: 8e4770a4035b7df7c9e870dc60d7d3d44c8e7b90b70389f19a4e1ba9322aa09a
5
5
  SHA512:
6
- metadata.gz: 3309551edab5e40ead1eaf7ecf7b34548a4cf6e14be34bf8af0d14af9a2966dfa4ebed51cd1ff0f7399640f1c4e21b3c5b224250558fb7b09d9d52e7680e0a77
7
- data.tar.gz: 60e7ad421942da5848a2a8d1b45cd5c56f271cdb092f49af37b7a68e4ebf4014c4c05a7d15ba217d99ad00f00ba98f21604ee1464ac19ca98ee9339adcd954f9
6
+ metadata.gz: 046246fbbf865afb0677463746b458d94b0efb12f63729b9a4f60166547b0cac25a4a3498702c31fc8e2fadc357742d65e613e11b6c23307997245b5c4db50e3
7
+ data.tar.gz: 8011c4c5b33be7a6983cb1e887cb2f159efa680411ff29cf31dc7d79115029fc61c21cae7ad2955bd08310059e2f062c0aa91dad186fffcd5c53f8aaba6d9216
@@ -0,0 +1,32 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ rails_version: [6.1.4.7, 7.0.2.3]
15
+ ruby: [2.7, '3.0']
16
+ include:
17
+ - rails_version: 6.0.3.7
18
+ ruby: 2.7
19
+ env:
20
+ RAILS_VERSION: ${{ matrix.rails_version }}
21
+ steps:
22
+ - uses: actions/checkout@v2
23
+ - name: Set up Ruby ${{ matrix.ruby }}
24
+ uses: ruby/setup-ruby@v1
25
+ with:
26
+ ruby-version: ${{ matrix.ruby }}
27
+ - name: Install dependencies with Rails ${{ matrix.rails_version }}
28
+ run: bundle install
29
+ - name: Install dependencies with yarn
30
+ run: yarn install
31
+ - name: Run tests
32
+ run: bundle exec rake
data/.rubocop.yml CHANGED
@@ -1,4 +1,6 @@
1
- require: rubocop-rspec
1
+ require:
2
+ - rubocop-rspec
3
+ - rubocop-rails
2
4
 
3
5
  inherit_from:
4
6
  - .rubocop_todo.yml
@@ -11,7 +13,7 @@ AllCops:
11
13
  - 'lib/generators/arclight/templates/**/*'
12
14
  - 'vendor/**/*'
13
15
  - 'node_modules/**/*'
14
- TargetRubyVersion: 2.4
16
+ TargetRubyVersion: 2.5
15
17
  DisplayCopNames: true
16
18
 
17
19
  Metrics/ModuleLength:
data/.rubocop_todo.yml CHANGED
@@ -1,44 +1,113 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2019-09-05 15:26:25 -0600 using RuboCop version 0.74.0.
3
+ # on 2021-05-17 20:57:22 UTC using RuboCop version 1.15.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 3
9
+ # Offense count: 1
10
+ # Configuration parameters: Include.
11
+ # Include: **/*.gemspec
12
+ Gemspec/RequiredRubyVersion:
13
+ Exclude:
14
+ - 'arclight.gemspec'
15
+
16
+ # Offense count: 2
17
+ # Cop supports --auto-correct.
18
+ # Configuration parameters: EnforcedStyleAlignWith, Severity.
19
+ # SupportedStylesAlignWith: start_of_line, begin
20
+ Layout/BeginEndAlignment:
21
+ Exclude:
22
+ - 'app/models/arclight/document_downloads.rb'
23
+ - 'lib/tasks/index.rake'
24
+
25
+ # Offense count: 1
26
+ # Cop supports --auto-correct.
27
+ # Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, AllowAdjacentOneLineDefs, NumberOfEmptyLines.
28
+ Layout/EmptyLineBetweenDefs:
29
+ Exclude:
30
+ - 'lib/arclight/exceptions.rb'
31
+
32
+ # Offense count: 7
33
+ # Cop supports --auto-correct.
34
+ # Configuration parameters: AllowAliasSyntax, AllowedMethods.
35
+ # AllowedMethods: alias_method, public, protected, private
36
+ Layout/EmptyLinesAroundAttributeAccessor:
37
+ Exclude:
38
+ - 'app/models/arclight/document_downloads.rb'
39
+ - 'app/models/arclight/parent.rb'
40
+ - 'app/models/arclight/parents.rb'
41
+ - 'app/models/arclight/requests/aeon_web_ead.rb'
42
+ - 'app/models/arclight/requests/google_form.rb'
43
+ - 'lib/arclight/digital_object.rb'
44
+ - 'lib/arclight/hash_absolute_xpath.rb'
45
+
46
+ # Offense count: 2
47
+ # Cop supports --auto-correct.
48
+ Layout/RescueEnsureAlignment:
49
+ Exclude:
50
+ - 'app/models/arclight/document_downloads.rb'
51
+ - 'lib/tasks/index.rake'
52
+
53
+ # Offense count: 2
54
+ # Configuration parameters: IgnoredMethods.
10
55
  Lint/AmbiguousBlockAssociation:
11
56
  Exclude:
12
57
  - 'lib/arclight/traject/ead2_config.rb'
13
58
 
59
+ # Offense count: 1
60
+ # Cop supports --auto-correct.
61
+ Lint/RedundantCopDisableDirective:
62
+ Exclude:
63
+ - 'spec/features/search_results_spec.rb'
64
+
65
+ # Offense count: 1
66
+ # Cop supports --auto-correct.
67
+ Lint/SendWithMixinArgument:
68
+ Exclude:
69
+ - 'lib/arclight/engine.rb'
70
+
71
+ # Offense count: 1
72
+ # Cop supports --auto-correct.
73
+ Lint/UriRegexp:
74
+ Exclude:
75
+ - 'lib/tasks/index.rake'
76
+
14
77
  # Offense count: 1
15
78
  # Configuration parameters: CheckForMethodsWithNoSideEffects.
16
79
  Lint/Void:
17
80
  Exclude:
18
81
  - 'lib/arclight/year_range.rb'
19
82
 
20
- # Offense count: 68
21
- # Configuration parameters: CountComments, ExcludedMethods.
22
- Metrics/BlockLength:
23
- Max: 278
24
- Exclude:
25
- - 'spec/features/collection_page_spec.rb'
26
-
27
83
  # Offense count: 1
28
- # Configuration parameters: CountComments, ExcludedMethods.
84
+ # Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
85
+ Metrics/AbcSize:
86
+ Max: 19
87
+
88
+ # Offense count: 2
89
+ # Configuration parameters: IgnoredMethods.
90
+ Metrics/CyclomaticComplexity:
91
+ Max: 8
92
+
93
+ # Offense count: 4
94
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
29
95
  Metrics/MethodLength:
30
- Max: 11
31
- Exclude:
32
- - 'app/helpers/arclight_helper.rb'
96
+ Max: 17
97
+
98
+ # Offense count: 1
99
+ # Configuration parameters: IgnoredMethods.
100
+ Metrics/PerceivedComplexity:
101
+ Max: 9
33
102
 
34
103
  # Offense count: 1
35
- # Configuration parameters: Blacklist.
36
- # Blacklist: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$))
104
+ # Configuration parameters: ForbiddenDelimiters.
105
+ # ForbiddenDelimiters: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$))
37
106
  Naming/HeredocDelimiterNaming:
38
107
  Exclude:
39
108
  - 'spec/features/autocomplete_spec.rb'
40
109
 
41
- # Offense count: 91
110
+ # Offense count: 80
42
111
  # Configuration parameters: Prefixes.
43
112
  # Prefixes: when, with, without
44
113
  RSpec/ContextWording:
@@ -52,58 +121,122 @@ RSpec/DescribedClass:
52
121
  Exclude:
53
122
  - 'spec/presenters/arclight/show_presenter_spec.rb'
54
123
 
55
- # Offense count: 61
124
+ # Offense count: 55
56
125
  # Cop supports --auto-correct.
57
126
  RSpec/EmptyLineAfterExampleGroup:
58
127
  Enabled: false
59
128
 
60
- # Offense count: 12
129
+ # Offense count: 10
61
130
  # Cop supports --auto-correct.
62
131
  RSpec/EmptyLineAfterHook:
63
132
  Exclude:
64
133
  - 'spec/features/collection_page_spec.rb'
65
134
  - 'spec/features/home_page_spec.rb'
66
135
  - 'spec/features/many_component_ead_spec.rb'
67
- - 'spec/features/search_results_spec.rb'
68
136
  - 'spec/helpers/arclight_helper_spec.rb'
69
- - 'spec/views/_collection_count.html.erb_spec.rb'
70
137
  - 'spec/views/repositories/index.html.erb_spec.rb'
71
138
 
72
- # Offense count: 49
73
- # Configuration parameters: Max.
139
+ # Offense count: 63
140
+ # Configuration parameters: CountAsOne.
74
141
  RSpec/ExampleLength:
75
- Enabled: false
142
+ Max: 49
76
143
 
77
- # Offense count: 2
144
+ # Offense count: 3
78
145
  RSpec/ExpectInHook:
79
146
  Exclude:
80
147
  - 'spec/helpers/arclight_helper_spec.rb'
81
- - 'spec/presenters/arclight/index_presenter_spec.rb'
82
148
 
83
149
  # Offense count: 1
84
- # Configuration parameters: CustomTransform, IgnoreMethods.
150
+ # Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
151
+ # Include: **/*_spec*rb*, **/spec/**/*
85
152
  RSpec/FilePath:
86
153
  Exclude:
87
154
  - 'spec/lib/arclight/viewers/oembed_spec.rb'
88
155
 
89
- # Offense count: 107
90
- # Configuration parameters: AggregateFailuresByDefault.
156
+ # Offense count: 133
91
157
  RSpec/MultipleExpectations:
92
- Max: 26
158
+ Max: 25
159
+
160
+ # Offense count: 30
161
+ # Configuration parameters: AllowSubject.
162
+ RSpec/MultipleMemoizedHelpers:
163
+ Max: 10
93
164
 
94
- # Offense count: 8
165
+ # Offense count: 19
95
166
  RSpec/NestedGroups:
96
167
  Max: 4
97
168
 
98
169
  # Offense count: 7
99
170
  # Cop supports --auto-correct.
100
- # Configuration parameters: Strict, EnforcedStyle.
171
+ # Configuration parameters: Strict, EnforcedStyle, AllowedExplicitMatchers.
101
172
  # SupportedStyles: inflected, explicit
102
173
  RSpec/PredicateMatcher:
103
174
  Exclude:
104
175
  - 'spec/helpers/arclight_helper_spec.rb'
105
176
  - 'spec/lib/arclight/year_range_spec.rb'
106
177
 
178
+ # Offense count: 7
179
+ RSpec/StubbedMock:
180
+ Exclude:
181
+ - 'spec/helpers/arclight_helper_spec.rb'
182
+ - 'spec/lib/arclight/viewer_spec.rb'
183
+
184
+ # Offense count: 4
185
+ # Cop supports --auto-correct.
186
+ # Configuration parameters: NilOrEmpty, NotPresent, UnlessPresent.
187
+ Rails/Blank:
188
+ Exclude:
189
+ - 'app/controllers/concerns/arclight/ead_format_helpers.rb'
190
+ - 'lib/arclight/repository.rb'
191
+
192
+ # Offense count: 5
193
+ # Cop supports --auto-correct.
194
+ Rails/ContentTag:
195
+ Exclude:
196
+ - 'app/controllers/concerns/arclight/ead_format_helpers.rb'
197
+ - 'app/controllers/concerns/arclight/field_config_helpers.rb'
198
+ - 'app/helpers/arclight_helper.rb'
199
+
200
+ # Offense count: 1
201
+ # Configuration parameters: EnforcedStyle.
202
+ # SupportedStyles: slashes, arguments
203
+ Rails/FilePath:
204
+ Exclude:
205
+ - 'app/models/arclight/document_downloads.rb'
206
+
207
+ # Offense count: 1
208
+ # Configuration parameters: Include.
209
+ # Include: app/helpers/**/*.rb
210
+ Rails/HelperInstanceVariable:
211
+ Exclude:
212
+ - 'app/helpers/arclight_helper.rb'
213
+
214
+ # Offense count: 1
215
+ # Cop supports --auto-correct.
216
+ Rails/IndexWith:
217
+ Exclude:
218
+ - 'app/models/arclight/document_downloads.rb'
219
+
220
+ # Offense count: 1
221
+ Rails/OutputSafety:
222
+ Exclude:
223
+ - 'app/controllers/concerns/arclight/field_config_helpers.rb'
224
+
225
+ # Offense count: 1
226
+ # Cop supports --auto-correct.
227
+ Rails/Presence:
228
+ Exclude:
229
+ - 'lib/arclight/digital_object.rb'
230
+
231
+ # Offense count: 7
232
+ # Cop supports --auto-correct.
233
+ # Configuration parameters: Include.
234
+ # Include: **/Rakefile, **/*.rake
235
+ Rails/RakeEnvironment:
236
+ Exclude:
237
+ - 'lib/tasks/index.rake'
238
+ - 'tasks/arclight.rake'
239
+
107
240
  # Offense count: 1
108
241
  Security/Open:
109
242
  Exclude:
@@ -111,7 +244,7 @@ Security/Open:
111
244
 
112
245
  # Offense count: 1
113
246
  # Cop supports --auto-correct.
114
- # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, IgnoredMethods, AllowBracesOnProceduralOneLiners.
247
+ # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, IgnoredMethods, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
115
248
  # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
116
249
  # ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
117
250
  # FunctionalMethods: let, let!, subject, watch
@@ -121,19 +254,51 @@ Style/BlockDelimiters:
121
254
  - 'lib/tasks/index.rake'
122
255
 
123
256
  # Offense count: 1
257
+ # Cop supports --auto-correct.
258
+ # Configuration parameters: Keywords.
259
+ # Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE
260
+ Style/CommentAnnotation:
261
+ Exclude:
262
+ - 'app/models/concerns/arclight/solr_document.rb'
263
+
264
+ # Offense count: 1
265
+ # Cop supports --auto-correct.
124
266
  Style/CommentedKeyword:
125
267
  Exclude:
126
268
  - 'lib/arclight/year_range.rb'
127
269
 
128
270
  # Offense count: 1
271
+ # Configuration parameters: AllowedConstants.
129
272
  Style/Documentation:
130
273
  Exclude:
131
- - 'spec/**/*'
132
- - 'test/**/*'
133
274
  - 'lib/arclight.rb'
134
275
 
276
+ # Offense count: 4
277
+ # Configuration parameters: MaxUnannotatedPlaceholdersAllowed, IgnoredMethods.
278
+ # SupportedStyles: annotated, template, unannotated
279
+ Style/FormatStringToken:
280
+ EnforcedStyle: template
281
+
135
282
  # Offense count: 1
136
283
  # Cop supports --auto-correct.
284
+ Style/HashEachMethods:
285
+ Exclude:
286
+ - 'lib/arclight/repository.rb'
287
+
288
+ # Offense count: 2
289
+ # Cop supports --auto-correct.
137
290
  Style/IfUnlessModifier:
138
291
  Exclude:
139
292
  - 'app/models/concerns/arclight/search_behavior.rb'
293
+
294
+ # Offense count: 1
295
+ # Cop supports --auto-correct.
296
+ Style/RedundantRegexpEscape:
297
+ Exclude:
298
+ - 'spec/features/collection_page_spec.rb'
299
+
300
+ # Offense count: 1
301
+ # Cop supports --auto-correct.
302
+ Style/StringConcatenation:
303
+ Exclude:
304
+ - 'spec/lib/arclight/repository_spec.rb'
data/Gemfile CHANGED
@@ -4,6 +4,9 @@ source 'https://rubygems.org'
4
4
 
5
5
  # Specify your gem's dependencies in arclight.gemspec
6
6
  gemspec
7
+
8
+ gem 'rexml' if RUBY_VERSION >= '3'
9
+
7
10
  # BEGIN ENGINE_CART BLOCK
8
11
  # engine_cart: 1.1.0
9
12
  # engine_cart stanza: 0.10.0
@@ -38,3 +41,5 @@ else
38
41
  end
39
42
  end
40
43
  # END ENGINE_CART BLOCK
44
+
45
+ eval_gemfile File.expand_path('spec/test_app_templates/Gemfile.extra', File.dirname(__FILE__))
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Build Status](https://travis-ci.org/projectblacklight/arclight.svg?branch=master)](https://travis-ci.org/projectblacklight/arclight)
1
+ ![Build Status](https://github.com/projectblacklight/arclight/workflows/CI/badge.svg)
2
2
  [![All Contributors](https://img.shields.io/badge/all_contributors-17-orange.svg?style=flat-square)](CONTRIBUTORS.md)
3
3
  [![Code Climate Test Coverage](https://codeclimate.com/github/projectblacklight/arclight/badges/coverage.svg)](https://codeclimate.com/github/projectblacklight/arclight/coverage)
4
4
 
@@ -10,8 +10,8 @@ A Rails engine supporting discovery of archival materials, based on [Blacklight]
10
10
 
11
11
  ## Requirements
12
12
 
13
- * [Ruby](https://www.ruby-lang.org/en/) 2.5 or later
14
- * [Rails](http://rubyonrails.org) 5.0 or later
13
+ * [Ruby](https://www.ruby-lang.org/en/) 2.6 or later
14
+ * [Rails](http://rubyonrails.org) 5.2 or later
15
15
  * Solr 8.1 or later
16
16
 
17
17
  ## Installation
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M0 512V48C0 21.49 21.49 0 48 0h288c26.51 0 48 21.49 48 48v464L192 400 0 512z"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 384 512"><path d="M0 512V48C0 21.49 21.49 0 48 0h288c26.51 0 48 21.49 48 48v464L192 400 0 512z"/></svg>
@@ -2,4 +2,4 @@
2
2
  Used unmodified from https://fontawesome.com
3
3
  CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
4
4
  -->
5
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M32 448c0 17.7 14.3 32 32 32h384c17.7 0 32-14.3 32-32V160H32v288zm160-212c0-6.6 5.4-12 12-12h104c6.6 0 12 5.4 12 12v8c0 6.6-5.4 12-12 12H204c-6.6 0-12-5.4-12-12v-8zM480 32H32C14.3 32 0 46.3 0 64v48c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16V64c0-17.7-14.3-32-32-32z"/></svg>
5
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 512 512"><path d="M32 448c0 17.7 14.3 32 32 32h384c17.7 0 32-14.3 32-32V160H32v288zm160-212c0-6.6 5.4-12 12-12h104c6.6 0 12 5.4 12 12v8c0 6.6-5.4 12-12 12H204c-6.6 0-12-5.4-12-12v-8zM480 32H32C14.3 32 0 46.3 0 64v48c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16V64c0-17.7-14.3-32-32-32z"/></svg>
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3,15H21V13H3Zm0,4H21V17H3Zm0-8H21V9H3ZM3,5V7H21V5Z"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24"><path d="M3,15H21V13H3Zm0,4H21V17H3Zm0-8H21V9H3ZM3,5V7H21V5Z"/></svg>
@@ -2,4 +2,4 @@
2
2
  Used unmodified from https://fontawesome.com
3
3
  CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
4
4
  -->
5
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M464 128H272l-64-64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48z"/></svg>
5
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 512 512"><path d="M464 128H272l-64-64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48z"/></svg>
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M149.9 349.1l-.2-.2-32.8-28.9 32.8-28.9c3.6-3.2 4-8.8.8-12.4l-.2-.2-17.4-18.6c-3.4-3.6-9-3.7-12.4-.4l-57.7 54.1c-3.7 3.5-3.7 9.4 0 12.8l57.7 54.1c1.6 1.5 3.8 2.4 6 2.4 2.4 0 4.8-1 6.4-2.8l17.4-18.6c3.3-3.5 3.1-9.1-.4-12.4zm220-251.2L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM256 51.9l76.1 76.1H256zM336 464H48V48h160v104c0 13.3 10.7 24 24 24h104zM209.6 214c-4.7-1.4-9.5 1.3-10.9 6L144 408.1c-1.4 4.7 1.3 9.6 6 10.9l24.4 7.1c4.7 1.4 9.6-1.4 10.9-6L240 231.9c1.4-4.7-1.3-9.6-6-10.9zm24.5 76.9l.2.2 32.8 28.9-32.8 28.9c-3.6 3.2-4 8.8-.8 12.4l.2.2 17.4 18.6c3.3 3.5 8.9 3.7 12.4.4l57.7-54.1c3.7-3.5 3.7-9.4 0-12.8l-57.7-54.1c-3.5-3.3-9.1-3.2-12.4.4l-17.4 18.6c-3.3 3.5-3.1 9.1.4 12.4z"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 384 512"><path d="M149.9 349.1l-.2-.2-32.8-28.9 32.8-28.9c3.6-3.2 4-8.8.8-12.4l-.2-.2-17.4-18.6c-3.4-3.6-9-3.7-12.4-.4l-57.7 54.1c-3.7 3.5-3.7 9.4 0 12.8l57.7 54.1c1.6 1.5 3.8 2.4 6 2.4 2.4 0 4.8-1 6.4-2.8l17.4-18.6c3.3-3.5 3.1-9.1-.4-12.4zm220-251.2L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM256 51.9l76.1 76.1H256zM336 464H48V48h160v104c0 13.3 10.7 24 24 24h104zM209.6 214c-4.7-1.4-9.5 1.3-10.9 6L144 408.1c-1.4 4.7 1.3 9.6 6 10.9l24.4 7.1c4.7 1.4 9.6-1.4 10.9-6L240 231.9c1.4-4.7-1.3-9.6-6-10.9zm24.5 76.9l.2.2 32.8 28.9-32.8 28.9c-3.6 3.2-4 8.8-.8 12.4l.2.2 17.4 18.6c3.3 3.5 8.9 3.7 12.4.4l57.7-54.1c3.7-3.5 3.7-9.4 0-12.8l-57.7-54.1c-3.5-3.3-9.1-3.2-12.4.4l-17.4 18.6c-3.3 3.5-3.1 9.1.4 12.4z"/></svg>
@@ -2,4 +2,4 @@
2
2
  Used unmodified from https://fontawesome.com
3
3
  CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
4
4
  -->
5
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm160-14.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"/></svg>
5
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 384 512"><path d="M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm160-14.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"/></svg>
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M464 128H272l-64-64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48z"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 512 512"><path d="M464 128H272l-64-64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48z"/></svg>
@@ -1 +1 @@
1
- <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>file</title><path d="M0,0H24V24H0Z" fill="none"/><path d="M3,19H21V13.45H3ZM3,5v5.61H21V5Z"/></svg>
1
+ <svg height="24" width="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>file</title><path d="M0,0H24V24H0Z" fill="none"/><path d="M3,19H21V13.45H3ZM3,5v5.61H21V5Z"/></svg>
@@ -2,4 +2,4 @@
2
2
  Used unmodified from https://fontawesome.com
3
3
  CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
4
4
  -->
5
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path d="M608 0H160a32 32 0 0 0-32 32v96h160V64h192v320h128a32 32 0 0 0 32-32V32a32 32 0 0 0-32-32zM232 103a9 9 0 0 1-9 9h-30a9 9 0 0 1-9-9V73a9 9 0 0 1 9-9h30a9 9 0 0 1 9 9zm352 208a9 9 0 0 1-9 9h-30a9 9 0 0 1-9-9v-30a9 9 0 0 1 9-9h30a9 9 0 0 1 9 9zm0-104a9 9 0 0 1-9 9h-30a9 9 0 0 1-9-9v-30a9 9 0 0 1 9-9h30a9 9 0 0 1 9 9zm0-104a9 9 0 0 1-9 9h-30a9 9 0 0 1-9-9V73a9 9 0 0 1 9-9h30a9 9 0 0 1 9 9zm-168 57H32a32 32 0 0 0-32 32v288a32 32 0 0 0 32 32h384a32 32 0 0 0 32-32V192a32 32 0 0 0-32-32zM96 224a32 32 0 1 1-32 32 32 32 0 0 1 32-32zm288 224H64v-32l64-64 32 32 128-128 96 96z"/></svg>
5
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 640 512"><path d="M608 0H160a32 32 0 0 0-32 32v96h160V64h192v320h128a32 32 0 0 0 32-32V32a32 32 0 0 0-32-32zM232 103a9 9 0 0 1-9 9h-30a9 9 0 0 1-9-9V73a9 9 0 0 1 9-9h30a9 9 0 0 1 9 9zm352 208a9 9 0 0 1-9 9h-30a9 9 0 0 1-9-9v-30a9 9 0 0 1 9-9h30a9 9 0 0 1 9 9zm0-104a9 9 0 0 1-9 9h-30a9 9 0 0 1-9-9v-30a9 9 0 0 1 9-9h30a9 9 0 0 1 9 9zm0-104a9 9 0 0 1-9 9h-30a9 9 0 0 1-9-9V73a9 9 0 0 1 9-9h30a9 9 0 0 1 9 9zm-168 57H32a32 32 0 0 0-32 32v288a32 32 0 0 0 32 32h384a32 32 0 0 0 32-32V192a32 32 0 0 0-32-32zM96 224a32 32 0 1 1-32 32 32 32 0 0 1 32-32zm288 224H64v-32l64-64 32 32 128-128 96 96z"/></svg>
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48zm250.2-143.7c-12.2-12-47-8.7-64.4-6.5-17.2-10.5-28.7-25-36.8-46.3 3.9-16.1 10.1-40.6 5.4-56-4.2-26.2-37.8-23.6-42.6-5.9-4.4 16.1-.4 38.5 7 67.1-10 23.9-24.9 56-35.4 74.4-20 10.3-47 26.2-51 46.2-3.3 15.8 26 55.2 76.1-31.2 22.4-7.4 46.8-16.5 68.4-20.1 18.9 10.2 41 17 55.8 17 25.5 0 28-28.2 17.5-38.7zm-198.1 77.8c5.1-13.7 24.5-29.5 30.4-35-19 30.3-30.4 35.7-30.4 35zm81.6-190.6c7.4 0 6.7 32.1 1.8 40.8-4.4-13.9-4.3-40.8-1.8-40.8zm-24.4 136.6c9.7-16.9 18-37 24.7-54.7 8.3 15.1 18.9 27.2 30.1 35.5-20.8 4.3-38.9 13.1-54.8 19.2zm131.6-5s-5 6-37.3-7.8c35.1-2.6 40.9 5.4 37.3 7.8z"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 384 512"><path d="M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48zm250.2-143.7c-12.2-12-47-8.7-64.4-6.5-17.2-10.5-28.7-25-36.8-46.3 3.9-16.1 10.1-40.6 5.4-56-4.2-26.2-37.8-23.6-42.6-5.9-4.4 16.1-.4 38.5 7 67.1-10 23.9-24.9 56-35.4 74.4-20 10.3-47 26.2-51 46.2-3.3 15.8 26 55.2 76.1-31.2 22.4-7.4 46.8-16.5 68.4-20.1 18.9 10.2 41 17 55.8 17 25.5 0 28-28.2 17.5-38.7zm-198.1 77.8c5.1-13.7 24.5-29.5 30.4-35-19 30.3-30.4 35.7-30.4 35zm81.6-190.6c7.4 0 6.7 32.1 1.8 40.8-4.4-13.9-4.3-40.8-1.8-40.8zm-24.4 136.6c9.7-16.9 18-37 24.7-54.7 8.3 15.1 18.9 27.2 30.1 35.5-20.8 4.3-38.9 13.1-54.8 19.2zm131.6-5s-5 6-37.3-7.8c35.1-2.6 40.9 5.4 37.3 7.8z"/></svg>
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M4 10v7h3v-7H4zm6 0v7h3v-7h-3zM2 22h19v-3H2v3zm14-12v7h3v-7h-3zm-4.5-9L2 6v2h19V6l-9.5-5z"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M4 10v7h3v-7H4zm6 0v7h3v-7h-3zM2 22h19v-3H2v3zm14-12v7h3v-7h-3zm-4.5-9L2 6v2h19V6l-9.5-5z"/></svg>
@@ -11,6 +11,10 @@ class NavigationDocument {
11
11
  this.el.find('li.al-collection-context').addClass('al-hierarchy-highlight');
12
12
  }
13
13
 
14
+ makeCollapsible() {
15
+ this.el.find('li.al-collection-context').addClass('collapsible');
16
+ }
17
+
14
18
  collapse() {
15
19
  this.el.find('li.al-collection-context').addClass('collapsed');
16
20
  }
@@ -32,9 +36,9 @@ class ExpandButton {
32
36
  * @param {jQuery} $li - the <button> element
33
37
  * @return {jQuery} - a jQuery object containing the targeted <li>
34
38
  */
35
- findSiblings() {
36
- const $siblings = this.$el.parent().children('li');
37
- return $siblings.slice(0, -1);
39
+ findCollapsibleSiblings() {
40
+ const $siblings = this.$el.parent().children('li.collapsible');
41
+ return $siblings;
38
42
  }
39
43
 
40
44
  /**
@@ -44,7 +48,7 @@ class ExpandButton {
44
48
  * <button> element
45
49
  */
46
50
  handleClick() {
47
- const $targeted = this.findSiblings();
51
+ const $targeted = this.findCollapsibleSiblings();
48
52
 
49
53
  $targeted.toggleClass('collapsed');
50
54
  this.$el.toggleClass('collapsed');
@@ -66,25 +70,6 @@ class ExpandButton {
66
70
  }
67
71
  }
68
72
 
69
- /**
70
- * Modeling <button> Elements which hide or retrieve <li> elements for sibling
71
- * documents nested within the <li> elements of the <ul> tree
72
- * @class
73
- */
74
- class NestedExpandButton extends ExpandButton {
75
- /**
76
- * This retrieves the <li> elements which are hidden/rendered in response to
77
- * clicking the <button> element
78
- * @param {jQuery} $li - the <button> element
79
- * @return {jQuery} - a jQuery object containing the targeted <li>
80
- */
81
- findSiblings() {
82
- const highlighted = this.$el.siblings('.al-hierarchy-highlight');
83
- const $siblings = highlighted.prevAll('.al-collection-context');
84
- return $siblings.slice(0, -1);
85
- }
86
- }
87
-
88
73
  /**
89
74
  * Models the placeholder display elements for content loading from AJAX
90
75
  * requests
@@ -198,6 +183,7 @@ class ContextNavigation {
198
183
  if (prevSiblingDocs.length > 1 && originalDocumentIndex > 0) {
199
184
  const hiddenPrevSiblingDocs = prevSiblingDocs.slice(0, -1);
200
185
  hiddenPrevSiblingDocs.forEach(siblingDoc => {
186
+ siblingDoc.makeCollapsible();
201
187
  siblingDoc.collapse();
202
188
  });
203
189
 
@@ -245,6 +231,7 @@ class ContextNavigation {
245
231
  let renderedBeforeDocs;
246
232
  if (beforeDocs.length > 1) {
247
233
  beforeDocs.forEach(function (parentDoc) {
234
+ parentDoc.makeCollapsible();
248
235
  parentDoc.collapse();
249
236
  });
250
237
  renderedBeforeDocs = beforeDocs.map(newDoc => newDoc.render()).join('');
@@ -281,28 +268,6 @@ class ContextNavigation {
281
268
  });
282
269
  }
283
270
 
284
-
285
- /**
286
- * Update the ancestors for <li> elements
287
- * @param {jQuery} $li - the <li> element for the current, highlighted
288
- * Document in the <ul> context list of collections, components, and
289
- * containers
290
- */
291
- /* eslint-disable class-methods-use-this */
292
- updateListSiblings($li) {
293
- const prevSiblings = $li.prevAll('.al-collection-context');
294
- if (prevSiblings.length > 1) {
295
- const hiddenNextSiblings = prevSiblings.slice(0, -1);
296
- hiddenNextSiblings.toggleClass('collapsed');
297
-
298
- const button = new NestedExpandButton();
299
-
300
- const lastHiddenNextSibling = hiddenNextSiblings[hiddenNextSiblings.length - 1];
301
- button.$el.insertAfter(lastHiddenNextSibling);
302
- }
303
- }
304
- /* eslint-enable class-methods-use-this */
305
-
306
271
  /**
307
272
  * This updates the elements in the View DOM using an AJAX response containing
308
273
  * the HTML of a server-rendered View template.
@@ -356,8 +321,8 @@ class ContextNavigation {
356
321
  const that = this;
357
322
  this.ul.find('.al-toggle-view-children').on('click', (e) => {
358
323
  e.preventDefault();
359
- const targetArea = $($(e.target).attr('href'));
360
- if (!targetArea.data().resolved) {
324
+ const targetArea = $($(e.currentTarget).attr('href'));
325
+ if (!targetArea.data('resolved') === true) {
361
326
  targetArea.find('.context-navigator').each((i, ee) => {
362
327
  const contextNavigation = new ContextNavigation(
363
328
  // Send null for originalParents. We want to disregard the original
@@ -7,6 +7,7 @@
7
7
  @import 'modules/collection_search';
8
8
  @import 'modules/highlights';
9
9
  @import 'modules/hierarchy_and_online_contents';
10
+ @import 'modules/icons';
10
11
  @import 'modules/layout';
11
12
  @import 'modules/mastheads';
12
13
  @import 'modules/repositories.scss';
@@ -0,0 +1,4 @@
1
+ .blacklight-icons svg {
2
+ height: 1rem;
3
+ width: 1rem;
4
+ }
@@ -21,6 +21,7 @@
21
21
  .breadcrumb-home-link {
22
22
  margin-bottom: ($spacer / 4);
23
23
  }
24
+
24
25
  .al-show-actions-box {
25
26
  border: $default-border-styling;
26
27
  background-color: $gray-200;
@@ -81,7 +82,7 @@
81
82
  }
82
83
 
83
84
  // Show page breadcrumbs
84
- @for $i from 1 to 14 {
85
+ @for $i from 1 to 20 {
85
86
  .breadcrumb-item.breadcrumb-item-#{$i}.media {
86
87
  padding-left: 0;
87
88
 
@@ -99,7 +100,7 @@
99
100
 
100
101
  // Show page metadata.
101
102
  // Indent to match terminal show page breadcrumb.
102
- @for $i from 1 to 14 {
103
+ @for $i from 1 to 20 {
103
104
  .al-metadata-section.breadcrumb-item-#{$i} {
104
105
  padding-left: 0;
105
106
 
@@ -111,13 +112,12 @@
111
112
 
112
113
  // Collapse +/- indicators
113
114
  .al-toggle-view-children {
114
- &:not(.collapsed) {
115
- & {
116
- content: image-url('blacklight/minus.svg');
117
- }
115
+ &::after {
116
+ content: image-url('blacklight/plus.svg');
117
+ }
118
+ &:not(.collapsed)::after {
119
+ content: image-url('blacklight/minus.svg');
118
120
  }
119
-
120
- content: image-url('blacklight/plus.svg');
121
121
  }
122
122
 
123
123
  .al-toggle-children-container {
@@ -88,7 +88,7 @@ module Arclight
88
88
  end
89
89
 
90
90
  def link_to_name_facet(args)
91
- options = args[:config].try(:separator_options) || {}
91
+ options = args[:config]&.separator_options || {}
92
92
  values = args[:value] || []
93
93
 
94
94
  values.map do |value|
@@ -117,7 +117,7 @@ module ArclightHelper
117
117
  end
118
118
 
119
119
  def collection_active?
120
- try(:search_state) && search_state.params_for_search.try(:[], 'f').try(:[], 'level_sim') == ['Collection']
120
+ respond_to?(:search_state) && search_state&.params_for_search&.dig('f', 'level_sim') == ['Collection']
121
121
  end
122
122
 
123
123
  def collection_active_class
@@ -129,7 +129,7 @@ module ArclightHelper
129
129
  end
130
130
 
131
131
  def grouped?
132
- try(:search_state) && search_state.params_for_search.try(:[], 'group') == 'true'
132
+ respond_to?(:search_state) && search_state&.params_for_search&.dig('group') == 'true'
133
133
  end
134
134
 
135
135
  def search_with_group
@@ -167,7 +167,7 @@ module ArclightHelper
167
167
  #
168
168
  # @return [Repository]
169
169
  def repository_faceted_on
170
- return unless try(:search_state) && facet_field_in_params?('repository_sim')
170
+ return unless respond_to?(:search_state) && search_state && facet_field_in_params?('repository_sim')
171
171
 
172
172
  repos = Array(facet_params('repository_sim'))
173
173
  faceted = repos && repos.length == 1 && repos.first
@@ -1,7 +1,7 @@
1
1
  <% document ||= @document %>
2
2
  <% if parsed_files = ead_files(document) %>
3
3
  <% aeon_web_ead ||= Arclight::Requests::AeonWebEad.new(document, parsed_files.href) %>
4
- <% aeon_web_ead_url = aeon_web_ead.try(:url) %>
4
+ <% aeon_web_ead_url = aeon_web_ead&.url %>
5
5
 
6
6
  <%= link_to 'Request', aeon_web_ead_url, class: 'btn btn-secondary btn-sm' %>
7
7
  <% end %>
@@ -4,7 +4,7 @@
4
4
  <% if document.children? %>
5
5
  <div class="al-toggle-children-container">
6
6
  <%= link_to(
7
- blacklight_icon(:plus),
7
+ '',
8
8
  "##{document.id}-collapsible-hierarchy",
9
9
  class: "al-toggle-view-children #{!show_expanded?(document) ? 'collapsed' : ''}",
10
10
  'aria-label': t('arclight.hierarchy.view_all'),
@@ -21,7 +21,11 @@
21
21
  <% end %>
22
22
 
23
23
  <label for="q" class="sr-only"><%= t('blacklight.search.form.search.label') %></label>
24
- <%= text_field_tag :q, params[:q], placeholder: t('blacklight.search.form.search.placeholder'), class: "search-q q rounded-0 form-control", id: "q", autofocus: presenter.autofocus?, data: { autocomplete_enabled: presenter.autocomplete_enabled?, autocomplete_path: search_action_path(action: :suggest) } %>
24
+ <%
25
+ # Use "autocomplete_path: suggest_index_catalog_path" explicitly so that the RepositoriesController gets the appropriate
26
+ # autocomplete path w/o having to have the search form action be local to the controller (by including Blacklight::Catalog)
27
+ %>
28
+ <%= text_field_tag :q, params[:q], placeholder: t('blacklight.search.form.search.placeholder'), class: "search-q q rounded-0 form-control", id: "q", autofocus: presenter.autofocus?, data: { autocomplete_enabled: presenter.autocomplete_enabled?, autocomplete_path: suggest_index_catalog_path } %>
25
29
 
26
30
  <span class="input-group-append">
27
31
  <button type="submit" class="btn btn-primary search-btn" id="search">
data/arclight.gemspec CHANGED
@@ -23,20 +23,21 @@ Gem::Specification.new do |spec|
23
23
  spec.require_paths = ['lib']
24
24
 
25
25
  spec.add_dependency 'blacklight', '~> 7.2'
26
- spec.add_dependency 'blacklight_range_limit', '~> 7.1'
27
- spec.add_dependency 'rails', '~> 5.0'
28
- spec.add_dependency 'sprockets-bumble_d'
26
+ spec.add_dependency 'blacklight_range_limit', '>= 7.1', '< 9'
27
+ spec.add_dependency 'rails', '>= 6', '< 7.1'
28
+ spec.add_dependency 'rexml'
29
29
  spec.add_dependency 'traject', '~> 3.0'
30
- spec.add_dependency 'traject_plus', '~> 1.2'
30
+ spec.add_dependency 'traject_plus', '~> 2.0'
31
31
 
32
- spec.add_development_dependency 'bundler', '> 1.14'
32
+ spec.add_development_dependency 'bundler'
33
33
  spec.add_development_dependency 'capybara'
34
34
  spec.add_development_dependency 'engine_cart'
35
35
  spec.add_development_dependency 'i18n-tasks'
36
- spec.add_development_dependency 'rake', '~> 12.0'
37
- spec.add_development_dependency 'rspec-rails', '~> 3.0'
38
- spec.add_development_dependency 'rubocop', '~> 0.74.0'
39
- spec.add_development_dependency 'rubocop-rspec', '~> 1.35'
36
+ spec.add_development_dependency 'rake', '>= 12.0'
37
+ spec.add_development_dependency 'rspec-rails'
38
+ spec.add_development_dependency 'rubocop', '~> 1.8'
39
+ spec.add_development_dependency 'rubocop-rails', '~> 2.8'
40
+ spec.add_development_dependency 'rubocop-rspec', '~> 2.3'
40
41
  spec.add_development_dependency 'selenium-webdriver'
41
42
  spec.add_development_dependency 'simplecov'
42
43
  spec.add_development_dependency 'solr_wrapper'
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'sprockets/bumble_d'
4
3
  require 'blacklight'
5
4
  require 'traject'
6
5
  require 'active_model'
@@ -15,13 +14,6 @@ module Arclight
15
14
  ##
16
15
  # This is the defining class for the Arclight Rails Engine
17
16
  class Engine < ::Rails::Engine
18
- extend ::Sprockets::BumbleD::DSL
19
-
20
- # We're not sure this is right, but we aren't doing module imports
21
- # at the moment anyway
22
- register_umd_globals :arclight,
23
- 'blacklight' => 'Blacklight'
24
-
25
17
  config.viewer_class = Arclight::Viewers::OEmbed
26
18
  config.oembed_resource_exclude_patterns = [/\.pdf$/, /\.ppt$/]
27
19
 
@@ -60,7 +52,9 @@ module Arclight
60
52
  end
61
53
 
62
54
  initializer 'arclight.helpers' do
63
- ActionView::Base.send :include, ArclightHelper
55
+ config.after_initialize do
56
+ ActionView::Base.send :include, ArclightHelper
57
+ end
64
58
  end
65
59
  end
66
60
  end
@@ -117,8 +117,8 @@ module Arclight
117
117
  # @param [String] `slug` or `name` -- same as `find_by`
118
118
  # @return [Repository]
119
119
  # @raise [ActiveRecord::RecordNotFound] if cannot find repository
120
- def self.find_by!(*args)
121
- repository = find_by(*args)
120
+ def self.find_by!(**kwargs)
121
+ repository = find_by(**kwargs)
122
122
  raise ActiveRecord::RecordNotFound if repository.blank?
123
123
 
124
124
  repository
@@ -5,6 +5,7 @@ require 'traject'
5
5
  require 'traject/nokogiri_reader'
6
6
  require 'traject_plus'
7
7
  require 'traject_plus/macros'
8
+ require 'arclight/exceptions'
8
9
  require 'arclight/level_label'
9
10
  require 'arclight/normalized_date'
10
11
  require 'arclight/normalized_title'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Arclight
4
- VERSION = '0.3.2'
4
+ VERSION = '0.5.0'
5
5
  end
@@ -43,9 +43,22 @@ module Arclight
43
43
  end
44
44
  end
45
45
 
46
- def assets
46
+ def copy_styles
47
47
  copy_file 'arclight.scss', 'app/assets/stylesheets/arclight.scss'
48
- copy_file 'arclight.js', 'app/assets/javascripts/arclight.js'
48
+ end
49
+
50
+ def inject_js
51
+ inject_into_file 'app/assets/javascripts/application.js', after: '//= require blacklight/blacklight' do
52
+ "\n// Required by Arclight" \
53
+ "\n//= require arclight/arclight" \
54
+ "\n//= require stickyfill"
55
+ end
56
+ end
57
+
58
+ def install_webpacker
59
+ return unless Rails.version.to_i == 6
60
+
61
+ rake 'webpacker:install'
49
62
  end
50
63
 
51
64
  def add_arclight_search_behavior
@@ -95,6 +95,12 @@ class CatalogController < ApplicationController
95
95
  config.add_facet_field 'geogname_sim', label: 'Place', limit: 10
96
96
  config.add_facet_field 'places_ssim', label: 'Places', show: false
97
97
  config.add_facet_field 'access_subjects_ssim', label: 'Subject', limit: 10
98
+ config.add_facet_field 'component_level_isim', show: false
99
+
100
+ # Note that parent_ssim is an array of all ancestor nodes, including the parent
101
+ # parent_ssi is just the immediate parent; it's used in queries for context nav
102
+ config.add_facet_field 'parent_ssim', show: false
103
+ config.add_facet_field 'parent_ssi', show: false
98
104
 
99
105
  # Have BL send all facet field names to Solr, which has been the default
100
106
  # previously. Simply remove these lines if you'd rather use Solr request
data/package.json CHANGED
@@ -3,10 +3,10 @@
3
3
  "description": "",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
- "@babel/core": "^7.5.5",
7
- "@babel/plugin-external-helpers": "^7.2.0",
8
- "@babel/plugin-transform-modules-umd": "^7.2.0",
9
- "@babel/preset-env": "^7.5.5"
6
+ "@babel/core": "^7.18.5",
7
+ "@babel/plugin-external-helpers": "^7.17.12",
8
+ "@babel/plugin-transform-modules-umd": "^7.18.0",
9
+ "@babel/preset-env": "^7.18.2"
10
10
  },
11
11
  "devDependencies": {
12
12
  "eslint": "^3.19.0",
data/solr/conf/schema.xml CHANGED
@@ -244,8 +244,8 @@
244
244
  </analyzer>
245
245
  </fieldType>
246
246
 
247
- <!-- A specialized field for geospatial search. If indexed, this fieldType must not be multivalued. -->
248
- <fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
247
+ <!-- A specialized field for geospatial search filters and distance sorting. -->
248
+ <fieldType name="location" class="solr.LatLonPointSpatialField" docValues="true" />
249
249
 
250
250
  <fieldType name="_nest_path_" class="solr.NestPathField" />
251
251
 
@@ -30,6 +30,7 @@
30
30
  -->
31
31
  <luceneMatchVersion>8.2.0</luceneMatchVersion>
32
32
 
33
+ <lib dir="${solr.install.dir:../../../..}/modules/analysis-extras/lib" />
33
34
  <lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lib" />
34
35
  <lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lucene-libs" />
35
36
 
data/template.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- gem 'arclight', github: 'sul-dlss/arclight'
3
+ gem 'arclight'
4
4
  gem 'blacklight_range_limit', '~> 7.1'
5
5
 
6
6
  run 'bundle install'
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arclight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darren Hardy
8
8
  - Jessie Keck
9
9
  - Gordon Leacock
10
10
  - Jack Reed
11
- autorequire:
11
+ autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2020-04-06 00:00:00.000000000 Z
14
+ date: 2022-06-23 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: blacklight
@@ -31,32 +31,44 @@ dependencies:
31
31
  name: blacklight_range_limit
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  requirements:
34
- - - "~>"
34
+ - - ">="
35
35
  - !ruby/object:Gem::Version
36
36
  version: '7.1'
37
+ - - "<"
38
+ - !ruby/object:Gem::Version
39
+ version: '9'
37
40
  type: :runtime
38
41
  prerelease: false
39
42
  version_requirements: !ruby/object:Gem::Requirement
40
43
  requirements:
41
- - - "~>"
44
+ - - ">="
42
45
  - !ruby/object:Gem::Version
43
46
  version: '7.1'
47
+ - - "<"
48
+ - !ruby/object:Gem::Version
49
+ version: '9'
44
50
  - !ruby/object:Gem::Dependency
45
51
  name: rails
46
52
  requirement: !ruby/object:Gem::Requirement
47
53
  requirements:
48
- - - "~>"
54
+ - - ">="
49
55
  - !ruby/object:Gem::Version
50
- version: '5.0'
56
+ version: '6'
57
+ - - "<"
58
+ - !ruby/object:Gem::Version
59
+ version: '7.1'
51
60
  type: :runtime
52
61
  prerelease: false
53
62
  version_requirements: !ruby/object:Gem::Requirement
54
63
  requirements:
55
- - - "~>"
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: '6'
67
+ - - "<"
56
68
  - !ruby/object:Gem::Version
57
- version: '5.0'
69
+ version: '7.1'
58
70
  - !ruby/object:Gem::Dependency
59
- name: sprockets-bumble_d
71
+ name: rexml
60
72
  requirement: !ruby/object:Gem::Requirement
61
73
  requirements:
62
74
  - - ">="
@@ -89,28 +101,28 @@ dependencies:
89
101
  requirements:
90
102
  - - "~>"
91
103
  - !ruby/object:Gem::Version
92
- version: '1.2'
104
+ version: '2.0'
93
105
  type: :runtime
94
106
  prerelease: false
95
107
  version_requirements: !ruby/object:Gem::Requirement
96
108
  requirements:
97
109
  - - "~>"
98
110
  - !ruby/object:Gem::Version
99
- version: '1.2'
111
+ version: '2.0'
100
112
  - !ruby/object:Gem::Dependency
101
113
  name: bundler
102
114
  requirement: !ruby/object:Gem::Requirement
103
115
  requirements:
104
- - - ">"
116
+ - - ">="
105
117
  - !ruby/object:Gem::Version
106
- version: '1.14'
118
+ version: '0'
107
119
  type: :development
108
120
  prerelease: false
109
121
  version_requirements: !ruby/object:Gem::Requirement
110
122
  requirements:
111
- - - ">"
123
+ - - ">="
112
124
  - !ruby/object:Gem::Version
113
- version: '1.14'
125
+ version: '0'
114
126
  - !ruby/object:Gem::Dependency
115
127
  name: capybara
116
128
  requirement: !ruby/object:Gem::Requirement
@@ -157,58 +169,72 @@ dependencies:
157
169
  name: rake
158
170
  requirement: !ruby/object:Gem::Requirement
159
171
  requirements:
160
- - - "~>"
172
+ - - ">="
161
173
  - !ruby/object:Gem::Version
162
174
  version: '12.0'
163
175
  type: :development
164
176
  prerelease: false
165
177
  version_requirements: !ruby/object:Gem::Requirement
166
178
  requirements:
167
- - - "~>"
179
+ - - ">="
168
180
  - !ruby/object:Gem::Version
169
181
  version: '12.0'
170
182
  - !ruby/object:Gem::Dependency
171
183
  name: rspec-rails
184
+ requirement: !ruby/object:Gem::Requirement
185
+ requirements:
186
+ - - ">="
187
+ - !ruby/object:Gem::Version
188
+ version: '0'
189
+ type: :development
190
+ prerelease: false
191
+ version_requirements: !ruby/object:Gem::Requirement
192
+ requirements:
193
+ - - ">="
194
+ - !ruby/object:Gem::Version
195
+ version: '0'
196
+ - !ruby/object:Gem::Dependency
197
+ name: rubocop
172
198
  requirement: !ruby/object:Gem::Requirement
173
199
  requirements:
174
200
  - - "~>"
175
201
  - !ruby/object:Gem::Version
176
- version: '3.0'
202
+ version: '1.8'
177
203
  type: :development
178
204
  prerelease: false
179
205
  version_requirements: !ruby/object:Gem::Requirement
180
206
  requirements:
181
207
  - - "~>"
182
208
  - !ruby/object:Gem::Version
183
- version: '3.0'
209
+ version: '1.8'
184
210
  - !ruby/object:Gem::Dependency
185
- name: rubocop
211
+ name: rubocop-rails
186
212
  requirement: !ruby/object:Gem::Requirement
187
213
  requirements:
188
214
  - - "~>"
189
215
  - !ruby/object:Gem::Version
190
- version: 0.74.0
216
+ version: '2.8'
191
217
  type: :development
192
218
  prerelease: false
193
219
  version_requirements: !ruby/object:Gem::Requirement
194
220
  requirements:
195
221
  - - "~>"
196
222
  - !ruby/object:Gem::Version
197
- version: 0.74.0
223
+ version: '2.8'
198
224
  - !ruby/object:Gem::Dependency
199
225
  name: rubocop-rspec
200
226
  requirement: !ruby/object:Gem::Requirement
201
227
  requirements:
202
228
  - - "~>"
203
229
  - !ruby/object:Gem::Version
204
- version: '1.35'
230
+ version: '2.3'
205
231
  type: :development
206
232
  prerelease: false
207
233
  version_requirements: !ruby/object:Gem::Requirement
208
234
  requirements:
209
235
  - - "~>"
210
236
  - !ruby/object:Gem::Version
211
- version: '1.35'
237
+ version: '2.3'
212
238
  - !ruby/object:Gem::Dependency
213
239
  name: selenium-webdriver
214
240
  requirement: !ruby/object:Gem::Requirement
@@ -279,12 +305,12 @@ files:
279
305
  - ".babelrc"
280
306
  - ".codeclimate.yml"
281
307
  - ".eslintrc"
308
+ - ".github/workflows/ruby.yml"
282
309
  - ".gitignore"
283
310
  - ".rspec"
284
311
  - ".rubocop.yml"
285
312
  - ".rubocop_todo.yml"
286
313
  - ".solr_wrapper"
287
- - ".travis.yml"
288
314
  - CONTRIBUTING.md
289
315
  - CONTRIBUTORS.md
290
316
  - Gemfile
@@ -317,6 +343,7 @@ files:
317
343
  - app/assets/stylesheets/arclight/modules/context_navigation.scss
318
344
  - app/assets/stylesheets/arclight/modules/hierarchy_and_online_contents.scss
319
345
  - app/assets/stylesheets/arclight/modules/highlights.scss
346
+ - app/assets/stylesheets/arclight/modules/icons.scss
320
347
  - app/assets/stylesheets/arclight/modules/layout.scss
321
348
  - app/assets/stylesheets/arclight/modules/mastheads.scss
322
349
  - app/assets/stylesheets/arclight/modules/repositories.scss
@@ -432,7 +459,6 @@ files:
432
459
  - lib/arclight/viewers/oembed.rb
433
460
  - lib/arclight/year_range.rb
434
461
  - lib/generators/arclight/install_generator.rb
435
- - lib/generators/arclight/templates/arclight.js
436
462
  - lib/generators/arclight/templates/arclight.scss
437
463
  - lib/generators/arclight/templates/catalog_controller.rb
438
464
  - lib/generators/arclight/templates/config/downloads.yml
@@ -464,7 +490,7 @@ homepage: https://github.com/sul-dlss/arclight
464
490
  licenses:
465
491
  - Apache-2.0
466
492
  metadata: {}
467
- post_install_message:
493
+ post_install_message:
468
494
  rdoc_options: []
469
495
  require_paths:
470
496
  - lib
@@ -479,8 +505,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
479
505
  - !ruby/object:Gem::Version
480
506
  version: '0'
481
507
  requirements: []
482
- rubygems_version: 3.1.2
483
- signing_key:
508
+ rubygems_version: 3.2.32
509
+ signing_key:
484
510
  specification_version: 4
485
511
  summary: ''
486
512
  test_files: []
data/.travis.yml DELETED
@@ -1,28 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- notifications:
4
- email: false
5
- rvm:
6
- - 2.5.5
7
- - 2.6.3
8
- jdk:
9
- - openjdk11
10
-
11
- before_script:
12
- - find spec/fixtures/ead -name '*.xml' | xargs xmllint --noout --schema spec/fixtures/xsd/ead.xsd
13
- - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
14
- - chmod +x ./cc-test-reporter
15
- - ./cc-test-reporter before-build
16
- - yarn install
17
- addons:
18
- apt:
19
- packages:
20
- - libxml2-utils
21
- chrome: stable
22
-
23
- env:
24
- global:
25
- - CC_TEST_REPORTER_ID=0bbc7b5fd7f6bab0c0517183ae34a4d2f6010ca1ef2d1c7c3ccdec55ea823115
26
-
27
- after_script:
28
- - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
@@ -1,2 +0,0 @@
1
- //= require arclight/arclight
2
- //= require stickyfill