Skip to content

Commit

Permalink
Merge branch 'main' into contributor-autocomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorcorrea authored Feb 4, 2025
2 parents 7aed1aa + 20f1422 commit a8170b3
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 92 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ gem "net-imap"
gem "net-pop"
gem "net-ssh", "7.0.0.beta1"
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main'
gem "actioncable"
gem "rails"
# Use sqlite3 as the database for Active Record
gem "pg"
Expand Down
101 changes: 38 additions & 63 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,22 @@ GEM
specs:
aasm (5.5.0)
concurrent-ruby (~> 1.0)
actioncable (7.2.1.1)
actionpack (= 7.2.1.1)
activesupport (= 7.2.1.1)
actioncable (7.2.2.1)
actionpack (= 7.2.2.1)
activesupport (= 7.2.2.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.2.1.1)
actionpack (= 7.2.1.1)
activejob (= 7.2.1.1)
activerecord (= 7.2.1.1)
activestorage (= 7.2.1.1)
activesupport (= 7.2.1.1)
mail (>= 2.8.0)
actionmailer (7.2.1.1)
actionpack (= 7.2.1.1)
actionview (= 7.2.1.1)
activejob (= 7.2.1.1)
activesupport (= 7.2.1.1)
actionmailer (7.2.2.1)
actionpack (= 7.2.2.1)
actionview (= 7.2.2.1)
activejob (= 7.2.2.1)
activesupport (= 7.2.2.1)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (7.2.1.1)
actionview (= 7.2.1.1)
activesupport (= 7.2.1.1)
actionpack (7.2.2.1)
actionview (= 7.2.2.1)
activesupport (= 7.2.2.1)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4, < 3.2)
Expand All @@ -54,36 +47,24 @@ GEM
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
useragent (~> 0.16)
actiontext (7.2.1.1)
actionpack (= 7.2.1.1)
activerecord (= 7.2.1.1)
activestorage (= 7.2.1.1)
activesupport (= 7.2.1.1)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.2.1.1)
activesupport (= 7.2.1.1)
actionview (7.2.2.1)
activesupport (= 7.2.2.1)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.2.1.1)
activesupport (= 7.2.1.1)
activejob (7.2.2.1)
activesupport (= 7.2.2.1)
globalid (>= 0.3.6)
activemodel (7.2.1.1)
activesupport (= 7.2.1.1)
activerecord (7.2.1.1)
activemodel (= 7.2.1.1)
activesupport (= 7.2.1.1)
activemodel (7.2.2.1)
activesupport (= 7.2.2.1)
activerecord (7.2.2.1)
activemodel (= 7.2.2.1)
activesupport (= 7.2.2.1)
timeout (>= 0.4.0)
activestorage (7.2.1.1)
actionpack (= 7.2.1.1)
activejob (= 7.2.1.1)
activerecord (= 7.2.1.1)
activesupport (= 7.2.1.1)
marcel (~> 1.0)
activesupport (7.2.1.1)
activesupport (7.2.2.1)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
Expand Down Expand Up @@ -130,6 +111,7 @@ GEM
bcrypt (3.1.20)
bcrypt_pbkdf (1.1.1)
bcrypt_pbkdf (1.1.1-x86_64-darwin)
benchmark (0.4.0)
bigdecimal (3.1.8)
bindex (0.8.1)
bixby (5.0.2)
Expand Down Expand Up @@ -238,6 +220,8 @@ GEM
websocket-driver (>= 0.5.1)
ffaker (2.23.0)
ffi (1.17.0)
ffi (1.17.0-x86_64-darwin)
ffi (1.17.0-x86_64-linux-gnu)
foreman (0.88.1)
friendly_id (5.4.2)
activerecord (>= 4.0.0)
Expand Down Expand Up @@ -275,7 +259,7 @@ GEM
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.6.1)
logger (1.6.2)
loofah (2.23.1)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
Expand All @@ -293,15 +277,14 @@ GEM
sinatra (~> 3.2)
sqlite3 (~> 1.3)
thin (~> 1.8)
marcel (1.0.4)
matrix (0.4.2)
method_source (1.1.0)
mime-types (3.5.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2024.0903)
mini_mime (1.1.5)
mini_portile2 (2.8.8)
minitest (5.25.1)
minitest (5.25.4)
msgpack (1.7.2)
mustermann (3.0.3)
ruby2_keywords (~> 0.0.1)
Expand Down Expand Up @@ -376,20 +359,11 @@ GEM
rackup (1.0.1)
rack (< 3)
webrick
rails (7.2.1.1)
actioncable (= 7.2.1.1)
actionmailbox (= 7.2.1.1)
actionmailer (= 7.2.1.1)
actionpack (= 7.2.1.1)
actiontext (= 7.2.1.1)
actionview (= 7.2.1.1)
activejob (= 7.2.1.1)
activemodel (= 7.2.1.1)
activerecord (= 7.2.1.1)
activestorage (= 7.2.1.1)
activesupport (= 7.2.1.1)
bundler (>= 1.15.0)
railties (= 7.2.1.1)
rails (0.9.5)
actionmailer (>= 0.6.1)
actionpack (>= 1.4.0)
activerecord (>= 1.6.0)
rake (>= 0.4.15)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
Expand All @@ -401,9 +375,9 @@ GEM
rails-html-sanitizer (1.6.1)
loofah (~> 2.21)
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
railties (7.2.1.1)
actionpack (= 7.2.1.1)
activesupport (= 7.2.1.1)
railties (7.2.2.1)
actionpack (= 7.2.2.1)
activesupport (= 7.2.2.1)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
Expand Down Expand Up @@ -488,7 +462,7 @@ GEM
sprockets (> 3.0)
sprockets-rails
tilt
securerandom (0.3.1)
securerandom (0.4.0)
selenium-webdriver (4.24.0)
base64 (~> 0.2)
logger (~> 1.4)
Expand Down Expand Up @@ -554,7 +528,7 @@ GEM
concurrent-ruby (~> 1.0)
unicode-display_width (2.6.0)
uri (0.13.1)
useragent (0.16.10)
useragent (0.16.11)
virtus (2.0.0)
axiom-types (~> 0.1)
coercible (~> 1.0)
Expand Down Expand Up @@ -602,6 +576,7 @@ PLATFORMS

DEPENDENCIES
aasm
actioncable
amazing_print
aws-sdk-s3
axe-core-rspec
Expand Down
6 changes: 0 additions & 6 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# frozen_string_literal: true
class ApplicationController < ActionController::Base
# This is necessary only for localhost development, with storage configured for the filesystem,
# but it shouldn't cause problems in other environments that use S3.
# Including this concern lets the disk service generate URLs using
# the same host, protocol, and port as the current request.
include ActiveStorage::SetCurrent

protect_from_forgery with: :exception
before_action :authenticate_user!

Expand Down
3 changes: 0 additions & 3 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
config.cache_store = :null_store
end

# Store uploaded files on amazon (see config/storage.yml for options).
config.active_storage.service = :local

config.action_mailer.perform_caching = false

config.action_mailer.default_options = {
Expand Down
3 changes: 0 additions & 3 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX

# Store uploaded files on the local file system (see config/storage.yml for options).
config.active_storage.service = :local

# Mount Action Cable outside main process or domain.
# config.action_cable.mount_path = nil
# config.action_cable.url = 'wss://example.com/cable'
Expand Down
3 changes: 0 additions & 3 deletions config/environments/staging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX

# Store uploaded files on the local file system (see config/storage.yml for options).
config.active_storage.service = :local

# Mount Action Cable outside main process or domain.
# config.action_cable.mount_path = nil
# config.action_cable.url = 'wss://example.com/cable'
Expand Down
3 changes: 0 additions & 3 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@
# Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false

# Store uploaded files on the local file system in a temporary directory.
config.active_storage.service = :test

config.action_mailer.perform_caching = false

# Tell Action Mailer not to deliver emails to the real world.
Expand Down
4 changes: 0 additions & 4 deletions spec/controllers/works_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
Group.create_defaults
user
stub_datacite(host: "api.datacite.org", body: datacite_register_body(prefix: "10.34770"))
allow(ActiveStorage::PurgeJob).to receive(:new).and_call_original

stub_request(:get, /#{Regexp.escape('https://example-bucket.s3.amazonaws.com/us_covid_20')}.*\.csv/).to_return(status: 200, body: "", headers: {})
end
Expand Down Expand Up @@ -76,7 +75,6 @@
work.reload
expect(work.resource_type).to eq("Dataset")
expect(work.resource_type_general).to eq("Dataset")
expect(ActiveStorage::PurgeJob).not_to have_received(:new)
end

it "handles the reordering the creators on the update page" do
Expand Down Expand Up @@ -366,7 +364,6 @@

expect(saved_work.pre_curation_uploads.length).to eq(1)

expect(ActiveStorage::PurgeJob).not_to have_received(:new)
expect(fake_s3_service).to have_received(:delete_s3_object).with(s3_file1.key)
expect(fake_s3_service).to have_received(:delete_s3_object).with(s3_file3.key)
expect(fake_s3_service).not_to have_received(:delete_s3_object).with(s3_file2.key)
Expand Down Expand Up @@ -428,7 +425,6 @@
post :update, params: params_no_delete

expect(response).to redirect_to(work_path(work))
expect(ActiveStorage::PurgeJob).not_to have_received(:new)
end
end
end
Expand Down
2 changes: 0 additions & 2 deletions spec/controllers/works_wizard_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
Group.create_defaults
user
stub_datacite(host: "api.datacite.org", body: datacite_register_body(prefix: "10.34770"))
allow(ActiveStorage::PurgeJob).to receive(:new).and_call_original

stub_request(:get, /#{Regexp.escape('https://example-bucket.s3.amazonaws.com/us_covid_20')}.*\.csv/).to_return(status: 200, body: "", headers: {})
end
Expand Down Expand Up @@ -46,7 +45,6 @@
post(:update_wizard, params:)
expect(response.status).to be 302
expect(response.location).to eq "http://test.host/works/#{work.id}/update-additional"
expect(ActiveStorage::PurgeJob).not_to have_received(:new)
end

context "save and stay on page" do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
Group.create_defaults
user
stub_datacite(host: "api.datacite.org", body: datacite_register_body(prefix: "10.34770"))
allow(ActiveStorage::PurgeJob).to receive(:new).and_call_original

stub_request(:get, /#{Regexp.escape('https://example-bucket.s3.amazonaws.com/us_covid_20')}.*\.csv/).to_return(status: 200, body: "", headers: {})
end
Expand Down Expand Up @@ -45,7 +44,6 @@
patch(:update_additional_save, params:)
expect(response.status).to be 302
expect(response.location).to eq "http://test.host/works/#{work.id}/readme-select"
expect(ActiveStorage::PurgeJob).not_to have_received(:new)
end

context "save and stay on page" do
Expand Down
3 changes: 0 additions & 3 deletions spec/system/work_edit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
end

it "allows users to delete one of the uploads" do
allow(ActiveStorage::PurgeJob).to receive(:new).and_call_original
allow(fake_s3_service).to receive(:client_s3_files).and_return([contents1, contents2], [contents2])

expect(page).to have_content "Filename"
Expand All @@ -63,7 +62,6 @@
end

it "allows users to cancel the delete of one of the uploads" do
allow(ActiveStorage::PurgeJob).to receive(:new).and_call_original
allow(fake_s3_service).to receive(:client_s3_files).and_return([contents1, contents2], [contents2])

expect(page).to have_link "us_covid_2019.csv"
Expand All @@ -76,7 +74,6 @@
end

it "allows users to replace one of the uploads" do
allow(ActiveStorage::PurgeJob).to receive(:new).and_call_original
expect(page).to have_content "Filename"
expect(page).to have_content "Last Modified"
expect(page).to have_content "Size"
Expand Down

0 comments on commit a8170b3

Please sign in to comment.