blacklight-spotlight 4.7.1 → 5.0.0.pre.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (153) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +30 -12
  3. data/Rakefile +8 -1
  4. data/app/assets/javascripts/spotlight/application.js +0 -1
  5. data/app/assets/javascripts/spotlight/spotlight.esm.js +3620 -3847
  6. data/app/assets/javascripts/spotlight/spotlight.esm.js.map +1 -1
  7. data/app/assets/javascripts/spotlight/spotlight.js +3620 -3852
  8. data/app/assets/javascripts/spotlight/spotlight.js.map +1 -1
  9. data/app/assets/stylesheets/spotlight/_accessibility.scss +0 -9
  10. data/app/assets/stylesheets/spotlight/_autocomplete.scss +49 -0
  11. data/app/assets/stylesheets/spotlight/_blacklight_configuration.scss +0 -1
  12. data/app/assets/stylesheets/spotlight/_blacklight_overrides.scss +1 -6
  13. data/app/assets/stylesheets/spotlight/_browse.scss +2 -2
  14. data/app/assets/stylesheets/spotlight/_catalog.scss +40 -41
  15. data/app/assets/stylesheets/spotlight/_curation.scss +1 -1
  16. data/app/assets/stylesheets/spotlight/_exhibit_admin.scss +7 -0
  17. data/app/assets/stylesheets/spotlight/_exhibits_index.scss +8 -5
  18. data/app/assets/stylesheets/spotlight/_featured_browse_categories_block.scss +3 -3
  19. data/app/assets/stylesheets/spotlight/_header.scss +13 -0
  20. data/app/assets/stylesheets/spotlight/_mixins.scss +3 -4
  21. data/app/assets/stylesheets/spotlight/_nestable.scss +2 -12
  22. data/app/assets/stylesheets/spotlight/_pages.scss +11 -9
  23. data/app/assets/stylesheets/spotlight/_report_a_problem.scss +1 -3
  24. data/app/assets/stylesheets/spotlight/_sir-trevor_overrides.scss +2 -2
  25. data/app/assets/stylesheets/spotlight/_spotlight.scss +2 -1
  26. data/app/assets/stylesheets/spotlight/_tag_selector.scss +34 -0
  27. data/app/assets/stylesheets/spotlight/_variables.scss +0 -8
  28. data/app/components/spotlight/analytics/dashboard_component.html.erb +3 -3
  29. data/app/components/spotlight/breadcrumbs_component.html.erb +13 -19
  30. data/app/components/spotlight/bulk_action_component.rb +1 -1
  31. data/app/components/spotlight/document_component.rb +1 -1
  32. data/app/components/spotlight/save_search_component.rb +1 -1
  33. data/app/components/spotlight/select_image_component.html.erb +17 -0
  34. data/app/components/spotlight/select_image_component.rb +24 -0
  35. data/app/components/spotlight/skip_link_component.rb +16 -0
  36. data/app/components/spotlight/tag_selector_component.html.erb +40 -0
  37. data/app/components/spotlight/tag_selector_component.rb +41 -0
  38. data/app/components/spotlight/tag_selector_component.yml +6 -0
  39. data/app/components/spotlight/title_component.html.erb +8 -0
  40. data/app/components/spotlight/title_component.rb +22 -0
  41. data/app/controllers/spotlight/accessibility_controller.rb +2 -2
  42. data/app/controllers/spotlight/catalog_controller.rb +7 -2
  43. data/app/controllers/spotlight/contact_email_controller.rb +8 -2
  44. data/app/controllers/spotlight/languages_controller.rb +9 -4
  45. data/app/helpers/spotlight/application_helper.rb +7 -0
  46. data/app/helpers/spotlight/crop_helper.rb +4 -0
  47. data/app/helpers/spotlight/meta_helper.rb +59 -36
  48. data/app/javascript/spotlight/admin/blacklight_configuration.js +1 -1
  49. data/app/javascript/spotlight/admin/block_mixins/autocompleteable.js +70 -34
  50. data/app/javascript/spotlight/admin/blocks/block.js +1 -0
  51. data/app/javascript/spotlight/admin/blocks/browse_block.js +8 -12
  52. data/app/javascript/spotlight/admin/blocks/browse_group_categories_block.js +14 -18
  53. data/app/javascript/spotlight/admin/blocks/pages_block.js +6 -10
  54. data/app/javascript/spotlight/admin/blocks/resources_block.js +33 -15
  55. data/app/javascript/spotlight/admin/blocks/solr_documents_base_block.js +11 -6
  56. data/app/javascript/spotlight/admin/blocks/solr_documents_embed_block.js +1 -0
  57. data/app/javascript/spotlight/admin/blocks/uploaded_items_block.js +4 -3
  58. data/app/javascript/spotlight/admin/copy_email_addresses.js +2 -0
  59. data/app/javascript/spotlight/admin/crop.js +45 -17
  60. data/app/javascript/spotlight/admin/croppable.js +8 -1
  61. data/app/javascript/spotlight/admin/croppable_modal.js +68 -0
  62. data/app/javascript/spotlight/admin/exhibits.js +15 -10
  63. data/app/javascript/spotlight/admin/form_observer.js +1 -1
  64. data/app/javascript/spotlight/admin/index.js +0 -10
  65. data/app/javascript/spotlight/admin/locks.js +15 -5
  66. data/app/javascript/spotlight/admin/pages.js +1 -1
  67. data/app/javascript/spotlight/admin/search_typeahead.js +62 -55
  68. data/app/javascript/spotlight/admin/spotlight_nestable.js +173 -50
  69. data/app/javascript/spotlight/admin/visibility_toggle.js +1 -11
  70. data/app/javascript/spotlight/controllers/index.js +8 -0
  71. data/app/javascript/spotlight/controllers/tag_selector_controller.js +203 -0
  72. data/app/javascript/spotlight/core.js +4 -6
  73. data/app/javascript/spotlight/index.js +2 -0
  74. data/app/javascript/spotlight/user/browse_group_categories.js +2 -0
  75. data/app/javascript/spotlight/user/carousel.js +3 -1
  76. data/app/javascript/spotlight/user/index.js +0 -2
  77. data/app/models/sir_trevor_rails/block.rb +5 -4
  78. data/app/models/sir_trevor_rails/blocks/solr_documents_block.rb +1 -1
  79. data/app/models/sir_trevor_rails/blocks/solr_documents_embed_block.rb +1 -1
  80. data/app/models/sir_trevor_rails/blocks/uploaded_items_block.rb +1 -1
  81. data/app/models/spotlight/page_configurations.rb +1 -1
  82. data/app/views/catalog/_add_tags.html.erb +2 -2
  83. data/app/views/catalog/_change_visibility.html.erb +1 -1
  84. data/app/views/catalog/_remove_tags.html.erb +2 -2
  85. data/app/views/layouts/spotlight/base.html.erb +24 -13
  86. data/app/views/layouts/spotlight/spotlight.html.erb +6 -6
  87. data/app/views/shared/_masthead.html.erb +4 -31
  88. data/app/views/shared/_site_sidebar.html.erb +1 -1
  89. data/app/views/shared/_user_util_links.html.erb +3 -1
  90. data/app/views/spotlight/accessibility/alt_text.html.erb +2 -2
  91. data/app/views/spotlight/admin_users/index.html.erb +3 -3
  92. data/app/views/spotlight/appearances/edit.html.erb +1 -1
  93. data/app/views/spotlight/browse/_search_box.html.erb +8 -8
  94. data/app/views/spotlight/browse/show.html.erb +1 -1
  95. data/app/views/spotlight/bulk_updates/_download.html.erb +1 -1
  96. data/app/views/spotlight/bulk_updates/_upload.html.erb +1 -1
  97. data/app/views/spotlight/catalog/_admin_header.html.erb +1 -1
  98. data/app/views/spotlight/catalog/_edit_default.html.erb +2 -1
  99. data/app/views/spotlight/catalog/select_image.html.erb +1 -0
  100. data/app/views/spotlight/contacts/_form.html.erb +1 -1
  101. data/app/views/spotlight/exhibits/_contact.html.erb +5 -6
  102. data/app/views/spotlight/exhibits/_delete.html.erb +1 -1
  103. data/app/views/spotlight/exhibits/_languages.html.erb +3 -2
  104. data/app/views/spotlight/featured_images/_form.html.erb +6 -2
  105. data/app/views/spotlight/featured_images/_upload_form.html.erb +1 -1
  106. data/app/views/spotlight/metadata_configurations/_metadata_field.html.erb +1 -1
  107. data/app/views/spotlight/metadata_configurations/edit.html.erb +6 -6
  108. data/app/views/spotlight/pages/show.html.erb +1 -1
  109. data/app/views/spotlight/resources/csv_upload/_form.html.erb +1 -1
  110. data/app/views/spotlight/resources/upload/_form.html.erb +1 -1
  111. data/app/views/spotlight/roles/index.html.erb +1 -1
  112. data/app/views/spotlight/searches/_form.html.erb +1 -1
  113. data/app/views/spotlight/shared/_dd3_item.html.erb +1 -1
  114. data/app/views/spotlight/sir_trevor/blocks/_browse_group_categories_block.html.erb +1 -1
  115. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb +1 -1
  116. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb +1 -1
  117. data/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb +1 -1
  118. data/app/views/spotlight/tags/index.html.erb +2 -3
  119. data/app/views/spotlight/translations/_import.html.erb +2 -2
  120. data/config/importmap.rb +5 -0
  121. data/config/locales/spotlight.en.yml +2 -0
  122. data/config/routes.rb +5 -3
  123. data/lib/generators/spotlight/assets/generator_common_utilities.rb +36 -0
  124. data/lib/generators/spotlight/assets/importmap_generator.rb +87 -0
  125. data/lib/generators/spotlight/assets/propshaft_generator.rb +96 -0
  126. data/lib/generators/spotlight/assets_generator.rb +22 -0
  127. data/lib/generators/spotlight/install_generator.rb +8 -36
  128. data/lib/generators/spotlight/scaffold_resource_generator.rb +1 -1
  129. data/lib/generators/spotlight/templates/assets/spotlight.scss +6 -0
  130. data/lib/generators/spotlight/templates/javascript/jquery-shim.js +1 -0
  131. data/lib/spotlight/engine.rb +7 -6
  132. data/lib/spotlight/version.rb +1 -1
  133. data/spec/support/features/capybara_wait_metadata_helper.rb +13 -0
  134. data/spec/support/features/test_features_helpers.rb +16 -30
  135. data/vendor/assets/javascripts/tiny-slider.js +3 -0
  136. metadata +35 -87
  137. data/app/assets/stylesheets/spotlight/#_accessibility.scss# +0 -12
  138. data/app/javascript/spotlight/admin/checkbox_submit.js +0 -75
  139. data/app/javascript/spotlight/admin/exhibit_tag_autocomplete.js +0 -39
  140. data/app/javascript/spotlight/user/report_a_problem.js +0 -30
  141. data/app/views/spotlight/browse/_tophat.html.erb +0 -1
  142. data/app/views/spotlight/catalog/_tophat_default.html.erb +0 -1
  143. data/app/views/spotlight/home_pages/_tophat.html.erb +0 -2
  144. data/app/views/spotlight/pages/_tophat.html.erb +0 -1
  145. data/lib/generators/spotlight/templates/spotlight.js +0 -1
  146. data/lib/generators/spotlight/templates/spotlight.scss +0 -5
  147. data/spec/support/features/capybara_default_max_wait_metadata_helper.rb +0 -20
  148. data/vendor/assets/javascripts/bootstrap-tagsinput.js +0 -530
  149. data/vendor/assets/javascripts/jquery.serializejson.js +0 -234
  150. data/vendor/assets/javascripts/nestable.js +0 -645
  151. data/vendor/assets/javascripts/sir-trevor.js +0 -23508
  152. data/vendor/assets/javascripts/typeahead.bundle.min.js +0 -7
  153. data/vendor/assets/stylesheets/bootstrap-tagsinput.css +0 -46
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ebea908eb8ae3ba884d61eb1b965f382443e87d479fd297f29c7f290f2bd5566
4
- data.tar.gz: 2d73d341ada846d8870482711d63a020405185b3f3d75b8809f42ab67354790f
3
+ metadata.gz: ce44443bbb2fb8d5c0a1d0d7aad9bc0b897e7fd69a508f0c657e9d6afef88c0c
4
+ data.tar.gz: 1634dbfb882f80488abd0c32351a78f11c46664c2f0ce81a16baca9c1807c663
5
5
  SHA512:
6
- metadata.gz: 3d9909da016ef1d4ac572ad2e1306b4cfe8fb9ed85e6f737d33e2619fcc71c7e4b2398ef71d4a04ed6ec7978821d1bf97d650958dc7e407c1823e59ea04910d5
7
- data.tar.gz: 0d05c74d317579c3981ca44a93668c432ff786db7ec215315849eec0a095fa8f0e69dd98b032bdd6c696438790439686a4fd2c0e4fbfe99fa037f1258305e18f
6
+ metadata.gz: c9e40d3004bc25781c5a49fa4bcfc2e1ff22bf7c8bb173b269b41d9db1493b98a2d1597f8f996f0fa5214aa3d52e10d032c20196573dd7838ff27bc1d34aa344
7
+ data.tar.gz: ec53a3c1124ed3477744063462e7f5860d5fad382b3dcd33cf96ea2ee1e752204c7dff36864978ba354c11a570f55c7eea7bcc709ad14ed3789190ccb02997f3
data/README.md CHANGED
@@ -9,17 +9,23 @@ Read more about what Spotlight is, our motivations for creating it, and how to i
9
9
 
10
10
  ## Requirements
11
11
 
12
- 1. Ruby (2.7 or greater)
13
- 2. Rails (5.2 or greater)
14
- 3. Java (7 or greater) *for Solr*
12
+ 1. [Ruby](https://www.ruby-lang.org/) 3.1+
13
+ 2. [Ruby on Rails](https://rubyonrails.org/) 7.1+
14
+ 3. Java (11 or greater) *for Solr*
15
15
  4. ImageMagick (http://www.imagemagick.org/script/index.php) due to [carrierwave](https://github.com/carrierwaveuploader/carrierwave#adding-versions)
16
16
 
17
17
  ## Installation
18
18
 
19
- To bootstrap a new Rails application:
19
+ To bootstrap a new Rails application using [importmap-rails](https://github.com/rails/importmap-rails):
20
20
 
21
21
  ```
22
- $ SKIP_TRANSLATION=1 rails new app-name -m https://raw.githubusercontent.com/projectblacklight/spotlight/main/template.rb
22
+ $ SKIP_TRANSLATION=1 rails new app-name -m https://raw.githubusercontent.com/projectblacklight/spotlight/main/template.rb -a propshaft --css bootstrap
23
+ ```
24
+
25
+ or using [jsbundling-rails](https://github.com/rails/jsbundling-rails) with [esbuild](https://esbuild.github.io/):
26
+
27
+ ```
28
+ $ SKIP_TRANSLATION=1 rails new app-name -m https://raw.githubusercontent.com/projectblacklight/spotlight/main/template.rb -a propshaft -j esbuild --css bootstrap
23
29
  ```
24
30
 
25
31
  or from an existing Rails application:
@@ -51,7 +57,7 @@ $ solr_wrapper
51
57
  and the Rails development server:
52
58
 
53
59
  ```
54
- $ rails server
60
+ $ bin/dev
55
61
  ```
56
62
 
57
63
  Go to http://localhost:3000 in your browser.
@@ -60,22 +66,34 @@ Go to http://localhost:3000 in your browser.
60
66
 
61
67
  ### Default ActionMailer configuration
62
68
 
63
- Spotlight introduces functionality that depends on being able to send emails to exhibit curators and contacts. Be sure to configure your application's environments appropriately (see the Rails Guide for [Action Mailer Configuration](http://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration)).
69
+ Spotlight introduces functionality that depends on being able to send emails to exhibit curators and contacts. Be sure to configure your application's environments appropriately (see the Rails Guide for [Action Mailer Configuration](https://guides.rubyonrails.org/v7.2/action_mailer_basics.html#action-mailer-configuration)).
64
70
 
65
71
  See the [Spotlight wiki](https://github.com/projectblacklight/spotlight/wiki) for more detailed information on configuring Spotlight.
66
72
 
67
73
  # Developing Spotlight
68
74
 
69
- Spotlight:
75
+ ## Branches
76
+
77
+ * The `main` branch is for development of the upcoming 5.0 release.
78
+ * The `4.x` series is on the [release-4.x](https://github.com/projectblacklight/spotlight/tree/release-4.x) branch for backports of features and bug fixes.
79
+
80
+ ## Spotlight
70
81
 
71
82
  * is a Rails engine and needs to be used in the context of a Rails application. We use [engine_cart](https://github.com/cbeer/engine_cart) to create an internal test application at .internal_test_app/
72
83
  * uses Solr as part of its integration tests. We use [solr_wrapper](https://github.com/cbeer/solr_wrapper) to manage the Solr instance used for development and test.
73
84
 
74
- Our `$ rake ci` and `$ rake spotlight:server` tasks utilize Solr and the testing rails app automatically.
75
-
76
85
  See more detailed instructions for development environment setup at ["Contributing to Spotlight"](https://github.com/projectblacklight/spotlight/wiki/Contributing-to-Spotlight)
77
86
 
78
- ## With Docker
87
+ ## Run a development server
88
+
89
+ ### With EngineCart
90
+ ```
91
+ $ rake spotlight:server
92
+ ```
93
+
94
+ Then visit http://localhost:3000. A Solr instance will be running on port 8983. When using importmap (the default configuration), JavaScript changes in development should not require [bundling](#updating-the-javascript-bundle) or a server restart.
95
+
96
+ ### With Docker
79
97
 
80
98
  ```sh
81
99
  # because of how docker compose handles named images, running `docker compose up --build` will error when the Rails images have not been built locally
@@ -134,4 +152,4 @@ You only need to update `package.json` and prepare/publish the JavaScript packag
134
152
  5. Push the release to rubygems and GitHub: `bundle exec rake release`
135
153
  6. Run `npm publish` to push the JavaScript package to https://npmjs.org/package/spotlight-frontend
136
154
 
137
- See "Updating the JavaScript bundle" above for more details.
155
+ See [Updating the JavaScript bundle](#updating-the-javascript-bundle) above for more details.
data/Rakefile CHANGED
@@ -31,6 +31,13 @@ require 'engine_cart/rake_task'
31
31
 
32
32
  require 'spotlight/version'
33
33
 
34
+ # Build with our opinionated defaults if none are provided.
35
+ rails_options = ENV.fetch('ENGINE_CART_RAILS_OPTIONS', '')
36
+ rails_options = "#{rails_options} -a propshaft" unless rails_options.match?(/-a\s|--asset-pipeline/)
37
+ rails_options = "#{rails_options} -j importmap" unless rails_options.match?(/-j\s|--javascript/)
38
+ rails_options = "#{rails_options} --css bootstrap" unless rails_options.match?(/--css/)
39
+ ENV['ENGINE_CART_RAILS_OPTIONS'] = rails_options
40
+
34
41
  def system_with_error_handling(*args)
35
42
  Open3.popen3(*args) do |_stdin, stdout, stderr, thread|
36
43
  puts stdout.read
@@ -93,7 +100,7 @@ namespace :spotlight do
93
100
  system 'bin/rails spotlight:initialize spotlight_test:solr:seed'
94
101
  File.open('.initialized', 'w') {}
95
102
  end
96
- system 'bin/rails s'
103
+ system 'bin/dev'
97
104
  end
98
105
  end
99
106
  end
@@ -3,6 +3,5 @@
3
3
  //= require sir-trevor
4
4
  //= require clipboard
5
5
  //= require tiny-slider
6
- //= require typeahead.bundle.min.js
7
6
 
8
7
  //= require spotlight/spotlight