Skip to content

Commit

Permalink
Merge branch 'release/5.13.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
ewlarson committed Jan 17, 2025
2 parents 597fbe3 + 7c9bcdd commit cd63844
Show file tree
Hide file tree
Showing 11 changed files with 3,173 additions and 2,915 deletions.
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 7.0.0'
gem 'concurrent-ruby', '1.3.4'
gem 'bootsnap', '~> 1.9.3', require: false
gem 'listen', '~> 3.0'

Expand Down Expand Up @@ -82,7 +83,7 @@ gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript'
gem 'geoblacklight', '4.4'

# GBL Admin
gem 'geoblacklight_admin', git: "https://github.com/geobtaa/geoblacklight_admin.git", branch: "feature/background-distribution-imports"
gem 'geoblacklight_admin', '~> 0.7.0'
gem 'git', ">= 1.13"
gem "rubyzip", ">= 1.3.0"
gem "awesome_print"
Expand Down
91 changes: 43 additions & 48 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -41,45 +41,6 @@ GIT
rails (>= 5.2, < 8.0)
statesman (>= 3.4)

GIT
remote: https://github.com/geobtaa/geoblacklight_admin.git
revision: e2006c9923fae57a7beb7d066d6c6d763cedac75
branch: feature/background-distribution-imports
specs:
geoblacklight_admin (0.6.3)
active_storage_validations (~> 1.0)
amazing_print
blacklight (~> 7.33)
blacklight_advanced_search
blacklight_range_limit
bootstrap (~> 4.0)
chosen-rails (~> 1.10)
cocoon (~> 1.2)
config (~> 4.0)
devise (~> 4.7)
devise-bootstrap-views (~> 1.0)
dotenv-rails (~> 2.8)
geoblacklight (~> 4.4)
haml (~> 5.2)
httparty (~> 0.21)
inline_svg (~> 1.9)
jquery-rails (~> 4.4)
kithe (~> 2.0)
mutex_m (~> 0.2.0)
noticed (~> 1.6)
pagy (~> 6.0)
paper_trail (~> 15.0)
pg (~> 1.4)
qa (~> 5.0)
rails (~> 7.0, < 7.3)
ruby-progressbar
simple_form (~> 5.0)
sprockets (~> 3.0)
statesman (~> 12.0)
vite_rails (~> 3.0)
vite_ruby (>= 3.5)
zeitwerk (~> 2.6)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -177,20 +138,20 @@ GEM
execjs (~> 2)
awesome_print (1.9.2)
aws-eventstream (1.3.0)
aws-partitions (1.1031.0)
aws-sdk-core (3.214.1)
aws-partitions (1.1038.0)
aws-sdk-core (3.216.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.96.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sdk-kms (1.97.0)
aws-sdk-core (~> 3, >= 3.216.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.177.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sdk-s3 (1.178.0)
aws-sdk-core (~> 3, >= 3.216.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.10.1)
aws-sigv4 (1.11.0)
aws-eventstream (~> 1, >= 1.0.2)
axe-core-api (4.10.2)
dumb_delegator
Expand Down Expand Up @@ -405,6 +366,39 @@ GEM
rgeo-geojson
sprockets-rails (~> 3.0)
vite_rails (~> 3.0)
geoblacklight_admin (0.7.0)
active_storage_validations (~> 1.0)
amazing_print
blacklight (~> 7.33)
blacklight_advanced_search
blacklight_range_limit
bootstrap (~> 4.0)
chosen-rails (~> 1.10)
cocoon (~> 1.2)
config (~> 4.0)
devise (~> 4.7)
devise-bootstrap-views (~> 1.0)
dotenv-rails (~> 2.8)
geoblacklight (~> 4.4)
haml (~> 5.2)
httparty (~> 0.21)
inline_svg (~> 1.9)
jquery-rails (~> 4.4)
kithe (~> 2.0)
mutex_m (~> 0.2.0)
noticed (~> 1.6)
pagy (~> 6.0)
paper_trail (~> 15.0)
pg (~> 1.4)
qa (~> 5.0)
rails (~> 7.0, < 7.3)
ruby-progressbar
simple_form (~> 5.0)
sprockets (~> 3.0)
statesman (~> 12.0)
vite_rails (~> 3.0)
vite_ruby (>= 3.5)
zeitwerk (~> 2.6)
geocoder (1.8.5)
base64 (>= 0.1.0)
csv (>= 3.0.0)
Expand Down Expand Up @@ -762,7 +756,7 @@ GEM
sprockets (>= 3.0.0)
sqlite3 (1.7.3)
mini_portile2 (~> 2.8.0)
stackprof (0.2.26)
stackprof (0.2.27)
statesman (12.1.0)
stimulus-rails (1.3.4)
railties (>= 6.0.0)
Expand Down Expand Up @@ -871,6 +865,7 @@ DEPENDENCIES
chosen-rails (~> 1.10)
chronic
coffee-rails (~> 4.2)
concurrent-ruby (= 1.3.4)
database_cleaner
devise (~> 4.0)
devise-bootstrap-views (~> 1.0)
Expand All @@ -883,7 +878,7 @@ DEPENDENCIES
foreman
geoblacklight (= 4.4)
geoblacklight-icons!
geoblacklight_admin!
geoblacklight_admin (~> 0.7.0)
geoblacklight_sidecar_images!
git (>= 1.13)
haml
Expand Down
11 changes: 11 additions & 0 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ class CatalogController < ApplicationController
# Custom tools for GeoBlacklight
config.add_show_tools_partial :more_details, partial: 'more_details', if: proc { |_context, _config, options| options[:document] && (!options[:document].references.nil? & !options[:document].references.url.nil?)}
config.add_show_tools_partial :metadata, if: proc { |_context, _config, options| options[:document] && (Settings.METADATA_SHOWN & options[:document].references.refs.map(&:type).map(&:to_s)).any? }
config.add_show_tools_partial :gbl_admin_data_dictionaries, partial: 'gbl_admin_data_dictionaries', if: proc { |_context, _config, options| options[:document] && options[:document]&.kithe_model&.document_data_dictionaries&.present? }
config.add_show_tools_partial :arcgis, partial: 'arcgis', if: proc { |_context, _config, options| options[:document] && options[:document].arcgis_urls.present? }
config.add_show_tools_partial :data_dictionary, partial: 'data_dictionary', if: proc { |_context, _config, options| options[:document] && options[:document].data_dictionary_download.present? }
config.add_show_tools_partial(:citation, if: proc { |_context, _config, options| options[:document] && (options[:document].resource_class != 'Collections')})
Expand Down Expand Up @@ -378,6 +379,16 @@ def web_services
end
end

def data_dictionaries
@response, @documents = action_documents
respond_to do |format|
format.html do
return render layout: false if request.xhr?
# Otherwise draw the full page
end
end
end

# Administrative view of document
# - Sidecar Image
# - URIs
Expand Down
7 changes: 4 additions & 3 deletions app/views/catalog/_access_links.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

%div.access-links.list-group
- b1g_access_links(@document).sort.each do |key,value|
%a.list-group-item.list-group-item-action{href:value}
= blacklight_icon(key.parameterize)
= key
- if key.present?
%a.list-group-item.list-group-item-action{href:value}
= blacklight_icon(key.parameterize)
= key
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module.exports = function(api) {
[
require('@babel/plugin-proposal-class-properties').default,
{
loose: true
loose: false
}
],
[
Expand Down
82 changes: 23 additions & 59 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@
get 'feedback' => 'feedback_forms#new'

concern :gbl_exportable, Geoblacklight::Routes::Exportable.new
concern :gbl_admin_data_dictionariesable, GeoblacklightAdmin::Routes::DataDictionariesable.new

resources :solr_documents, only: [:show], path: '/catalog', controller: 'catalog' do
concerns :gbl_exportable
concerns :gbl_admin_data_dictionariesable
end

concern :gbl_wms, Geoblacklight::Routes::Wms.new
Expand Down Expand Up @@ -219,6 +222,25 @@
end
end

# Data Dictionaries
resources :document_data_dictionaries, path: "data_dictionaries" do
collection do
get "import"
post "import"

get "destroy_all"
post "destroy_all"
end

resources :document_data_dictionary_entries, path: "entries" do
collection do
post "sort"
get "destroy_all"
post "destroy_all"
end
end
end

# DocumentDownloads
resources :document_downloads, path: "downloads" do
collection do
Expand Down Expand Up @@ -296,7 +318,7 @@
# DocumentAssets
get "/documents/:id/ingest", to: "document_assets#display_attach_form", as: "asset_ingest"
post "/documents/:id/ingest", to: "document_assets#attach_files"

# Asset Direct Upload
mount Kithe::AssetUploader.upload_endpoint(:cache) => "/direct_upload", :as => :direct_app_upload

Expand Down Expand Up @@ -344,62 +366,4 @@
get '/blog/2019/02/28/featured-item-map-of-the-nimrod-glacier.html', :to => redirect('https://sites.google.com/umn.edu/btaa-gdp/news/2019/02/28-featured-item-map-of-the-nimrod-glacier?authuser=0')
get '/blog/2019/03/19/contributor-spotlight-iowa.html', :to => redirect('https://sites.google.com/umn.edu/btaa-gdp/news/2019/03/19-contributor-spotlight-iowa?authuser=0')
get '/blog/2019/03/19/featured-collection-dc-open-data.html', :to => redirect('https://sites.google.com/umn.edu/btaa-gdp/news/2019/03/19-featured-collection-dc-open-data?authuser=0')


# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".

# You can have the root of your site routed with "root"
# root 'welcome#index'

# Example of regular route:
# get 'products/:id' => 'catalog#view'

# Example of named route that can be invoked with purchase_url(id: product.id)
# get 'products/:id/purchase' => 'catalog#purchase', as: :purchase

# Example resource route (maps HTTP verbs to controller actions automatically):
# resources :products

# Example resource route with options:
# resources :products do
# member do
# get 'short'
# post 'toggle'
# end
#
# collection do
# get 'sold'
# end
# end

# Example resource route with sub-resources:
# resources :products do
# resources :comments, :sales
# resource :seller
# end

# Example resource route with more complex sub-resources:
# resources :products do
# resources :comments
# resources :sales do
# get 'recent', on: :collection
# end
# end

# Example resource route with concerns:
# concern :toggleable do
# post 'toggle'
# end
# resources :posts, concerns: :toggleable
# resources :photos, concerns: :toggleable

# Example resource route within a namespace:
# namespace :admin do
# # Directs /admin/products/* to Admin::ProductsController
# # (app/controllers/admin/products_controller.rb)
# resources :products
# end

# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
end
14 changes: 14 additions & 0 deletions db/migrate/20241204163117_create_document_data_dictionaries.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class CreateDocumentDataDictionaries < ActiveRecord::Migration[7.0]
def change
create_table :document_data_dictionaries do |t|
t.string :friendlier_id
t.string :name
t.text :description
t.text :staff_notes
t.string :tags, limit: 4096, default: "", null: false
t.integer :position

t.timestamps
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
class CreateDocumentDataDictionaryEntries < ActiveRecord::Migration[7.0]
def change
create_table :document_data_dictionary_entries do |t|
t.references :document_data_dictionary,
null: false,
foreign_key: true,
index: { name: "idx_data_dict_entries_doc_dict_id" }

t.string :friendlier_id
t.string :field_name
t.string :field_type
t.string :values
t.string :definition
t.string :definition_source
t.string :parent_field_name
t.integer :position

t.timestamps
end
end
end
27 changes: 27 additions & 0 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,32 @@
t.datetime "updated_at", null: false
end

create_table "document_data_dictionaries", force: :cascade do |t|
t.string "friendlier_id"
t.string "name"
t.text "description"
t.text "staff_notes"
t.string "tags", limit: 4096, default: "", null: false
t.integer "position"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

create_table "document_data_dictionary_entries", force: :cascade do |t|
t.bigint "document_data_dictionary_id", null: false
t.string "friendlier_id"
t.string "field_name"
t.string "field_type"
t.string "values"
t.string "definition"
t.string "definition_source"
t.string "parent_field_name"
t.integer "position"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["document_data_dictionary_id"], name: "idx_data_dict_entries_doc_dict_id"
end

create_table "document_distributions", force: :cascade do |t|
t.string "friendlier_id", null: false
t.bigint "reference_type_id", null: false
Expand Down Expand Up @@ -609,6 +635,7 @@
add_foreign_key "bulk_action_document_transitions", "bulk_action_documents"
add_foreign_key "bulk_action_documents", "bulk_actions"
add_foreign_key "bulk_action_transitions", "bulk_actions"
add_foreign_key "document_data_dictionary_entries", "document_data_dictionaries"
add_foreign_key "document_distributions", "reference_types"
add_foreign_key "image_upload_transitions", "solr_document_sidecars"
add_foreign_key "import_document_transitions", "import_documents"
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
},
"dependencies": {
"@babel/cli": "^7.5.5",
"@babel/helper-simple-access": "^7.25.9",
"@babel/helpers": "^7.22.15",
"@babel/plugin-proposal-private-methods": "^7.18.6",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
Expand Down
Loading

0 comments on commit cd63844

Please sign in to comment.