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.
- checksums.yaml +4 -4
- data/.eslintrc +11 -4
- data/.github/workflows/ruby.yml +24 -11
- data/.rspec +0 -1
- data/.rubocop.yml +286 -2
- data/.rubocop_todo.yml +18 -195
- data/CONTRIBUTING.md +5 -5
- data/Gemfile +12 -12
- data/README.md +18 -12
- data/app/assets/javascripts/arclight/arclight.js +3 -7
- data/app/assets/javascripts/arclight/oembed_viewer.js +64 -39
- data/app/assets/javascripts/arclight/truncate_controller.js +27 -0
- data/app/assets/stylesheets/arclight/application.scss +1 -5
- data/app/assets/stylesheets/arclight/modules/hierarchy_and_online_contents.scss +104 -130
- data/app/assets/stylesheets/arclight/modules/icons.scss +14 -3
- data/app/assets/stylesheets/arclight/modules/layout.scss +120 -100
- data/app/assets/stylesheets/arclight/modules/mastheads.scss +15 -57
- data/app/assets/stylesheets/arclight/modules/repositories.scss +2 -2
- data/app/assets/stylesheets/arclight/modules/repository_card.scss +4 -48
- data/app/assets/stylesheets/arclight/modules/search_results.scss +86 -35
- data/app/assets/stylesheets/arclight/modules/show_collection.scss +5 -32
- data/app/assets/stylesheets/arclight/modules/truncator.scss +56 -0
- data/app/assets/stylesheets/arclight/variables.scss +7 -4
- data/app/components/arclight/access_component.html.erb +14 -0
- data/app/components/arclight/access_component.rb +25 -0
- data/app/components/arclight/bookmark_component.html.erb +25 -0
- data/app/components/arclight/bookmark_component.rb +9 -0
- data/app/components/arclight/breadcrumb_component.rb +40 -0
- data/app/components/arclight/breadcrumbs_hierarchy_component.html.erb +34 -0
- data/app/components/arclight/breadcrumbs_hierarchy_component.rb +25 -0
- data/app/components/arclight/collection_context_component.html.erb +12 -0
- data/app/components/arclight/collection_context_component.rb +27 -0
- data/app/components/arclight/collection_info_component.html.erb +28 -0
- data/app/components/arclight/collection_info_component.rb +26 -0
- data/app/components/arclight/collection_sidebar_component.html.erb +15 -0
- data/app/components/arclight/collection_sidebar_component.rb +41 -0
- data/app/{views/catalog/_search_results_repository.html.erb → components/arclight/constraints_component.html.erb} +2 -1
- data/app/components/arclight/constraints_component.rb +17 -0
- data/app/components/arclight/document_collection_context_component.html.erb +29 -0
- data/app/components/arclight/document_collection_context_component.rb +28 -0
- data/app/components/arclight/document_collection_hierarchy_component.html.erb +46 -0
- data/app/components/arclight/document_collection_hierarchy_component.rb +62 -0
- data/app/components/arclight/document_component.html.erb +39 -0
- data/app/components/arclight/document_component.rb +49 -0
- data/app/components/arclight/document_components_hierarchy_component.html.erb +32 -0
- data/app/components/arclight/document_components_hierarchy_component.rb +28 -0
- data/app/components/arclight/document_download_component.html.erb +24 -0
- data/app/components/arclight/document_download_component.rb +71 -0
- data/app/components/arclight/embed_component.html.erb +10 -0
- data/app/components/arclight/embed_component.rb +43 -0
- data/app/components/arclight/group_component.html.erb +30 -0
- data/app/components/arclight/group_component.rb +23 -0
- data/app/components/arclight/header_component.html.erb +5 -0
- data/app/components/arclight/header_component.rb +10 -0
- data/app/components/arclight/index_metadata_field_component.html.erb +17 -0
- data/app/components/arclight/index_metadata_field_component.rb +20 -0
- data/app/components/arclight/masthead_component.html.erb +15 -0
- data/app/components/arclight/masthead_component.rb +10 -0
- data/app/components/arclight/metadata_section_component.html.erb +13 -0
- data/app/components/arclight/metadata_section_component.rb +22 -0
- data/app/components/arclight/oembed_viewer_component.html.erb +5 -0
- data/app/components/arclight/oembed_viewer_component.rb +16 -0
- data/app/components/arclight/online_content_filter_component.html.erb +15 -0
- data/app/components/arclight/online_content_filter_component.rb +19 -0
- data/app/components/arclight/online_status_indicator_component.rb +19 -0
- data/app/components/arclight/repository_breadcrumb_component.html.erb +10 -0
- data/app/components/arclight/repository_breadcrumb_component.rb +17 -0
- data/app/components/arclight/repository_location_component.html.erb +20 -0
- data/app/components/arclight/repository_location_component.rb +10 -0
- data/app/components/arclight/search_bar_component.html.erb +25 -0
- data/app/components/arclight/search_bar_component.rb +32 -0
- data/app/components/arclight/search_result_breadcrumbs_component.html.erb +3 -0
- data/app/components/arclight/search_result_breadcrumbs_component.rb +37 -0
- data/app/components/arclight/search_result_component.html.erb +20 -0
- data/app/components/arclight/search_result_component.rb +24 -0
- data/app/components/arclight/search_result_title_component.html.erb +13 -0
- data/app/components/arclight/search_result_title_component.rb +15 -0
- data/app/components/arclight/sidebar_component.html.erb +9 -0
- data/app/components/arclight/sidebar_component.rb +19 -0
- data/app/components/arclight/upper_metadata_layout_component.rb +10 -0
- data/app/components/blacklight/icons/bookmark_component.rb +12 -0
- data/app/components/blacklight/icons/collection_component.rb +14 -0
- data/app/components/blacklight/icons/compact_component.rb +12 -0
- data/app/components/blacklight/icons/container_component.rb +14 -0
- data/app/components/blacklight/icons/ead_component.rb +12 -0
- data/app/components/blacklight/icons/file_component.rb +14 -0
- data/app/components/blacklight/icons/folder_component.rb +12 -0
- data/app/components/blacklight/icons/online_component.rb +15 -0
- data/app/components/blacklight/icons/pdf_component.rb +12 -0
- data/app/components/blacklight/icons/repository_component.rb +12 -0
- data/app/controllers/arclight/repositories_controller.rb +4 -4
- data/app/{controllers/concerns → helpers}/arclight/ead_format_helpers.rb +4 -7
- data/app/helpers/arclight/field_config_helpers.rb +26 -0
- data/app/helpers/arclight_helper.rb +15 -253
- data/app/models/arclight/document_downloads.rb +12 -15
- data/app/models/arclight/parent.rb +5 -0
- data/app/models/arclight/parents.rb +2 -1
- data/app/models/arclight/requests/aeon_external_request.rb +1 -1
- data/app/models/arclight/requests/aeon_web_ead.rb +8 -3
- data/app/models/arclight/requests/google_form.rb +8 -3
- data/app/models/concerns/arclight/catalog.rb +25 -15
- data/app/models/concerns/arclight/search_behavior.rb +12 -26
- data/app/models/concerns/arclight/solr_document.rb +70 -73
- data/app/presenters/arclight/show_presenter.rb +34 -7
- data/app/views/arclight/_requests.html.erb +2 -2
- data/app/views/arclight/repositories/_repository.html.erb +21 -40
- data/app/views/arclight/repositories/index.html.erb +3 -1
- data/app/views/arclight/repositories/show.html.erb +4 -6
- data/app/views/arclight/requests/_aeon_external_request_endpoint.html.erb +4 -5
- data/app/views/arclight/requests/_aeon_web_ead.html.erb +2 -3
- data/app/views/arclight/requests/_google_form.html.erb +4 -6
- data/app/views/catalog/_group.html.erb +1 -18
- data/app/views/catalog/_group_toggle.html.erb +1 -1
- data/app/views/catalog/_search_results_header.html.erb +3 -0
- data/app/views/catalog/hierarchy.html.erb +19 -0
- data/app/views/catalog/index.html.erb +16 -7
- data/app/views/shared/_breadcrumbs.html.erb +2 -14
- data/app/views/shared/_main_menu_links.html.erb +1 -1
- data/arclight.gemspec +7 -6
- data/config/breadcrumbs.rb +24 -0
- data/config/i18n-tasks.yml +9 -8
- data/config/importmap.rb +3 -0
- data/config/locales/arclight.en.yml +31 -30
- data/config/routes.rb +1 -1
- data/docker-compose.yml +16 -0
- data/lib/arclight/digital_object.rb +2 -1
- data/lib/arclight/engine.rb +18 -31
- data/lib/arclight/exceptions.rb +1 -0
- data/lib/arclight/hash_absolute_xpath.rb +2 -1
- data/lib/arclight/normalized_id.rb +2 -0
- data/lib/arclight/normalized_title.rb +2 -0
- data/lib/arclight/repository.rb +43 -54
- data/lib/arclight/routes/hierarchy.rb +19 -0
- data/lib/arclight/routes.rb +8 -0
- data/lib/arclight/traject/ead2_component_config.rb +292 -0
- data/lib/arclight/traject/ead2_config.rb +66 -287
- data/lib/arclight/version.rb +1 -1
- data/lib/arclight/year_range.rb +4 -3
- data/lib/arclight.rb +6 -1
- data/lib/generators/arclight/install_generator.rb +59 -21
- data/lib/generators/arclight/templates/arclight.scss +4 -3
- data/lib/generators/arclight/templates/catalog_controller.rb +150 -169
- data/lib/generators/arclight/templates/config/locales/arclight.en.yml +53 -0
- data/lib/generators/arclight/templates/config/repositories.yml +20 -27
- data/lib/tasks/index.rake +14 -17
- data/package.json +11 -13
- data/solr/conf/schema.xml +40 -36
- data/solr/conf/solrconfig.xml +33 -31
- data/tasks/arclight.rake +8 -7
- data/template.rb +0 -1
- metadata +111 -104
- data/.babelrc +0 -3
- data/app/assets/javascripts/arclight/collection_navigation.js +0 -100
- data/app/assets/javascripts/arclight/collection_scrollspy.js +0 -6
- data/app/assets/javascripts/arclight/context_navigation.js +0 -351
- data/app/assets/javascripts/arclight/truncator.js.erb +0 -29
- data/app/assets/stylesheets/arclight/bootstrap_overrides.scss +0 -26
- data/app/assets/stylesheets/arclight/modules/context_navigation.scss +0 -75
- data/app/controllers/concerns/arclight/field_config_helpers.rb +0 -102
- data/app/factories/blacklight_field_configuration_factory.rb +0 -30
- data/app/views/arclight/repositories/_in_person_repository.html.erb +0 -19
- data/app/views/arclight/repositories/_repository_contact.html.erb +0 -9
- data/app/views/arclight/viewers/_oembed.html.erb +0 -8
- data/app/views/catalog/_access_contents.html.erb +0 -15
- data/app/views/catalog/_arclight_abstract_or_scope.html.erb +0 -5
- data/app/views/catalog/_arclight_bookmark_control.html.erb +0 -38
- data/app/views/catalog/_arclight_document_header_icon.html.erb +0 -1
- data/app/views/catalog/_arclight_document_index_header.html.erb +0 -13
- data/app/views/catalog/_arclight_document_index_header_hierarchy_default.html.erb +0 -0
- data/app/views/catalog/_arclight_document_index_header_online_contents_default.html.erb +0 -0
- data/app/views/catalog/_arclight_index_compact_default.html.erb +0 -22
- data/app/views/catalog/_arclight_index_default.html.erb +0 -45
- data/app/views/catalog/_arclight_index_group_document_compact_default.html.erb +0 -19
- data/app/views/catalog/_arclight_index_group_document_default.html.erb +0 -18
- data/app/views/catalog/_arclight_online_content_indicator.html.erb +0 -3
- data/app/views/catalog/_arclight_rangelimit.html.erb +0 -24
- data/app/views/catalog/_arclight_viewer_default.html.erb +0 -1
- data/app/views/catalog/_collection_contents.html.erb +0 -4
- data/app/views/catalog/_collection_context.html.erb +0 -15
- data/app/views/catalog/_collection_context_nav.html.erb +0 -12
- data/app/views/catalog/_collection_online_contents.html.erb +0 -17
- data/app/views/catalog/_component_context.html.erb +0 -5
- data/app/views/catalog/_containers.html.erb +0 -3
- data/app/views/catalog/_context_card.html.erb +0 -27
- data/app/views/catalog/_context_sidebar.html.erb +0 -8
- data/app/views/catalog/_custom_metadata.html.erb +0 -16
- data/app/views/catalog/_document_downloads.html.erb +0 -14
- data/app/views/catalog/_group_header_compact_default.html.erb +0 -15
- data/app/views/catalog/_group_header_default.html.erb +0 -20
- data/app/views/catalog/_home.html.erb +0 -1
- data/app/views/catalog/_index_breadcrumb_default.html.erb +0 -6
- data/app/views/catalog/_index_collection_context_default.html.erb +0 -53
- data/app/views/catalog/_index_default.html.erb +0 -17
- data/app/views/catalog/_index_header.html.erb +0 -7
- data/app/views/catalog/_index_header_online_contents_default.html.erb +0 -1
- data/app/views/catalog/_index_online_contents_default.html.erb +0 -6
- data/app/views/catalog/_online_content_label.html.erb +0 -5
- data/app/views/catalog/_search_form.html.erb +0 -38
- data/app/views/catalog/_search_results.html.erb +0 -28
- data/app/views/catalog/_show_actions_box_default.html.erb +0 -27
- data/app/views/catalog/_show_breadcrumbs_default.html.erb +0 -6
- data/app/views/catalog/_show_collection.html.erb +0 -66
- data/app/views/catalog/_show_default.html.erb +0 -70
- data/app/views/catalog/_show_upper_metadata_collection.html.erb +0 -1
- data/app/views/catalog/_show_upper_metadata_default.html.erb +0 -14
- data/app/views/catalog/_sort_and_per_page.html.erb +0 -8
- data/app/views/catalog/_within_collection_dropdown.html.erb +0 -26
- data/app/views/layouts/catalog_result.html.erb +0 -7
- data/app/views/shared/_context_sidebar.html.erb +0 -8
- data/app/views/shared/_header_navbar.html.erb +0 -61
- data/app/views/shared/_show_breadcrumbs.html.erb +0 -27
- data/lib/arclight/viewer.rb +0 -45
- data/lib/arclight/viewers/oembed.rb +0 -57
- data/solr/conf/scripts.conf +0 -24
- data/vendor/assets/javascripts/responsiveTruncator.js +0 -69
- 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
|
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
|
-
#
|
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
|
-
#
|
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:
|
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:
|
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:
|
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:
|
79
|
+
Max: 5
|
168
80
|
|
169
81
|
# Offense count: 7
|
170
|
-
#
|
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:
|
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:
|
185
|
-
#
|
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/
|
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
|
-
#
|
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/
|
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/
|
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/
|
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/
|
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/
|
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:
|
12
|
-
# engine_cart stanza:
|
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
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
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.
|
14
|
-
* [Rails](http://rubyonrails.org)
|
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/
|
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/
|
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/
|
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/
|
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/
|
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
|
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
|
-
###
|
110
|
+
### Releasing
|
112
111
|
|
113
|
-
To release a new
|
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/
|
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
|
-
|
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
|
-
|
8
|
-
|
3
|
+
import Truncate from 'arclight/truncate_controller'
|
4
|
+
Stimulus.register('arclight-truncate', Truncate)
|
@@ -1,46 +1,71 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
class OembedLoader {
|
2
|
+
constructor(el) {
|
3
|
+
this.el = el
|
4
|
+
}
|
3
5
|
|
4
|
-
|
5
|
-
|
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
|
-
|
8
|
-
|
9
|
-
if ($viewerElements.length === 0) {
|
10
|
-
return;
|
11
|
+
if (loadedAttr && loadedAttr === 'loaded') {
|
12
|
+
return
|
11
13
|
}
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
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
|
-
|
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
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
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/
|
13
|
+
@import 'modules/truncator';
|