geoblacklight_admin 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -2
  3. data/app/models/asset.rb +2 -0
  4. data/app/models/document.rb +21 -21
  5. data/app/models/document_distribution.rb +1 -1
  6. data/app/models/geoblacklight_admin.rb +0 -1
  7. data/app/views/admin/advanced_search/facets.json.jbuilder +0 -2
  8. data/app/views/admin/advanced_search/index.json.jbuilder +0 -2
  9. data/app/views/admin/api/_field.json.jbuilder +0 -2
  10. data/app/views/admin/api/fetch.json.jbuilder +0 -2
  11. data/app/views/admin/api/index.json.jbuilder +0 -2
  12. data/app/views/admin/document_distributions/_form.html.erb +1 -1
  13. data/app/views/admin/document_distributions/index.html.erb +0 -2
  14. data/app/views/admin/documents/_form_nav.html.erb +0 -1
  15. data/app/views/admin/documents/_json_aardvark.jbuilder +0 -2
  16. data/app/views/admin/documents/_json_btaa_aardvark.jbuilder +0 -2
  17. data/app/views/admin/documents/_json_file.jbuilder +0 -2
  18. data/app/views/admin/documents/_json_gbl_v1.jbuilder +0 -2
  19. data/app/views/admin/documents/fetch.json_aardvark.jbuilder +0 -2
  20. data/app/views/admin/documents/fetch.json_btaa_aardvark.jbuilder +0 -2
  21. data/app/views/admin/documents/fetch.json_file.jbuilder +0 -2
  22. data/app/views/admin/documents/fetch.json_gbl_v1.jbuilder +0 -2
  23. data/app/views/admin/documents/index.json_aardvark.jbuilder +0 -2
  24. data/app/views/admin/documents/index.json_btaa_aardvark.jbuilder +0 -2
  25. data/app/views/admin/documents/index.json_file.jbuilder +0 -2
  26. data/app/views/admin/documents/index.json_gbl_v1.jbuilder +0 -2
  27. data/app/views/admin/documents/show.json_aardvark.jbuilder +0 -2
  28. data/app/views/admin/documents/show.json_btaa_aardvark.jbuilder +0 -2
  29. data/app/views/admin/documents/show.json_gbl_v1.jbuilder +0 -2
  30. data/lib/geoblacklight_admin/version.rb +1 -1
  31. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fb7dfdea7cb8626ae4e65999624310642a89c81cea03a8d0e58a5649c080091b
4
- data.tar.gz: e08e45d57f47e372d574e7cce41e1babd93697741a1261a22dcf816e07a0b74b
3
+ metadata.gz: 7fcfdbb7ea830459ca48b31a53d53d8ffba6907f65854b0cc98c4405fa724531
4
+ data.tar.gz: b0f7f43a9fdf214711479393e8b1d485b551b230708d52d9e27172ba970174c5
5
5
  SHA512:
6
- metadata.gz: b7e2504e7f0fb46e55e0ba3359577a4d6e90842afa5c6be608e79a52d2b278ec39fe24812b68d8ca6d950ff2ef7842905550bb2a1354ba012f82f8b6349da154
7
- data.tar.gz: d913fe08b848b6b9a2f2cd730570cecbb1f0e98157540b967306fc903ee7433bdae04a422b7d0b06c20678103bd30440bfaa939b04369c9b9f100bdd55611a65
6
+ metadata.gz: 6e56308683ec638bc5905254a8719f467c9b40d139389ed800038de75b318e4995e88ba297587042744e79433204556d87d65adcf7a0fe2867bc2b67ee618db2
7
+ data.tar.gz: 84ec89c486944d06a529caf276072fe426ab350bfcffd18f92cb172561c626d569ee5fe6871d9ef56003950215abce7e008b3be0d7212cd9f183be79463e14f2
data/README.md CHANGED
@@ -69,8 +69,11 @@ The gem is available as open source under the terms of the [Apache 2.0 License](
69
69
  * ~~Debug Rails 7.2 support (remove devise_invitable, see [#915](https://github.com/scambra/devise_invitable/issues/915))~~
70
70
  * ~~Separate dct_references_s support into a separate model~~
71
71
  * ~~Import/Export dct_references_s outside of the main document model~~
72
- * Migrate our GBL API controllers to just RSolr-based models
73
- * DRY up Gem dependencies and Engine routing
72
+ * Data Dictionary: Add support for `document_data_dictionary`
74
73
  * Gazetteer: Add GeoNames support
75
74
  * Gazetteer: Add Who's On First support
75
+ * Gazetteer: Add Ollama support
76
+ * Gazetteer: Add BTAA spatial file support
77
+ * Migrate our GBL API controllers to just RSolr-based models
78
+ * DRY up Gem dependencies and Engine routing
76
79
  * Remove any remaining GEOMG references
data/app/models/asset.rb CHANGED
@@ -55,6 +55,8 @@ class Asset < Kithe::Asset
55
55
  if dct_references_uri_key.present?
56
56
  reference_type = ReferenceType.find_by_name(dct_references_uri_key)
57
57
  hash[reference_type.reference_uri.to_s] = if reference_type.reference_uri.to_s == "http://schema.org/downloadUrl"
58
+ logger.debug("Asset#to_aardvark_reference > downloadUrl: #{full_file_url} > #{label.present? ? label : file.metadata["filename"]}")
59
+
58
60
  {
59
61
  "url" => full_file_url,
60
62
  "label" => label.present? ? label : file.metadata["filename"]
@@ -122,35 +122,35 @@ class Document < Kithe::Work
122
122
  # - Use distributable assets
123
123
  # @TODO: Remove BEFORE path once we've migrated to DocumentDistributions
124
124
  def distributions
125
- distributions = ActiveSupport::HashWithIndifferentAccess.new
125
+ distributions = {}
126
126
 
127
127
  # AFTER - Add DocumentDistributions to distributions
128
128
  if ENV["GBL_ADMIN_REFERENCES_MIGRATED"] == "true"
129
129
  distributions = document_distributions.to_aardvark_distributions
130
- end
131
-
132
- # BEFORE - Prep value arrays
133
- # @TODO: Remove this once we've migrated to DocumentDistributions
134
- send(GeoblacklightAdmin::Schema.instance.solr_fields[:reference]).each do |ref|
135
- if ref.category.present?
136
- distributions[Document::Reference::REFERENCE_VALUES[ref.category.to_sym][:uri]] = []
130
+ else
131
+ # BEFORE - Prep value arrays
132
+ # @TODO: Remove this once we've migrated to DocumentDistributions
133
+ send(GeoblacklightAdmin::Schema.instance.solr_fields[:reference]).each do |ref|
134
+ if ref.category.present?
135
+ distributions[Document::Reference::REFERENCE_VALUES[ref.category.to_sym][:uri]] = []
136
+ end
137
137
  end
138
- end
139
138
 
140
- # BEFORE - Seed value arrays
141
- # @TODO: Remove this once we've migrated to DocumentDistributions
142
- send(GeoblacklightAdmin::Schema.instance.solr_fields[:reference]).each do |ref|
143
- if ref.category.present?
144
- distributions[Document::Reference::REFERENCE_VALUES[ref.category.to_sym][:uri]] << ref.value
139
+ # BEFORE - Seed value arrays
140
+ # @TODO: Remove this once we've migrated to DocumentDistributions
141
+ send(GeoblacklightAdmin::Schema.instance.solr_fields[:reference]).each do |ref|
142
+ if ref.category.present?
143
+ distributions[Document::Reference::REFERENCE_VALUES[ref.category.to_sym][:uri]] << ref.value
144
+ end
145
145
  end
146
- end
147
- logger.debug("\n\nDocument#distributions > seeded: #{distributions}")
146
+ logger.debug("\n\nDocument#distributions > seeded: #{distributions}")
148
147
 
149
- # BEFORE - Apply Multiple Downloads
150
- # @TODO: Remove this once we've migrated to DocumentDistributions
151
- if ENV["GBL_ADMIN_REFERENCES_MIGRATED"] == "false"
152
- distributions = apply_downloads(distributions)
153
- logger.debug("Document#distributions > downloads: #{distributions}")
148
+ # BEFORE - Apply Multiple Downloads
149
+ # @TODO: Remove this once we've migrated to DocumentDistributions
150
+ if ENV["GBL_ADMIN_REFERENCES_MIGRATED"] == "false"
151
+ distributions = apply_downloads(distributions)
152
+ logger.debug("Document#distributions > downloads: #{distributions}")
153
+ end
154
154
  end
155
155
 
156
156
  # BEFORE & AFTER - Apply Distributable Assets
@@ -39,7 +39,7 @@ class DocumentDistribution < ApplicationRecord
39
39
  merged["http://schema.org/downloadUrl"] ||= []
40
40
  merged["http://schema.org/downloadUrl"] << {
41
41
  "url" => dist.values.first,
42
- "label" => dist[:label]
42
+ "label" => dist[:label].present? ? dist[:label] : dist.values.first
43
43
  }
44
44
  else
45
45
  merged[dist.keys.first] = dist.values.first
@@ -1,5 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GeoblacklightAdmin
4
- include GeoblacklightAdmin::IsoLanguageCodes
5
4
  end
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  json.data do
4
2
  json.array! @presenter.documents do |document|
5
3
  document_url = polymorphic_url(url_for_document(document))
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  json.links do
4
2
  json.self url_for(search_state.to_h.merge(only_path: false))
5
3
  json.prev url_for(search_state.to_h.merge(only_path: false, page: @response.prev_page.to_s)) if @response.prev_page
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  json.set!(field_name) do
4
2
  json.id "#{document_url}##{field_name}"
5
3
  json.type "document_value"
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  json.links do
4
2
  json.self url_for(search_state.to_h.merge(only_path: false))
5
3
  json.prev url_for(search_state.to_h.merge(only_path: false, page: @response.prev_page.to_s)) if @response.prev_page
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  json.links do
4
2
  json.self url_for(search_state.to_h.merge(only_path: false))
5
3
  json.prev url_for(search_state.to_h.merge(only_path: false, page: @response.prev_page.to_s)) if @response.prev_page
@@ -21,7 +21,7 @@ document.addEventListener('DOMContentLoaded', function() {
21
21
  const labelInput = document.getElementById('label-input');
22
22
 
23
23
  function toggleLabelInput() {
24
- if (distributionSelect.options[distributionSelect.selectedIndex].text === 'Download file') {
24
+ if (distributionSelect.options[distributionSelect.selectedIndex].text === 'Download') {
25
25
  labelInput.disabled = false;
26
26
  } else {
27
27
  labelInput.disabled = true;
@@ -18,8 +18,6 @@
18
18
  <% if params[:document_id] %>
19
19
  <h2 class='h3'>
20
20
  <%= link_to(@document.title, admin_document_path(@document)) %>
21
- &middot;
22
- <%= @document_distributions.count %> distributions
23
21
  </h2>
24
22
  <% else %>
25
23
  <h2 class='h3'>Distributions</h2>
@@ -34,7 +34,6 @@
34
34
  <% end %>
35
35
  <%= link_to admin_document_document_distributions_url(@document), class: "ml-2" do %>
36
36
  Distributions
37
- <span class="badge badge-light"><%= @document.distributions.size %></span>
38
37
  <% end %>
39
38
  <% end %>
40
39
  </nav>
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  # See GBL Aardvark Schema
4
2
  # https://docs.google.com/spreadsheets/d/1QQjUzRe8YdPGKK4h0GYoNPTow2zZ1f0KFA0zzZyHAsk/edit?ts=602d52f2#gid=252925024
5
3
 
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  # Required
4
2
  json.set! :gbl_mdVersion_s, "BTAA Aardvark"
5
3
 
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  # Required
4
2
  json.set! :gbl_mdVersion_s, "BTAA Aardvark"
5
3
 
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  # See OpenGeoMetadata Legacy Versions
4
2
  # https://opengeometadata.org/docs/gbl-1.0
5
3
 
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  json.ignore_nil!
4
2
 
5
3
  json.array! @documents.map do |document|
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  json.ignore_nil!
4
2
 
5
3
  json.array! @documents.map do |document|
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  json.ignore_nil!
4
2
 
5
3
  json.array! @documents.map do |document|
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  json.ignore_nil!
4
2
 
5
3
  json.array! @documents.map do |document|
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  json.ignore_nil!
4
2
 
5
3
  json.array! @documents.load_all.map do |document|
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  json.ignore_nil!
4
2
 
5
3
  json.array! @documents.load_all.map do |document|
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  json.ignore_nil!
4
2
 
5
3
  json.array! @documents.load_all.map do |document|
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  json.ignore_nil!
4
2
 
5
3
  json.array! @documents.load_all.map do |document|
@@ -1,3 +1 @@
1
- # frozen_string_literal: true
2
-
3
1
  json.partial! "json_aardvark", document: @document
@@ -1,3 +1 @@
1
- # frozen_string_literal: true
2
-
3
1
  json.partial! "json_btaa_aardvark", document: @document
@@ -1,3 +1 @@
1
- # frozen_string_literal: true
2
-
3
1
  json.partial! "json_gbl_v1", document: @document
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GeoblacklightAdmin
4
- VERSION = "0.6.0"
4
+ VERSION = "0.6.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geoblacklight_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Larson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-22 00:00:00.000000000 Z
11
+ date: 2024-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_storage_validations