arclight 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +11 -4
- data/.rubocop.yml +185 -26
- data/.solr_wrapper +2 -1
- data/README.md +1 -1
- data/app/assets/stylesheets/arclight/modules/mastheads.scss +1 -16
- data/app/components/arclight/collection_sidebar_component.rb +1 -1
- data/app/components/arclight/document_components_hierarchy_component.html.erb +3 -15
- data/app/components/arclight/document_components_hierarchy_component.rb +6 -0
- data/app/components/arclight/expand_hierarchy_button_component.html.erb +5 -0
- data/app/components/arclight/expand_hierarchy_button_component.rb +16 -0
- data/app/components/arclight/masthead_component.html.erb +8 -6
- data/app/components/arclight/online_content_filter_component.html.erb +1 -1
- data/app/components/arclight/online_content_filter_component.rb +1 -3
- data/app/components/arclight/repository_breadcrumb_component.html.erb +1 -1
- data/app/components/arclight/search_result_title_component.html.erb +3 -3
- data/app/models/arclight/document_downloads.rb +1 -1
- data/app/models/arclight/parents.rb +1 -1
- data/app/models/concerns/arclight/solr_document.rb +2 -1
- data/app/views/shared/_main_menu_links.html.erb +1 -1
- data/arclight.gemspec +1 -1
- data/lib/arclight/repository.rb +1 -1
- data/lib/arclight/traject/ead2_component_config.rb +1 -1
- data/lib/arclight/version.rb +1 -1
- data/lib/generators/arclight/install_generator.rb +40 -3
- data/lib/generators/arclight/templates/arclight.scss +6 -5
- data/lib/generators/arclight/templates/catalog_controller.rb +1 -0
- data/package.json +1 -1
- data/tasks/arclight.rake +9 -2
- metadata +15 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7371056b2eb8d6241d7113f46f593ce352afe9029c16eb6cc404bee31ebcf511
|
4
|
+
data.tar.gz: ccb5c2b72c6c67441d74c358568bef14d6e35117ba92be77fb01989e01a80875
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bc505687178b9dbac2d809def95a1fb3fe0bb156f577bb266bc1221c651d9c188b5288a1254f1b2e054484090e2fff5225ee46fa3cbabbf8f0ce493003de7d0
|
7
|
+
data.tar.gz: e16678a9073c7a1c845586b968659016f62cfd7b0b8c543552c0ef29c9e92fcb38daf4c3b6f542531e57041ff26b79d2f44e661d58129898652a260bbfe1ba7f
|
data/.github/workflows/ruby.yml
CHANGED
@@ -2,19 +2,26 @@ name: CI
|
|
2
2
|
|
3
3
|
on:
|
4
4
|
push:
|
5
|
-
branches: [main]
|
5
|
+
branches: [main, release-*]
|
6
6
|
pull_request:
|
7
|
-
branches: [main]
|
7
|
+
branches: [main, release-*]
|
8
8
|
|
9
9
|
jobs:
|
10
10
|
test:
|
11
11
|
runs-on: ubuntu-latest
|
12
12
|
strategy:
|
13
13
|
matrix:
|
14
|
-
rails_version: [7.1.
|
15
|
-
ruby: ["3.
|
14
|
+
rails_version: [7.1.5.1, 7.2.2.1]
|
15
|
+
ruby: ["3.2", "3.3"]
|
16
|
+
additional_engine_cart_rails_options: [""]
|
17
|
+
include:
|
18
|
+
- ruby: "3.1"
|
19
|
+
rails_version: "7.1.5"
|
20
|
+
- ruby: "3.3"
|
21
|
+
rails_version: "8.0.1"
|
16
22
|
env:
|
17
23
|
RAILS_VERSION: ${{ matrix.rails_version }}
|
24
|
+
ENGINE_CART_RAILS_OPTIONS: "--skip-git --skip-listen --skip-spring --skip-keeps --skip-kamal --skip-solid --skip-coffee --skip-test --css bootstrap -a propshaft -j importmap ${{ matrix.additional_engine_cart_rails_options }}"
|
18
25
|
steps:
|
19
26
|
- uses: actions/checkout@v4
|
20
27
|
- name: Set up Ruby ${{ matrix.ruby }}
|
data/.rubocop.yml
CHANGED
@@ -1,41 +1,46 @@
|
|
1
|
+
plugins:
|
2
|
+
- rubocop-factory_bot
|
3
|
+
|
1
4
|
require:
|
2
5
|
- rubocop-rspec
|
3
6
|
- rubocop-rails
|
4
7
|
- rubocop-rake
|
8
|
+
- rubocop-rspec_rails
|
9
|
+
- rubocop-capybara
|
5
10
|
|
6
11
|
inherit_from:
|
7
12
|
- .rubocop_todo.yml
|
8
13
|
|
9
14
|
AllCops:
|
10
15
|
Exclude:
|
11
|
-
-
|
12
|
-
-
|
13
|
-
-
|
14
|
-
-
|
15
|
-
-
|
16
|
-
-
|
16
|
+
- ".internal_test_app/**/*"
|
17
|
+
- "bin/**/*"
|
18
|
+
- "db/**/*"
|
19
|
+
- "lib/generators/arclight/templates/**/*"
|
20
|
+
- "vendor/**/*"
|
21
|
+
- "node_modules/**/*"
|
17
22
|
TargetRubyVersion: 3.0
|
18
23
|
DisplayCopNames: true
|
19
24
|
|
20
25
|
Metrics/ModuleLength:
|
21
26
|
Exclude:
|
22
|
-
-
|
23
|
-
-
|
27
|
+
- "app/helpers/arclight_helper.rb"
|
28
|
+
- "app/models/concerns/arclight/solr_document.rb"
|
24
29
|
|
25
30
|
Metrics/BlockLength:
|
26
31
|
Exclude:
|
27
|
-
-
|
28
|
-
-
|
29
|
-
-
|
30
|
-
-
|
31
|
-
-
|
32
|
-
-
|
33
|
-
-
|
34
|
-
-
|
32
|
+
- "arclight.gemspec"
|
33
|
+
- "lib/arclight/traject/ead2_config.rb"
|
34
|
+
- "lib/tasks/**/*"
|
35
|
+
- "spec/features/traject/ead2_indexing_spec.rb"
|
36
|
+
- "spec/helpers/arclight_helper_spec.rb"
|
37
|
+
- "spec/features/collection_page_spec.rb"
|
38
|
+
- "spec/**/*"
|
39
|
+
- "tasks/**/*"
|
35
40
|
|
36
41
|
Naming/PredicateName:
|
37
42
|
ForbiddenPrefixes:
|
38
|
-
-
|
43
|
+
- is_
|
39
44
|
|
40
45
|
Layout/LineLength:
|
41
46
|
Max: 160
|
@@ -48,7 +53,7 @@ Bundler/DuplicatedGem:
|
|
48
53
|
|
49
54
|
Style/FormatStringToken:
|
50
55
|
Exclude:
|
51
|
-
-
|
56
|
+
- "spec/test_app_templates/lib/generators/test_app_generator.rb"
|
52
57
|
|
53
58
|
Gemspec/DeprecatedAttributeAssignment: # new in 1.30
|
54
59
|
Enabled: true
|
@@ -204,11 +209,11 @@ Capybara/SpecificFinders: # new in 2.13
|
|
204
209
|
Enabled: true
|
205
210
|
Capybara/SpecificMatcher: # new in 2.12
|
206
211
|
Enabled: true
|
207
|
-
|
212
|
+
FactoryBot/SyntaxMethods: # new in 2.7
|
208
213
|
Enabled: true
|
209
|
-
|
214
|
+
RSpecRails/AvoidSetupHook: # new in 2.4
|
210
215
|
Enabled: true
|
211
|
-
|
216
|
+
RSpecRails/HaveHttpStatus: # new in 2.12
|
212
217
|
Enabled: true
|
213
218
|
Rails/ActionControllerFlashBeforeRender: # new in 2.16
|
214
219
|
Enabled: true
|
@@ -318,9 +323,9 @@ Capybara/NegationMatcher: # new in 2.14
|
|
318
323
|
Enabled: true
|
319
324
|
Capybara/SpecificActions: # new in 2.14
|
320
325
|
Enabled: true
|
321
|
-
|
326
|
+
FactoryBot/ConsistentParenthesesStyle: # new in 2.14
|
322
327
|
Enabled: false # https://github.com/rspec/rspec-rails/issues/2635
|
323
|
-
|
328
|
+
RSpecRails/InferredSpecType: # new in 2.14
|
324
329
|
Enabled: true
|
325
330
|
Rails/ActionOrder: # new in 2.17
|
326
331
|
Enabled: true
|
@@ -354,9 +359,163 @@ RSpec/DuplicatedMetadata: # new in 2.16
|
|
354
359
|
Enabled: true
|
355
360
|
RSpec/PendingWithoutReason: # new in 2.16
|
356
361
|
Enabled: true
|
357
|
-
|
362
|
+
FactoryBot/FactoryNameStyle: # new in 2.16
|
358
363
|
Enabled: false # https://github.com/rubocop/rubocop-rspec/issues/1587
|
359
|
-
|
364
|
+
RSpecRails/MinitestAssertions: # new in 2.17
|
360
365
|
Enabled: true
|
361
366
|
Rails/ResponseParsedBody: # new in 2.18
|
362
|
-
Enabled: true
|
367
|
+
Enabled: true
|
368
|
+
Gemspec/AddRuntimeDependency: # new in 1.65
|
369
|
+
Enabled: true
|
370
|
+
Lint/DuplicateMatchPattern: # new in 1.50
|
371
|
+
Enabled: true
|
372
|
+
Lint/DuplicateSetElement: # new in 1.67
|
373
|
+
Enabled: true
|
374
|
+
Lint/HashNewWithKeywordArgumentsAsDefault: # new in 1.69
|
375
|
+
Enabled: true
|
376
|
+
Lint/ItWithoutArgumentsInBlock: # new in 1.59
|
377
|
+
Enabled: true
|
378
|
+
Lint/LiteralAssignmentInCondition: # new in 1.58
|
379
|
+
Enabled: true
|
380
|
+
Lint/MixedCaseRange: # new in 1.53
|
381
|
+
Enabled: true
|
382
|
+
Lint/NumericOperationWithConstantResult: # new in 1.69
|
383
|
+
Enabled: true
|
384
|
+
Lint/RedundantRegexpQuantifiers: # new in 1.53
|
385
|
+
Enabled: true
|
386
|
+
Lint/UnescapedBracketInRegexp: # new in 1.68
|
387
|
+
Enabled: true
|
388
|
+
Lint/UselessDefined: # new in 1.69
|
389
|
+
Enabled: true
|
390
|
+
Lint/UselessNumericOperation: # new in 1.66
|
391
|
+
Enabled: true
|
392
|
+
Metrics/CollectionLiteralLength: # new in 1.47
|
393
|
+
Enabled: true
|
394
|
+
Style/AmbiguousEndlessMethodDefinition: # new in 1.68
|
395
|
+
Enabled: true
|
396
|
+
Style/BitwisePredicate: # new in 1.68
|
397
|
+
Enabled: true
|
398
|
+
Style/CombinableDefined: # new in 1.68
|
399
|
+
Enabled: true
|
400
|
+
Style/DataInheritance: # new in 1.49
|
401
|
+
Enabled: true
|
402
|
+
Style/DigChain: # new in 1.69
|
403
|
+
Enabled: true
|
404
|
+
Style/DirEmpty: # new in 1.48
|
405
|
+
Enabled: true
|
406
|
+
Style/ExactRegexpMatch: # new in 1.51
|
407
|
+
Enabled: true
|
408
|
+
Style/FileEmpty: # new in 1.48
|
409
|
+
Enabled: true
|
410
|
+
Style/FileNull: # new in 1.69
|
411
|
+
Enabled: true
|
412
|
+
Style/FileTouch: # new in 1.69
|
413
|
+
Enabled: true
|
414
|
+
Style/KeywordArgumentsMerging: # new in 1.68
|
415
|
+
Enabled: true
|
416
|
+
Style/MapIntoArray: # new in 1.63
|
417
|
+
Enabled: true
|
418
|
+
Style/RedundantArrayConstructor: # new in 1.52
|
419
|
+
Enabled: true
|
420
|
+
Style/RedundantCurrentDirectoryInPath: # new in 1.53
|
421
|
+
Enabled: true
|
422
|
+
Style/RedundantFilterChain: # new in 1.52
|
423
|
+
Enabled: true
|
424
|
+
Style/RedundantInterpolationUnfreeze: # new in 1.66
|
425
|
+
Enabled: true
|
426
|
+
Style/RedundantLineContinuation: # new in 1.49
|
427
|
+
Enabled: true
|
428
|
+
Style/RedundantRegexpArgument: # new in 1.53
|
429
|
+
Enabled: true
|
430
|
+
Style/RedundantRegexpConstructor: # new in 1.52
|
431
|
+
Enabled: true
|
432
|
+
Style/ReturnNilInPredicateMethodDefinition: # new in 1.53
|
433
|
+
Enabled: true
|
434
|
+
Style/SafeNavigationChainLength: # new in 1.68
|
435
|
+
Enabled: true
|
436
|
+
Style/SendWithLiteralMethodName: # new in 1.64
|
437
|
+
Enabled: true
|
438
|
+
Style/SingleLineDoEndBlock: # new in 1.57
|
439
|
+
Enabled: true
|
440
|
+
Style/SuperArguments: # new in 1.64
|
441
|
+
Enabled: true
|
442
|
+
Style/SuperWithArgsParentheses: # new in 1.58
|
443
|
+
Enabled: true
|
444
|
+
Style/YAMLFileRead: # new in 1.53
|
445
|
+
Enabled: true
|
446
|
+
Capybara/ClickLinkOrButtonStyle: # new in 2.19
|
447
|
+
Enabled: true
|
448
|
+
Capybara/RedundantWithinFind: # new in 2.20
|
449
|
+
Enabled: true
|
450
|
+
Capybara/RSpec/HaveSelector: # new in 2.19
|
451
|
+
Enabled: true
|
452
|
+
Capybara/RSpec/PredicateMatcher: # new in 2.19
|
453
|
+
Enabled: true
|
454
|
+
FactoryBot/AssociationStyle: # new in 2.23
|
455
|
+
Enabled: true
|
456
|
+
FactoryBot/ExcessiveCreateList: # new in 2.25
|
457
|
+
Enabled: true
|
458
|
+
FactoryBot/FactoryAssociationWithStrategy: # new in 2.23
|
459
|
+
Enabled: true
|
460
|
+
FactoryBot/IdSequence: # new in 2.24
|
461
|
+
Enabled: true
|
462
|
+
FactoryBot/RedundantFactoryOption: # new in 2.23
|
463
|
+
Enabled: true
|
464
|
+
RSpecRails/NegationBeValid: # new in 2.23
|
465
|
+
Enabled: true
|
466
|
+
RSpecRails/TravelAround: # new in 2.19
|
467
|
+
Enabled: true
|
468
|
+
RSpec/BeEmpty: # new in 2.20
|
469
|
+
Enabled: true
|
470
|
+
RSpec/ContainExactly: # new in 2.19
|
471
|
+
Enabled: true
|
472
|
+
RSpec/EmptyMetadata: # new in 2.24
|
473
|
+
Enabled: true
|
474
|
+
RSpec/EmptyOutput: # new in 2.29
|
475
|
+
Enabled: true
|
476
|
+
RSpec/Eq: # new in 2.24
|
477
|
+
Enabled: true
|
478
|
+
RSpec/ExpectInLet: # new in 2.30
|
479
|
+
Enabled: true
|
480
|
+
RSpec/IndexedLet: # new in 2.20
|
481
|
+
Enabled: true
|
482
|
+
RSpec/IsExpectedSpecify: # new in 2.27
|
483
|
+
Enabled: true
|
484
|
+
RSpec/MatchArray: # new in 2.19
|
485
|
+
Enabled: true
|
486
|
+
RSpec/MetadataStyle: # new in 2.24
|
487
|
+
Enabled: true
|
488
|
+
RSpec/ReceiveMessages: # new in 2.23
|
489
|
+
Enabled: true
|
490
|
+
RSpec/RedundantAround: # new in 2.19
|
491
|
+
Enabled: true
|
492
|
+
RSpec/RedundantPredicateMatcher: # new in 2.26
|
493
|
+
Enabled: true
|
494
|
+
RSpec/RemoveConst: # new in 2.26
|
495
|
+
Enabled: true
|
496
|
+
RSpec/RepeatedSubjectCall: # new in 2.27
|
497
|
+
Enabled: true
|
498
|
+
RSpec/SkipBlockInsideExample: # new in 2.19
|
499
|
+
Enabled: true
|
500
|
+
RSpec/SpecFilePathFormat: # new in 2.24
|
501
|
+
Enabled: true
|
502
|
+
RSpec/SpecFilePathSuffix: # new in 2.24
|
503
|
+
Enabled: true
|
504
|
+
RSpec/UndescriptiveLiteralsDescription: # new in 2.29
|
505
|
+
Enabled: true
|
506
|
+
Rails/DangerousColumnNames: # new in 2.21
|
507
|
+
Enabled: true
|
508
|
+
Rails/EnumSyntax: # new in 2.26
|
509
|
+
Enabled: true
|
510
|
+
Rails/EnvLocal: # new in 2.22
|
511
|
+
Enabled: true
|
512
|
+
Rails/RedundantActiveRecordAllMethod: # new in 2.21
|
513
|
+
Enabled: true
|
514
|
+
Rails/SelectMap: # new in 2.21
|
515
|
+
Enabled: true
|
516
|
+
Rails/ThreeStateBooleanColumn: # new in 2.19
|
517
|
+
Enabled: true
|
518
|
+
Rails/UnusedRenderContent: # new in 2.21
|
519
|
+
Enabled: true
|
520
|
+
Rails/WhereRange: # new in 2.25
|
521
|
+
Enabled: true
|
data/.solr_wrapper
CHANGED
data/README.md
CHANGED
@@ -12,7 +12,7 @@ A Rails engine supporting discovery of archival materials, based on [Blacklight]
|
|
12
12
|
## Requirements
|
13
13
|
|
14
14
|
* [Ruby](https://www.ruby-lang.org/en/) 3.0.3 or later
|
15
|
-
* [Rails](http://rubyonrails.org) 7.
|
15
|
+
* [Rails](http://rubyonrails.org) 7.1 or later
|
16
16
|
* Solr 8.1 or later
|
17
17
|
|
18
18
|
## Installation
|
@@ -28,30 +28,15 @@
|
|
28
28
|
.al-masthead {
|
29
29
|
--al-mastead-active-link-color: var(--bs-gray-700);
|
30
30
|
--al-masthead-title-size: #{$h2-font-size};
|
31
|
+
--bs-nav-link-font-weight: 700;
|
31
32
|
|
32
33
|
.h1 {
|
33
|
-
display: block;
|
34
34
|
font-size: var(--al-masthead-title-size);
|
35
|
-
margin: 0;
|
36
|
-
padding: ($spacer * 1.5) ($spacer * 0.5);
|
37
35
|
}
|
38
36
|
|
39
37
|
.navbar-nav {
|
40
|
-
flex-direction: row;
|
41
|
-
font-weight: 700;
|
42
|
-
|
43
38
|
.active a {
|
44
39
|
color: var(--al-mastead-active-link-color);
|
45
40
|
}
|
46
41
|
}
|
47
|
-
|
48
|
-
@media (max-width: 767px) {
|
49
|
-
.nav-links {
|
50
|
-
justify-content: center !important;
|
51
|
-
}
|
52
|
-
|
53
|
-
h1 {
|
54
|
-
text-align: center;
|
55
|
-
}
|
56
|
-
}
|
57
42
|
}
|
@@ -2,29 +2,17 @@
|
|
2
2
|
<%# render the hierarchy as: outer (left) window ... window ... because our current document hierarchy is so far down the list it'd be buried %>
|
3
3
|
<%= helpers.turbo_frame_tag "al-hierarchy-#{@document.id}-left", loading: 'lazy', src: hierarchy_path(limit: @left_outer_window, key: '-left') %>
|
4
4
|
<%= tag.turbo_frame id: "al-hierarchy-#{@document.id}-gap" do %>
|
5
|
-
|
6
|
-
<li>
|
7
|
-
<%= link_to t('arclight.views.show.expand'), hierarchy_path(offset: @left_outer_window, limit: @target_index - @left_outer_window - (@window / 2), key: '-gap'), class: 'btn btn-secondary btn-sm' %>
|
8
|
-
</li>
|
9
|
-
</ul>
|
5
|
+
<%= render expand_hierarchy_component.new(path: hierarchy_path(offset: @left_outer_window, limit: @target_index - @left_outer_window - (@window / 2), key: '-gap')) %>
|
10
6
|
<% end %>
|
11
7
|
<%= helpers.turbo_frame_tag "al-hierarchy-#{@document.id}-window", src: hierarchy_path(offset: @target_index - (@window / 2), limit: @window, key: '-window') %>
|
12
8
|
<%= tag.turbo_frame id: "al-hierarchy-#{@document.id}-right" do %>
|
13
|
-
|
14
|
-
<li>
|
15
|
-
<%= link_to t('arclight.views.show.expand'), hierarchy_path(offset: @target_index + (@window / 2), key: '-right'), class: 'btn btn-secondary btn-sm' %>
|
16
|
-
</li>
|
17
|
-
</ul>
|
9
|
+
<%= render expand_hierarchy_component.new(path: hierarchy_path(offset: @target_index + (@window / 2), key: '-right')) %>
|
18
10
|
<% end %>
|
19
11
|
<% elsif paginate? %>
|
20
12
|
<%# render the first N documents, and let the user expand the remaining if desired %>
|
21
13
|
<%= helpers.turbo_frame_tag "al-hierarchy-#{@document.id}-sidebar", loading: ('lazy' unless @target_index >= 0), src: hierarchy_path(limit: @maximum_left_gap, key: '-sidebar') %>
|
22
14
|
<%= tag.turbo_frame id: "al-hierarchy-#{@document.id}-right" do %>
|
23
|
-
|
24
|
-
<li>
|
25
|
-
<%= link_to t('arclight.views.show.expand'), hierarchy_path(offset: @maximum_left_gap, key: '-right'), class: 'btn btn-secondary btn-sm' %>
|
26
|
-
</li>
|
27
|
-
</ul>
|
15
|
+
<%= render expand_hierarchy_component.new(path: hierarchy_path(offset: @maximum_left_gap, key: '-right')) %>
|
28
16
|
<% end %>
|
29
17
|
<% else %>
|
30
18
|
<%# there aren't enough to bother paginating, so load them all at once %>
|
@@ -24,5 +24,11 @@ module Arclight
|
|
24
24
|
def hierarchy_path(**kwargs)
|
25
25
|
helpers.hierarchy_solr_document_path(id: @document.id, hierarchy: true, nest_path: params[:nest_path], **kwargs)
|
26
26
|
end
|
27
|
+
|
28
|
+
def expand_hierarchy_component
|
29
|
+
blacklight_config.show.expand_hierarchy_component || Arclight::ExpandHierarchyButtonComponent
|
30
|
+
end
|
31
|
+
|
32
|
+
delegate :blacklight_config, to: :helpers
|
27
33
|
end
|
28
34
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Arclight
|
4
|
+
# Component for rendering an expand button in the hierarchy view
|
5
|
+
class ExpandHierarchyButtonComponent < Blacklight::Component
|
6
|
+
def initialize(path:, classes: 'btn btn-secondary btn-sm')
|
7
|
+
super
|
8
|
+
@path = path
|
9
|
+
@classes = classes
|
10
|
+
end
|
11
|
+
|
12
|
+
def expand_link
|
13
|
+
link_to t('arclight.views.show.expand'), @path, class: @classes
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -2,14 +2,16 @@
|
|
2
2
|
<div class="container">
|
3
3
|
<div class="row align-items-center">
|
4
4
|
<div class="col-md-8" >
|
5
|
-
<
|
5
|
+
<div class="h1 my-4 text-center text-md-start"><%= heading %></div>
|
6
6
|
</div>
|
7
7
|
|
8
|
-
<
|
9
|
-
<
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
<div class="col-md-4">
|
9
|
+
<nav class="navbar navbar-expand d-flex justify-content-md-end justify-content-center" aria-label="browse">
|
10
|
+
<ul class="navbar-nav">
|
11
|
+
<%= render 'shared/main_menu_links' %>
|
12
|
+
</ul>
|
13
|
+
</nav>
|
14
|
+
</div>
|
13
15
|
</div>
|
14
16
|
</div>
|
15
17
|
</div>
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<%= t('arclight.views.show.online_content.title') %>
|
8
8
|
</h2>
|
9
9
|
</div>
|
10
|
-
<div class="
|
10
|
+
<div class="ms-3 ms-xl-5">
|
11
11
|
<div><%= t('arclight.views.show.online_content.description') %></div>
|
12
12
|
<%= link_to t('arclight.views.show.online_content.link_text'), helpers.search_action_path(f: { collection: [collection_name], access: ['online'] }) %>
|
13
13
|
</div>
|
@@ -3,8 +3,8 @@
|
|
3
3
|
<%= helpers.link_to_document @document, counter: @counter %>
|
4
4
|
<% @document.extent.each do |extent| %>
|
5
5
|
<%= tag.span extent, class: 'al-document-extent badge' unless compact? %>
|
6
|
-
<% end %>
|
7
|
-
<%= tag.span class: 'al-document-container text-muted
|
6
|
+
<% end %>
|
7
|
+
<%= tag.span class: 'al-document-container text-muted' do %>
|
8
8
|
<%= @document.containers.join(', ') %>
|
9
9
|
<% end if @document.containers.present? %>
|
10
10
|
</h3>
|
@@ -12,4 +12,4 @@
|
|
12
12
|
<% actions.each do |action| %>
|
13
13
|
<%= action %>
|
14
14
|
<% end %>
|
15
|
-
</header>
|
15
|
+
</header>
|
@@ -29,7 +29,7 @@ module Arclight
|
|
29
29
|
# @param [SolrDocument] document
|
30
30
|
def self.from_solr_document(document)
|
31
31
|
ids = document.parent_ids
|
32
|
-
legacy_ids = document.legacy_parent_ids.map { |legacy_id| document.
|
32
|
+
legacy_ids = document.legacy_parent_ids.map { |legacy_id| document.root == legacy_id ? legacy_id : "#{document.root}#{legacy_id}" }
|
33
33
|
labels = document.parent_labels
|
34
34
|
eadid = document.eadid
|
35
35
|
levels = document.parent_levels
|
@@ -8,6 +8,7 @@ module Arclight
|
|
8
8
|
|
9
9
|
included do
|
10
10
|
attribute :collection_id, :string, '_root_'
|
11
|
+
Arclight.deprecation.deprecate_methods(self, collection_id: 'Use `root` instead')
|
11
12
|
attribute :parent_ids, :array, 'parent_ids_ssim'
|
12
13
|
attribute :legacy_parent_ids, :array, 'parent_ssim'
|
13
14
|
Arclight.deprecation.deprecate_methods(self, legacy_parent_ids: 'Use `parent_ids` instead')
|
@@ -51,7 +52,7 @@ module Arclight
|
|
51
52
|
def normalized_eadid
|
52
53
|
Arclight::NormalizedId.new(eadid).to_s
|
53
54
|
end
|
54
|
-
Arclight.deprecation.deprecate_methods(self, normalized_eadid: 'Use `
|
55
|
+
Arclight.deprecation.deprecate_methods(self, normalized_eadid: 'Use `root` instead')
|
55
56
|
|
56
57
|
def repository
|
57
58
|
first('repository_ssm') || collection&.first('repository_ssm')
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<li class="nav-item <%= repositories_active_class %>">
|
2
2
|
<%= link_to t('arclight.routes.repositories'), arclight_engine.repositories_path, class: 'nav-link' %>
|
3
3
|
</li>
|
4
|
-
<li class="nav-item
|
4
|
+
<li class="nav-item ms-3 <%= collection_active_class %>">
|
5
5
|
<%= link_to t('arclight.routes.collections'), arclight_engine.collections_path, class: 'nav-link' %>
|
6
6
|
</li>
|
data/arclight.gemspec
CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
|
|
26
26
|
|
27
27
|
spec.add_dependency 'blacklight', '>= 8.0.0', '< 9'
|
28
28
|
spec.add_dependency 'gretel'
|
29
|
-
spec.add_dependency 'rails', '
|
29
|
+
spec.add_dependency 'rails', '>= 7.1', '< 9'
|
30
30
|
spec.add_dependency 'traject', '~> 3.0'
|
31
31
|
spec.add_dependency 'traject_plus', '~> 2.0'
|
32
32
|
|
data/lib/arclight/repository.rb
CHANGED
@@ -86,7 +86,7 @@ to_field 'ref_ssi' do |record, accumulator, context|
|
|
86
86
|
record['id'] = hexdigest
|
87
87
|
hexdigest
|
88
88
|
else
|
89
|
-
record.attribute('id')&.value&.strip&.gsub('.', '-')
|
89
|
+
record.attribute('id')&.value&.strip&.gsub('.', '-') # rubocop:disable Style/SafeNavigationChainLength
|
90
90
|
end
|
91
91
|
end
|
92
92
|
to_field 'ref_ssm' do |_record, accumulator, context|
|
data/lib/arclight/version.rb
CHANGED
@@ -5,9 +5,11 @@ require 'rails/generators'
|
|
5
5
|
module Arclight
|
6
6
|
##
|
7
7
|
# Arclight install generator
|
8
|
-
class Install < Rails::Generators::Base
|
8
|
+
class Install < Rails::Generators::Base # rubocop:disable Metrics/ClassLength
|
9
9
|
source_root File.expand_path('templates', __dir__)
|
10
10
|
|
11
|
+
class_option :test, type: :boolean, default: false, aliases: '-t', desc: 'Indicates that app will be installed in a test environment'
|
12
|
+
|
11
13
|
def create_blacklight_catalog
|
12
14
|
remove_file 'app/controllers/catalog_controller.rb'
|
13
15
|
copy_file 'catalog_controller.rb', 'app/controllers/catalog_controller.rb'
|
@@ -41,9 +43,31 @@ module Arclight
|
|
41
43
|
gsub_file 'config/routes.rb', 'root to: "catalog#index"', 'root to: "arclight/repositories#index"'
|
42
44
|
end
|
43
45
|
|
44
|
-
def
|
46
|
+
def add_frontend
|
47
|
+
if ENV['CI']
|
48
|
+
run "yarn add file:#{Arclight::Engine.root}"
|
49
|
+
elsif options[:test]
|
50
|
+
run 'yarn link arclight'
|
51
|
+
|
52
|
+
# If a branch was specified (e.g. you are running a template.rb build
|
53
|
+
# against a test branch), use the latest version available on npm
|
54
|
+
elsif ENV['BRANCH']
|
55
|
+
run 'yarn add arclight@latest'
|
56
|
+
|
57
|
+
# Otherwise, pick the version from npm that matches the Arclight
|
58
|
+
# gem version
|
59
|
+
else
|
60
|
+
run "yarn add arclight@#{arclight_yarn_version}"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def add_stylesheets
|
45
65
|
copy_file 'arclight.scss', 'app/assets/stylesheets/arclight.scss'
|
46
|
-
|
66
|
+
append_to_file 'app/assets/stylesheets/application.bootstrap.scss' do
|
67
|
+
<<~CONTENT
|
68
|
+
@import "arclight";
|
69
|
+
CONTENT
|
70
|
+
end
|
47
71
|
end
|
48
72
|
|
49
73
|
def add_arclight_search_behavior
|
@@ -122,5 +146,18 @@ module Arclight
|
|
122
146
|
def import_arclight_javascript
|
123
147
|
append_to_file 'app/javascript/application.js', "\nimport \"arclight\""
|
124
148
|
end
|
149
|
+
|
150
|
+
def package_yarn_version(package_name, requested_version)
|
151
|
+
versions = JSON.parse(`yarn info #{package_name} versions --json`)['data']
|
152
|
+
exact_match = versions.find { |v| v == requested_version }
|
153
|
+
return exact_match if exact_match
|
154
|
+
|
155
|
+
major_version = Gem::Version.new(requested_version).segments.first
|
156
|
+
"^#{major_version}"
|
157
|
+
end
|
158
|
+
|
159
|
+
def arclight_yarn_version
|
160
|
+
package_yarn_version('arclight', Arclight::VERSION)
|
161
|
+
end
|
125
162
|
end
|
126
163
|
end
|
@@ -1,5 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
:root {
|
2
|
+
--bs-breadcrumb-divider: "»";
|
3
|
+
}
|
4
|
+
|
5
|
+
// Arclight, imported from arclight frontend package
|
6
|
+
@import 'arclight/app/assets/stylesheets/arclight/application';
|
@@ -78,6 +78,7 @@ class CatalogController < ApplicationController
|
|
78
78
|
config.show.embed_component = Arclight::EmbedComponent
|
79
79
|
config.show.access_component = Arclight::AccessComponent
|
80
80
|
config.show.online_status_component = Arclight::OnlineStatusIndicatorComponent
|
81
|
+
config.show.expand_hierarchy_component = Arclight::ExpandHierarchyButtonComponent
|
81
82
|
config.show.display_type_field = 'level_ssm'
|
82
83
|
# config.show.thumbnail_field = 'thumbnail_path_ss'
|
83
84
|
config.show.document_presenter_class = Arclight::ShowPresenter
|
data/package.json
CHANGED
data/tasks/arclight.rake
CHANGED
@@ -7,13 +7,20 @@ require 'arclight'
|
|
7
7
|
|
8
8
|
class DependencyNotInstalled < StandardError; end
|
9
9
|
|
10
|
+
# Build with our opinionated defaults if none are provided.
|
11
|
+
rails_options = ENV.fetch('ENGINE_CART_RAILS_OPTIONS', '')
|
12
|
+
rails_options = "#{rails_options} -a propshaft" unless rails_options.match?(/-a\s|--asset-pipeline/)
|
13
|
+
rails_options = "#{rails_options} -j importmap" unless rails_options.match?(/-j\s|--javascript/)
|
14
|
+
rails_options = "#{rails_options} --css bootstrap" unless rails_options.match?(/--css/)
|
15
|
+
ENV['ENGINE_CART_RAILS_OPTIONS'] = rails_options
|
16
|
+
|
10
17
|
desc 'Run test suite'
|
11
18
|
task ci: %w[arclight:generate] do
|
12
19
|
SolrWrapper.wrap do |solr|
|
13
20
|
solr.with_collection do
|
14
21
|
Rake::Task['arclight:seed'].invoke
|
15
22
|
within_test_app do
|
16
|
-
|
23
|
+
system 'bin/rake spec:prepare'
|
17
24
|
end
|
18
25
|
Rake::Task['spec'].invoke
|
19
26
|
end
|
@@ -47,7 +54,7 @@ namespace :arclight do
|
|
47
54
|
solr.with_collection do
|
48
55
|
Rake::Task['arclight:seed'].invoke
|
49
56
|
within_test_app do
|
50
|
-
system "
|
57
|
+
system "bin/dev #{args[:rails_server_args]}"
|
51
58
|
end
|
52
59
|
end
|
53
60
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arclight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Darren Hardy
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2025-05-13 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: blacklight
|
@@ -51,16 +51,22 @@ dependencies:
|
|
51
51
|
name: rails
|
52
52
|
requirement: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- - "
|
54
|
+
- - ">="
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: '7.
|
56
|
+
version: '7.1'
|
57
|
+
- - "<"
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '9'
|
57
60
|
type: :runtime
|
58
61
|
prerelease: false
|
59
62
|
version_requirements: !ruby/object:Gem::Requirement
|
60
63
|
requirements:
|
61
|
-
- - "
|
64
|
+
- - ">="
|
62
65
|
- !ruby/object:Gem::Version
|
63
|
-
version: '7.
|
66
|
+
version: '7.1'
|
67
|
+
- - "<"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '9'
|
64
70
|
- !ruby/object:Gem::Dependency
|
65
71
|
name: traject
|
66
72
|
requirement: !ruby/object:Gem::Requirement
|
@@ -356,6 +362,8 @@ files:
|
|
356
362
|
- app/components/arclight/document_download_component.rb
|
357
363
|
- app/components/arclight/embed_component.html.erb
|
358
364
|
- app/components/arclight/embed_component.rb
|
365
|
+
- app/components/arclight/expand_hierarchy_button_component.html.erb
|
366
|
+
- app/components/arclight/expand_hierarchy_button_component.rb
|
359
367
|
- app/components/arclight/group_component.html.erb
|
360
368
|
- app/components/arclight/group_component.rb
|
361
369
|
- app/components/arclight/header_component.html.erb
|
@@ -502,7 +510,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
502
510
|
- !ruby/object:Gem::Version
|
503
511
|
version: '0'
|
504
512
|
requirements: []
|
505
|
-
rubygems_version: 3.
|
513
|
+
rubygems_version: 3.4.19
|
506
514
|
signing_key:
|
507
515
|
specification_version: 4
|
508
516
|
summary: A Blacklight-based environment to support discovery and delivery for archives
|