blacklight-spotlight 3.6.0.beta5 → 3.6.0.beta6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ab068b29098e5b106e7b1727c62405eb25134e37c8822cb6507f1d19225ea18
4
- data.tar.gz: 4233be77f493a45b868422c3f96acc03242b975670496121630170352000c073
3
+ metadata.gz: a2ad914a77051069115c87db6d24e42773a464a38bbe59855105e1ba7c323615
4
+ data.tar.gz: 01a29be86b0b4877e5d7847c3fd11b3cf900bdec4a932a049e97cc2d035cb8eb
5
5
  SHA512:
6
- metadata.gz: 81f74cb5d502e8b0a190b7dd89853a2a545b49d7a2611985bb679868325f2a2a9e7bfb70021d62506cb9d4cb761a2fc11f1a6d971b7e714501121bf9e665f274
7
- data.tar.gz: 1aaacfd669052479884ccedf9ca0758d527bfda03c8587c106172c0b68def1d04bd456c7059041f1cf36426ebe2bd49c02eb3fe2b5247b091784c52aa30070ac
6
+ metadata.gz: 9ebf452f6eaaba05fe6bfdaafb5b9bd22de0e0900ba4f28b06ce07d9da386f219db5d4d2e2ead6a657ddf0cf5a028ee2bee467e2555fcfcad07e12fd73e2f4a9
7
+ data.tar.gz: 9a76eeed30ca40bcba0cc0bd1ae8c9aebf9f54830a3613e60fdf4783eb571aea92b69dace93003dd3ee07f2c74a0ee75feb9f5401dd1aa682e6839b13d342ab7
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spotlight
4
+ # Displays the document
5
+ # This overrides the title method to provide an edit link.
6
+ class DocumentComponent < Blacklight::DocumentComponent
7
+ def title
8
+ safe_join([exhibit_edit_link, super, add_document_meta_content(@document)])
9
+ end
10
+
11
+ attr_reader :document
12
+
13
+ delegate :current_exhibit, :can?, :add_document_meta_content, to: :helpers
14
+
15
+ def exhibit_edit_link
16
+ helpers.exhibit_edit_link document, [:edit, current_exhibit, document], class: 'float-right btn btn-primary' if can?(:curate, current_exhibit)
17
+ end
18
+ end
19
+ end
@@ -23,8 +23,7 @@ module Spotlight
23
23
  before_action :load_document, only: %i[edit update make_private make_public manifest]
24
24
 
25
25
  before_action only: :show do
26
- blacklight_config.show.partials.unshift 'tophat'
27
- blacklight_config.show.partials.unshift 'curation_mode_toggle'
26
+ blacklight_config.show.document_component = Spotlight::DocumentComponent
28
27
  end
29
28
 
30
29
  before_action only: :admin do
@@ -246,4 +245,5 @@ module Spotlight
246
245
  Rails.logger.info "Failed to commit document updates: #{e}"
247
246
  end
248
247
  end
248
+ # rubocop:enable Metrics/ClassLength
249
249
  end
@@ -115,7 +115,7 @@ module Spotlight
115
115
  end
116
116
 
117
117
  def build_initial_exhibit_contact_emails
118
- @exhibit.contact_emails.build unless @exhibit.contact_emails.present?
118
+ @exhibit.contact_emails.build if @exhibit.contact_emails.blank?
119
119
  end
120
120
  end
121
121
  end
@@ -97,7 +97,7 @@ module Spotlight
97
97
  # Return a copy of the blacklight configuration
98
98
  # that only includes views conifgured by our block
99
99
  def blacklight_view_config_for_search_block(block)
100
- return {} unless block.view.present?
100
+ return {} if block.view.blank?
101
101
 
102
102
  # Reject any views that aren't configured to display for this block
103
103
  blacklight_config.view.select do |view, _|
@@ -7,10 +7,6 @@ module Spotlight
7
7
  include Spotlight::NavbarHelper
8
8
  include Spotlight::MastheadHelper
9
9
 
10
- def cache_key_for_spotlight_exhibits
11
- "#{Spotlight::Exhibit.count}/#{Spotlight::Exhibit.maximum(:updated_at).try(:utc)}"
12
- end
13
-
14
10
  def on_browse_page?
15
11
  params[:controller] == 'spotlight/browse'
16
12
  end
@@ -40,7 +40,7 @@ module Spotlight
40
40
 
41
41
  encoded_csv(csv_data).each do |row|
42
42
  url = row.delete('url')
43
- next unless url.present?
43
+ next if url.blank?
44
44
 
45
45
  resource = Spotlight::Resources::Upload.new(
46
46
  data: row,
@@ -227,7 +227,7 @@ module Spotlight
227
227
  config
228
228
  end
229
229
  end
230
- # rubocop:enable Metrics/MethodLength, Metrics/PerceivedComplexity, Metrics/CyclomaticComplexity
230
+ # rubocop:enable Metrics/MethodLength, Metrics/PerceivedComplexity, Metrics/CyclomaticComplexity, Metrics/AbcSize
231
231
 
232
232
  def custom_index_fields(blacklight_config)
233
233
  Hash[exhibit.custom_fields.reject(&:new_record?).map do |custom_field|
@@ -406,4 +406,5 @@ module Spotlight
406
406
  ActiveModel::Type::Boolean.new.cast v
407
407
  end
408
408
  end
409
+ # rubocop:enable Metrics/ClassLength
409
410
  end
@@ -36,7 +36,7 @@ module Spotlight
36
36
  attr_accessor :upload_id
37
37
 
38
38
  def iiif_url
39
- return unless iiif_service_base.present?
39
+ return if iiif_service_base.blank?
40
40
 
41
41
  [iiif_service_base, iiif_region || 'full', image_size.join(','), '0', 'default.jpg'].join('/')
42
42
  end
@@ -129,7 +129,7 @@ module Spotlight
129
129
  end
130
130
 
131
131
  def lock!(user)
132
- create_lock(by: user).tap(&:current_session!) unless lock.present?
132
+ create_lock(by: user).tap(&:current_session!) if lock.blank?
133
133
  end
134
134
 
135
135
  def updated_after?(other_page)
@@ -89,7 +89,7 @@ module Spotlight
89
89
 
90
90
  def manifest_metadata
91
91
  metadata = metadata_class.new(manifest).to_solr
92
- return {} unless metadata.present?
92
+ return {} if metadata.blank?
93
93
 
94
94
  create_sidecars_for(*metadata.keys)
95
95
 
@@ -203,7 +203,7 @@ module Spotlight
203
203
  end
204
204
 
205
205
  def metadata_hash
206
- return {} unless metadata.present?
206
+ return {} if metadata.blank?
207
207
  return {} unless metadata.is_a?(Array)
208
208
 
209
209
  metadata.each_with_object({}) do |md, hash|
@@ -61,7 +61,7 @@ module Spotlight
61
61
 
62
62
  thing.manifests.each(&block)
63
63
 
64
- return unless thing.collections.present?
64
+ return if thing.collections.blank?
65
65
 
66
66
  thing.collections.each do |collection|
67
67
  recursive_manifests(collection, &block)
@@ -1,6 +1,4 @@
1
- /*
2
- *= require bootstrap-tagsinput
3
- */
1
+ @import 'bootstrap-tagsinput';
4
2
  @import 'spotlight/variables_bootstrap';
5
3
  @import 'bootstrap';
6
4
  @import 'sir-trevor/main';
@@ -97,7 +97,7 @@ module Migration
97
97
  end
98
98
 
99
99
  def coordinates(image)
100
- return unless image.image_crop_x.present?
100
+ return if image.image_crop_x.blank?
101
101
 
102
102
  [image.image_crop_x, image.image_crop_y, image.image_crop_w, image.image_crop_h].join(',')
103
103
  end
@@ -340,4 +340,5 @@ module Spotlight
340
340
  config.active_record.yaml_column_permitted_classes += [Symbol, ActiveSupport::HashWithIndifferentAccess]
341
341
  end
342
342
  end
343
+ # rubocop:enable Metrics/ClassLength
343
344
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spotlight
4
- VERSION = '3.6.0.beta5'
4
+ VERSION = '3.6.0.beta6'
5
5
  end
@@ -46,7 +46,7 @@ module Spotlight
46
46
  end
47
47
 
48
48
  def click_add_widget
49
- unless all('.st-block-replacer').present?
49
+ if all('.st-block-replacer').blank?
50
50
  expect(page).to have_css('.st-block-addition')
51
51
  first('.st-block-addition').click
52
52
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight-spotlight
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.0.beta5
4
+ version: 3.6.0.beta6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2023-03-09 00:00:00.000000000 Z
14
+ date: 2023-03-15 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activejob-status
@@ -911,6 +911,7 @@ files:
911
911
  - app/assets/stylesheets/spotlight/browse_group_categories_block.scss
912
912
  - app/assets/stylesheets/spotlight/typeahead.scss
913
913
  - app/builders/spotlight/bootstrap_breadcrumbs_builder.rb
914
+ - app/components/spotlight/document_component.rb
914
915
  - app/controllers/concerns/spotlight/base.rb
915
916
  - app/controllers/concerns/spotlight/catalog.rb
916
917
  - app/controllers/concerns/spotlight/config.rb
@@ -1204,7 +1205,6 @@ files:
1204
1205
  - app/views/spotlight/catalog/_admin_header.html.erb
1205
1206
  - app/views/spotlight/catalog/_admin_index_header_default.html.erb
1206
1207
  - app/views/spotlight/catalog/_admin_thumbnail_default.html.erb
1207
- - app/views/spotlight/catalog/_curation_mode_toggle_default.html.erb
1208
1208
  - app/views/spotlight/catalog/_document.html.erb
1209
1209
  - app/views/spotlight/catalog/_document_admin_table.html.erb
1210
1210
  - app/views/spotlight/catalog/_document_row.html.erb
@@ -1213,7 +1213,6 @@ files:
1213
1213
  - app/views/spotlight/catalog/_edit_sidecar.html.erb
1214
1214
  - app/views/spotlight/catalog/_index_compact_default.html.erb
1215
1215
  - app/views/spotlight/catalog/_reindex_progress_panel.html.erb
1216
- - app/views/spotlight/catalog/_tophat_default.html.erb
1217
1216
  - app/views/spotlight/catalog/admin.html.erb
1218
1217
  - app/views/spotlight/catalog/edit.html.erb
1219
1218
  - app/views/spotlight/catalog/index.iiif_json.jbuilder
@@ -1529,7 +1528,6 @@ files:
1529
1528
  - vendor/assets/javascripts/tiny-slider.js
1530
1529
  - vendor/assets/javascripts/typeahead.bundle.min.js
1531
1530
  - vendor/assets/stylesheets/bootstrap-tagsinput.css
1532
- - vendor/assets/stylesheets/leaflet-areaselect.css
1533
1531
  - vendor/assets/stylesheets/sir-trevor/_icons.scss
1534
1532
  - vendor/assets/stylesheets/sir-trevor/_variables.scss
1535
1533
  - vendor/assets/stylesheets/sir-trevor/base.scss
@@ -1566,7 +1564,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1566
1564
  - !ruby/object:Gem::Version
1567
1565
  version: 1.3.1
1568
1566
  requirements: []
1569
- rubygems_version: 3.3.26
1567
+ rubygems_version: 3.2.32
1570
1568
  signing_key:
1571
1569
  specification_version: 4
1572
1570
  summary: Enable librarians, curators, and others who are responsible for digital collections
@@ -1 +0,0 @@
1
- <%= exhibit_edit_link document, [:edit, current_exhibit, document], class: 'float-right btn btn-primary' if can?(:curate, current_exhibit) and !current_page? [:edit, current_exhibit, document] %>
@@ -1 +0,0 @@
1
- <% add_document_meta_content(@document) %>
@@ -1,15 +0,0 @@
1
- .leaflet-areaselect-shade {
2
- position: absolute;
3
- background: rgba(0,0,0, 0.4);
4
- }
5
- .leaflet-areaselect-handle {
6
- position: absolute;
7
- background: #fff;
8
- border: 1px solid #666;
9
- -moz-box-shadow: 1px 1px rgba(0,0,0, 0.2);
10
- -webkit-box-shadow: 1px 1px rgba(0,0,0, 0.2);
11
- box-shadow: 1px 1px rgba(0,0,0, 0.2);
12
- width: 14px;
13
- height: 14px;
14
- cursor: move;
15
- }