arclight 0.4.0 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.eslintrc +11 -4
- data/.github/workflows/ruby.yml +37 -15
- data/.gitignore +1 -0
- data/.rspec +0 -1
- data/.rubocop.yml +498 -21
- data/.rubocop_todo.yml +69 -86
- data/.solr_wrapper +2 -1
- data/CONTRIBUTING.md +5 -5
- data/CONTRIBUTORS.md +1 -1
- data/Gemfile +15 -10
- data/README.md +20 -16
- data/app/assets/javascripts/arclight/arclight.js +4 -8
- data/app/assets/javascripts/arclight/oembed_controller.js +58 -0
- data/app/assets/javascripts/arclight/truncate_controller.js +27 -0
- data/app/assets/stylesheets/arclight/application.scss +2 -5
- data/app/assets/stylesheets/arclight/build.scss +4 -0
- data/app/assets/stylesheets/arclight/modules/hierarchy_and_online_contents.scss +108 -130
- data/app/assets/stylesheets/arclight/modules/icons.scss +19 -3
- data/app/assets/stylesheets/arclight/modules/layout.scss +129 -99
- data/app/assets/stylesheets/arclight/modules/mastheads.scss +23 -96
- 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_form.scss +9 -0
- data/app/assets/stylesheets/arclight/modules/search_results.scss +95 -45
- data/app/assets/stylesheets/arclight/modules/show_collection.scss +5 -32
- data/app/assets/stylesheets/arclight/modules/truncator.scss +58 -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 +50 -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 +39 -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 +50 -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 +20 -0
- data/app/components/arclight/document_components_hierarchy_component.rb +34 -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/expand_hierarchy_button_component.html.erb +5 -0
- data/app/components/arclight/expand_hierarchy_button_component.rb +16 -0
- data/app/components/arclight/group_component.html.erb +34 -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 +16 -0
- data/app/components/arclight/index_metadata_field_component.rb +20 -0
- data/app/components/arclight/masthead_component.html.erb +17 -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 +17 -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 +27 -0
- data/app/components/arclight/search_bar_component.rb +32 -0
- data/app/components/arclight/search_result_breadcrumbs_component.html.erb +6 -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 +18 -0
- data/app/components/arclight/search_result_title_component.html.erb +15 -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 +91 -7
- data/app/helpers/arclight/field_config_helpers.rb +26 -0
- data/app/helpers/arclight_helper.rb +24 -251
- data/app/models/arclight/document_downloads.rb +12 -15
- data/app/models/arclight/parent.rb +6 -8
- data/app/models/arclight/parents.rb +7 -4
- 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 +80 -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 +3 -4
- data/app/views/arclight/requests/_google_form.html.erb +4 -6
- data/app/views/catalog/_document_list.html.erb +8 -0
- data/app/views/catalog/_group.html.erb +2 -19
- 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 +16 -14
- 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 -37
- data/lib/arclight/exceptions.rb +1 -0
- data/lib/arclight/hash_absolute_xpath.rb +2 -1
- data/lib/arclight/normalized_date.rb +5 -10
- data/lib/arclight/normalized_id.rb +6 -2
- data/lib/arclight/normalized_title.rb +2 -0
- data/lib/arclight/repository.rb +46 -57
- data/lib/arclight/routes/hierarchy.rb +19 -0
- data/lib/arclight/routes.rb +8 -0
- data/lib/arclight/traject/ead2_component_config.rb +335 -0
- data/lib/arclight/traject/ead2_config.rb +120 -299
- 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 +94 -21
- data/lib/generators/arclight/templates/arclight.scss +6 -3
- data/lib/generators/arclight/templates/catalog_controller.rb +193 -165
- data/lib/generators/arclight/templates/config/locales/arclight.en.yml +61 -0
- data/lib/generators/arclight/templates/config/repositories.yml +22 -29
- data/lib/tasks/index.rake +14 -17
- data/package.json +13 -14
- data/solr/conf/schema.xml +49 -39
- data/solr/conf/solrconfig.xml +78 -58
- data/tasks/arclight.rake +17 -9
- data/template.rb +6 -7
- metadata +149 -123
- 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/oembed_viewer.js +0 -46
- 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 -34
- 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/app/assets/images/{blacklight → arclight}/logo.png +0 -0
data/.rubocop_todo.yml
CHANGED
|
@@ -1,103 +1,81 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on
|
|
3
|
+
# on 2023-02-27 17:35:23 UTC using RuboCop version 1.46.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:
|
|
10
|
-
|
|
9
|
+
# Offense count: 10
|
|
10
|
+
# Configuration parameters: EnforcedStyle, AllowedGems, Include.
|
|
11
|
+
# SupportedStyles: Gemfile, gems.rb, gemspec
|
|
12
|
+
# Include: **/*.gemspec, **/Gemfile, **/gems.rb
|
|
13
|
+
Gemspec/DevelopmentDependencies:
|
|
11
14
|
Exclude:
|
|
12
|
-
- '
|
|
15
|
+
- 'arclight.gemspec'
|
|
13
16
|
|
|
14
17
|
# Offense count: 1
|
|
15
|
-
# Configuration parameters:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
- 'lib/arclight/year_range.rb'
|
|
19
|
-
|
|
20
|
-
# Offense count: 68
|
|
21
|
-
# Configuration parameters: CountComments, ExcludedMethods.
|
|
22
|
-
Metrics/BlockLength:
|
|
23
|
-
Max: 278
|
|
24
|
-
Exclude:
|
|
25
|
-
- 'spec/features/collection_page_spec.rb'
|
|
18
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
|
|
19
|
+
Metrics/AbcSize:
|
|
20
|
+
Max: 19
|
|
26
21
|
|
|
27
22
|
# Offense count: 1
|
|
28
|
-
# Configuration parameters:
|
|
23
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
|
24
|
+
Metrics/CyclomaticComplexity:
|
|
25
|
+
Max: 8
|
|
26
|
+
|
|
27
|
+
# Offense count: 3
|
|
28
|
+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
|
29
29
|
Metrics/MethodLength:
|
|
30
30
|
Max: 11
|
|
31
|
-
Exclude:
|
|
32
|
-
- 'app/helpers/arclight_helper.rb'
|
|
33
31
|
|
|
34
|
-
# Offense count:
|
|
35
|
-
# Configuration parameters:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
Exclude:
|
|
39
|
-
- 'spec/features/autocomplete_spec.rb'
|
|
32
|
+
# Offense count: 2
|
|
33
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
|
34
|
+
Metrics/PerceivedComplexity:
|
|
35
|
+
Max: 9
|
|
40
36
|
|
|
41
|
-
# Offense count:
|
|
42
|
-
# Configuration parameters: Prefixes.
|
|
37
|
+
# Offense count: 60
|
|
38
|
+
# Configuration parameters: Prefixes, AllowedPatterns.
|
|
43
39
|
# Prefixes: when, with, without
|
|
44
40
|
RSpec/ContextWording:
|
|
45
41
|
Enabled: false
|
|
46
42
|
|
|
47
43
|
# Offense count: 1
|
|
48
|
-
#
|
|
44
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
49
45
|
# Configuration parameters: SkipBlocks, EnforcedStyle.
|
|
50
46
|
# SupportedStyles: described_class, explicit
|
|
51
47
|
RSpec/DescribedClass:
|
|
52
48
|
Exclude:
|
|
53
49
|
- 'spec/presenters/arclight/show_presenter_spec.rb'
|
|
54
50
|
|
|
55
|
-
# Offense count:
|
|
56
|
-
#
|
|
57
|
-
RSpec/EmptyLineAfterExampleGroup:
|
|
58
|
-
Enabled: false
|
|
59
|
-
|
|
60
|
-
# Offense count: 12
|
|
61
|
-
# Cop supports --auto-correct.
|
|
62
|
-
RSpec/EmptyLineAfterHook:
|
|
63
|
-
Exclude:
|
|
64
|
-
- 'spec/features/collection_page_spec.rb'
|
|
65
|
-
- 'spec/features/home_page_spec.rb'
|
|
66
|
-
- 'spec/features/many_component_ead_spec.rb'
|
|
67
|
-
- 'spec/features/search_results_spec.rb'
|
|
68
|
-
- 'spec/helpers/arclight_helper_spec.rb'
|
|
69
|
-
- 'spec/views/_collection_count.html.erb_spec.rb'
|
|
70
|
-
- 'spec/views/repositories/index.html.erb_spec.rb'
|
|
71
|
-
|
|
72
|
-
# Offense count: 49
|
|
73
|
-
# Configuration parameters: Max.
|
|
51
|
+
# Offense count: 60
|
|
52
|
+
# Configuration parameters: CountAsOne.
|
|
74
53
|
RSpec/ExampleLength:
|
|
75
|
-
|
|
54
|
+
Max: 49
|
|
76
55
|
|
|
77
|
-
# Offense count:
|
|
78
|
-
RSpec/ExpectInHook:
|
|
79
|
-
Exclude:
|
|
80
|
-
- 'spec/helpers/arclight_helper_spec.rb'
|
|
81
|
-
- 'spec/presenters/arclight/index_presenter_spec.rb'
|
|
82
|
-
|
|
83
|
-
# Offense count: 1
|
|
84
|
-
# Configuration parameters: CustomTransform, IgnoreMethods.
|
|
85
|
-
RSpec/FilePath:
|
|
86
|
-
Exclude:
|
|
87
|
-
- 'spec/lib/arclight/viewers/oembed_spec.rb'
|
|
88
|
-
|
|
89
|
-
# Offense count: 107
|
|
90
|
-
# Configuration parameters: AggregateFailuresByDefault.
|
|
56
|
+
# Offense count: 112
|
|
91
57
|
RSpec/MultipleExpectations:
|
|
92
|
-
Max:
|
|
58
|
+
Max: 22
|
|
93
59
|
|
|
94
|
-
# Offense count:
|
|
60
|
+
# Offense count: 37
|
|
61
|
+
# Configuration parameters: AllowSubject.
|
|
62
|
+
RSpec/MultipleMemoizedHelpers:
|
|
63
|
+
Max: 10
|
|
64
|
+
|
|
65
|
+
# Offense count: 22
|
|
66
|
+
# Configuration parameters: AllowedGroups.
|
|
95
67
|
RSpec/NestedGroups:
|
|
96
|
-
Max:
|
|
68
|
+
Max: 5
|
|
69
|
+
|
|
70
|
+
# Offense count: 2
|
|
71
|
+
RSpec/PendingWithoutReason:
|
|
72
|
+
Exclude:
|
|
73
|
+
- 'spec/features/document_tools_spec.rb'
|
|
74
|
+
- 'spec/features/google_form_request_spec.rb'
|
|
97
75
|
|
|
98
|
-
# Offense count:
|
|
99
|
-
#
|
|
100
|
-
# Configuration parameters: Strict, EnforcedStyle.
|
|
76
|
+
# Offense count: 5
|
|
77
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
78
|
+
# Configuration parameters: Strict, EnforcedStyle, AllowedExplicitMatchers.
|
|
101
79
|
# SupportedStyles: inflected, explicit
|
|
102
80
|
RSpec/PredicateMatcher:
|
|
103
81
|
Exclude:
|
|
@@ -105,35 +83,40 @@ RSpec/PredicateMatcher:
|
|
|
105
83
|
- 'spec/lib/arclight/year_range_spec.rb'
|
|
106
84
|
|
|
107
85
|
# Offense count: 1
|
|
108
|
-
|
|
86
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
87
|
+
# Configuration parameters: NilOrEmpty, NotPresent, UnlessPresent.
|
|
88
|
+
Rails/Blank:
|
|
109
89
|
Exclude:
|
|
110
|
-
- 'lib/
|
|
90
|
+
- 'lib/arclight/repository.rb'
|
|
111
91
|
|
|
112
92
|
# Offense count: 1
|
|
113
|
-
#
|
|
114
|
-
#
|
|
115
|
-
|
|
116
|
-
# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
|
|
117
|
-
# FunctionalMethods: let, let!, subject, watch
|
|
118
|
-
# IgnoredMethods: lambda, proc, it
|
|
119
|
-
Style/BlockDelimiters:
|
|
93
|
+
# Configuration parameters: Include.
|
|
94
|
+
# Include: app/helpers/**/*.rb
|
|
95
|
+
Rails/HelperInstanceVariable:
|
|
120
96
|
Exclude:
|
|
121
|
-
- '
|
|
97
|
+
- 'app/helpers/arclight_helper.rb'
|
|
122
98
|
|
|
123
99
|
# Offense count: 1
|
|
124
|
-
|
|
100
|
+
Rails/OutputSafety:
|
|
125
101
|
Exclude:
|
|
126
|
-
- '
|
|
102
|
+
- 'app/helpers/arclight/field_config_helpers.rb'
|
|
103
|
+
|
|
104
|
+
# Offense count: 6
|
|
105
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
106
|
+
# Configuration parameters: Include.
|
|
107
|
+
# Include: **/Rakefile, **/*.rake
|
|
108
|
+
Rails/RakeEnvironment:
|
|
109
|
+
Exclude:
|
|
110
|
+
- 'lib/tasks/index.rake'
|
|
111
|
+
- 'tasks/arclight.rake'
|
|
127
112
|
|
|
128
113
|
# Offense count: 1
|
|
129
|
-
|
|
114
|
+
Security/Open:
|
|
130
115
|
Exclude:
|
|
131
|
-
- '
|
|
132
|
-
- 'test/**/*'
|
|
133
|
-
- 'lib/arclight.rb'
|
|
116
|
+
- 'lib/tasks/index.rake'
|
|
134
117
|
|
|
135
118
|
# Offense count: 1
|
|
136
|
-
#
|
|
137
|
-
Style/
|
|
119
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
120
|
+
Style/RedundantConstantBase:
|
|
138
121
|
Exclude:
|
|
139
|
-
- '
|
|
122
|
+
- 'spec/spec_helper.rb'
|
data/.solr_wrapper
CHANGED
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/CONTRIBUTORS.md
CHANGED
|
@@ -45,7 +45,7 @@ Individual project contributors include ([emoji key](https://allcontributors.org
|
|
|
45
45
|
</tr>
|
|
46
46
|
<tr>
|
|
47
47
|
<td align="center"><a href="https://github.com/gordonleacock"><img src="https://avatars3.githubusercontent.com/u/12927191?v=4" width="125px;" alt="Gordon Leacock"/><br /><sub><b>Gordon Leacock</b></sub></a><br /><a href="https://github.com/projectblacklight/arclight/commits?author=gordonleacock" title="Code">💻</a> <a href="https://github.com/projectblacklight/arclight/commits?author=gordonleacock" title="Documentation">📖</a></td>
|
|
48
|
-
<td align="center"><a href="https://matienzo.org/"><img src="https://avatars0.githubusercontent.com/u/73732?v=4" width="125px;" alt="
|
|
48
|
+
<td align="center"><a href="https://matienzo.org/"><img src="https://avatars0.githubusercontent.com/u/73732?v=4" width="125px;" alt="María A. Matienzo"/><br /><sub><b>María A. Matienzo</b></sub></a><br /><a href="#projectManagement-anarchivist" title="Project Management">📆</a> <a href="#business-anarchivist" title="Business development">💼</a> <a href="#analysis-anarchivist" title="Functional requirements and related research">🔬</a> <a href="#productOwner-anarchivist" title="Product owner">🗺</a></td>
|
|
49
49
|
<td align="center"><a href="https://github.com/archivistsarah"><img src="https://avatars0.githubusercontent.com/u/25084902?v=4" width="125px;" alt="Sarah Newhouse"/><br /><sub><b>Sarah Newhouse</b></sub></a><br /><a href="#analysis-archivistsarah" title="Functional requirements and related research">🔬</a></td>
|
|
50
50
|
<td align="center"><a href="https://github.com/grepcats"><img src="https://avatars0.githubusercontent.com/u/7513448?v=4" width="125px;" alt="Kayla Ondracek"/><br /><sub><b>Kayla Ondracek</b></sub></a><br /><a href="#analysis-grepcats" title="Functional requirements and related research">🔬</a></td>
|
|
51
51
|
<td align="center"><a href="https://github.com/djpillen"><img src="https://avatars3.githubusercontent.com/u/11635158?v=4" width="125px;" alt="Dallas Pillen"/><br /><sub><b>Dallas Pillen</b></sub></a><br /><a href="https://github.com/projectblacklight/arclight/commits?author=djpillen" title="Code">💻</a> <a href="#userTesting-djpillen" title="User Testing">📓</a></td>
|
data/Gemfile
CHANGED
|
@@ -4,9 +4,10 @@ source 'https://rubygems.org'
|
|
|
4
4
|
|
|
5
5
|
# Specify your gem's dependencies in arclight.gemspec
|
|
6
6
|
gemspec
|
|
7
|
+
|
|
7
8
|
# BEGIN ENGINE_CART BLOCK
|
|
8
|
-
# engine_cart:
|
|
9
|
-
# engine_cart stanza:
|
|
9
|
+
# engine_cart: 2.5.0
|
|
10
|
+
# engine_cart stanza: 2.5.0
|
|
10
11
|
# the below comes from engine_cart, a gem used to test this Rails engine gem in the context of a Rails app.
|
|
11
12
|
file = File.expand_path('Gemfile', ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('.internal_test_app', File.dirname(__FILE__)))
|
|
12
13
|
if File.exist?(file)
|
|
@@ -26,15 +27,19 @@ else
|
|
|
26
27
|
else
|
|
27
28
|
gem 'rails', ENV['RAILS_VERSION']
|
|
28
29
|
end
|
|
29
|
-
end
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
|
38
40
|
end
|
|
39
41
|
end
|
|
40
42
|
# END ENGINE_CART BLOCK
|
|
43
|
+
|
|
44
|
+
# Used by engine_cart if you need to change a specific version of a dependency
|
|
45
|
+
eval_gemfile File.expand_path('spec/test_app_templates/Gemfile.extra', File.dirname(__FILE__))
|
data/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
[](https://badge.fury.io/rb/arclight)
|
|
2
|
+
[](https://badge.fury.io/js/arclight)
|
|
1
3
|

|
|
2
4
|
[](CONTRIBUTORS.md)
|
|
3
5
|
[](https://codeclimate.com/github/projectblacklight/arclight/coverage)
|
|
@@ -6,17 +8,16 @@
|
|
|
6
8
|
|
|
7
9
|
A Rails engine supporting discovery of archival materials, based on [Blacklight](https://projectblacklight.org/)
|
|
8
10
|
|
|
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
11
|
|
|
11
12
|
## Requirements
|
|
12
13
|
|
|
13
|
-
* [Ruby](https://www.ruby-lang.org/en/)
|
|
14
|
-
* [Rails](http://rubyonrails.org)
|
|
14
|
+
* [Ruby](https://www.ruby-lang.org/en/) 3.0.3 or later
|
|
15
|
+
* [Rails](http://rubyonrails.org) 7.1 or later
|
|
15
16
|
* Solr 8.1 or later
|
|
16
17
|
|
|
17
18
|
## Installation
|
|
18
19
|
|
|
19
|
-
[Installing ArcLight](https://github.com/
|
|
20
|
+
[Installing ArcLight](https://github.com/projectblacklight/arclight/wiki/Creating,-installing,-and-running-your-ArcLight-application) is straightforward in a Rails environment.
|
|
20
21
|
|
|
21
22
|
Basically, add this line to your application's `Gemfile`:
|
|
22
23
|
|
|
@@ -36,7 +37,7 @@ Or install it yourself as:
|
|
|
36
37
|
$ gem install arclight
|
|
37
38
|
```
|
|
38
39
|
|
|
39
|
-
For further details, see our [Installing ArcLight](https://github.com/
|
|
40
|
+
For further details, see our [Installing ArcLight](https://github.com/projectblacklight/arclight/wiki/Creating,-installing,-and-running-your-ArcLight-application) documentation.
|
|
40
41
|
|
|
41
42
|
## Usage
|
|
42
43
|
|
|
@@ -48,9 +49,9 @@ Browsing allows you to view the Overview or Contents (when it exists) of a colle
|
|
|
48
49
|
|
|
49
50
|
Some pages include an inline view tab to the right of an item which will expand the Contents further.
|
|
50
51
|
|
|
51
|
-
See the [ArcLight demo](https://arclight-demo.projectblacklight.org/) and [ArcLight MVP Wiki](https://github.com/
|
|
52
|
+
See the [ArcLight demo](https://arclight-demo.projectblacklight.org/) and [ArcLight MVP Wiki](https://github.com/projectblacklight/arclight/wiki) for usage.
|
|
52
53
|
|
|
53
|
-
See [Arclight Major Features](https://github.com/
|
|
54
|
+
See [Arclight Major Features](https://github.com/projectblacklight/arclight/wiki/Arclight-Major-Features) for a list of features.
|
|
54
55
|
|
|
55
56
|
### Traject indexing of EAD content
|
|
56
57
|
[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:
|
|
@@ -69,15 +70,11 @@ bundle exec rake arclight:seed
|
|
|
69
70
|
|
|
70
71
|
* General
|
|
71
72
|
* [ArcLight demo site](https://arclight-demo.projectblacklight.org/)
|
|
72
|
-
* [ArcLight
|
|
73
|
-
* [ArcLight Github Wiki](https://github.com/sul-dlss/arclight/wiki): developer/implementor documentation
|
|
73
|
+
* [ArcLight Github wiki](https://github.com/projectblacklight/arclight/wiki): developer/implementor documentation
|
|
74
74
|
* [Blacklight wiki](https://github.com/projectblacklight/blacklight/wiki)
|
|
75
75
|
* Use the [ArcLight Google Group](http://groups.google.com/d/forum/arclight-community) to contact us with questions
|
|
76
|
-
* ArcLight Phase II:
|
|
77
|
-
* [Project overview](https://wiki.duraspace.org/display/samvera/ArcLight+Phase+II)
|
|
78
76
|
* ArcLight MVP:
|
|
79
77
|
* [MVP sprint demo videos](https://www.youtube.com/playlist?list=PLMdUaIJ0G8QgbuDCUVvFhTSTO96N37lRA)
|
|
80
|
-
* [Project overview](https://wiki.duraspace.org/display/samvera/ArcLight+MVP)
|
|
81
78
|
|
|
82
79
|
## Contributors
|
|
83
80
|
|
|
@@ -85,7 +82,7 @@ See the [CONTRIBUTORS](CONTRIBUTORS.md) file.
|
|
|
85
82
|
|
|
86
83
|
## Development
|
|
87
84
|
|
|
88
|
-
ArcLight development
|
|
85
|
+
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
86
|
|
|
90
87
|
### Run the test suite
|
|
91
88
|
|
|
@@ -108,16 +105,23 @@ Then visit http://localhost:3000. It will also start a Solr instance on port 898
|
|
|
108
105
|
|
|
109
106
|
You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
110
107
|
|
|
111
|
-
###
|
|
108
|
+
### Releasing
|
|
112
109
|
|
|
113
|
-
To release a new
|
|
110
|
+
#### To release a new gem:
|
|
114
111
|
|
|
115
112
|
1. Update the version number in `lib/arclight/version.rb`
|
|
116
113
|
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
114
|
|
|
115
|
+
#### To release the frontend sources:
|
|
116
|
+
|
|
117
|
+
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:
|
|
118
|
+
1. [Install npm](https://www.npmjs.com/get-npm)
|
|
119
|
+
2. Bump the version number in `package.json`
|
|
120
|
+
3. run `npm run build && npm publish` to push the javascript package to https://npmjs.org/package/arclight
|
|
121
|
+
|
|
118
122
|
## Contributing
|
|
119
123
|
|
|
120
|
-
[Bug reports](https://github.com/
|
|
124
|
+
[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
125
|
## License
|
|
122
126
|
|
|
123
127
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
//= require arclight/truncator
|
|
6
|
-
|
|
7
|
-
// Vendor Scripts
|
|
8
|
-
//= require responsiveTruncator
|
|
1
|
+
import Truncate from 'arclight/truncate_controller'
|
|
2
|
+
Stimulus.register('arclight-truncate', Truncate)
|
|
3
|
+
import Oembed from 'arclight/oembed_controller'
|
|
4
|
+
Stimulus.register('arclight-oembed', Oembed)
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Controller } from '@hotwired/stimulus'
|
|
2
|
+
|
|
3
|
+
export default class OembedController extends Controller {
|
|
4
|
+
static values = {
|
|
5
|
+
url: String
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
connect() {
|
|
9
|
+
const loadedAttr = this.element.getAttribute('loaded')
|
|
10
|
+
|
|
11
|
+
if (loadedAttr && loadedAttr === 'loaded') {
|
|
12
|
+
return
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
fetch(this.urlValue)
|
|
16
|
+
.then((response) => {
|
|
17
|
+
if (response.ok) return response.text()
|
|
18
|
+
throw new Error(`HTTP error, status = ${response.status}`)
|
|
19
|
+
})
|
|
20
|
+
.then((body) => {
|
|
21
|
+
const oEmbedEndPoint = this.findOEmbedEndPoint(body)
|
|
22
|
+
if (!oEmbedEndPoint || oEmbedEndPoint.length === 0) {
|
|
23
|
+
console.warn(`No oEmbed endpoint found in <head> at ${this.urlValue}`)
|
|
24
|
+
return
|
|
25
|
+
}
|
|
26
|
+
this.loadEndPoint(oEmbedEndPoint)
|
|
27
|
+
}).catch(error => {
|
|
28
|
+
console.error(error)
|
|
29
|
+
})
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// We are choosing not to make this class static so that downstream classes
|
|
33
|
+
// can override it and access values to populate extraParams.
|
|
34
|
+
// E.g. https://github.com/sul-dlss/vt-arclight/blob/main/app/javascript/controllers/sul_embed_controller.js
|
|
35
|
+
findOEmbedEndPoint(body, extraParams = {}) { // eslint-disable-line class-methods-use-this
|
|
36
|
+
// Parse out link elements so image assets are not loaded
|
|
37
|
+
const template = document.createElement('template')
|
|
38
|
+
template.innerHTML = body.match(/<link .*>/g).join('')
|
|
39
|
+
|
|
40
|
+
// Look for a link element containing the oEmbed endpoint; bail out if none
|
|
41
|
+
const endpoint = template.content.querySelector('link[rel="alternate"][type="application/json+oembed"]')
|
|
42
|
+
?.getAttribute('href')
|
|
43
|
+
if (!endpoint) return ''
|
|
44
|
+
|
|
45
|
+
// Serialize any extra params and append them to the endpoint
|
|
46
|
+
const qs = new URLSearchParams(extraParams).toString()
|
|
47
|
+
return `${endpoint}&${qs}`
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
loadEndPoint(oEmbedEndPoint) {
|
|
51
|
+
fetch(oEmbedEndPoint)
|
|
52
|
+
.then((response) => response.json())
|
|
53
|
+
.then((json) => {
|
|
54
|
+
this.element.innerHTML = json.html
|
|
55
|
+
this.element.setAttribute('loaded', 'loaded')
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -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,5 @@
|
|
|
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';
|
|
14
|
+
@import 'modules/search_form';
|