Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Upgrade Rails to 7 #728

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,4 @@ yarn-debug.log*
/storage/*
!/storage/.keep
all_sorns.code-workspace
vendor/javascript
14 changes: 4 additions & 10 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '~> 3.2'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 7.0.0'

# We need to use rails 6-1.stable to get around a problem with good_job:
# https://github.com/bensheldon/good_job/issues/1016#issuecomment-1644915406
gem 'rails', github: "rails/rails", branch: '6-1-stable'
# gem 'rails', '~> 6.1', '>= 6.1.7.8'
gem 'importmap-rails', '~> 2.0'
gem 'turbo-rails'
gem 'good_job', '~> 4.0'
gem 'pg'
gem 'httparty'
Expand All @@ -27,8 +25,6 @@ gem 'csv'
gem 'puma', '~> 6.4'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 6.0'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 5.4', '>= 5.4.4'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.12'

Expand Down Expand Up @@ -58,8 +54,6 @@ end
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '~> 3.40'
gem 'selenium-webdriver'
# Easy installation and use of web drivers to run system tests with browsers
gem 'webdrivers', '~> 5.3'
gem 'selenium-webdriver', '~> 4.22'
gem 'launchy'
end
174 changes: 85 additions & 89 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,97 +1,73 @@
GIT
remote: https://github.com/rails/rails.git
revision: 959037fa483f4fa65a06f61db9653381d51f073b
branch: 6-1-stable
GEM
remote: https://rubygems.org/
specs:
actioncable (6.1.7.8)
actionpack (= 6.1.7.8)
activesupport (= 6.1.7.8)
actioncable (7.0.8.4)
actionpack (= 7.0.8.4)
activesupport (= 7.0.8.4)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.7.8)
actionpack (= 6.1.7.8)
activejob (= 6.1.7.8)
activerecord (= 6.1.7.8)
activestorage (= 6.1.7.8)
activesupport (= 6.1.7.8)
actionmailbox (7.0.8.4)
actionpack (= 7.0.8.4)
activejob (= 7.0.8.4)
activerecord (= 7.0.8.4)
activestorage (= 7.0.8.4)
activesupport (= 7.0.8.4)
mail (>= 2.7.1)
actionmailer (6.1.7.8)
actionpack (= 6.1.7.8)
actionview (= 6.1.7.8)
activejob (= 6.1.7.8)
activesupport (= 6.1.7.8)
net-imap
net-pop
net-smtp
actionmailer (7.0.8.4)
actionpack (= 7.0.8.4)
actionview (= 7.0.8.4)
activejob (= 7.0.8.4)
activesupport (= 7.0.8.4)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (6.1.7.8)
actionview (= 6.1.7.8)
activesupport (= 6.1.7.8)
racc
rack (~> 2.0, >= 2.0.9)
actionpack (7.0.8.4)
actionview (= 7.0.8.4)
activesupport (= 7.0.8.4)
rack (~> 2.0, >= 2.2.4)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.1.7.8)
actionpack (= 6.1.7.8)
activerecord (= 6.1.7.8)
activestorage (= 6.1.7.8)
activesupport (= 6.1.7.8)
actiontext (7.0.8.4)
actionpack (= 7.0.8.4)
activerecord (= 7.0.8.4)
activestorage (= 7.0.8.4)
activesupport (= 7.0.8.4)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (6.1.7.8)
activesupport (= 6.1.7.8)
actionview (7.0.8.4)
activesupport (= 7.0.8.4)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.1.7.8)
activesupport (= 6.1.7.8)
activejob (7.0.8.4)
activesupport (= 7.0.8.4)
globalid (>= 0.3.6)
activemodel (6.1.7.8)
activesupport (= 6.1.7.8)
activerecord (6.1.7.8)
activemodel (= 6.1.7.8)
activesupport (= 6.1.7.8)
activestorage (6.1.7.8)
actionpack (= 6.1.7.8)
activejob (= 6.1.7.8)
activerecord (= 6.1.7.8)
activesupport (= 6.1.7.8)
activemodel (7.0.8.4)
activesupport (= 7.0.8.4)
activerecord (7.0.8.4)
activemodel (= 7.0.8.4)
activesupport (= 7.0.8.4)
activestorage (7.0.8.4)
actionpack (= 7.0.8.4)
activejob (= 7.0.8.4)
activerecord (= 7.0.8.4)
activesupport (= 7.0.8.4)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (6.1.7.8)
base64
bigdecimal
activesupport (7.0.8.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
rails (6.1.7.8)
actioncable (= 6.1.7.8)
actionmailbox (= 6.1.7.8)
actionmailer (= 6.1.7.8)
actionpack (= 6.1.7.8)
actiontext (= 6.1.7.8)
actionview (= 6.1.7.8)
activejob (= 6.1.7.8)
activemodel (= 6.1.7.8)
activerecord (= 6.1.7.8)
activestorage (= 6.1.7.8)
activesupport (= 6.1.7.8)
bundler (>= 1.15.0)
railties (= 6.1.7.8)
sprockets-rails (>= 2.0.0)
railties (6.1.7.8)
actionpack (= 6.1.7.8)
activesupport (= 6.1.7.8)
method_source
rake (>= 12.2)
thor (~> 1.0)

GEM
remote: https://rubygems.org/
specs:
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
base64 (0.2.0)
Expand Down Expand Up @@ -151,6 +127,10 @@ GEM
multi_xml (>= 0.5.2)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
importmap-rails (2.0.1)
actionpack (>= 6.0.0)
activesupport (>= 6.0.0)
railties (>= 6.0.0)
interception (0.5)
jbuilder (2.12.0)
actionview (>= 5.0.0)
Expand All @@ -173,6 +153,7 @@ GEM
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.6.0)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
Expand Down Expand Up @@ -226,17 +207,36 @@ GEM
raabro (1.4.0)
racc (1.8.0)
rack (2.2.9)
rack-proxy (0.7.7)
rack
rack-test (2.1.0)
rack (>= 1.3)
rails (7.0.8.4)
actioncable (= 7.0.8.4)
actionmailbox (= 7.0.8.4)
actionmailer (= 7.0.8.4)
actionpack (= 7.0.8.4)
actiontext (= 7.0.8.4)
actionview (= 7.0.8.4)
activejob (= 7.0.8.4)
activemodel (= 7.0.8.4)
activerecord (= 7.0.8.4)
activestorage (= 7.0.8.4)
activesupport (= 7.0.8.4)
bundler (>= 1.15.0)
railties (= 7.0.8.4)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.0.8.4)
actionpack (= 7.0.8.4)
activesupport (= 7.0.8.4)
method_source
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
Expand Down Expand Up @@ -276,11 +276,12 @@ GEM
scenic (1.8.0)
activerecord (>= 4.0.0)
railties (>= 4.0.0)
selenium-webdriver (4.10.0)
selenium-webdriver (4.22.0)
base64 (~> 0.2)
logger (~> 1.4)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
semantic_range (3.0.0)
spring (4.2.1)
spring-watcher-listen (2.1.0)
listen (>= 2.7, < 4.0)
Expand All @@ -296,23 +297,18 @@ GEM
thor (1.3.1)
tilt (2.3.0)
timeout (0.4.1)
turbo-rails (2.0.5)
actionpack (>= 6.0.0)
activejob (>= 6.0.0)
railties (>= 6.0.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
web-console (4.2.1)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webdrivers (5.3.1)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (~> 4.0, < 4.11)
webpacker (5.4.4)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
websocket (1.2.10)
websocket (1.2.11)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
Expand All @@ -335,6 +331,7 @@ DEPENDENCIES
federal_register (~> 0.7)
good_job (~> 4.0)
httparty
importmap-rails (~> 2.0)
jbuilder (~> 2.12)
kaminari (~> 1.2)
launchy
Expand All @@ -346,18 +343,17 @@ DEPENDENCIES
pry-rescue
pry-stack_explorer
puma (~> 6.4)
rails!
rails (~> 7.0.0)
rexml
rspec-rails (~> 6.1)
sass-rails (~> 6.0)
saxerator
scenic (~> 1.8)
selenium-webdriver
selenium-webdriver (~> 4.22)
spring
spring-watcher-listen (~> 2.1.0)
turbo-rails
web-console (>= 4.2.1)
webdrivers (~> 5.3)
webpacker (~> 5.4, >= 5.4.4)

RUBY VERSION
ruby 3.2.2p53
Expand Down
5 changes: 5 additions & 0 deletions app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
//= link_tree ../images
//= link_directory ../stylesheets .css
//= link_tree ../../javascript .js
//= link_tree ../../../vendor/javascript .js
//= link beforeSearch.js
//= link list.js/dist/list.js
//= link string-natural-compare/natural-compare.js
12 changes: 12 additions & 0 deletions app/javascript/application.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
// import "@hotwired/turbo-rails"
// import 'jquery';

import Rails from "@rails/ujs";
Rails.start();

window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-QZ9W5STPKJ');
22 changes: 0 additions & 22 deletions app/javascript/packs/application.js

This file was deleted.

4 changes: 3 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
<html lang="en">
<head>
<title><%= @title%>SORNS Dash</title>
<%= javascript_importmap_tags %>
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uswds/2.9.0/css/uswds.min.css" integrity="sha512-1JfROzJI5km8+inC3KrHAsJ4Ufjl2nD7/TbCBXoMUeXi0LIAZntfLQr2S6ifV0lCuO0mWOOlNJNTgKzkj7b7wA==" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/uswds/2.9.0/js/uswds.min.js" integrity="sha512-DK4Dfv782z/2seHu61hJL5WvFg95vZ64fKsqzeV7vTNcx01Ajp1kq5+w0QUNQ6GSakYyj6Mw0LZ/ddL5rNVMYQ==" crossorigin="anonymous"></script>
Expand All @@ -15,7 +18,6 @@
<script async src="https://www.googletagmanager.com/gtag/js?id=G-QZ9W5STPKJ"></script>

<%= stylesheet_link_tag 'application', media: 'all' %>
<%= javascript_pack_tag 'application' %>

<%= content_for :search %>
</head>
Expand Down
4 changes: 2 additions & 2 deletions app/views/search/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% content_for :search do %>
<%= javascript_pack_tag 'beforeSearch' %>
<%= javascript_include_tag 'beforeSearch', type: "module" %>
<% end %>

<header id="search-header" class="margin-top-2 home-intro">
Expand All @@ -12,7 +12,7 @@
</header>

<section class="grid-container">
<%= form_with local: false, url: search_path, method: "GET", id: "search-form", class: (params[:search].present? ? '' : 'pre-search') do %>
<%= form_with data: {turbo: false}, local: false, url: search_path, method: "GET", id: "search-form", class: (params[:search].present? ? '' : 'pre-search') do %>
<div class="desktop:grid-col-10 desktop:grid-offset-1 search-area">
<label for="general-search">Search for SORNs by entering a keyword (will return exact matches)</label>
<fieldset class="usa-search usa-search--big">
Expand Down
Loading
Loading