arclight 1.3.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.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +21 -14
  3. data/.rubocop.yml +185 -26
  4. data/.solr_wrapper +2 -1
  5. data/README.md +1 -1
  6. data/app/assets/stylesheets/arclight/modules/icons.scss +4 -1
  7. data/app/assets/stylesheets/arclight/modules/mastheads.scss +1 -16
  8. data/app/assets/stylesheets/arclight/modules/search_results.scss +5 -4
  9. data/app/components/arclight/collection_sidebar_component.rb +1 -1
  10. data/app/components/arclight/document_components_hierarchy_component.html.erb +3 -15
  11. data/app/components/arclight/document_components_hierarchy_component.rb +6 -0
  12. data/app/components/arclight/expand_hierarchy_button_component.html.erb +5 -0
  13. data/app/components/arclight/expand_hierarchy_button_component.rb +16 -0
  14. data/app/components/arclight/masthead_component.html.erb +8 -6
  15. data/app/components/arclight/online_content_filter_component.html.erb +1 -1
  16. data/app/components/arclight/online_content_filter_component.rb +1 -3
  17. data/app/components/arclight/repository_breadcrumb_component.html.erb +1 -1
  18. data/app/components/arclight/search_result_title_component.html.erb +3 -3
  19. data/app/models/arclight/document_downloads.rb +1 -1
  20. data/app/models/arclight/parents.rb +1 -1
  21. data/app/models/concerns/arclight/solr_document.rb +2 -1
  22. data/app/views/shared/_main_menu_links.html.erb +1 -1
  23. data/arclight.gemspec +1 -1
  24. data/lib/arclight/repository.rb +1 -1
  25. data/lib/arclight/traject/ead2_component_config.rb +1 -1
  26. data/lib/arclight/version.rb +1 -1
  27. data/lib/generators/arclight/install_generator.rb +40 -3
  28. data/lib/generators/arclight/templates/arclight.scss +6 -5
  29. data/lib/generators/arclight/templates/catalog_controller.rb +1 -0
  30. data/package.json +1 -1
  31. data/tasks/arclight.rake +9 -2
  32. metadata +15 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1f1e6b3f42d3537e2cf578afdac114aa0bf9809f9f331716f4cf57f2b8af84a1
4
- data.tar.gz: dd97429213dcdb6ce394627b1494b9f327ba338aedd7a3821e901e33bdd8b5d4
3
+ metadata.gz: 7371056b2eb8d6241d7113f46f593ce352afe9029c16eb6cc404bee31ebcf511
4
+ data.tar.gz: ccb5c2b72c6c67441d74c358568bef14d6e35117ba92be77fb01989e01a80875
5
5
  SHA512:
6
- metadata.gz: c7c0794ebc3a16206ec9cd175a5ef465a8afc08a4d197149b2c4d978de37399310eb75e676f67637b612c2a5ba15383c037e8d3030392e8c51689f873b309cc9
7
- data.tar.gz: 806b6e4c2c4e3ef9f051e9cf70592b474f9ce4bf051feffbd3b2111b472dce3e7f6bc76150e7f12a95bba6e4f50e8e86327c982217326c0c8e3001d2ce1f3e5c
6
+ metadata.gz: 3bc505687178b9dbac2d809def95a1fb3fe0bb156f577bb266bc1221c651d9c188b5288a1254f1b2e054484090e2fff5225ee46fa3cbabbf8f0ce493003de7d0
7
+ data.tar.gz: e16678a9073c7a1c845586b968659016f62cfd7b0b8c543552c0ef29c9e92fcb38daf4c3b6f542531e57041ff26b79d2f44e661d58129898652a260bbfe1ba7f
@@ -2,30 +2,37 @@ 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.0.4]
15
- ruby: ['3.0', '3.1', '3.2']
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
- - uses: actions/checkout@v4
20
- - name: Set up Ruby ${{ matrix.ruby }}
21
- uses: ruby/setup-ruby@v1
22
- with:
23
- bundler: latest
24
- ruby-version: ${{ matrix.ruby }}
25
- - name: Install dependencies with Rails ${{ matrix.rails_version }}
26
- run: bundle install
27
- - name: Run tests
28
- run: bundle exec rake ci
26
+ - uses: actions/checkout@v4
27
+ - name: Set up Ruby ${{ matrix.ruby }}
28
+ uses: ruby/setup-ruby@v1
29
+ with:
30
+ bundler: latest
31
+ ruby-version: ${{ matrix.ruby }}
32
+ - name: Install dependencies with Rails ${{ matrix.rails_version }}
33
+ run: bundle install
34
+ - name: Run tests
35
+ run: bundle exec rake ci
29
36
  lint:
30
37
  runs-on: ubuntu-latest
31
38
  steps:
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
- - '.internal_test_app/**/*'
12
- - 'bin/**/*'
13
- - 'db/**/*'
14
- - 'lib/generators/arclight/templates/**/*'
15
- - 'vendor/**/*'
16
- - 'node_modules/**/*'
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
- - 'app/helpers/arclight_helper.rb'
23
- - 'app/models/concerns/arclight/solr_document.rb'
27
+ - "app/helpers/arclight_helper.rb"
28
+ - "app/models/concerns/arclight/solr_document.rb"
24
29
 
25
30
  Metrics/BlockLength:
26
31
  Exclude:
27
- - 'arclight.gemspec'
28
- - 'lib/arclight/traject/ead2_config.rb'
29
- - 'lib/tasks/**/*'
30
- - 'spec/features/traject/ead2_indexing_spec.rb'
31
- - 'spec/helpers/arclight_helper_spec.rb'
32
- - 'spec/features/collection_page_spec.rb'
33
- - 'spec/**/*'
34
- - 'tasks/**/*'
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
- - _is
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
- - 'spec/test_app_templates/lib/generators/test_app_generator.rb'
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
- RSpec/FactoryBot/SyntaxMethods: # new in 2.7
212
+ FactoryBot/SyntaxMethods: # new in 2.7
208
213
  Enabled: true
209
- RSpec/Rails/AvoidSetupHook: # new in 2.4
214
+ RSpecRails/AvoidSetupHook: # new in 2.4
210
215
  Enabled: true
211
- RSpec/Rails/HaveHttpStatus: # new in 2.12
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
- RSpec/FactoryBot/ConsistentParenthesesStyle: # new in 2.14
326
+ FactoryBot/ConsistentParenthesesStyle: # new in 2.14
322
327
  Enabled: false # https://github.com/rspec/rspec-rails/issues/2635
323
- RSpec/Rails/InferredSpecType: # new in 2.14
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
- RSpec/FactoryBot/FactoryNameStyle: # new in 2.16
362
+ FactoryBot/FactoryNameStyle: # new in 2.16
358
363
  Enabled: false # https://github.com/rubocop/rubocop-rspec/issues/1587
359
- RSpec/Rails/MinitestAssertions: # new in 2.17
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
@@ -1,5 +1,6 @@
1
1
  # Place any default configuration for solr_wrapper here
2
2
  # port: 8983
3
3
  collection:
4
- dir: solr/conf/
4
+ dir: solr/conf
5
5
  name: blacklight-core
6
+ version: 9.7.0
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.0 or later
15
+ * [Rails](http://rubyonrails.org) 7.1 or later
16
16
  * Solr 8.1 or later
17
17
 
18
18
  ## Installation
@@ -1,3 +1,6 @@
1
+ :root {
2
+ --al-online-icon-color: #{$online-icon-color};
3
+ }
1
4
  .toggle-bookmark,
2
5
  .breadcrumb-item,
3
6
  .document,
@@ -9,7 +12,7 @@
9
12
  }
10
13
 
11
14
  .al-online-content-icon .blacklight-icons svg {
12
- fill: $online-icon-color;
15
+ fill: var(--al-online-icon-color);
13
16
  }
14
17
 
15
18
  .btn > .bi:first-child {
@@ -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
  }
@@ -1,3 +1,7 @@
1
+ :root {
2
+ --al-content-icon-color: #{$secondary};
3
+ }
4
+
1
5
  .documents-list {
2
6
  margin-bottom: $spacer;
3
7
 
@@ -43,10 +47,7 @@
43
47
 
44
48
  article.document {
45
49
  .blacklight-icons svg {
46
- fill: $secondary;
47
- }
48
- .al-online-content-icon .blacklight-icons svg {
49
- fill: $online-icon-color;
50
+ fill: var(--al-content-icon-color);
50
51
  }
51
52
  div.breadcrumb-links,
52
53
  dd.al-document-abstract-or-scope,
@@ -29,7 +29,7 @@ module Arclight
29
29
  end
30
30
 
31
31
  def document_path
32
- @document_path ||= solr_document_path(document.collection_id)
32
+ @document_path ||= solr_document_path(document.root)
33
33
  end
34
34
 
35
35
  def section_anchor(section)
@@ -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
- <ul>
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
- <ul>
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
- <ul>
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,5 @@
1
+ <ul>
2
+ <li>
3
+ <%= expand_link %>
4
+ </li>
5
+ </ul>
@@ -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
- <span class="h1"><%= heading %></span>
5
+ <div class="h1 my-4 text-center text-md-start"><%= heading %></div>
6
6
  </div>
7
7
 
8
- <nav class="col-md-4 nav-links d-flex justify-content-end" aria-label="browse">
9
- <ul class="navbar-nav">
10
- <%= render 'shared/main_menu_links' %>
11
- </ul>
12
- </nav>
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="ml-3 ms-3 ml-xl-5 ms-xl-5">
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>
@@ -12,8 +12,6 @@ module Arclight
12
12
  @document.collection? && @document.online_content?
13
13
  end
14
14
 
15
- def collection_name
16
- @document.collection_name
17
- end
15
+ delegate :collection_name, to: :@document
18
16
  end
19
17
  end
@@ -1,5 +1,5 @@
1
1
  <li class='breadcrumb-item'>
2
- <span class="ml-3 ms-3" aria-hidden="true">
2
+ <span class="ms-3" aria-hidden="true">
3
3
  <%= blacklight_icon(:repository, classes: 'al-repository-content-icon') %>
4
4
  </span>
5
5
  <% if repository_path %>
@@ -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 ml-auto' do %>
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>
@@ -33,7 +33,7 @@ module Arclight
33
33
  class << self
34
34
  def config
35
35
  @config ||= begin
36
- YAML.safe_load(::File.read(config_filename))
36
+ YAML.safe_load_file(config_filename)
37
37
  rescue Errno::ENOENT
38
38
  {}
39
39
  end
@@ -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.collection_id == legacy_id ? legacy_id : "#{document.collection_id}#{legacy_id}" }
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 `collection_id` instead')
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 ml-3 ms-3 <%= collection_active_class %>">
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', '~> 7.0'
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
 
@@ -72,7 +72,7 @@ module Arclight
72
72
  # @return [Hash<Slug,Repository>]
73
73
  def self.from_yaml(file)
74
74
  repos = {}
75
- data = YAML.safe_load(File.read(file))
75
+ data = YAML.safe_load_file(file)
76
76
  data.each_key do |slug|
77
77
  repos[slug] = new(data[slug].merge(slug: slug))
78
78
  end
@@ -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|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Arclight
4
- VERSION = '1.3.0'
4
+ VERSION = '1.5.0'
5
5
  end
@@ -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 copy_styles
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
- remove_file 'app/assets/stylesheets/blacklight.scss' # Avoid two copies of bootstrap
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
- $breadcrumb-divider: quote("»");
2
- $logo-image: image_url('arclight/logo.png') !default;
3
- @import 'bootstrap';
4
- @import 'blacklight/blacklight';
5
- @import 'arclight/application';
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arclight",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "description": "The frontend for arclight",
5
5
  "main": "app/assets/javascript/arclight/arclight.js",
6
6
  "files": ["app/assets"],
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
- ## Do stuff inside arclight app here
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 "bundle exec rails s #{args[:rails_server_args]}"
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.3.0
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: 2024-06-07 00:00:00.000000000 Z
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.0'
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.0'
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.5.10
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