diff --git a/CHANGELOG b/CHANGELOG index bc5dd81e7..c5e87f14d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ [v#.#.#] ([month] [YYYY]) - Upgrade to Rails 7.0.8 + - Add importmap-rails to handle js libraries - Upgraded gems: - [gem] - Bugs fixes: diff --git a/Gemfile b/Gemfile index a4e8535af..87b500ee1 100644 --- a/Gemfile +++ b/Gemfile @@ -69,6 +69,10 @@ gem 'time', '>= 0.2.2' gem 'font-awesome-sass', '~> 6.4.0' +gem 'importmap-rails', '~> 1.2' + +gem 'sprockets-rails', '>= 3.0.0' + # ------------------------------------------------------ With native extensions # These require native extensions. # Ensure Traveling Ruby provides an appropriate version before bumping. diff --git a/Gemfile.lock b/Gemfile.lock index 9f1e5ea68..e0aeb2ea2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -230,6 +230,9 @@ GEM i18n (1.14.1) concurrent-ruby (~> 1.0) image_size (1.3.1) + importmap-rails (1.2.1) + actionpack (>= 6.0.0) + railties (>= 6.0.0) jbuilder (2.10.0) activesupport (>= 5.0.0) jquery-fileupload-rails (0.3.5) @@ -564,6 +567,7 @@ DEPENDENCIES guard-rspec html-pipeline image_size (~> 1.3.0) + importmap-rails (~> 1.2) jbuilder (~> 2.7) jquery-fileupload-rails (~> 0.3.4) jquery-hotkeys-rails @@ -604,6 +608,7 @@ DEPENDENCIES simple_form sinatra (~> 2.2.3) spring + sprockets-rails (>= 3.0.0) sqlite3 terser (~> 1.1) thor (~> 1.2.1) diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js index b16e53d6d..bdfe922d3 100644 --- a/app/assets/config/manifest.js +++ b/app/assets/config/manifest.js @@ -1,3 +1,13 @@ +//= link application.css +//= link setup/setup.css +//= link tylium.css + +//= link legacy.application.js +//= link tylium.js + +//= link_tree ../../javascript .js +//= link_tree ../../../vendor/javascript .js + //= link_tree ../images -//= link_directory ../javascripts .js -//= link_directory ../stylesheets .css + +//= link_tree ../../../vendor/assets diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/legacy.application.js similarity index 100% rename from app/assets/javascripts/application.js rename to app/assets/javascripts/legacy.application.js diff --git a/app/assets/javascripts/tylium.js b/app/assets/javascripts/tylium.js index a8c80bea5..a447a2131 100644 --- a/app/assets/javascripts/tylium.js +++ b/app/assets/javascripts/tylium.js @@ -15,9 +15,6 @@ //= require popper //= require bootstrap -//= require vendor/datatables.min -//= require vendor/stupidtable - //= require cable //= require shared/auto_save/local diff --git a/app/javascript/application.js b/app/javascript/application.js new file mode 100644 index 000000000..03422366f --- /dev/null +++ b/app/javascript/application.js @@ -0,0 +1,3 @@ +// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails +import 'datatables' +import 'stupidtable' diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index f2c6ece58..8d9fd7697 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -3,10 +3,11 @@