arclight 0.5.0 → 1.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (216) hide show
  1. checksums.yaml +4 -4
  2. data/.eslintrc +11 -4
  3. data/.github/workflows/ruby.yml +24 -11
  4. data/.rspec +0 -1
  5. data/.rubocop.yml +286 -2
  6. data/.rubocop_todo.yml +18 -195
  7. data/CONTRIBUTING.md +5 -5
  8. data/Gemfile +12 -12
  9. data/README.md +18 -12
  10. data/app/assets/javascripts/arclight/arclight.js +3 -7
  11. data/app/assets/javascripts/arclight/oembed_viewer.js +64 -39
  12. data/app/assets/javascripts/arclight/truncate_controller.js +27 -0
  13. data/app/assets/stylesheets/arclight/application.scss +1 -5
  14. data/app/assets/stylesheets/arclight/modules/hierarchy_and_online_contents.scss +104 -130
  15. data/app/assets/stylesheets/arclight/modules/icons.scss +14 -3
  16. data/app/assets/stylesheets/arclight/modules/layout.scss +120 -100
  17. data/app/assets/stylesheets/arclight/modules/mastheads.scss +15 -57
  18. data/app/assets/stylesheets/arclight/modules/repositories.scss +2 -2
  19. data/app/assets/stylesheets/arclight/modules/repository_card.scss +4 -48
  20. data/app/assets/stylesheets/arclight/modules/search_results.scss +86 -35
  21. data/app/assets/stylesheets/arclight/modules/show_collection.scss +5 -32
  22. data/app/assets/stylesheets/arclight/modules/truncator.scss +56 -0
  23. data/app/assets/stylesheets/arclight/variables.scss +7 -4
  24. data/app/components/arclight/access_component.html.erb +14 -0
  25. data/app/components/arclight/access_component.rb +25 -0
  26. data/app/components/arclight/bookmark_component.html.erb +25 -0
  27. data/app/components/arclight/bookmark_component.rb +9 -0
  28. data/app/components/arclight/breadcrumb_component.rb +40 -0
  29. data/app/components/arclight/breadcrumbs_hierarchy_component.html.erb +34 -0
  30. data/app/components/arclight/breadcrumbs_hierarchy_component.rb +25 -0
  31. data/app/components/arclight/collection_context_component.html.erb +12 -0
  32. data/app/components/arclight/collection_context_component.rb +27 -0
  33. data/app/components/arclight/collection_info_component.html.erb +28 -0
  34. data/app/components/arclight/collection_info_component.rb +26 -0
  35. data/app/components/arclight/collection_sidebar_component.html.erb +15 -0
  36. data/app/components/arclight/collection_sidebar_component.rb +41 -0
  37. data/app/{views/catalog/_search_results_repository.html.erb → components/arclight/constraints_component.html.erb} +2 -1
  38. data/app/components/arclight/constraints_component.rb +17 -0
  39. data/app/components/arclight/document_collection_context_component.html.erb +29 -0
  40. data/app/components/arclight/document_collection_context_component.rb +28 -0
  41. data/app/components/arclight/document_collection_hierarchy_component.html.erb +46 -0
  42. data/app/components/arclight/document_collection_hierarchy_component.rb +62 -0
  43. data/app/components/arclight/document_component.html.erb +39 -0
  44. data/app/components/arclight/document_component.rb +49 -0
  45. data/app/components/arclight/document_components_hierarchy_component.html.erb +32 -0
  46. data/app/components/arclight/document_components_hierarchy_component.rb +28 -0
  47. data/app/components/arclight/document_download_component.html.erb +24 -0
  48. data/app/components/arclight/document_download_component.rb +71 -0
  49. data/app/components/arclight/embed_component.html.erb +10 -0
  50. data/app/components/arclight/embed_component.rb +43 -0
  51. data/app/components/arclight/group_component.html.erb +30 -0
  52. data/app/components/arclight/group_component.rb +23 -0
  53. data/app/components/arclight/header_component.html.erb +5 -0
  54. data/app/components/arclight/header_component.rb +10 -0
  55. data/app/components/arclight/index_metadata_field_component.html.erb +17 -0
  56. data/app/components/arclight/index_metadata_field_component.rb +20 -0
  57. data/app/components/arclight/masthead_component.html.erb +15 -0
  58. data/app/components/arclight/masthead_component.rb +10 -0
  59. data/app/components/arclight/metadata_section_component.html.erb +13 -0
  60. data/app/components/arclight/metadata_section_component.rb +22 -0
  61. data/app/components/arclight/oembed_viewer_component.html.erb +5 -0
  62. data/app/components/arclight/oembed_viewer_component.rb +16 -0
  63. data/app/components/arclight/online_content_filter_component.html.erb +15 -0
  64. data/app/components/arclight/online_content_filter_component.rb +19 -0
  65. data/app/components/arclight/online_status_indicator_component.rb +19 -0
  66. data/app/components/arclight/repository_breadcrumb_component.html.erb +10 -0
  67. data/app/components/arclight/repository_breadcrumb_component.rb +17 -0
  68. data/app/components/arclight/repository_location_component.html.erb +20 -0
  69. data/app/components/arclight/repository_location_component.rb +10 -0
  70. data/app/components/arclight/search_bar_component.html.erb +25 -0
  71. data/app/components/arclight/search_bar_component.rb +32 -0
  72. data/app/components/arclight/search_result_breadcrumbs_component.html.erb +3 -0
  73. data/app/components/arclight/search_result_breadcrumbs_component.rb +37 -0
  74. data/app/components/arclight/search_result_component.html.erb +20 -0
  75. data/app/components/arclight/search_result_component.rb +24 -0
  76. data/app/components/arclight/search_result_title_component.html.erb +13 -0
  77. data/app/components/arclight/search_result_title_component.rb +15 -0
  78. data/app/components/arclight/sidebar_component.html.erb +9 -0
  79. data/app/components/arclight/sidebar_component.rb +19 -0
  80. data/app/components/arclight/upper_metadata_layout_component.rb +10 -0
  81. data/app/components/blacklight/icons/bookmark_component.rb +12 -0
  82. data/app/components/blacklight/icons/collection_component.rb +14 -0
  83. data/app/components/blacklight/icons/compact_component.rb +12 -0
  84. data/app/components/blacklight/icons/container_component.rb +14 -0
  85. data/app/components/blacklight/icons/ead_component.rb +12 -0
  86. data/app/components/blacklight/icons/file_component.rb +14 -0
  87. data/app/components/blacklight/icons/folder_component.rb +12 -0
  88. data/app/components/blacklight/icons/online_component.rb +15 -0
  89. data/app/components/blacklight/icons/pdf_component.rb +12 -0
  90. data/app/components/blacklight/icons/repository_component.rb +12 -0
  91. data/app/controllers/arclight/repositories_controller.rb +4 -4
  92. data/app/{controllers/concerns → helpers}/arclight/ead_format_helpers.rb +4 -7
  93. data/app/helpers/arclight/field_config_helpers.rb +26 -0
  94. data/app/helpers/arclight_helper.rb +15 -253
  95. data/app/models/arclight/document_downloads.rb +12 -15
  96. data/app/models/arclight/parent.rb +5 -0
  97. data/app/models/arclight/parents.rb +2 -1
  98. data/app/models/arclight/requests/aeon_external_request.rb +1 -1
  99. data/app/models/arclight/requests/aeon_web_ead.rb +8 -3
  100. data/app/models/arclight/requests/google_form.rb +8 -3
  101. data/app/models/concerns/arclight/catalog.rb +25 -15
  102. data/app/models/concerns/arclight/search_behavior.rb +12 -26
  103. data/app/models/concerns/arclight/solr_document.rb +70 -73
  104. data/app/presenters/arclight/show_presenter.rb +34 -7
  105. data/app/views/arclight/_requests.html.erb +2 -2
  106. data/app/views/arclight/repositories/_repository.html.erb +21 -40
  107. data/app/views/arclight/repositories/index.html.erb +3 -1
  108. data/app/views/arclight/repositories/show.html.erb +4 -6
  109. data/app/views/arclight/requests/_aeon_external_request_endpoint.html.erb +4 -5
  110. data/app/views/arclight/requests/_aeon_web_ead.html.erb +2 -3
  111. data/app/views/arclight/requests/_google_form.html.erb +4 -6
  112. data/app/views/catalog/_group.html.erb +1 -18
  113. data/app/views/catalog/_group_toggle.html.erb +1 -1
  114. data/app/views/catalog/_search_results_header.html.erb +3 -0
  115. data/app/views/catalog/hierarchy.html.erb +19 -0
  116. data/app/views/catalog/index.html.erb +16 -7
  117. data/app/views/shared/_breadcrumbs.html.erb +2 -14
  118. data/app/views/shared/_main_menu_links.html.erb +1 -1
  119. data/arclight.gemspec +7 -6
  120. data/config/breadcrumbs.rb +24 -0
  121. data/config/i18n-tasks.yml +9 -8
  122. data/config/importmap.rb +3 -0
  123. data/config/locales/arclight.en.yml +31 -30
  124. data/config/routes.rb +1 -1
  125. data/docker-compose.yml +16 -0
  126. data/lib/arclight/digital_object.rb +2 -1
  127. data/lib/arclight/engine.rb +18 -31
  128. data/lib/arclight/exceptions.rb +1 -0
  129. data/lib/arclight/hash_absolute_xpath.rb +2 -1
  130. data/lib/arclight/normalized_id.rb +2 -0
  131. data/lib/arclight/normalized_title.rb +2 -0
  132. data/lib/arclight/repository.rb +43 -54
  133. data/lib/arclight/routes/hierarchy.rb +19 -0
  134. data/lib/arclight/routes.rb +8 -0
  135. data/lib/arclight/traject/ead2_component_config.rb +292 -0
  136. data/lib/arclight/traject/ead2_config.rb +66 -287
  137. data/lib/arclight/version.rb +1 -1
  138. data/lib/arclight/year_range.rb +4 -3
  139. data/lib/arclight.rb +6 -1
  140. data/lib/generators/arclight/install_generator.rb +59 -21
  141. data/lib/generators/arclight/templates/arclight.scss +4 -3
  142. data/lib/generators/arclight/templates/catalog_controller.rb +150 -169
  143. data/lib/generators/arclight/templates/config/locales/arclight.en.yml +53 -0
  144. data/lib/generators/arclight/templates/config/repositories.yml +20 -27
  145. data/lib/tasks/index.rake +14 -17
  146. data/package.json +11 -13
  147. data/solr/conf/schema.xml +40 -36
  148. data/solr/conf/solrconfig.xml +33 -31
  149. data/tasks/arclight.rake +8 -7
  150. data/template.rb +0 -1
  151. metadata +111 -104
  152. data/.babelrc +0 -3
  153. data/app/assets/javascripts/arclight/collection_navigation.js +0 -100
  154. data/app/assets/javascripts/arclight/collection_scrollspy.js +0 -6
  155. data/app/assets/javascripts/arclight/context_navigation.js +0 -351
  156. data/app/assets/javascripts/arclight/truncator.js.erb +0 -29
  157. data/app/assets/stylesheets/arclight/bootstrap_overrides.scss +0 -26
  158. data/app/assets/stylesheets/arclight/modules/context_navigation.scss +0 -75
  159. data/app/controllers/concerns/arclight/field_config_helpers.rb +0 -102
  160. data/app/factories/blacklight_field_configuration_factory.rb +0 -30
  161. data/app/views/arclight/repositories/_in_person_repository.html.erb +0 -19
  162. data/app/views/arclight/repositories/_repository_contact.html.erb +0 -9
  163. data/app/views/arclight/viewers/_oembed.html.erb +0 -8
  164. data/app/views/catalog/_access_contents.html.erb +0 -15
  165. data/app/views/catalog/_arclight_abstract_or_scope.html.erb +0 -5
  166. data/app/views/catalog/_arclight_bookmark_control.html.erb +0 -38
  167. data/app/views/catalog/_arclight_document_header_icon.html.erb +0 -1
  168. data/app/views/catalog/_arclight_document_index_header.html.erb +0 -13
  169. data/app/views/catalog/_arclight_document_index_header_hierarchy_default.html.erb +0 -0
  170. data/app/views/catalog/_arclight_document_index_header_online_contents_default.html.erb +0 -0
  171. data/app/views/catalog/_arclight_index_compact_default.html.erb +0 -22
  172. data/app/views/catalog/_arclight_index_default.html.erb +0 -45
  173. data/app/views/catalog/_arclight_index_group_document_compact_default.html.erb +0 -19
  174. data/app/views/catalog/_arclight_index_group_document_default.html.erb +0 -18
  175. data/app/views/catalog/_arclight_online_content_indicator.html.erb +0 -3
  176. data/app/views/catalog/_arclight_rangelimit.html.erb +0 -24
  177. data/app/views/catalog/_arclight_viewer_default.html.erb +0 -1
  178. data/app/views/catalog/_collection_contents.html.erb +0 -4
  179. data/app/views/catalog/_collection_context.html.erb +0 -15
  180. data/app/views/catalog/_collection_context_nav.html.erb +0 -12
  181. data/app/views/catalog/_collection_online_contents.html.erb +0 -17
  182. data/app/views/catalog/_component_context.html.erb +0 -5
  183. data/app/views/catalog/_containers.html.erb +0 -3
  184. data/app/views/catalog/_context_card.html.erb +0 -27
  185. data/app/views/catalog/_context_sidebar.html.erb +0 -8
  186. data/app/views/catalog/_custom_metadata.html.erb +0 -16
  187. data/app/views/catalog/_document_downloads.html.erb +0 -14
  188. data/app/views/catalog/_group_header_compact_default.html.erb +0 -15
  189. data/app/views/catalog/_group_header_default.html.erb +0 -20
  190. data/app/views/catalog/_home.html.erb +0 -1
  191. data/app/views/catalog/_index_breadcrumb_default.html.erb +0 -6
  192. data/app/views/catalog/_index_collection_context_default.html.erb +0 -53
  193. data/app/views/catalog/_index_default.html.erb +0 -17
  194. data/app/views/catalog/_index_header.html.erb +0 -7
  195. data/app/views/catalog/_index_header_online_contents_default.html.erb +0 -1
  196. data/app/views/catalog/_index_online_contents_default.html.erb +0 -6
  197. data/app/views/catalog/_online_content_label.html.erb +0 -5
  198. data/app/views/catalog/_search_form.html.erb +0 -38
  199. data/app/views/catalog/_search_results.html.erb +0 -28
  200. data/app/views/catalog/_show_actions_box_default.html.erb +0 -27
  201. data/app/views/catalog/_show_breadcrumbs_default.html.erb +0 -6
  202. data/app/views/catalog/_show_collection.html.erb +0 -66
  203. data/app/views/catalog/_show_default.html.erb +0 -70
  204. data/app/views/catalog/_show_upper_metadata_collection.html.erb +0 -1
  205. data/app/views/catalog/_show_upper_metadata_default.html.erb +0 -14
  206. data/app/views/catalog/_sort_and_per_page.html.erb +0 -8
  207. data/app/views/catalog/_within_collection_dropdown.html.erb +0 -26
  208. data/app/views/layouts/catalog_result.html.erb +0 -7
  209. data/app/views/shared/_context_sidebar.html.erb +0 -8
  210. data/app/views/shared/_header_navbar.html.erb +0 -61
  211. data/app/views/shared/_show_breadcrumbs.html.erb +0 -27
  212. data/lib/arclight/viewer.rb +0 -45
  213. data/lib/arclight/viewers/oembed.rb +0 -57
  214. data/solr/conf/scripts.conf +0 -24
  215. data/vendor/assets/javascripts/responsiveTruncator.js +0 -69
  216. data/vendor/assets/javascripts/stickyfill.js +0 -480
data/.rubocop_todo.yml CHANGED
@@ -1,102 +1,28 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2021-05-17 20:57:22 UTC using RuboCop version 1.15.0.
3
+ # on 2022-10-05 03:27:31 UTC using RuboCop version 1.36.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: 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
9
  # 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.
55
- Lint/AmbiguousBlockAssociation:
56
- Exclude:
57
- - 'lib/arclight/traject/ead2_config.rb'
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
-
77
- # Offense count: 1
78
- # Configuration parameters: CheckForMethodsWithNoSideEffects.
79
- Lint/Void:
80
- Exclude:
81
- - 'lib/arclight/year_range.rb'
82
-
83
- # Offense count: 1
84
- # Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
10
+ # Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, CountRepeatedAttributes.
85
11
  Metrics/AbcSize:
86
12
  Max: 19
87
13
 
88
14
  # Offense count: 2
89
- # Configuration parameters: IgnoredMethods.
15
+ # Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods.
90
16
  Metrics/CyclomaticComplexity:
91
17
  Max: 8
92
18
 
93
19
  # Offense count: 4
94
- # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
20
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods.
95
21
  Metrics/MethodLength:
96
22
  Max: 17
97
23
 
98
24
  # Offense count: 1
99
- # Configuration parameters: IgnoredMethods.
25
+ # Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods.
100
26
  Metrics/PerceivedComplexity:
101
27
  Max: 9
102
28
 
@@ -108,40 +34,25 @@ Naming/HeredocDelimiterNaming:
108
34
  - 'spec/features/autocomplete_spec.rb'
109
35
 
110
36
  # Offense count: 80
111
- # Configuration parameters: Prefixes.
37
+ # Configuration parameters: Prefixes, AllowedPatterns.
112
38
  # Prefixes: when, with, without
113
39
  RSpec/ContextWording:
114
40
  Enabled: false
115
41
 
116
42
  # Offense count: 1
117
- # Cop supports --auto-correct.
43
+ # This cop supports unsafe autocorrection (--autocorrect-all).
118
44
  # Configuration parameters: SkipBlocks, EnforcedStyle.
119
45
  # SupportedStyles: described_class, explicit
120
46
  RSpec/DescribedClass:
121
47
  Exclude:
122
48
  - 'spec/presenters/arclight/show_presenter_spec.rb'
123
49
 
124
- # Offense count: 55
125
- # Cop supports --auto-correct.
126
- RSpec/EmptyLineAfterExampleGroup:
127
- Enabled: false
128
-
129
- # Offense count: 10
130
- # Cop supports --auto-correct.
131
- RSpec/EmptyLineAfterHook:
132
- Exclude:
133
- - 'spec/features/collection_page_spec.rb'
134
- - 'spec/features/home_page_spec.rb'
135
- - 'spec/features/many_component_ead_spec.rb'
136
- - 'spec/helpers/arclight_helper_spec.rb'
137
- - 'spec/views/repositories/index.html.erb_spec.rb'
138
-
139
- # Offense count: 63
50
+ # Offense count: 62
140
51
  # Configuration parameters: CountAsOne.
141
52
  RSpec/ExampleLength:
142
53
  Max: 49
143
54
 
144
- # Offense count: 3
55
+ # Offense count: 2
145
56
  RSpec/ExpectInHook:
146
57
  Exclude:
147
58
  - 'spec/helpers/arclight_helper_spec.rb'
@@ -153,7 +64,7 @@ RSpec/FilePath:
153
64
  Exclude:
154
65
  - 'spec/lib/arclight/viewers/oembed_spec.rb'
155
66
 
156
- # Offense count: 133
67
+ # Offense count: 132
157
68
  RSpec/MultipleExpectations:
158
69
  Max: 25
159
70
 
@@ -163,11 +74,12 @@ RSpec/MultipleMemoizedHelpers:
163
74
  Max: 10
164
75
 
165
76
  # Offense count: 19
77
+ # Configuration parameters: AllowedGroups.
166
78
  RSpec/NestedGroups:
167
- Max: 4
79
+ Max: 5
168
80
 
169
81
  # Offense count: 7
170
- # Cop supports --auto-correct.
82
+ # This cop supports unsafe autocorrection (--autocorrect-all).
171
83
  # Configuration parameters: Strict, EnforcedStyle, AllowedExplicitMatchers.
172
84
  # SupportedStyles: inflected, explicit
173
85
  RSpec/PredicateMatcher:
@@ -175,35 +87,19 @@ RSpec/PredicateMatcher:
175
87
  - 'spec/helpers/arclight_helper_spec.rb'
176
88
  - 'spec/lib/arclight/year_range_spec.rb'
177
89
 
178
- # Offense count: 7
90
+ # Offense count: 3
179
91
  RSpec/StubbedMock:
180
92
  Exclude:
181
93
  - 'spec/helpers/arclight_helper_spec.rb'
182
94
  - 'spec/lib/arclight/viewer_spec.rb'
183
95
 
184
- # Offense count: 4
185
- # Cop supports --auto-correct.
96
+ # Offense count: 2
97
+ # This cop supports unsafe autocorrection (--autocorrect-all).
186
98
  # Configuration parameters: NilOrEmpty, NotPresent, UnlessPresent.
187
99
  Rails/Blank:
188
100
  Exclude:
189
- - 'app/controllers/concerns/arclight/ead_format_helpers.rb'
190
101
  - 'lib/arclight/repository.rb'
191
102
 
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
103
  # Offense count: 1
208
104
  # Configuration parameters: Include.
209
105
  # Include: app/helpers/**/*.rb
@@ -211,25 +107,13 @@ Rails/HelperInstanceVariable:
211
107
  Exclude:
212
108
  - 'app/helpers/arclight_helper.rb'
213
109
 
214
- # Offense count: 1
215
- # Cop supports --auto-correct.
216
- Rails/IndexWith:
217
- Exclude:
218
- - 'app/models/arclight/document_downloads.rb'
219
-
220
110
  # Offense count: 1
221
111
  Rails/OutputSafety:
222
112
  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'
113
+ - 'app/helpers/arclight/field_config_helpers.rb'
230
114
 
231
115
  # Offense count: 7
232
- # Cop supports --auto-correct.
116
+ # This cop supports unsafe autocorrection (--autocorrect-all).
233
117
  # Configuration parameters: Include.
234
118
  # Include: **/Rakefile, **/*.rake
235
119
  Rails/RakeEnvironment:
@@ -241,64 +125,3 @@ Rails/RakeEnvironment:
241
125
  Security/Open:
242
126
  Exclude:
243
127
  - 'lib/tasks/index.rake'
244
-
245
- # Offense count: 1
246
- # Cop supports --auto-correct.
247
- # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, IgnoredMethods, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
248
- # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
249
- # ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
250
- # FunctionalMethods: let, let!, subject, watch
251
- # IgnoredMethods: lambda, proc, it
252
- Style/BlockDelimiters:
253
- Exclude:
254
- - 'lib/tasks/index.rake'
255
-
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.
266
- Style/CommentedKeyword:
267
- Exclude:
268
- - 'lib/arclight/year_range.rb'
269
-
270
- # Offense count: 1
271
- # Configuration parameters: AllowedConstants.
272
- Style/Documentation:
273
- Exclude:
274
- - 'lib/arclight.rb'
275
-
276
- # Offense count: 4
277
- # Configuration parameters: MaxUnannotatedPlaceholdersAllowed, IgnoredMethods.
278
- # SupportedStyles: annotated, template, unannotated
279
- Style/FormatStringToken:
280
- EnforcedStyle: template
281
-
282
- # Offense count: 1
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.
290
- Style/IfUnlessModifier:
291
- Exclude:
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/CONTRIBUTING.md CHANGED
@@ -1,13 +1,13 @@
1
1
  ## Contributing
2
2
 
3
- ArcLight is a collaborative open source project where contributions are welcome. This contributing guide is borrowed in part from the [GeoBlacklight Contributing Guide](https://github.com/geoblacklight/geoblacklight/blob/master/CONTRIBUTING.md).
3
+ ArcLight is a collaborative open source project where contributions are welcome. This contributing guide is borrowed in part from the [GeoBlacklight Contributing Guide](https://github.com/geoblacklight/geoblacklight/blob/main/CONTRIBUTING.md).
4
4
 
5
5
  ### Reporting issues
6
6
 
7
- Did you find a bug in ArcLight or interested in a new feature? Please make sure to add an issue for it in the [issue tracker](https://github.com/sul-dlss/arclight/issues) as follows:
7
+ Did you find a bug in ArcLight or interested in a new feature? Please make sure to add an issue for it in the [issue tracker](https://github.com/projectblacklight/arclight/issues) as follows:
8
8
 
9
9
  - Make sure you have a [GitHub account](https://github.com/signup/free)
10
- - Submit a new [Github issue](https://github.com/sul-dlss/arclight/issues) by:
10
+ - Submit a new [Github issue](https://github.com/projectblacklight/arclight/issues) by:
11
11
  - Clearly describing the issue
12
12
  - Provide a descriptive summary
13
13
  - Explain the expected behavior
@@ -20,7 +20,7 @@ ArcLight also welcomes code and documentation contributions. We follow the [pull
20
20
 
21
21
  #### Pull request overview
22
22
 
23
- 1. Fork it ( http://github.com/sul-dlss/arclight/fork )
23
+ 1. Fork it ( http://github.com/projectblacklight/arclight/fork )
24
24
  2. Create your feature branch (`git checkout -b my-new-feature`)
25
25
  3. Commit your changes (`git commit -am 'Add some feature'`)
26
26
  4. Push to the branch (`git push origin my-new-feature`)
@@ -40,4 +40,4 @@ Here are some general rules to follow for merging pull requests.
40
40
  - If you are uncertain, bring other contributors into the conversation by creating a comment that includes their `@username`.
41
41
  - If you like the pull request, but want others to chime in, create a +1 comment and tag a user.
42
42
 
43
- If you wish to ask questions or participate further, see our general [README](https://github.com/sul-dlss/arclight/blob/master/README.md).
43
+ If you wish to ask questions or participate further, see our general [README](https://github.com/projectblacklight/arclight/blob/main/README.md).
data/Gemfile CHANGED
@@ -5,11 +5,9 @@ source 'https://rubygems.org'
5
5
  # Specify your gem's dependencies in arclight.gemspec
6
6
  gemspec
7
7
 
8
- gem 'rexml' if RUBY_VERSION >= '3'
9
-
10
8
  # BEGIN ENGINE_CART BLOCK
11
- # engine_cart: 1.1.0
12
- # engine_cart stanza: 0.10.0
9
+ # engine_cart: 2.5.0
10
+ # engine_cart stanza: 2.5.0
13
11
  # the below comes from engine_cart, a gem used to test this Rails engine gem in the context of a Rails app.
14
12
  file = File.expand_path('Gemfile', ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('.internal_test_app', File.dirname(__FILE__)))
15
13
  if File.exist?(file)
@@ -29,17 +27,19 @@ else
29
27
  else
30
28
  gem 'rails', ENV['RAILS_VERSION']
31
29
  end
32
- end
33
30
 
34
- case ENV['RAILS_VERSION']
35
- when /^4.2/
36
- gem 'coffee-rails', '~> 4.1.0'
37
- gem 'responders', '~> 2.0'
38
- gem 'sass-rails', '>= 5.0'
39
- when /^4.[01]/
40
- gem 'sass-rails', '< 5.0'
31
+ case ENV['RAILS_VERSION']
32
+ when /^6.0/
33
+ gem 'sass-rails', '>= 6'
34
+ gem 'webpacker', '~> 4.0'
35
+ when /^5.[12]/
36
+ gem 'sass-rails', '~> 5.0'
37
+ gem 'sprockets', '~> 3.7'
38
+ gem 'thor', '~> 0.20'
39
+ end
41
40
  end
42
41
  end
43
42
  # END ENGINE_CART BLOCK
44
43
 
44
+ # Used by engine_cart if you need to change a specific version of a dependency
45
45
  eval_gemfile File.expand_path('spec/test_app_templates/Gemfile.extra', File.dirname(__FILE__))
data/README.md CHANGED
@@ -6,17 +6,16 @@
6
6
 
7
7
  A Rails engine supporting discovery of archival materials, based on [Blacklight](https://projectblacklight.org/)
8
8
 
9
- > ℹ️ From August-October 2019, Stanford University, University of Michigan, Indiana University, Princeton University, and Duke University are collaborating on a second phase of ArcLight! See the [project board](https://github.com/projectblacklight/arclight/projects/2) or our [demo videos](https://www.youtube.com/playlist?list=PLMdUaIJ0G8QiIXZ_SFHASJErD14CJW-p5) to follow our work.
10
9
 
11
10
  ## Requirements
12
11
 
13
- * [Ruby](https://www.ruby-lang.org/en/) 2.6 or later
14
- * [Rails](http://rubyonrails.org) 5.2 or later
12
+ * [Ruby](https://www.ruby-lang.org/en/) 2.7 or later
13
+ * [Rails](http://rubyonrails.org) 6.1 or later
15
14
  * Solr 8.1 or later
16
15
 
17
16
  ## Installation
18
17
 
19
- [Installing ArcLight](https://github.com/sul-dlss/arclight/wiki/Creating,-installing,-and-running-your-ArcLight-application) is straightforward in a Rails environment.
18
+ [Installing ArcLight](https://github.com/projectblacklight/arclight/wiki/Creating,-installing,-and-running-your-ArcLight-application) is straightforward in a Rails environment.
20
19
 
21
20
  Basically, add this line to your application's `Gemfile`:
22
21
 
@@ -36,7 +35,7 @@ Or install it yourself as:
36
35
  $ gem install arclight
37
36
  ```
38
37
 
39
- For further details, see our [Installing ArcLight](https://github.com/sul-dlss/arclight/wiki/Creating,-installing,-and-running-your-ArcLight-application) documentation.
38
+ For further details, see our [Installing ArcLight](https://github.com/projectblacklight/arclight/wiki/Creating,-installing,-and-running-your-ArcLight-application) documentation.
40
39
 
41
40
  ## Usage
42
41
 
@@ -48,9 +47,9 @@ Browsing allows you to view the Overview or Contents (when it exists) of a colle
48
47
 
49
48
  Some pages include an inline view tab to the right of an item which will expand the Contents further.
50
49
 
51
- See the [ArcLight demo](https://arclight-demo.projectblacklight.org/) and [ArcLight MVP Wiki](https://github.com/sul-dlss/arclight/wiki) for usage.
50
+ See the [ArcLight demo](https://arclight-demo.projectblacklight.org/) and [ArcLight MVP Wiki](https://github.com/projectblacklight/arclight/wiki) for usage.
52
51
 
53
- See [Arclight Major Features](https://github.com/sul-dlss/arclight/wiki/Arclight-Major-Features) for a list of features.
52
+ See [Arclight Major Features](https://github.com/projectblacklight/arclight/wiki/Arclight-Major-Features) for a list of features.
54
53
 
55
54
  ### Traject indexing of EAD content
56
55
  [Traject](https://github.com/traject/traject) is a high performance way of transforming documents for indexing into Solr and how ArcLight does indexing. An EAD2 can be indexed by doing the following:
@@ -70,7 +69,7 @@ bundle exec rake arclight:seed
70
69
  * General
71
70
  * [ArcLight demo site](https://arclight-demo.projectblacklight.org/)
72
71
  * [ArcLight project wiki](https://bit.ly/arclightproject): includes design process documentation
73
- * [ArcLight Github Wiki](https://github.com/sul-dlss/arclight/wiki): developer/implementor documentation
72
+ * [ArcLight Github Wiki](https://github.com/projectblacklight/arclight/wiki): developer/implementor documentation
74
73
  * [Blacklight wiki](https://github.com/projectblacklight/blacklight/wiki)
75
74
  * Use the [ArcLight Google Group](http://groups.google.com/d/forum/arclight-community) to contact us with questions
76
75
  * ArcLight Phase II:
@@ -85,7 +84,7 @@ See the [CONTRIBUTORS](CONTRIBUTORS.md) file.
85
84
 
86
85
  ## Development
87
86
 
88
- ArcLight development uses [`solr_wrapper`](https://rubygems.org/gems/solr_wrapper/versions/0.18.1) and [`engine_cart`](https://rubygems.org/gems/engine_cart) to host development instances of Solr and Rails server on your local machine.
87
+ ArcLight requires Solr to be running. For development you can start this using `solr_wrapper` or you may choose to use Docker. Start Solr using Docker by doing `docker compose up`.
89
88
 
90
89
  ### Run the test suite
91
90
 
@@ -108,16 +107,23 @@ Then visit http://localhost:3000. It will also start a Solr instance on port 898
108
107
 
109
108
  You can also run `bin/console` for an interactive prompt that will allow you to experiment.
110
109
 
111
- ### Release a new version of the gem
110
+ ### Releasing
112
111
 
113
- To release a new version:
112
+ #### To release a new gem:
114
113
 
115
114
  1. Update the version number in `lib/arclight/version.rb`
116
115
  2. Run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, build the gem file (e.g., `gem build arclight.gemspec`) and push the `.gem` file to [rubygems.org](https://rubygems.org) (e.g., `gem push arclight-x.y.z.gem`).
117
116
 
117
+ #### To release the frontend sources:
118
+
119
+ When any of the javascript components or SASS sources in the gem are changed, this package should be published to NPM with the following steps:
120
+ 1. [Install npm](https://www.npmjs.com/get-npm)
121
+ 2. Bump the version number in `package.json`
122
+ 3. run `npm publish` to push the javascript package to https://npmjs.org/package/arclight
123
+
118
124
  ## Contributing
119
125
 
120
- [Bug reports](https://github.com/sul-dlss/arclight/issues) and [pull requests](https://github.com/sul-dlss/arclight/pulls) are welcome on ArcLight -- see [CONTRIBUTING.md](https://github.com/sul-dlss/arclight/blob/master/CONTRIBUTING.md) for details.
126
+ [Bug reports](https://github.com/projectblacklight/arclight/issues) and [pull requests](https://github.com/projectblacklight/arclight/pulls) are welcome on ArcLight -- see [CONTRIBUTING.md](https://github.com/projectblacklight/arclight/blob/main/CONTRIBUTING.md) for details.
121
127
  ## License
122
128
 
123
129
  The gem is available as open source under the terms of the [Apache 2 License](https://opensource.org/licenses/Apache-2.0).
@@ -1,8 +1,4 @@
1
- //= require arclight/collection_scrollspy
2
- //= require arclight/collection_navigation
3
- //= require arclight/context_navigation
4
- //= require arclight/oembed_viewer
5
- //= require arclight/truncator
1
+ import 'arclight/oembed_viewer'
6
2
 
7
- // Vendor Scripts
8
- //= require responsiveTruncator
3
+ import Truncate from 'arclight/truncate_controller'
4
+ Stimulus.register('arclight-truncate', Truncate)
@@ -1,46 +1,71 @@
1
- Blacklight.onLoad(function () {
2
- 'use strict';
1
+ class OembedLoader {
2
+ constructor(el) {
3
+ this.el = el
4
+ }
3
5
 
4
- var onlineContentTabSelector = '[data-arclight-online-content-tab="true"]';
5
- var oEmbedViewerSelector = '[data-arclight-oembed="true"]';
6
+ load() {
7
+ const loadedAttr = this.el.getAttribute('loaded')
8
+ const { arclightOembed, arclightOembedUrl, ...extraOembedParams } = this.el.dataset
9
+ const extraParams = OembedLoader.normalizeParams(extraOembedParams)
6
10
 
7
- $(onlineContentTabSelector).on('shown.bs.tab', function () {
8
- var $viewerElements = $(oEmbedViewerSelector);
9
- if ($viewerElements.length === 0) {
10
- return;
11
+ if (loadedAttr && loadedAttr === 'loaded') {
12
+ return
11
13
  }
12
14
 
13
- $viewerElements.each(function (i, element) {
14
- var $el = $(element);
15
- var loadedAttr = $el.attr('loaded');
16
- var data = $el.data();
17
- var resourceUrl = data.arclightOembedUrl;
18
- if (loadedAttr && loadedAttr === 'loaded') {
19
- return;
20
- }
21
-
22
- $.ajax({
23
- url: resourceUrl,
24
- dataType: 'html'
25
- }).done(function (response) {
26
- var links = $('<div>' + response.match(/<link .*>/g).join('') + '</div>'); // Parse out link elements so image assets are not loaded
27
- var oEmbedEndPoint = links.find('link[rel="alternate"][type="application/json+oembed"]').prop('href');
28
-
15
+ fetch(arclightOembedUrl)
16
+ .then((response) => response.text())
17
+ .then((body) => {
18
+ const oEmbedEndPoint = OembedLoader.findOEmbedEndPoint(body, extraParams)
29
19
  if (!oEmbedEndPoint || oEmbedEndPoint.length === 0) {
30
- return;
20
+ console.warn(`No oEmbed endpoint found in <head> at ${arclightOembedUrl}`)
21
+ return
31
22
  }
23
+ this.loadEndPoint(oEmbedEndPoint)
24
+ })
25
+ }
26
+
27
+ // Convert data-arclight-oembed-* attributes to URL parameters for the viewer
28
+ static normalizeParams(attributes) {
29
+ return Object.keys(attributes).reduce((acc, attribute) => {
30
+ // Reverse data attribute name conversion. See:
31
+ // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset#name_conversion
32
+ const parameterName = attribute.replace('arclightOembed', '')
33
+ .replace(/([a-z])([A-Z])/g, '$1-$2')
34
+ .toLowerCase()
35
+
36
+ acc[parameterName] = attributes[attribute]
37
+ return acc
38
+ }, {})
39
+ }
40
+
41
+ static findOEmbedEndPoint(body, extraParams = {}) {
42
+ // Parse out link elements so image assets are not loaded
43
+ const template = document.createElement('template')
44
+ template.innerHTML = body.match(/<link .*>/g).join('')
32
45
 
33
- $.ajax({
34
- url: oEmbedEndPoint
35
- }).done(function (oEmbedResponse) {
36
- if (oEmbedResponse.html) {
37
- $el.hide()
38
- .html(oEmbedResponse.html)
39
- .fadeIn(500);
40
- $el.attr('loaded', 'loaded');
41
- }
42
- });
43
- });
44
- });
45
- });
46
- });
46
+ // Look for a link element containing the oEmbed endpoint; bail out if none
47
+ const endpoint = template.content.querySelector('link[rel="alternate"][type="application/json+oembed"]')
48
+ ?.getAttribute('href')
49
+ if (!endpoint) return ''
50
+
51
+ // Serialize any extra params and append them to the endpoint
52
+ const qs = new URLSearchParams(extraParams).toString()
53
+ return `${endpoint}&${qs}`
54
+ }
55
+
56
+ loadEndPoint(oEmbedEndPoint) {
57
+ fetch(oEmbedEndPoint)
58
+ .then((response) => response.json())
59
+ .then((json) => {
60
+ this.el.innerHTML = json.html
61
+ this.el.setAttribute('loaded', 'loaded')
62
+ })
63
+ }
64
+ }
65
+
66
+ Blacklight.onLoad(function () {
67
+ document.querySelectorAll('[data-arclight-oembed="true"]').forEach((element) => {
68
+ const loader = new OembedLoader(element)
69
+ loader.load()
70
+ })
71
+ })
@@ -0,0 +1,27 @@
1
+ import { Controller } from '@hotwired/stimulus'
2
+
3
+ export default class extends Controller {
4
+ static targets = ['content']
5
+
6
+ connect() {
7
+ // target elements
8
+ const contentInner = Array.from(this.contentTarget.children)
9
+
10
+ // calculate total scrollable inner height vs. observed outer height
11
+ const outerHeight = this.contentTarget.clientHeight
12
+ const innerHeight = contentInner.map(e => e.scrollHeight).reduce((a, b) => a + b, 0)
13
+
14
+ // truncation occurred if total inner height exceeds outer (observed) height.
15
+ // if no longer truncated, reset the expanded state (e.g. on window resize).
16
+ if (innerHeight > outerHeight) {
17
+ this.element.classList.add('truncated')
18
+ } else {
19
+ this.element.classList.remove('truncated')
20
+ this.contentTarget.classList.remove('expanded')
21
+ }
22
+ }
23
+
24
+ trigger() {
25
+ this.element.classList.toggle('expanded')
26
+ }
27
+ }
@@ -1,7 +1,3 @@
1
- @import 'bootstrap/functions';
2
- @import 'bootstrap/variables';
3
- @import 'bootstrap/mixins/breakpoints';
4
- @import 'bootstrap_overrides';
5
1
  @import 'variables';
6
2
  @import 'responsive';
7
3
  @import 'modules/collection_search';
@@ -14,4 +10,4 @@
14
10
  @import 'modules/repository_card.scss';
15
11
  @import 'modules/search_results';
16
12
  @import 'modules/show_collection';
17
- @import 'modules/context_navigation'
13
+ @import 'modules/truncator';