Skip to content

Commit

Permalink
WIP - Turbo rails changes required for rails updated refs #15907
Browse files Browse the repository at this point in the history
  • Loading branch information
AshviniKabadi committed Aug 20, 2024
1 parent 1eac9fd commit f917035
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 12 deletions.
5 changes: 4 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ gem "sqlite3", "1.7.3"
# Use Puma as the app server
gem "puma", "5.6.8"
## Use SCSS for stylesheets
#gem 'sass-rails', '6.0.0'
gem 'sass-rails', '6.0.0'

# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '5.4.4'

# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
gem "turbo-rails"
Expand Down
16 changes: 13 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ GEM
http-cookie (~> 1.0)
http-form_data (~> 2.2)
llhttp-ffi (~> 0.5.0)
http-cookie (1.0.6)
http-cookie (1.0.7)
domain_name (~> 0.5)
http-form_data (2.3.0)
i18n (1.14.5)
Expand Down Expand Up @@ -274,7 +274,7 @@ GEM
mime-types-data (3.2024.0806)
mini_mime (1.1.5)
minitar (1.0.1)
minitest (5.24.1)
minitest (5.25.0)
msgpack (1.7.2)
multi_json (1.15.0)
mutex_m (0.2.0)
Expand Down Expand Up @@ -385,9 +385,11 @@ GEM
faraday (>= 0.9, < 3, != 2.0.0)
ruby-progressbar (1.13.0)
rubyzip (2.3.2)
sanitize (6.1.2)
sanitize (6.1.3)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
sass-rails (6.0.0)
sassc-rails (~> 2.1, >= 2.1.1)
sassc (2.4.0)
ffi (~> 1.9)
sassc-rails (2.1.2)
Expand All @@ -400,6 +402,7 @@ GEM
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
semantic_range (3.0.0)
slackistrano (4.0.2)
capistrano (>= 3.8.1)
solr_wrapper (4.0.2)
Expand Down Expand Up @@ -467,6 +470,11 @@ GEM
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)
webrick (1.8.1)
websocket (1.2.11)
websocket-driver (0.7.6)
Expand Down Expand Up @@ -517,6 +525,7 @@ DEPENDENCIES
rack-mini-profiler (= 2.3.4)
rails (= 7.1.3.4)
rsolr (= 2.6.0)
sass-rails (= 6.0.0)
selenium-webdriver (= 4.10.0)
slackistrano (= 4.0.2)
solr_wrapper (= 4.0.2)
Expand All @@ -529,6 +538,7 @@ DEPENDENCIES
tzinfo-data
web-console (= 4.2.1)
webdrivers (= 5.3.1)
webpacker (= 5.4.4)

RUBY VERSION
ruby 3.2.2p53
Expand Down
5 changes: 3 additions & 2 deletions app/javascript/packs/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
// that code so it'll be compiled.

import Rails from "@rails/ujs"
import Turbolinks from "turbolinks"
//import Turbolinks from "turbolinks"
import { Turbo } from "@hotwired/turbo-rails"
import * as ActiveStorage from "@rails/activestorage"
import "channels"

Rails.start()
Turbolinks.start()
Turbo.start();
ActiveStorage.start()
4 changes: 2 additions & 2 deletions app/mailers/application_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class ApplicationMailer < ActionMailer::Base
default from: '[email protected]'
layout 'mailer'
default from: "[email protected]"
layout "mailer"
end
5 changes: 3 additions & 2 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
<%= csrf_meta_tags %>
<%= csp_meta_tag %>

<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
<%= stylesheet_link_tag "application", "data-turbolinks-track": "reload" %>
<%= javascript_pack_tag "application", "data-turbolinks-track": "reload" %>
<%= javascript_tag '$.fx.off = true;' if Rails.env.test? %>
<%= javascript_importmap_tags %>
</head>

<body>
Expand Down
4 changes: 2 additions & 2 deletions app/views/layouts/blacklight/base.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ https://github.com/projectblacklight/blacklight/blob/main/app/views/layouts/blac
</head>
<body class="<%= render_body_class %> d-flex flex-column h-100">
<nav id="skip-link" role="navigation" aria-label="<%= t('blacklight.skip_links.label') %>">
<%= link_to t('blacklight.skip_links.search_field'), '#search_field', class: 'element-invisible element-focusable rounded-bottom py-2 px-3', data: { turbolinks: 'false' } %>
<%= link_to t('blacklight.skip_links.main_content'), '#main-container', class: 'element-invisible element-focusable rounded-bottom py-2 px-3', data: { turbolinks: 'false' } %>
<%= link_to t('blacklight.skip_links.search_field'), '#search_field', class: 'element-invisible element-focusable rounded-bottom py-2 px-3', data: { turbo: 'false' } %>
<%= link_to t('blacklight.skip_links.main_content'), '#main-container', class: 'element-invisible element-focusable rounded-bottom py-2 px-3', data: { turbo: 'false' } %>
<%= content_for(:skip_links) %>
</nav>
<%= render partial: 'shared/header_navbar' %>
Expand Down
1 change: 1 addition & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,6 @@

# Raise error when a before_action's only/except options reference missing actions
config.action_controller.raise_on_missing_callback_actions = true
config.hosts = ["geo.lndo.site"]

end
2 changes: 2 additions & 0 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@
config.active_record.dump_schema_after_migration = false

# Enable DNS rebinding protection and other `Host` header attacks.
# config.hosts << "geo.lndo.site"
config.hosts = ["geo.lndo.site"]
# config.hosts = [
# "example.com", # Allow requests from example.com
# /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
Expand Down
1 change: 1 addition & 0 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,5 @@

# Raise error when a before_action's only/except options reference missing actions
config.action_controller.raise_on_missing_callback_actions = true
config.hosts << "geo.lndo.site"
end

0 comments on commit f917035

Please sign in to comment.