Skip to content

Commit

Permalink
Merge branch 'feature/background-distribution-imports' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ewlarson committed Jan 15, 2025
2 parents 97681cb + 30d435c commit 5ac33ac
Show file tree
Hide file tree
Showing 5 changed files with 163 additions and 46 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript'
gem 'geoblacklight', '4.4'

# GBL Admin
gem 'geoblacklight_admin', "~> 0.6.0"
gem 'geoblacklight_admin', git: "https://github.com/geobtaa/geoblacklight_admin.git", branch: "feature/background-distribution-imports"
gem 'git', ">= 1.13"
gem "rubyzip", ">= 1.3.0"
gem "awesome_print"
Expand Down
91 changes: 47 additions & 44 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,45 @@ 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 @@ -127,7 +166,7 @@ GEM
faraday (>= 1.0, < 3.0)
faraday-net_http_persistent
net-http-persistent
amazing_print (1.6.0)
amazing_print (1.7.2)
ansi (1.5.0)
appsignal (4.3.2)
logger
Expand Down Expand Up @@ -235,7 +274,7 @@ GEM
config (4.2.1)
deep_merge (~> 1.2, >= 1.2.1)
dry-validation (~> 1.0, >= 1.0.0)
connection_pool (2.4.1)
connection_pool (2.5.0)
content_disposition (1.0.0)
crass (1.0.6)
csv (3.3.2)
Expand Down Expand Up @@ -366,39 +405,6 @@ GEM
rgeo-geojson
sprockets-rails (~> 3.0)
vite_rails (~> 3.0)
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)
geocoder (1.8.5)
base64 (>= 0.1.0)
csv (>= 3.0.0)
Expand Down Expand Up @@ -498,7 +504,7 @@ GEM
llhttp-ffi (0.5.0)
ffi-compiler (~> 1.0)
rake (~> 13.0)
logger (1.6.4)
logger (1.6.5)
loofah (2.24.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
Expand All @@ -510,10 +516,9 @@ GEM
net-imap
net-pop
net-smtp
marc (1.2.0)
marc (1.3.0)
nokogiri (~> 1.0)
rexml
scrub_rb (>= 1.0.1, < 2)
unf
marc-fastxmlwriter (1.1.0)
marc (~> 1.0)
marcel (1.0.4)
Expand All @@ -523,7 +528,7 @@ GEM
mime-types (3.6.0)
logger
mime-types-data (~> 3.2015)
mime-types-data (3.2024.1203)
mime-types-data (3.2025.0107)
mimemagic (0.4.3)
nokogiri (~> 1)
rake
Expand Down Expand Up @@ -713,7 +718,6 @@ GEM
sprockets (> 3.0)
sprockets-rails
tilt
scrub_rb (1.0.1)
sd_notify (0.1.1)
selenium-webdriver (4.27.0)
base64 (~> 0.2)
Expand Down Expand Up @@ -769,7 +773,7 @@ GEM
rails (>= 3.1)
thor (1.3.2)
thread_safe (0.3.6)
tilt (2.5.0)
tilt (2.6.0)
time (0.4.1)
date
timeout (0.4.3)
Expand Down Expand Up @@ -800,7 +804,6 @@ GEM
ethon (>= 0.8.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unf (0.2.0)
uri (1.0.2)
view_component (2.83.0)
activesupport (>= 5.2.0, < 8.0)
Expand Down Expand Up @@ -880,7 +883,7 @@ DEPENDENCIES
foreman
geoblacklight (= 4.4)
geoblacklight-icons!
geoblacklight_admin (~> 0.6.0)
geoblacklight_admin!
geoblacklight_sidecar_images!
git (>= 1.13)
haml
Expand Down
6 changes: 6 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@
patch :run, on: :member
end

# Import Distributions
resources :import_distributions do
resources :import_document_distributions, only: [:show]
patch :run, on: :member
end

# Elements
resources :elements do
post :sort, on: :collection
Expand Down
56 changes: 56 additions & 0 deletions db/migrate/20250113213655_import_distributions.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
class ImportDistributions < ActiveRecord::Migration[7.0]
def change
add_column :document_distributions, :import_distribution_id, :bigint

create_table :import_distributions do |t|
t.string :name
t.string :source
t.text :description
t.string :filename
t.integer :row_count
t.text :headers, default: [], array: true
t.string :encoding
t.string :content_type
t.string :extension
t.boolean :validity, default: false
t.text :validation_result

t.timestamps
end

create_table :import_distribution_transitions do |t|
t.string :to_state, null: false
t.text :metadata, default: "{}"
t.integer :sort_key, null: false
t.integer :import_distribution_id, null: false
t.boolean :most_recent, null: false
t.datetime :created_at, null: false
t.datetime :updated_at, null: false
t.index ["import_distribution_id", "most_recent"], name: "index_import_distribution_transitions_parent_most_recent", unique: true, where: "most_recent"
t.index ["import_distribution_id", "sort_key"], name: "index_import_distribution_transitions_parent_sort", unique: true
end

create_table :import_document_distributions do |t|
t.string :friendlier_id
t.string :reference_type
t.text :distribution_url
t.string :label
t.bigint :import_distribution_id, null: false
t.index ["import_distribution_id"], name: "index_import_distributions_on_import_distribution_id"

t.timestamps
end

create_table :import_document_distribution_transitions do |t|
t.string :to_state, null: false
t.text :metadata, default: "{}"
t.integer :sort_key, null: false
t.integer :import_document_distribution_id, null: false
t.boolean :most_recent, null: false
t.datetime :created_at, null: false
t.datetime :updated_at, null: false
t.index ["import_document_distribution_id", "most_recent"], name: "index_import_doc_distribution_transitions_parent_most_recent", unique: true, where: "most_recent"
t.index ["import_document_distribution_id", "sort_key"], name: "index_import_doc_distribution_transitions_parent_sort", unique: true
end
end
end
54 changes: 53 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.0].define(version: 2024_11_20_238823) do
ActiveRecord::Schema[7.0].define(version: 2025_01_13_213655) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
enable_extension "plpgsql"
Expand Down Expand Up @@ -237,6 +237,7 @@
t.integer "position"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.bigint "import_distribution_id"
t.index ["friendlier_id", "reference_type_id", "url"], name: "document_references_unique_index", unique: true
t.index ["reference_type_id"], name: "index_document_distributions_on_reference_type_id"
end
Expand Down Expand Up @@ -323,6 +324,57 @@
t.index ["solr_document_sidecar_id"], name: "index_image_upload_transitions_on_solr_document_sidecar_id"
end

create_table "import_distribution_transitions", force: :cascade do |t|
t.string "to_state", null: false
t.text "metadata", default: "{}"
t.integer "sort_key", null: false
t.integer "import_distribution_id", null: false
t.boolean "most_recent", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["import_distribution_id", "most_recent"], name: "index_import_distribution_transitions_parent_most_recent", unique: true, where: "most_recent"
t.index ["import_distribution_id", "sort_key"], name: "index_import_distribution_transitions_parent_sort", unique: true
end

create_table "import_distributions", force: :cascade do |t|
t.string "name"
t.string "source"
t.text "description"
t.string "filename"
t.integer "row_count"
t.text "headers", default: [], array: true
t.string "encoding"
t.string "content_type"
t.string "extension"
t.boolean "validity", default: false
t.text "validation_result"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

create_table "import_document_distribution_transitions", force: :cascade do |t|
t.string "to_state", null: false
t.text "metadata", default: "{}"
t.integer "sort_key", null: false
t.integer "import_document_distribution_id", null: false
t.boolean "most_recent", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["import_document_distribution_id", "most_recent"], name: "index_import_doc_distribution_transitions_parent_most_recent", unique: true, where: "most_recent"
t.index ["import_document_distribution_id", "sort_key"], name: "index_import_doc_distribution_transitions_parent_sort", unique: true
end

create_table "import_document_distributions", force: :cascade do |t|
t.string "friendlier_id"
t.string "reference_type"
t.text "distribution_url"
t.string "label"
t.bigint "import_distribution_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["import_distribution_id"], name: "index_import_distributions_on_import_distribution_id"
end

create_table "import_document_transitions", force: :cascade do |t|
t.string "to_state", null: false
t.text "metadata", default: "{}"
Expand Down

0 comments on commit 5ac33ac

Please sign in to comment.